Home | History | Annotate | Line # | Download | only in fpsp
DYADIC.GCC revision 1.1
      1  1.1  mycroft *	MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP
      2  1.1  mycroft *	M68000 Hi-Performance Microprocessor Division
      3  1.1  mycroft *	M68040 Software Package 
      4  1.1  mycroft *
      5  1.1  mycroft *	M68040 Software Package Copyright (c) 1993, 1994 Motorola Inc.
      6  1.1  mycroft *	All rights reserved.
      7  1.1  mycroft *
      8  1.1  mycroft *	THE SOFTWARE is provided on an "AS IS" basis and without warranty.
      9  1.1  mycroft *	To the maximum extent permitted by applicable law,
     10  1.1  mycroft *	MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
     11  1.1  mycroft *	INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
     12  1.1  mycroft *	PARTICULAR PURPOSE and any warranty against infringement with
     13  1.1  mycroft *	regard to the SOFTWARE (INCLUDING ANY MODIFIED VERSIONS THEREOF)
     14  1.1  mycroft *	and any accompanying written materials. 
     15  1.1  mycroft *
     16  1.1  mycroft *	To the maximum extent permitted by applicable law,
     17  1.1  mycroft *	IN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER
     18  1.1  mycroft *	(INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS
     19  1.1  mycroft *	PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR
     20  1.1  mycroft *	OTHER PECUNIARY LOSS) ARISING OF THE USE OR INABILITY TO USE THE
     21  1.1  mycroft *	SOFTWARE.  Motorola assumes no responsibility for the maintenance
     22  1.1  mycroft *	and support of the SOFTWARE.  
     23  1.1  mycroft *
     24  1.1  mycroft *	You are hereby granted a copyright license to use, modify, and
     25  1.1  mycroft *	distribute the SOFTWARE so long as this entire notice is retained
     26  1.1  mycroft *	without alteration in any modified and/or redistributed versions,
     27  1.1  mycroft *	and that such modified versions are clearly identified as such.
     28  1.1  mycroft *	No licenses are granted by implication, estoppel or otherwise
     29  1.1  mycroft *	under any patents or trademarks of Motorola, Inc.
     30  1.1  mycroft 
     31  1.1  mycroft *
     32  1.1  mycroft *	DYADIC.GCC --- DYADIC template for GCC compiler
     33  1.1  mycroft *
     34  1.1  mycroft *	This is based on the generic template.  The only difference is that
     35  1.1  mycroft *	GCC does not need the d0-d1/a0-a1 registers saved.
     36  1.1  mycroft *
     37  1.1  mycroft *	Customizations:  
     38  1.1  mycroft *		2. Likewise, don't save FP0/FP1 if they are scratch
     39  1.1  mycroft *		   registers.
     40  1.1  mycroft *		3. Delete updating of the fpsr if you only care about
     41  1.1  mycroft *		   the result.
     42  1.1  mycroft *		5. Move the result to d0/d1 if the compiler is that old.
     43  1.1  mycroft *
     44  1.1  mycroft 
     45  1.1  mycroft 	xref	_OPa_
     46  1.1  mycroft 	xref	tag
     47  1.1  mycroft 
     48  1.1  mycroft 	xdef	_OPs_
     49  1.1  mycroft _OPs_:
     50  1.1  mycroft 	link	a6,#-LOCAL_SIZE
     51  1.1  mycroft 	fmovem.x fp0-fp3,USER_FP0(a6)
     52  1.1  mycroft 	fmove.l	fpsr,USER_FPSR(a6)
     53  1.1  mycroft 	fmove.l	fpcr,USER_FPCR(a6)	; user's rounding mode/precision
     54  1.1  mycroft 	fmove.l	#0,fpcr		; force rounding mode/prec to extended,rn
     55  1.1  mycroft *
     56  1.1  mycroft *	copy, convert and tag input arguments
     57  1.1  mycroft *
     58  1.1  mycroft 	fmove.s	8(a6),fp0
     59  1.1  mycroft 	fmove.x	fp0,FPTEMP(a6)
     60  1.1  mycroft 	lea	FPTEMP(a6),a0
     61  1.1  mycroft 	bsr	tag
     62  1.1  mycroft 	move.b	d0,DTAG(a6)
     63  1.1  mycroft 
     64  1.1  mycroft 	fmove.s	12(a6),fp0
     65  1.1  mycroft 	fmove.x	fp0,ETEMP(a6)
     66  1.1  mycroft 	lea	ETEMP(a6),a0
     67  1.1  mycroft 	bsr	tag
     68  1.1  mycroft 	move.b	d0,STAG(a6)
     69  1.1  mycroft 
     70  1.1  mycroft 	bsr	_OPa_
     71  1.1  mycroft 
     72  1.1  mycroft 	fmove.l	fpsr,d0		; update status register
     73  1.1  mycroft 	or.b	FPSR_AEXCEPT(a6),d0	;add previously accrued exceptions
     74  1.1  mycroft 	swap.w	d0
     75  1.1  mycroft 	or.b	FPSR_QBYTE(a6),d0	; pickup sign of quotient byte
     76  1.1  mycroft 	swap.w	d0
     77  1.1  mycroft 	fmove.l	d0,fpsr
     78  1.1  mycroft *
     79  1.1  mycroft *	Result is now in FP0
     80  1.1  mycroft *
     81  1.1  mycroft 	fmovem.x USER_FP1(a6),fp1-fp3	; note: FP0 not restored
     82  1.1  mycroft 	unlk	a6
     83  1.1  mycroft 	rts
     84  1.1  mycroft 
     85  1.1  mycroft 	xdef	_OPd_
     86  1.1  mycroft _OPd_:
     87  1.1  mycroft 	link	a6,#-LOCAL_SIZE
     88  1.1  mycroft 	fmovem.x fp0-fp3,USER_FP0(a6)
     89  1.1  mycroft 	fmove.l	fpsr,USER_FPSR(a6)
     90  1.1  mycroft 	fmove.l	fpcr,USER_FPCR(a6)	; user's rounding mode/precision
     91  1.1  mycroft 	fmove.l	#0,fpcr		; force rounding mode/prec to extended,rn
     92  1.1  mycroft *
     93  1.1  mycroft *	copy, convert and tag input arguments
     94  1.1  mycroft *
     95  1.1  mycroft 	fmove.d	8(a6),fp0
     96  1.1  mycroft 	fmove.x	fp0,FPTEMP(a6)
     97  1.1  mycroft 	lea	FPTEMP(a6),a0
     98  1.1  mycroft 	bsr	tag
     99  1.1  mycroft 	move.b	d0,DTAG(a6)
    100  1.1  mycroft 
    101  1.1  mycroft 	fmove.d	16(a6),fp0
    102  1.1  mycroft 	fmove.x	fp0,ETEMP(a6)
    103  1.1  mycroft 	lea	ETEMP(a6),a0
    104  1.1  mycroft 	bsr	tag
    105  1.1  mycroft 	move.b	d0,STAG(a6)
    106  1.1  mycroft 
    107  1.1  mycroft 	bsr	_OPa_
    108  1.1  mycroft 
    109  1.1  mycroft 	fmove.l	fpsr,d0		; update status register
    110  1.1  mycroft 	or.b	FPSR_AEXCEPT(a6),d0	;add previously accrued exceptions
    111  1.1  mycroft 	swap.w	d0
    112  1.1  mycroft 	or.b	FPSR_QBYTE(a6),d0	; pickup sign of quotient byte
    113  1.1  mycroft 	swap.w	d0
    114  1.1  mycroft 	fmove.l	d0,fpsr
    115  1.1  mycroft *
    116  1.1  mycroft *	Result is now in FP0
    117  1.1  mycroft *
    118  1.1  mycroft 	fmovem.x USER_FP1(a6),fp1-fp3	; note: FP0 not restored
    119  1.1  mycroft 	unlk	a6
    120  1.1  mycroft 	rts
    121  1.1  mycroft 
    122  1.1  mycroft 	xdef	_OPx_
    123  1.1  mycroft _OPx_:
    124  1.1  mycroft 	link	a6,#-LOCAL_SIZE
    125  1.1  mycroft 	fmovem.x fp0-fp3,USER_FP0(a6)
    126  1.1  mycroft 	fmove.l	fpsr,USER_FPSR(a6)
    127  1.1  mycroft 	fmove.l	fpcr,USER_FPCR(a6)	; user's rounding mode/precision
    128  1.1  mycroft 	fmove.l	#0,fpcr		; force rounding mode/prec to extended,rn
    129  1.1  mycroft *
    130  1.1  mycroft *	copy, convert and tag input arguments
    131  1.1  mycroft *
    132  1.1  mycroft 	fmove.x	8(a6),fp0
    133  1.1  mycroft 	fmove.x	fp0,FPTEMP(a6)
    134  1.1  mycroft 	lea	FPTEMP(a6),a0
    135  1.1  mycroft 	bsr	tag
    136  1.1  mycroft 	move.b	d0,DTAG(a6)
    137  1.1  mycroft 
    138  1.1  mycroft 	fmove.x	20(a6),fp0
    139  1.1  mycroft 	fmove.x	fp0,ETEMP(a6)
    140  1.1  mycroft 	lea	ETEMP(a6),a0
    141  1.1  mycroft 	bsr	tag
    142  1.1  mycroft 	move.b	d0,STAG(a6)
    143  1.1  mycroft 
    144  1.1  mycroft 	bsr	_OPa_
    145  1.1  mycroft 
    146  1.1  mycroft 	fmove.l	fpsr,d0		; update status register
    147  1.1  mycroft 	or.b	FPSR_AEXCEPT(a6),d0	;add previously accrued exceptions
    148  1.1  mycroft 	swap.w	d0
    149  1.1  mycroft 	or.b	FPSR_QBYTE(a6),d0	; pickup sign of quotient byte
    150  1.1  mycroft 	swap.w	d0
    151  1.1  mycroft 	fmove.l	d0,fpsr
    152  1.1  mycroft *
    153  1.1  mycroft *	Result is now in FP0
    154  1.1  mycroft *
    155  1.1  mycroft 	fmovem.x USER_FP1(a6),fp1-fp3	; note: FP0 not restored
    156  1.1  mycroft 	unlk	a6
    157  1.1  mycroft 	rts
    158  1.1  mycroft 
    159