Annotation of sys/arch/m68k/fpsp/MONADIC.CI5, Revision 1.1
1.1 ! nbrk 1: * $OpenBSD: MONADIC.CI5,v 1.2 1996/05/29 21:05:21 niklas Exp $
! 2: * $NetBSD: MONADIC.CI5,v 1.2 1994/10/26 07:48:39 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.CI5 1.3 4/30/91
! 36: *
! 37: * MONADIC.CI5 --- MONADIC template for CI5 compiler
! 38: *
! 39:
! 40: xref tag
! 41: xref _OPr_
! 42: xref _OPz_
! 43: xref _OPi_
! 44: xref _OPn_
! 45: xref _OPm_
! 46:
! 47:
! 48: xdef _OPd_
! 49: _OPd_:
! 50: link a6,#-LOCAL_SIZE
! 51: fmovem.x fp2-fp3,USER_FP2(a6)
! 52: fmove.l fpsr,USER_FPSR(a6)
! 53: fmove.l fpcr,d1 ; user's rounding mode/precision
! 54: fmove.l #0,fpcr ; force rounding mode/prec to extended,rn
! 55: *
! 56: * copy, convert and tag input argument
! 57: *
! 58: fmove.d 8(a6),fp0
! 59: fmove.x fp0,ETEMP(a6)
! 60: lea ETEMP(a6),a0
! 61: bsr tag
! 62: move.b d0,STAG(a6)
! 63: tst.b d0
! 64: bne.b _TMP_2
! 65: bsr _OPr_ ; normalized (regular) number
! 66: bra.b _TMP_6
! 67: _TMP_2:
! 68: cmp.b #$20,d0 ; zero?
! 69: bne.b _TMP_3
! 70: bsr _OPz_
! 71: bra.b _TMP_6
! 72: _TMP_3:
! 73: cmp.b #$40,d0 ; infinity?
! 74: bne.b _TMP_4
! 75: bsr _OPi_
! 76: bra.b _TMP_6
! 77: _TMP_4:
! 78: cmp.b #$60,d0 ; NaN?
! 79: bne.b _TMP_5
! 80: bsr _OPn_
! 81: bra.b _TMP_6
! 82: _TMP_5:
! 83: bsr _OPm_ ; assuming a denorm...
! 84:
! 85: _TMP_6:
! 86: fmove.l fpsr,d0 ; update status register
! 87: or.b USER_FPSR+3(a6),d0 ;add previously accrued exceptions
! 88: move.l d0,USER_FPSR(a6)
! 89: *
! 90: * Result is now in FP0
! 91: *
! 92: fmovem.x USER_FP2(a6),fp2-fp3 ; note: FP1 not restored
! 93: unlk a6
! 94: rts
CVSweb