1* $NetBSD: DYADIC.CI5,v 1.2 1994/10/26 07:48:26 cgd Exp $ 2 3* MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP 4* M68000 Hi-Performance Microprocessor Division 5* M68040 Software Package 6* 7* M68040 Software Package Copyright (c) 1993, 1994 Motorola Inc. 8* All rights reserved. 9* 10* THE SOFTWARE is provided on an "AS IS" basis and without warranty. 11* To the maximum extent permitted by applicable law, 12* MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, 13* INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A 14* PARTICULAR PURPOSE and any warranty against infringement with 15* regard to the SOFTWARE (INCLUDING ANY MODIFIED VERSIONS THEREOF) 16* and any accompanying written materials. 17* 18* To the maximum extent permitted by applicable law, 19* IN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER 20* (INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS 21* PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR 22* OTHER PECUNIARY LOSS) ARISING OF THE USE OR INABILITY TO USE THE 23* SOFTWARE. Motorola assumes no responsibility for the maintenance 24* and support of the SOFTWARE. 25* 26* You are hereby granted a copyright license to use, modify, and 27* distribute the SOFTWARE so long as this entire notice is retained 28* without alteration in any modified and/or redistributed versions, 29* and that such modified versions are clearly identified as such. 30* No licenses are granted by implication, estoppel or otherwise 31* under any patents or trademarks of Motorola, Inc. 32 33* 34* DYADIC.CI5 1.2 4/30/91 35* 36* DYADIC.CI5 --- DYADIC template for CI5 compiler 37* 38 39 xref _OPa_ 40 xref tag 41 42 xdef _OPd_ 43_OPd_: 44 link a6,#-LOCAL_SIZE 45 fmovem.x fp2-fp3,USER_FP2(a6) 46 fmovem.l fpsr/fpcr,USER_FPSR(a6) ; user's rounding mode/precision 47 fmove.l #0,fpcr ; force rounding mode/prec to extended,rn 48* 49* copy, convert and tag input arguments 50* 51 fmove.d 8(a6),fp0 52 fmove.x fp0,FPTEMP(a6) 53 lea FPTEMP(a6),a0 54 bsr tag 55 move.b d0,DTAG(a6) 56 57 fmove.d 16(a6),fp0 58 fmove.x fp0,ETEMP(a6) 59 lea ETEMP(a6),a0 60 bsr tag 61 move.b d0,STAG(a6) 62 63 bsr _OPa_ 64 65 fmove.l fpsr,d0 ; update status register 66 or.b FPSR_AEXCEPT(a6),d0 ;add previously accrued exceptions 67 swap.w d0 68 or.b FPSR_QBYTE(a6),d0 ; pickup sign of quotient byte 69 swap.w d0 70 fmove.l d0,fpsr 71* 72* Result is now in FP0 73* 74 fmovem.x USER_FP2(a6),fp2-fp3 ; note: FP0/FP1 not restored 75 unlk a6 76 rts 77 78