162306a36Sopenharmony_ci|
262306a36Sopenharmony_ci|	util.sa 3.7 7/29/91
362306a36Sopenharmony_ci|
462306a36Sopenharmony_ci|	This file contains routines used by other programs.
562306a36Sopenharmony_ci|
662306a36Sopenharmony_ci|	ovf_res: used by overflow to force the correct
762306a36Sopenharmony_ci|		 result. ovf_r_k, ovf_r_x2, ovf_r_x3 are
862306a36Sopenharmony_ci|		 derivatives of this routine.
962306a36Sopenharmony_ci|	get_fline: get user's opcode word
1062306a36Sopenharmony_ci|	g_dfmtou: returns the destination format.
1162306a36Sopenharmony_ci|	g_opcls: returns the opclass of the float instruction.
1262306a36Sopenharmony_ci|	g_rndpr: returns the rounding precision.
1362306a36Sopenharmony_ci|	reg_dest: write byte, word, or long data to Dn
1462306a36Sopenharmony_ci|
1562306a36Sopenharmony_ci|
1662306a36Sopenharmony_ci|		Copyright (C) Motorola, Inc. 1990
1762306a36Sopenharmony_ci|			All Rights Reserved
1862306a36Sopenharmony_ci|
1962306a36Sopenharmony_ci|       For details on the license for this file, please see the
2062306a36Sopenharmony_ci|       file, README, in this same directory.
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_ci|UTIL	idnt    2,1 | Motorola 040 Floating Point Software Package
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ci	|section	8
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_ci#include "fpsp.h"
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ci	|xref	mem_read
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_ci	.global	g_dfmtou
3162306a36Sopenharmony_ci	.global	g_opcls
3262306a36Sopenharmony_ci	.global	g_rndpr
3362306a36Sopenharmony_ci	.global	get_fline
3462306a36Sopenharmony_ci	.global	reg_dest
3562306a36Sopenharmony_ci
3662306a36Sopenharmony_ci|
3762306a36Sopenharmony_ci| Final result table for ovf_res. Note that the negative counterparts
3862306a36Sopenharmony_ci| are unnecessary as ovf_res always returns the sign separately from
3962306a36Sopenharmony_ci| the exponent.
4062306a36Sopenharmony_ci|					;+inf
4162306a36Sopenharmony_ciEXT_PINF:	.long	0x7fff0000,0x00000000,0x00000000,0x00000000
4262306a36Sopenharmony_ci|					;largest +ext
4362306a36Sopenharmony_ciEXT_PLRG:	.long	0x7ffe0000,0xffffffff,0xffffffff,0x00000000
4462306a36Sopenharmony_ci|					;largest magnitude +sgl in ext
4562306a36Sopenharmony_ciSGL_PLRG:	.long	0x407e0000,0xffffff00,0x00000000,0x00000000
4662306a36Sopenharmony_ci|					;largest magnitude +dbl in ext
4762306a36Sopenharmony_ciDBL_PLRG:	.long	0x43fe0000,0xffffffff,0xfffff800,0x00000000
4862306a36Sopenharmony_ci|					;largest -ext
4962306a36Sopenharmony_ci
5062306a36Sopenharmony_citblovfl:
5162306a36Sopenharmony_ci	.long	EXT_RN
5262306a36Sopenharmony_ci	.long	EXT_RZ
5362306a36Sopenharmony_ci	.long	EXT_RM
5462306a36Sopenharmony_ci	.long	EXT_RP
5562306a36Sopenharmony_ci	.long	SGL_RN
5662306a36Sopenharmony_ci	.long	SGL_RZ
5762306a36Sopenharmony_ci	.long	SGL_RM
5862306a36Sopenharmony_ci	.long	SGL_RP
5962306a36Sopenharmony_ci	.long	DBL_RN
6062306a36Sopenharmony_ci	.long	DBL_RZ
6162306a36Sopenharmony_ci	.long	DBL_RM
6262306a36Sopenharmony_ci	.long	DBL_RP
6362306a36Sopenharmony_ci	.long	error
6462306a36Sopenharmony_ci	.long	error
6562306a36Sopenharmony_ci	.long	error
6662306a36Sopenharmony_ci	.long	error
6762306a36Sopenharmony_ci
6862306a36Sopenharmony_ci
6962306a36Sopenharmony_ci|
7062306a36Sopenharmony_ci|	ovf_r_k --- overflow result calculation
7162306a36Sopenharmony_ci|
7262306a36Sopenharmony_ci| This entry point is used by kernel_ex.
7362306a36Sopenharmony_ci|
7462306a36Sopenharmony_ci| This forces the destination precision to be extended
7562306a36Sopenharmony_ci|
7662306a36Sopenharmony_ci| Input:	operand in ETEMP
7762306a36Sopenharmony_ci| Output:	a result is in ETEMP (internal extended format)
7862306a36Sopenharmony_ci|
7962306a36Sopenharmony_ci	.global	ovf_r_k
8062306a36Sopenharmony_ciovf_r_k:
8162306a36Sopenharmony_ci	lea	ETEMP(%a6),%a0	|a0 points to source operand
8262306a36Sopenharmony_ci	bclrb	#sign_bit,ETEMP_EX(%a6)
8362306a36Sopenharmony_ci	sne	ETEMP_SGN(%a6)	|convert to internal IEEE format
8462306a36Sopenharmony_ci
8562306a36Sopenharmony_ci|
8662306a36Sopenharmony_ci|	ovf_r_x2 --- overflow result calculation
8762306a36Sopenharmony_ci|
8862306a36Sopenharmony_ci| This entry point used by x_ovfl.  (opclass 0 and 2)
8962306a36Sopenharmony_ci|
9062306a36Sopenharmony_ci| Input		a0  points to an operand in the internal extended format
9162306a36Sopenharmony_ci| Output	a0  points to the result in the internal extended format
9262306a36Sopenharmony_ci|
9362306a36Sopenharmony_ci| This sets the round precision according to the user's FPCR unless the
9462306a36Sopenharmony_ci| instruction is fsgldiv or fsglmul or fsadd, fdadd, fsub, fdsub, fsmul,
9562306a36Sopenharmony_ci| fdmul, fsdiv, fddiv, fssqrt, fsmove, fdmove, fsabs, fdabs, fsneg, fdneg.
9662306a36Sopenharmony_ci| If the instruction is fsgldiv of fsglmul, the rounding precision must be
9762306a36Sopenharmony_ci| extended.  If the instruction is not fsgldiv or fsglmul but a force-
9862306a36Sopenharmony_ci| precision instruction, the rounding precision is then set to the force
9962306a36Sopenharmony_ci| precision.
10062306a36Sopenharmony_ci
10162306a36Sopenharmony_ci	.global	ovf_r_x2
10262306a36Sopenharmony_ciovf_r_x2:
10362306a36Sopenharmony_ci	btstb	#E3,E_BYTE(%a6)		|check for nu exception
10462306a36Sopenharmony_ci	beql	ovf_e1_exc		|it is cu exception
10562306a36Sopenharmony_ciovf_e3_exc:
10662306a36Sopenharmony_ci	movew	CMDREG3B(%a6),%d0		|get the command word
10762306a36Sopenharmony_ci	andiw	#0x00000060,%d0		|clear all bits except 6 and 5
10862306a36Sopenharmony_ci	cmpil	#0x00000040,%d0
10962306a36Sopenharmony_ci	beql	ovff_sgl		|force precision is single
11062306a36Sopenharmony_ci	cmpil	#0x00000060,%d0
11162306a36Sopenharmony_ci	beql	ovff_dbl		|force precision is double
11262306a36Sopenharmony_ci	movew	CMDREG3B(%a6),%d0		|get the command word again
11362306a36Sopenharmony_ci	andil	#0x7f,%d0			|clear all except operation
11462306a36Sopenharmony_ci	cmpil	#0x33,%d0
11562306a36Sopenharmony_ci	beql	ovf_fsgl		|fsglmul or fsgldiv
11662306a36Sopenharmony_ci	cmpil	#0x30,%d0
11762306a36Sopenharmony_ci	beql	ovf_fsgl
11862306a36Sopenharmony_ci	bra	ovf_fpcr		|instruction is none of the above
11962306a36Sopenharmony_ci|					;use FPCR
12062306a36Sopenharmony_ciovf_e1_exc:
12162306a36Sopenharmony_ci	movew	CMDREG1B(%a6),%d0		|get command word
12262306a36Sopenharmony_ci	andil	#0x00000044,%d0		|clear all bits except 6 and 2
12362306a36Sopenharmony_ci	cmpil	#0x00000040,%d0
12462306a36Sopenharmony_ci	beql	ovff_sgl		|the instruction is force single
12562306a36Sopenharmony_ci	cmpil	#0x00000044,%d0
12662306a36Sopenharmony_ci	beql	ovff_dbl		|the instruction is force double
12762306a36Sopenharmony_ci	movew	CMDREG1B(%a6),%d0		|again get the command word
12862306a36Sopenharmony_ci	andil	#0x0000007f,%d0		|clear all except the op code
12962306a36Sopenharmony_ci	cmpil	#0x00000027,%d0
13062306a36Sopenharmony_ci	beql	ovf_fsgl		|fsglmul
13162306a36Sopenharmony_ci	cmpil	#0x00000024,%d0
13262306a36Sopenharmony_ci	beql	ovf_fsgl		|fsgldiv
13362306a36Sopenharmony_ci	bra	ovf_fpcr		|none of the above, use FPCR
13462306a36Sopenharmony_ci|
13562306a36Sopenharmony_ci|
13662306a36Sopenharmony_ci| Inst is either fsgldiv or fsglmul.  Force extended precision.
13762306a36Sopenharmony_ci|
13862306a36Sopenharmony_ciovf_fsgl:
13962306a36Sopenharmony_ci	clrl	%d0
14062306a36Sopenharmony_ci	bra	ovf_res
14162306a36Sopenharmony_ci
14262306a36Sopenharmony_ciovff_sgl:
14362306a36Sopenharmony_ci	movel	#0x00000001,%d0		|set single
14462306a36Sopenharmony_ci	bra	ovf_res
14562306a36Sopenharmony_ciovff_dbl:
14662306a36Sopenharmony_ci	movel	#0x00000002,%d0		|set double
14762306a36Sopenharmony_ci	bra	ovf_res
14862306a36Sopenharmony_ci|
14962306a36Sopenharmony_ci| The precision is in the fpcr.
15062306a36Sopenharmony_ci|
15162306a36Sopenharmony_ciovf_fpcr:
15262306a36Sopenharmony_ci	bfextu	FPCR_MODE(%a6){#0:#2},%d0 |set round precision
15362306a36Sopenharmony_ci	bra	ovf_res
15462306a36Sopenharmony_ci
15562306a36Sopenharmony_ci|
15662306a36Sopenharmony_ci|
15762306a36Sopenharmony_ci|	ovf_r_x3 --- overflow result calculation
15862306a36Sopenharmony_ci|
15962306a36Sopenharmony_ci| This entry point used by x_ovfl. (opclass 3 only)
16062306a36Sopenharmony_ci|
16162306a36Sopenharmony_ci| Input		a0  points to an operand in the internal extended format
16262306a36Sopenharmony_ci| Output	a0  points to the result in the internal extended format
16362306a36Sopenharmony_ci|
16462306a36Sopenharmony_ci| This sets the round precision according to the destination size.
16562306a36Sopenharmony_ci|
16662306a36Sopenharmony_ci	.global	ovf_r_x3
16762306a36Sopenharmony_ciovf_r_x3:
16862306a36Sopenharmony_ci	bsr	g_dfmtou	|get dest fmt in d0{1:0}
16962306a36Sopenharmony_ci|				;for fmovout, the destination format
17062306a36Sopenharmony_ci|				;is the rounding precision
17162306a36Sopenharmony_ci
17262306a36Sopenharmony_ci|
17362306a36Sopenharmony_ci|	ovf_res --- overflow result calculation
17462306a36Sopenharmony_ci|
17562306a36Sopenharmony_ci| Input:
17662306a36Sopenharmony_ci|	a0	points to operand in internal extended format
17762306a36Sopenharmony_ci| Output:
17862306a36Sopenharmony_ci|	a0	points to result in internal extended format
17962306a36Sopenharmony_ci|
18062306a36Sopenharmony_ci	.global	ovf_res
18162306a36Sopenharmony_ciovf_res:
18262306a36Sopenharmony_ci	lsll	#2,%d0		|move round precision to d0{3:2}
18362306a36Sopenharmony_ci	bfextu	FPCR_MODE(%a6){#2:#2},%d1 |set round mode
18462306a36Sopenharmony_ci	orl	%d1,%d0		|index is fmt:mode in d0{3:0}
18562306a36Sopenharmony_ci	leal	tblovfl,%a1	|load a1 with table address
18662306a36Sopenharmony_ci	movel	%a1@(%d0:l:4),%a1	|use d0 as index to the table
18762306a36Sopenharmony_ci	jmp	(%a1)		|go to the correct routine
18862306a36Sopenharmony_ci|
18962306a36Sopenharmony_ci|case DEST_FMT = EXT
19062306a36Sopenharmony_ci|
19162306a36Sopenharmony_ciEXT_RN:
19262306a36Sopenharmony_ci	leal	EXT_PINF,%a1	|answer is +/- infinity
19362306a36Sopenharmony_ci	bsetb	#inf_bit,FPSR_CC(%a6)
19462306a36Sopenharmony_ci	bra	set_sign	|now go set the sign
19562306a36Sopenharmony_ciEXT_RZ:
19662306a36Sopenharmony_ci	leal	EXT_PLRG,%a1	|answer is +/- large number
19762306a36Sopenharmony_ci	bra	set_sign	|now go set the sign
19862306a36Sopenharmony_ciEXT_RM:
19962306a36Sopenharmony_ci	tstb	LOCAL_SGN(%a0)	|if negative overflow
20062306a36Sopenharmony_ci	beqs	e_rm_pos
20162306a36Sopenharmony_cie_rm_neg:
20262306a36Sopenharmony_ci	leal	EXT_PINF,%a1	|answer is negative infinity
20362306a36Sopenharmony_ci	orl	#neginf_mask,USER_FPSR(%a6)
20462306a36Sopenharmony_ci	bra	end_ovfr
20562306a36Sopenharmony_cie_rm_pos:
20662306a36Sopenharmony_ci	leal	EXT_PLRG,%a1	|answer is large positive number
20762306a36Sopenharmony_ci	bra	end_ovfr
20862306a36Sopenharmony_ciEXT_RP:
20962306a36Sopenharmony_ci	tstb	LOCAL_SGN(%a0)	|if negative overflow
21062306a36Sopenharmony_ci	beqs	e_rp_pos
21162306a36Sopenharmony_cie_rp_neg:
21262306a36Sopenharmony_ci	leal	EXT_PLRG,%a1	|answer is large negative number
21362306a36Sopenharmony_ci	bsetb	#neg_bit,FPSR_CC(%a6)
21462306a36Sopenharmony_ci	bra	end_ovfr
21562306a36Sopenharmony_cie_rp_pos:
21662306a36Sopenharmony_ci	leal	EXT_PINF,%a1	|answer is positive infinity
21762306a36Sopenharmony_ci	bsetb	#inf_bit,FPSR_CC(%a6)
21862306a36Sopenharmony_ci	bra	end_ovfr
21962306a36Sopenharmony_ci|
22062306a36Sopenharmony_ci|case DEST_FMT = DBL
22162306a36Sopenharmony_ci|
22262306a36Sopenharmony_ciDBL_RN:
22362306a36Sopenharmony_ci	leal	EXT_PINF,%a1	|answer is +/- infinity
22462306a36Sopenharmony_ci	bsetb	#inf_bit,FPSR_CC(%a6)
22562306a36Sopenharmony_ci	bra	set_sign
22662306a36Sopenharmony_ciDBL_RZ:
22762306a36Sopenharmony_ci	leal	DBL_PLRG,%a1	|answer is +/- large number
22862306a36Sopenharmony_ci	bra	set_sign	|now go set the sign
22962306a36Sopenharmony_ciDBL_RM:
23062306a36Sopenharmony_ci	tstb	LOCAL_SGN(%a0)	|if negative overflow
23162306a36Sopenharmony_ci	beqs	d_rm_pos
23262306a36Sopenharmony_cid_rm_neg:
23362306a36Sopenharmony_ci	leal	EXT_PINF,%a1	|answer is negative infinity
23462306a36Sopenharmony_ci	orl	#neginf_mask,USER_FPSR(%a6)
23562306a36Sopenharmony_ci	bra	end_ovfr	|inf is same for all precisions (ext,dbl,sgl)
23662306a36Sopenharmony_cid_rm_pos:
23762306a36Sopenharmony_ci	leal	DBL_PLRG,%a1	|answer is large positive number
23862306a36Sopenharmony_ci	bra	end_ovfr
23962306a36Sopenharmony_ciDBL_RP:
24062306a36Sopenharmony_ci	tstb	LOCAL_SGN(%a0)	|if negative overflow
24162306a36Sopenharmony_ci	beqs	d_rp_pos
24262306a36Sopenharmony_cid_rp_neg:
24362306a36Sopenharmony_ci	leal	DBL_PLRG,%a1	|answer is large negative number
24462306a36Sopenharmony_ci	bsetb	#neg_bit,FPSR_CC(%a6)
24562306a36Sopenharmony_ci	bra	end_ovfr
24662306a36Sopenharmony_cid_rp_pos:
24762306a36Sopenharmony_ci	leal	EXT_PINF,%a1	|answer is positive infinity
24862306a36Sopenharmony_ci	bsetb	#inf_bit,FPSR_CC(%a6)
24962306a36Sopenharmony_ci	bra	end_ovfr
25062306a36Sopenharmony_ci|
25162306a36Sopenharmony_ci|case DEST_FMT = SGL
25262306a36Sopenharmony_ci|
25362306a36Sopenharmony_ciSGL_RN:
25462306a36Sopenharmony_ci	leal	EXT_PINF,%a1	|answer is +/-  infinity
25562306a36Sopenharmony_ci	bsetb	#inf_bit,FPSR_CC(%a6)
25662306a36Sopenharmony_ci	bras	set_sign
25762306a36Sopenharmony_ciSGL_RZ:
25862306a36Sopenharmony_ci	leal	SGL_PLRG,%a1	|answer is +/- large number
25962306a36Sopenharmony_ci	bras	set_sign
26062306a36Sopenharmony_ciSGL_RM:
26162306a36Sopenharmony_ci	tstb	LOCAL_SGN(%a0)	|if negative overflow
26262306a36Sopenharmony_ci	beqs	s_rm_pos
26362306a36Sopenharmony_cis_rm_neg:
26462306a36Sopenharmony_ci	leal	EXT_PINF,%a1	|answer is negative infinity
26562306a36Sopenharmony_ci	orl	#neginf_mask,USER_FPSR(%a6)
26662306a36Sopenharmony_ci	bras	end_ovfr
26762306a36Sopenharmony_cis_rm_pos:
26862306a36Sopenharmony_ci	leal	SGL_PLRG,%a1	|answer is large positive number
26962306a36Sopenharmony_ci	bras	end_ovfr
27062306a36Sopenharmony_ciSGL_RP:
27162306a36Sopenharmony_ci	tstb	LOCAL_SGN(%a0)	|if negative overflow
27262306a36Sopenharmony_ci	beqs	s_rp_pos
27362306a36Sopenharmony_cis_rp_neg:
27462306a36Sopenharmony_ci	leal	SGL_PLRG,%a1	|answer is large negative number
27562306a36Sopenharmony_ci	bsetb	#neg_bit,FPSR_CC(%a6)
27662306a36Sopenharmony_ci	bras	end_ovfr
27762306a36Sopenharmony_cis_rp_pos:
27862306a36Sopenharmony_ci	leal	EXT_PINF,%a1	|answer is positive infinity
27962306a36Sopenharmony_ci	bsetb	#inf_bit,FPSR_CC(%a6)
28062306a36Sopenharmony_ci	bras	end_ovfr
28162306a36Sopenharmony_ci
28262306a36Sopenharmony_ciset_sign:
28362306a36Sopenharmony_ci	tstb	LOCAL_SGN(%a0)	|if negative overflow
28462306a36Sopenharmony_ci	beqs	end_ovfr
28562306a36Sopenharmony_cineg_sign:
28662306a36Sopenharmony_ci	bsetb	#neg_bit,FPSR_CC(%a6)
28762306a36Sopenharmony_ci
28862306a36Sopenharmony_ciend_ovfr:
28962306a36Sopenharmony_ci	movew	LOCAL_EX(%a1),LOCAL_EX(%a0) |do not overwrite sign
29062306a36Sopenharmony_ci	movel	LOCAL_HI(%a1),LOCAL_HI(%a0)
29162306a36Sopenharmony_ci	movel	LOCAL_LO(%a1),LOCAL_LO(%a0)
29262306a36Sopenharmony_ci	rts
29362306a36Sopenharmony_ci
29462306a36Sopenharmony_ci
29562306a36Sopenharmony_ci|
29662306a36Sopenharmony_ci|	ERROR
29762306a36Sopenharmony_ci|
29862306a36Sopenharmony_cierror:
29962306a36Sopenharmony_ci	rts
30062306a36Sopenharmony_ci|
30162306a36Sopenharmony_ci|	get_fline --- get f-line opcode of interrupted instruction
30262306a36Sopenharmony_ci|
30362306a36Sopenharmony_ci|	Returns opcode in the low word of d0.
30462306a36Sopenharmony_ci|
30562306a36Sopenharmony_ciget_fline:
30662306a36Sopenharmony_ci	movel	USER_FPIAR(%a6),%a0	|opcode address
30762306a36Sopenharmony_ci	movel	#0,-(%a7)	|reserve a word on the stack
30862306a36Sopenharmony_ci	leal	2(%a7),%a1	|point to low word of temporary
30962306a36Sopenharmony_ci	movel	#2,%d0		|count
31062306a36Sopenharmony_ci	bsrl	mem_read
31162306a36Sopenharmony_ci	movel	(%a7)+,%d0
31262306a36Sopenharmony_ci	rts
31362306a36Sopenharmony_ci|
31462306a36Sopenharmony_ci|	g_rndpr --- put rounding precision in d0{1:0}
31562306a36Sopenharmony_ci|
31662306a36Sopenharmony_ci|	valid return codes are:
31762306a36Sopenharmony_ci|		00 - extended
31862306a36Sopenharmony_ci|		01 - single
31962306a36Sopenharmony_ci|		10 - double
32062306a36Sopenharmony_ci|
32162306a36Sopenharmony_ci| begin
32262306a36Sopenharmony_ci| get rounding precision (cmdreg3b{6:5})
32362306a36Sopenharmony_ci| begin
32462306a36Sopenharmony_ci|  case	opclass = 011 (move out)
32562306a36Sopenharmony_ci|	get destination format - this is the also the rounding precision
32662306a36Sopenharmony_ci|
32762306a36Sopenharmony_ci|  case	opclass = 0x0
32862306a36Sopenharmony_ci|	if E3
32962306a36Sopenharmony_ci|	    *case RndPr(from cmdreg3b{6:5} = 11  then RND_PREC = DBL
33062306a36Sopenharmony_ci|	    *case RndPr(from cmdreg3b{6:5} = 10  then RND_PREC = SGL
33162306a36Sopenharmony_ci|	     case RndPr(from cmdreg3b{6:5} = 00 | 01
33262306a36Sopenharmony_ci|		use precision from FPCR{7:6}
33362306a36Sopenharmony_ci|			case 00 then RND_PREC = EXT
33462306a36Sopenharmony_ci|			case 01 then RND_PREC = SGL
33562306a36Sopenharmony_ci|			case 10 then RND_PREC = DBL
33662306a36Sopenharmony_ci|	else E1
33762306a36Sopenharmony_ci|	     use precision in FPCR{7:6}
33862306a36Sopenharmony_ci|	     case 00 then RND_PREC = EXT
33962306a36Sopenharmony_ci|	     case 01 then RND_PREC = SGL
34062306a36Sopenharmony_ci|	     case 10 then RND_PREC = DBL
34162306a36Sopenharmony_ci| end
34262306a36Sopenharmony_ci|
34362306a36Sopenharmony_cig_rndpr:
34462306a36Sopenharmony_ci	bsr	g_opcls		|get opclass in d0{2:0}
34562306a36Sopenharmony_ci	cmpw	#0x0003,%d0	|check for opclass 011
34662306a36Sopenharmony_ci	bnes	op_0x0
34762306a36Sopenharmony_ci
34862306a36Sopenharmony_ci|
34962306a36Sopenharmony_ci| For move out instructions (opclass 011) the destination format
35062306a36Sopenharmony_ci| is the same as the rounding precision.  Pass results from g_dfmtou.
35162306a36Sopenharmony_ci|
35262306a36Sopenharmony_ci	bsr	g_dfmtou
35362306a36Sopenharmony_ci	rts
35462306a36Sopenharmony_ciop_0x0:
35562306a36Sopenharmony_ci	btstb	#E3,E_BYTE(%a6)
35662306a36Sopenharmony_ci	beql	unf_e1_exc	|branch to e1 underflow
35762306a36Sopenharmony_ciunf_e3_exc:
35862306a36Sopenharmony_ci	movel	CMDREG3B(%a6),%d0	|rounding precision in d0{10:9}
35962306a36Sopenharmony_ci	bfextu	%d0{#9:#2},%d0	|move the rounding prec bits to d0{1:0}
36062306a36Sopenharmony_ci	cmpil	#0x2,%d0
36162306a36Sopenharmony_ci	beql	unff_sgl	|force precision is single
36262306a36Sopenharmony_ci	cmpil	#0x3,%d0		|force precision is double
36362306a36Sopenharmony_ci	beql	unff_dbl
36462306a36Sopenharmony_ci	movew	CMDREG3B(%a6),%d0	|get the command word again
36562306a36Sopenharmony_ci	andil	#0x7f,%d0		|clear all except operation
36662306a36Sopenharmony_ci	cmpil	#0x33,%d0
36762306a36Sopenharmony_ci	beql	unf_fsgl	|fsglmul or fsgldiv
36862306a36Sopenharmony_ci	cmpil	#0x30,%d0
36962306a36Sopenharmony_ci	beql	unf_fsgl	|fsgldiv or fsglmul
37062306a36Sopenharmony_ci	bra	unf_fpcr
37162306a36Sopenharmony_ciunf_e1_exc:
37262306a36Sopenharmony_ci	movel	CMDREG1B(%a6),%d0	|get 32 bits off the stack, 1st 16 bits
37362306a36Sopenharmony_ci|				;are the command word
37462306a36Sopenharmony_ci	andil	#0x00440000,%d0	|clear all bits except bits 6 and 2
37562306a36Sopenharmony_ci	cmpil	#0x00400000,%d0
37662306a36Sopenharmony_ci	beql	unff_sgl	|force single
37762306a36Sopenharmony_ci	cmpil	#0x00440000,%d0	|force double
37862306a36Sopenharmony_ci	beql	unff_dbl
37962306a36Sopenharmony_ci	movel	CMDREG1B(%a6),%d0	|get the command word again
38062306a36Sopenharmony_ci	andil	#0x007f0000,%d0	|clear all bits except the operation
38162306a36Sopenharmony_ci	cmpil	#0x00270000,%d0
38262306a36Sopenharmony_ci	beql	unf_fsgl	|fsglmul
38362306a36Sopenharmony_ci	cmpil	#0x00240000,%d0
38462306a36Sopenharmony_ci	beql	unf_fsgl	|fsgldiv
38562306a36Sopenharmony_ci	bra	unf_fpcr
38662306a36Sopenharmony_ci
38762306a36Sopenharmony_ci|
38862306a36Sopenharmony_ci| Convert to return format.  The values from cmdreg3b and the return
38962306a36Sopenharmony_ci| values are:
39062306a36Sopenharmony_ci|	cmdreg3b	return	     precision
39162306a36Sopenharmony_ci|	--------	------	     ---------
39262306a36Sopenharmony_ci|	  00,01		  0		ext
39362306a36Sopenharmony_ci|	   10		  1		sgl
39462306a36Sopenharmony_ci|	   11		  2		dbl
39562306a36Sopenharmony_ci| Force single
39662306a36Sopenharmony_ci|
39762306a36Sopenharmony_ciunff_sgl:
39862306a36Sopenharmony_ci	movel	#1,%d0		|return 1
39962306a36Sopenharmony_ci	rts
40062306a36Sopenharmony_ci|
40162306a36Sopenharmony_ci| Force double
40262306a36Sopenharmony_ci|
40362306a36Sopenharmony_ciunff_dbl:
40462306a36Sopenharmony_ci	movel	#2,%d0		|return 2
40562306a36Sopenharmony_ci	rts
40662306a36Sopenharmony_ci|
40762306a36Sopenharmony_ci| Force extended
40862306a36Sopenharmony_ci|
40962306a36Sopenharmony_ciunf_fsgl:
41062306a36Sopenharmony_ci	movel	#0,%d0
41162306a36Sopenharmony_ci	rts
41262306a36Sopenharmony_ci|
41362306a36Sopenharmony_ci| Get rounding precision set in FPCR{7:6}.
41462306a36Sopenharmony_ci|
41562306a36Sopenharmony_ciunf_fpcr:
41662306a36Sopenharmony_ci	movel	USER_FPCR(%a6),%d0 |rounding precision bits in d0{7:6}
41762306a36Sopenharmony_ci	bfextu	%d0{#24:#2},%d0	|move the rounding prec bits to d0{1:0}
41862306a36Sopenharmony_ci	rts
41962306a36Sopenharmony_ci|
42062306a36Sopenharmony_ci|	g_opcls --- put opclass in d0{2:0}
42162306a36Sopenharmony_ci|
42262306a36Sopenharmony_cig_opcls:
42362306a36Sopenharmony_ci	btstb	#E3,E_BYTE(%a6)
42462306a36Sopenharmony_ci	beqs	opc_1b		|if set, go to cmdreg1b
42562306a36Sopenharmony_ciopc_3b:
42662306a36Sopenharmony_ci	clrl	%d0		|if E3, only opclass 0x0 is possible
42762306a36Sopenharmony_ci	rts
42862306a36Sopenharmony_ciopc_1b:
42962306a36Sopenharmony_ci	movel	CMDREG1B(%a6),%d0
43062306a36Sopenharmony_ci	bfextu	%d0{#0:#3},%d0	|shift opclass bits d0{31:29} to d0{2:0}
43162306a36Sopenharmony_ci	rts
43262306a36Sopenharmony_ci|
43362306a36Sopenharmony_ci|	g_dfmtou --- put destination format in d0{1:0}
43462306a36Sopenharmony_ci|
43562306a36Sopenharmony_ci|	If E1, the format is from cmdreg1b{12:10}
43662306a36Sopenharmony_ci|	If E3, the format is extended.
43762306a36Sopenharmony_ci|
43862306a36Sopenharmony_ci|	Dest. Fmt.
43962306a36Sopenharmony_ci|		extended  010 -> 00
44062306a36Sopenharmony_ci|		single    001 -> 01
44162306a36Sopenharmony_ci|		double    101 -> 10
44262306a36Sopenharmony_ci|
44362306a36Sopenharmony_cig_dfmtou:
44462306a36Sopenharmony_ci	btstb	#E3,E_BYTE(%a6)
44562306a36Sopenharmony_ci	beqs	op011
44662306a36Sopenharmony_ci	clrl	%d0		|if E1, size is always ext
44762306a36Sopenharmony_ci	rts
44862306a36Sopenharmony_ciop011:
44962306a36Sopenharmony_ci	movel	CMDREG1B(%a6),%d0
45062306a36Sopenharmony_ci	bfextu	%d0{#3:#3},%d0	|dest fmt from cmdreg1b{12:10}
45162306a36Sopenharmony_ci	cmpb	#1,%d0		|check for single
45262306a36Sopenharmony_ci	bnes	not_sgl
45362306a36Sopenharmony_ci	movel	#1,%d0
45462306a36Sopenharmony_ci	rts
45562306a36Sopenharmony_cinot_sgl:
45662306a36Sopenharmony_ci	cmpb	#5,%d0		|check for double
45762306a36Sopenharmony_ci	bnes	not_dbl
45862306a36Sopenharmony_ci	movel	#2,%d0
45962306a36Sopenharmony_ci	rts
46062306a36Sopenharmony_cinot_dbl:
46162306a36Sopenharmony_ci	clrl	%d0		|must be extended
46262306a36Sopenharmony_ci	rts
46362306a36Sopenharmony_ci
46462306a36Sopenharmony_ci|
46562306a36Sopenharmony_ci|
46662306a36Sopenharmony_ci| Final result table for unf_sub. Note that the negative counterparts
46762306a36Sopenharmony_ci| are unnecessary as unf_sub always returns the sign separately from
46862306a36Sopenharmony_ci| the exponent.
46962306a36Sopenharmony_ci|					;+zero
47062306a36Sopenharmony_ciEXT_PZRO:	.long	0x00000000,0x00000000,0x00000000,0x00000000
47162306a36Sopenharmony_ci|					;+zero
47262306a36Sopenharmony_ciSGL_PZRO:	.long	0x3f810000,0x00000000,0x00000000,0x00000000
47362306a36Sopenharmony_ci|					;+zero
47462306a36Sopenharmony_ciDBL_PZRO:	.long	0x3c010000,0x00000000,0x00000000,0x00000000
47562306a36Sopenharmony_ci|					;smallest +ext denorm
47662306a36Sopenharmony_ciEXT_PSML:	.long	0x00000000,0x00000000,0x00000001,0x00000000
47762306a36Sopenharmony_ci|					;smallest +sgl denorm
47862306a36Sopenharmony_ciSGL_PSML:	.long	0x3f810000,0x00000100,0x00000000,0x00000000
47962306a36Sopenharmony_ci|					;smallest +dbl denorm
48062306a36Sopenharmony_ciDBL_PSML:	.long	0x3c010000,0x00000000,0x00000800,0x00000000
48162306a36Sopenharmony_ci|
48262306a36Sopenharmony_ci|	UNF_SUB --- underflow result calculation
48362306a36Sopenharmony_ci|
48462306a36Sopenharmony_ci| Input:
48562306a36Sopenharmony_ci|	d0	contains round precision
48662306a36Sopenharmony_ci|	a0	points to input operand in the internal extended format
48762306a36Sopenharmony_ci|
48862306a36Sopenharmony_ci| Output:
48962306a36Sopenharmony_ci|	a0	points to correct internal extended precision result.
49062306a36Sopenharmony_ci|
49162306a36Sopenharmony_ci
49262306a36Sopenharmony_citblunf:
49362306a36Sopenharmony_ci	.long	uEXT_RN
49462306a36Sopenharmony_ci	.long	uEXT_RZ
49562306a36Sopenharmony_ci	.long	uEXT_RM
49662306a36Sopenharmony_ci	.long	uEXT_RP
49762306a36Sopenharmony_ci	.long	uSGL_RN
49862306a36Sopenharmony_ci	.long	uSGL_RZ
49962306a36Sopenharmony_ci	.long	uSGL_RM
50062306a36Sopenharmony_ci	.long	uSGL_RP
50162306a36Sopenharmony_ci	.long	uDBL_RN
50262306a36Sopenharmony_ci	.long	uDBL_RZ
50362306a36Sopenharmony_ci	.long	uDBL_RM
50462306a36Sopenharmony_ci	.long	uDBL_RP
50562306a36Sopenharmony_ci	.long	uDBL_RN
50662306a36Sopenharmony_ci	.long	uDBL_RZ
50762306a36Sopenharmony_ci	.long	uDBL_RM
50862306a36Sopenharmony_ci	.long	uDBL_RP
50962306a36Sopenharmony_ci
51062306a36Sopenharmony_ci	.global	unf_sub
51162306a36Sopenharmony_ciunf_sub:
51262306a36Sopenharmony_ci	lsll	#2,%d0		|move round precision to d0{3:2}
51362306a36Sopenharmony_ci	bfextu	FPCR_MODE(%a6){#2:#2},%d1 |set round mode
51462306a36Sopenharmony_ci	orl	%d1,%d0		|index is fmt:mode in d0{3:0}
51562306a36Sopenharmony_ci	leal	tblunf,%a1	|load a1 with table address
51662306a36Sopenharmony_ci	movel	%a1@(%d0:l:4),%a1	|use d0 as index to the table
51762306a36Sopenharmony_ci	jmp	(%a1)		|go to the correct routine
51862306a36Sopenharmony_ci|
51962306a36Sopenharmony_ci|case DEST_FMT = EXT
52062306a36Sopenharmony_ci|
52162306a36Sopenharmony_ciuEXT_RN:
52262306a36Sopenharmony_ci	leal	EXT_PZRO,%a1	|answer is +/- zero
52362306a36Sopenharmony_ci	bsetb	#z_bit,FPSR_CC(%a6)
52462306a36Sopenharmony_ci	bra	uset_sign	|now go set the sign
52562306a36Sopenharmony_ciuEXT_RZ:
52662306a36Sopenharmony_ci	leal	EXT_PZRO,%a1	|answer is +/- zero
52762306a36Sopenharmony_ci	bsetb	#z_bit,FPSR_CC(%a6)
52862306a36Sopenharmony_ci	bra	uset_sign	|now go set the sign
52962306a36Sopenharmony_ciuEXT_RM:
53062306a36Sopenharmony_ci	tstb	LOCAL_SGN(%a0)	|if negative underflow
53162306a36Sopenharmony_ci	beqs	ue_rm_pos
53262306a36Sopenharmony_ciue_rm_neg:
53362306a36Sopenharmony_ci	leal	EXT_PSML,%a1	|answer is negative smallest denorm
53462306a36Sopenharmony_ci	bsetb	#neg_bit,FPSR_CC(%a6)
53562306a36Sopenharmony_ci	bra	end_unfr
53662306a36Sopenharmony_ciue_rm_pos:
53762306a36Sopenharmony_ci	leal	EXT_PZRO,%a1	|answer is positive zero
53862306a36Sopenharmony_ci	bsetb	#z_bit,FPSR_CC(%a6)
53962306a36Sopenharmony_ci	bra	end_unfr
54062306a36Sopenharmony_ciuEXT_RP:
54162306a36Sopenharmony_ci	tstb	LOCAL_SGN(%a0)	|if negative underflow
54262306a36Sopenharmony_ci	beqs	ue_rp_pos
54362306a36Sopenharmony_ciue_rp_neg:
54462306a36Sopenharmony_ci	leal	EXT_PZRO,%a1	|answer is negative zero
54562306a36Sopenharmony_ci	oril	#negz_mask,USER_FPSR(%a6)
54662306a36Sopenharmony_ci	bra	end_unfr
54762306a36Sopenharmony_ciue_rp_pos:
54862306a36Sopenharmony_ci	leal	EXT_PSML,%a1	|answer is positive smallest denorm
54962306a36Sopenharmony_ci	bra	end_unfr
55062306a36Sopenharmony_ci|
55162306a36Sopenharmony_ci|case DEST_FMT = DBL
55262306a36Sopenharmony_ci|
55362306a36Sopenharmony_ciuDBL_RN:
55462306a36Sopenharmony_ci	leal	DBL_PZRO,%a1	|answer is +/- zero
55562306a36Sopenharmony_ci	bsetb	#z_bit,FPSR_CC(%a6)
55662306a36Sopenharmony_ci	bra	uset_sign
55762306a36Sopenharmony_ciuDBL_RZ:
55862306a36Sopenharmony_ci	leal	DBL_PZRO,%a1	|answer is +/- zero
55962306a36Sopenharmony_ci	bsetb	#z_bit,FPSR_CC(%a6)
56062306a36Sopenharmony_ci	bra	uset_sign	|now go set the sign
56162306a36Sopenharmony_ciuDBL_RM:
56262306a36Sopenharmony_ci	tstb	LOCAL_SGN(%a0)	|if negative overflow
56362306a36Sopenharmony_ci	beqs	ud_rm_pos
56462306a36Sopenharmony_ciud_rm_neg:
56562306a36Sopenharmony_ci	leal	DBL_PSML,%a1	|answer is smallest denormalized negative
56662306a36Sopenharmony_ci	bsetb	#neg_bit,FPSR_CC(%a6)
56762306a36Sopenharmony_ci	bra	end_unfr
56862306a36Sopenharmony_ciud_rm_pos:
56962306a36Sopenharmony_ci	leal	DBL_PZRO,%a1	|answer is positive zero
57062306a36Sopenharmony_ci	bsetb	#z_bit,FPSR_CC(%a6)
57162306a36Sopenharmony_ci	bra	end_unfr
57262306a36Sopenharmony_ciuDBL_RP:
57362306a36Sopenharmony_ci	tstb	LOCAL_SGN(%a0)	|if negative overflow
57462306a36Sopenharmony_ci	beqs	ud_rp_pos
57562306a36Sopenharmony_ciud_rp_neg:
57662306a36Sopenharmony_ci	leal	DBL_PZRO,%a1	|answer is negative zero
57762306a36Sopenharmony_ci	oril	#negz_mask,USER_FPSR(%a6)
57862306a36Sopenharmony_ci	bra	end_unfr
57962306a36Sopenharmony_ciud_rp_pos:
58062306a36Sopenharmony_ci	leal	DBL_PSML,%a1	|answer is smallest denormalized negative
58162306a36Sopenharmony_ci	bra	end_unfr
58262306a36Sopenharmony_ci|
58362306a36Sopenharmony_ci|case DEST_FMT = SGL
58462306a36Sopenharmony_ci|
58562306a36Sopenharmony_ciuSGL_RN:
58662306a36Sopenharmony_ci	leal	SGL_PZRO,%a1	|answer is +/- zero
58762306a36Sopenharmony_ci	bsetb	#z_bit,FPSR_CC(%a6)
58862306a36Sopenharmony_ci	bras	uset_sign
58962306a36Sopenharmony_ciuSGL_RZ:
59062306a36Sopenharmony_ci	leal	SGL_PZRO,%a1	|answer is +/- zero
59162306a36Sopenharmony_ci	bsetb	#z_bit,FPSR_CC(%a6)
59262306a36Sopenharmony_ci	bras	uset_sign
59362306a36Sopenharmony_ciuSGL_RM:
59462306a36Sopenharmony_ci	tstb	LOCAL_SGN(%a0)	|if negative overflow
59562306a36Sopenharmony_ci	beqs	us_rm_pos
59662306a36Sopenharmony_cius_rm_neg:
59762306a36Sopenharmony_ci	leal	SGL_PSML,%a1	|answer is smallest denormalized negative
59862306a36Sopenharmony_ci	bsetb	#neg_bit,FPSR_CC(%a6)
59962306a36Sopenharmony_ci	bras	end_unfr
60062306a36Sopenharmony_cius_rm_pos:
60162306a36Sopenharmony_ci	leal	SGL_PZRO,%a1	|answer is positive zero
60262306a36Sopenharmony_ci	bsetb	#z_bit,FPSR_CC(%a6)
60362306a36Sopenharmony_ci	bras	end_unfr
60462306a36Sopenharmony_ciuSGL_RP:
60562306a36Sopenharmony_ci	tstb	LOCAL_SGN(%a0)	|if negative overflow
60662306a36Sopenharmony_ci	beqs	us_rp_pos
60762306a36Sopenharmony_cius_rp_neg:
60862306a36Sopenharmony_ci	leal	SGL_PZRO,%a1	|answer is negative zero
60962306a36Sopenharmony_ci	oril	#negz_mask,USER_FPSR(%a6)
61062306a36Sopenharmony_ci	bras	end_unfr
61162306a36Sopenharmony_cius_rp_pos:
61262306a36Sopenharmony_ci	leal	SGL_PSML,%a1	|answer is smallest denormalized positive
61362306a36Sopenharmony_ci	bras	end_unfr
61462306a36Sopenharmony_ci
61562306a36Sopenharmony_ciuset_sign:
61662306a36Sopenharmony_ci	tstb	LOCAL_SGN(%a0)	|if negative overflow
61762306a36Sopenharmony_ci	beqs	end_unfr
61862306a36Sopenharmony_ciuneg_sign:
61962306a36Sopenharmony_ci	bsetb	#neg_bit,FPSR_CC(%a6)
62062306a36Sopenharmony_ci
62162306a36Sopenharmony_ciend_unfr:
62262306a36Sopenharmony_ci	movew	LOCAL_EX(%a1),LOCAL_EX(%a0) |be careful not to overwrite sign
62362306a36Sopenharmony_ci	movel	LOCAL_HI(%a1),LOCAL_HI(%a0)
62462306a36Sopenharmony_ci	movel	LOCAL_LO(%a1),LOCAL_LO(%a0)
62562306a36Sopenharmony_ci	rts
62662306a36Sopenharmony_ci|
62762306a36Sopenharmony_ci|	reg_dest --- write byte, word, or long data to Dn
62862306a36Sopenharmony_ci|
62962306a36Sopenharmony_ci|
63062306a36Sopenharmony_ci| Input:
63162306a36Sopenharmony_ci|	L_SCR1: Data
63262306a36Sopenharmony_ci|	d1:     data size and dest register number formatted as:
63362306a36Sopenharmony_ci|
63462306a36Sopenharmony_ci|	32		5    4     3     2     1     0
63562306a36Sopenharmony_ci|       -----------------------------------------------
63662306a36Sopenharmony_ci|       |        0        |    Size   |  Dest Reg #   |
63762306a36Sopenharmony_ci|       -----------------------------------------------
63862306a36Sopenharmony_ci|
63962306a36Sopenharmony_ci|	Size is:
64062306a36Sopenharmony_ci|		0 - Byte
64162306a36Sopenharmony_ci|		1 - Word
64262306a36Sopenharmony_ci|		2 - Long/Single
64362306a36Sopenharmony_ci|
64462306a36Sopenharmony_cipregdst:
64562306a36Sopenharmony_ci	.long	byte_d0
64662306a36Sopenharmony_ci	.long	byte_d1
64762306a36Sopenharmony_ci	.long	byte_d2
64862306a36Sopenharmony_ci	.long	byte_d3
64962306a36Sopenharmony_ci	.long	byte_d4
65062306a36Sopenharmony_ci	.long	byte_d5
65162306a36Sopenharmony_ci	.long	byte_d6
65262306a36Sopenharmony_ci	.long	byte_d7
65362306a36Sopenharmony_ci	.long	word_d0
65462306a36Sopenharmony_ci	.long	word_d1
65562306a36Sopenharmony_ci	.long	word_d2
65662306a36Sopenharmony_ci	.long	word_d3
65762306a36Sopenharmony_ci	.long	word_d4
65862306a36Sopenharmony_ci	.long	word_d5
65962306a36Sopenharmony_ci	.long	word_d6
66062306a36Sopenharmony_ci	.long	word_d7
66162306a36Sopenharmony_ci	.long	long_d0
66262306a36Sopenharmony_ci	.long	long_d1
66362306a36Sopenharmony_ci	.long	long_d2
66462306a36Sopenharmony_ci	.long	long_d3
66562306a36Sopenharmony_ci	.long	long_d4
66662306a36Sopenharmony_ci	.long	long_d5
66762306a36Sopenharmony_ci	.long	long_d6
66862306a36Sopenharmony_ci	.long	long_d7
66962306a36Sopenharmony_ci
67062306a36Sopenharmony_cireg_dest:
67162306a36Sopenharmony_ci	leal	pregdst,%a0
67262306a36Sopenharmony_ci	movel	%a0@(%d1:l:4),%a0
67362306a36Sopenharmony_ci	jmp	(%a0)
67462306a36Sopenharmony_ci
67562306a36Sopenharmony_cibyte_d0:
67662306a36Sopenharmony_ci	moveb	L_SCR1(%a6),USER_D0+3(%a6)
67762306a36Sopenharmony_ci	rts
67862306a36Sopenharmony_cibyte_d1:
67962306a36Sopenharmony_ci	moveb	L_SCR1(%a6),USER_D1+3(%a6)
68062306a36Sopenharmony_ci	rts
68162306a36Sopenharmony_cibyte_d2:
68262306a36Sopenharmony_ci	moveb	L_SCR1(%a6),%d2
68362306a36Sopenharmony_ci	rts
68462306a36Sopenharmony_cibyte_d3:
68562306a36Sopenharmony_ci	moveb	L_SCR1(%a6),%d3
68662306a36Sopenharmony_ci	rts
68762306a36Sopenharmony_cibyte_d4:
68862306a36Sopenharmony_ci	moveb	L_SCR1(%a6),%d4
68962306a36Sopenharmony_ci	rts
69062306a36Sopenharmony_cibyte_d5:
69162306a36Sopenharmony_ci	moveb	L_SCR1(%a6),%d5
69262306a36Sopenharmony_ci	rts
69362306a36Sopenharmony_cibyte_d6:
69462306a36Sopenharmony_ci	moveb	L_SCR1(%a6),%d6
69562306a36Sopenharmony_ci	rts
69662306a36Sopenharmony_cibyte_d7:
69762306a36Sopenharmony_ci	moveb	L_SCR1(%a6),%d7
69862306a36Sopenharmony_ci	rts
69962306a36Sopenharmony_ciword_d0:
70062306a36Sopenharmony_ci	movew	L_SCR1(%a6),USER_D0+2(%a6)
70162306a36Sopenharmony_ci	rts
70262306a36Sopenharmony_ciword_d1:
70362306a36Sopenharmony_ci	movew	L_SCR1(%a6),USER_D1+2(%a6)
70462306a36Sopenharmony_ci	rts
70562306a36Sopenharmony_ciword_d2:
70662306a36Sopenharmony_ci	movew	L_SCR1(%a6),%d2
70762306a36Sopenharmony_ci	rts
70862306a36Sopenharmony_ciword_d3:
70962306a36Sopenharmony_ci	movew	L_SCR1(%a6),%d3
71062306a36Sopenharmony_ci	rts
71162306a36Sopenharmony_ciword_d4:
71262306a36Sopenharmony_ci	movew	L_SCR1(%a6),%d4
71362306a36Sopenharmony_ci	rts
71462306a36Sopenharmony_ciword_d5:
71562306a36Sopenharmony_ci	movew	L_SCR1(%a6),%d5
71662306a36Sopenharmony_ci	rts
71762306a36Sopenharmony_ciword_d6:
71862306a36Sopenharmony_ci	movew	L_SCR1(%a6),%d6
71962306a36Sopenharmony_ci	rts
72062306a36Sopenharmony_ciword_d7:
72162306a36Sopenharmony_ci	movew	L_SCR1(%a6),%d7
72262306a36Sopenharmony_ci	rts
72362306a36Sopenharmony_cilong_d0:
72462306a36Sopenharmony_ci	movel	L_SCR1(%a6),USER_D0(%a6)
72562306a36Sopenharmony_ci	rts
72662306a36Sopenharmony_cilong_d1:
72762306a36Sopenharmony_ci	movel	L_SCR1(%a6),USER_D1(%a6)
72862306a36Sopenharmony_ci	rts
72962306a36Sopenharmony_cilong_d2:
73062306a36Sopenharmony_ci	movel	L_SCR1(%a6),%d2
73162306a36Sopenharmony_ci	rts
73262306a36Sopenharmony_cilong_d3:
73362306a36Sopenharmony_ci	movel	L_SCR1(%a6),%d3
73462306a36Sopenharmony_ci	rts
73562306a36Sopenharmony_cilong_d4:
73662306a36Sopenharmony_ci	movel	L_SCR1(%a6),%d4
73762306a36Sopenharmony_ci	rts
73862306a36Sopenharmony_cilong_d5:
73962306a36Sopenharmony_ci	movel	L_SCR1(%a6),%d5
74062306a36Sopenharmony_ci	rts
74162306a36Sopenharmony_cilong_d6:
74262306a36Sopenharmony_ci	movel	L_SCR1(%a6),%d6
74362306a36Sopenharmony_ci	rts
74462306a36Sopenharmony_cilong_d7:
74562306a36Sopenharmony_ci	movel	L_SCR1(%a6),%d7
74662306a36Sopenharmony_ci	rts
74762306a36Sopenharmony_ci	|end
748