Home | History | Annotate | Line # | Download | only in fpsp
      1  1.4    soren *	$NetBSD: sto_res.sa,v 1.4 2000/03/13 23:52:32 soren Exp $
      2  1.3      cgd 
      3  1.1  mycroft *	MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP
      4  1.1  mycroft *	M68000 Hi-Performance Microprocessor Division
      5  1.1  mycroft *	M68040 Software Package 
      6  1.1  mycroft *
      7  1.1  mycroft *	M68040 Software Package Copyright (c) 1993, 1994 Motorola Inc.
      8  1.1  mycroft *	All rights reserved.
      9  1.1  mycroft *
     10  1.1  mycroft *	THE SOFTWARE is provided on an "AS IS" basis and without warranty.
     11  1.1  mycroft *	To the maximum extent permitted by applicable law,
     12  1.1  mycroft *	MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
     13  1.1  mycroft *	INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
     14  1.1  mycroft *	PARTICULAR PURPOSE and any warranty against infringement with
     15  1.1  mycroft *	regard to the SOFTWARE (INCLUDING ANY MODIFIED VERSIONS THEREOF)
     16  1.1  mycroft *	and any accompanying written materials. 
     17  1.1  mycroft *
     18  1.1  mycroft *	To the maximum extent permitted by applicable law,
     19  1.1  mycroft *	IN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER
     20  1.1  mycroft *	(INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS
     21  1.1  mycroft *	PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR
     22  1.1  mycroft *	OTHER PECUNIARY LOSS) ARISING OF THE USE OR INABILITY TO USE THE
     23  1.1  mycroft *	SOFTWARE.  Motorola assumes no responsibility for the maintenance
     24  1.1  mycroft *	and support of the SOFTWARE.  
     25  1.1  mycroft *
     26  1.1  mycroft *	You are hereby granted a copyright license to use, modify, and
     27  1.1  mycroft *	distribute the SOFTWARE so long as this entire notice is retained
     28  1.1  mycroft *	without alteration in any modified and/or redistributed versions,
     29  1.1  mycroft *	and that such modified versions are clearly identified as such.
     30  1.1  mycroft *	No licenses are granted by implication, estoppel or otherwise
     31  1.1  mycroft *	under any patents or trademarks of Motorola, Inc.
     32  1.1  mycroft 
     33  1.1  mycroft *
     34  1.1  mycroft *	sto_res.sa 3.1 12/10/90
     35  1.1  mycroft *
     36  1.1  mycroft *	Takes the result and puts it in where the user expects it.
     37  1.1  mycroft *	Library functions return result in fp0.	If fp0 is not the
     38  1.4    soren *	users destination register then fp0 is moved to the
     39  1.1  mycroft *	correct floating-point destination register.  fp0 and fp1
     40  1.1  mycroft *	are then restored to the original contents. 
     41  1.1  mycroft *
     42  1.1  mycroft *	Input:	result in fp0,fp1 
     43  1.1  mycroft *
     44  1.1  mycroft *		d2 & a0 should be kept unmodified
     45  1.1  mycroft *
     46  1.1  mycroft *	Output:	moves the result to the true destination reg or mem
     47  1.1  mycroft *
     48  1.1  mycroft *	Modifies: destination floating point register
     49  1.1  mycroft *
     50  1.1  mycroft 
     51  1.1  mycroft STO_RES	IDNT	2,1 Motorola 040 Floating Point Software Package
     52  1.1  mycroft 
     53  1.1  mycroft 
     54  1.1  mycroft 	section	8
     55  1.1  mycroft 
     56  1.1  mycroft 	include	fpsp.h
     57  1.1  mycroft 
     58  1.1  mycroft 	xdef	sto_cos
     59  1.1  mycroft sto_cos:
     60  1.1  mycroft 	bfextu		CMDREG1B(a6){13:3},d0	;extract cos destination
     61  1.1  mycroft 	cmpi.b		#3,d0		;check for fp0/fp1 cases
     62  1.1  mycroft 	ble.b		c_fp0123
     63  1.1  mycroft 	fmovem.x	fp1,-(a7)
     64  1.1  mycroft 	moveq.l		#7,d1
     65  1.1  mycroft 	sub.l		d0,d1		;d1 = 7- (dest. reg. no.)
     66  1.1  mycroft 	clr.l		d0
     67  1.1  mycroft 	bset.l		d1,d0		;d0 is dynamic register mask
     68  1.1  mycroft 	fmovem.x	(a7)+,d0
     69  1.1  mycroft 	rts
     70  1.1  mycroft c_fp0123:
     71  1.2  mycroft 	tst.b		d0
     72  1.1  mycroft 	beq.b		c_is_fp0
     73  1.1  mycroft 	cmpi.b		#1,d0
     74  1.1  mycroft 	beq.b		c_is_fp1
     75  1.1  mycroft 	cmpi.b		#2,d0
     76  1.1  mycroft 	beq.b		c_is_fp2
     77  1.1  mycroft c_is_fp3:
     78  1.1  mycroft 	fmovem.x	fp1,USER_FP3(a6)
     79  1.1  mycroft 	rts
     80  1.1  mycroft c_is_fp2:
     81  1.1  mycroft 	fmovem.x	fp1,USER_FP2(a6)
     82  1.1  mycroft 	rts
     83  1.1  mycroft c_is_fp1:
     84  1.1  mycroft 	fmovem.x	fp1,USER_FP1(a6)
     85  1.1  mycroft 	rts
     86  1.1  mycroft c_is_fp0:
     87  1.1  mycroft 	fmovem.x	fp1,USER_FP0(a6)
     88  1.1  mycroft 	rts
     89  1.1  mycroft 
     90  1.1  mycroft 
     91  1.1  mycroft 	xdef	sto_res
     92  1.1  mycroft sto_res:
     93  1.1  mycroft 	bfextu		CMDREG1B(a6){6:3},d0	;extract destination register
     94  1.1  mycroft 	cmpi.b		#3,d0		;check for fp0/fp1 cases
     95  1.1  mycroft 	ble.b		fp0123
     96  1.1  mycroft 	fmovem.x	fp0,-(a7)
     97  1.1  mycroft 	moveq.l		#7,d1
     98  1.1  mycroft 	sub.l		d0,d1		;d1 = 7- (dest. reg. no.)
     99  1.1  mycroft 	clr.l		d0
    100  1.1  mycroft 	bset.l		d1,d0		;d0 is dynamic register mask
    101  1.1  mycroft 	fmovem.x	(a7)+,d0
    102  1.1  mycroft 	rts
    103  1.1  mycroft fp0123:
    104  1.2  mycroft 	tst.b		d0
    105  1.1  mycroft 	beq.b		is_fp0
    106  1.1  mycroft 	cmpi.b		#1,d0
    107  1.1  mycroft 	beq.b		is_fp1
    108  1.1  mycroft 	cmpi.b		#2,d0
    109  1.1  mycroft 	beq.b		is_fp2
    110  1.1  mycroft is_fp3:
    111  1.1  mycroft 	fmovem.x	fp0,USER_FP3(a6)
    112  1.1  mycroft 	rts
    113  1.1  mycroft is_fp2:
    114  1.1  mycroft 	fmovem.x	fp0,USER_FP2(a6)
    115  1.1  mycroft 	rts
    116  1.1  mycroft is_fp1:
    117  1.1  mycroft 	fmovem.x	fp0,USER_FP1(a6)
    118  1.1  mycroft 	rts
    119  1.1  mycroft is_fp0:
    120  1.1  mycroft 	fmovem.x	fp0,USER_FP0(a6)
    121  1.1  mycroft 	rts
    122  1.1  mycroft 
    123  1.1  mycroft 	end
    124