Annotation of sys/arch/m68k/fpsp/MONADIC.R3V6, Revision 1.1.1.1
1.1 nbrk 1: * $OpenBSD: MONADIC.R3V6,v 1.2 1996/05/29 21:05:23 niklas Exp $
2: * $NetBSD: MONADIC.R3V6,v 1.2 1994/10/26 07:48:44 cgd Exp $
3:
4: * MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP
5: * M68000 Hi-Performance Microprocessor Division
6: * M68040 Software Package
7: *
8: * M68040 Software Package Copyright (c) 1993, 1994 Motorola Inc.
9: * All rights reserved.
10: *
11: * THE SOFTWARE is provided on an "AS IS" basis and without warranty.
12: * To the maximum extent permitted by applicable law,
13: * MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
14: * INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
15: * PARTICULAR PURPOSE and any warranty against infringement with
16: * regard to the SOFTWARE (INCLUDING ANY MODIFIED VERSIONS THEREOF)
17: * and any accompanying written materials.
18: *
19: * To the maximum extent permitted by applicable law,
20: * IN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER
21: * (INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS
22: * PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR
23: * OTHER PECUNIARY LOSS) ARISING OF THE USE OR INABILITY TO USE THE
24: * SOFTWARE. Motorola assumes no responsibility for the maintenance
25: * and support of the SOFTWARE.
26: *
27: * You are hereby granted a copyright license to use, modify, and
28: * distribute the SOFTWARE so long as this entire notice is retained
29: * without alteration in any modified and/or redistributed versions,
30: * and that such modified versions are clearly identified as such.
31: * No licenses are granted by implication, estoppel or otherwise
32: * under any patents or trademarks of Motorola, Inc.
33:
34: *
35: * MONADIC.R3V6 1.3 4/30/91
36: *
37: * MONADIC.R3V6 --- MONADIC template for MCD R3V6 native C compiler
38: *
39: * The MCD compiler is old. It returns float and double values
40: * as a double stored in d0/d1. There is no support for single or extended
41: * precision operations. It's not clear whether the float registers
42: * should be preserved, so for speed, they're not.
43: *
44:
45: xref tag
46: xref _OPr_
47: xref _OPz_
48: xref _OPi_
49: xref _OPn_
50: xref _OPm_
51:
52: xdef _OPd_
53: _OPd_:
54: link a6,#-LOCAL_SIZE
55: fmove.l fpcr,d1 ; user's rounding mode/precision
56: fmove.l #0,fpcr ; force rounding mode/prec to extended,rn
57: *
58: * copy, convert and tag input argument
59: *
60: fmove.d 8(a6),fp0
61: fmove.x fp0,ETEMP(a6)
62: lea ETEMP(a6),a0
63: bsr tag
64: move.b d0,STAG(a6)
65: tst.b d0
66: bne.b _TMP_2
67: bsr _OPr_ ; normalized (regular) number
68: bra.b _TMP_6
69: _TMP_2:
70: cmp.b #$20,d0 ; zero?
71: bne.b _TMP_3
72: bsr _OPz_
73: bra.b _TMP_6
74: _TMP_3:
75: cmp.b #$40,d0 ; infinity?
76: bne.b _TMP_4
77: bsr _OPi_
78: bra.b _TMP_6
79: _TMP_4:
80: cmp.b #$60,d0 ; NaN?
81: bne.b _TMP_5
82: bsr _OPn_
83: bra.b _TMP_6
84: _TMP_5:
85: bsr _OPm_ ; assuming a denorm...
86:
87: _TMP_6:
88: fmove.d fp0,USER_D0(a6) ; result goes into d0/d1 pair
89: movem.l USER_D0(a6),d0-d1
90: unlk a6
91: rts
92:
CVSweb