⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 get_op.s

📁 VXWORKS源代码
💻 S
📖 第 1 页 / 共 2 页
字号:
|| Dest is not denormalized.  Check for norm, and set fpte15| accordingly.|	moveb	a6@(DTAG),d0	andib	#0xf0,d0		| strip to only dtag:fpte15	tstb	d0		| check for normalized value	jne 	end_getop	| if inf/nan/zero leave __x_get_op	movew	a6@(FPTEMP_EX),d0	andiw	#0x7fff,d0	cmpiw	#0x3fff,d0	| check if fpte15 needs setting	jge 	end_getop	| if >= 0x3fff, leave fpte15=0	orb	#0x10,a6@(DTAG)	jra 	end_getop|| At this point, it is either an fmoveout packed, unnorm or denorm|opclass3:	clrb	a6@(DY_MO_FLG)	| set dyadic/monadic flag to monadic	bfextu	a6@(CMDREG1B){#4:#2},d0	cmpib	#3,d0	jne 	src_ex_dnrm	| if not equal, must be unnorm or denorm|				| else it is a packed move out|				| exitend_getop:	rts|| Sets the DY_MO_FLG correctly. This is used only on if it is an| unuspported data type exception.  Set if dyadic.|chk_dy_mo:	movew	a6@(CMDREG1B),d0	btst	#5,d0		| testing extension command word	jeq 	set_mon		| if bit 5 = 0 then monadic	btst	#4,d0		| know that bit 5 = 1	jeq 	set_dya		| if bit 4 = 0 then dyadic	andiw	#0x007f,d0	| get rid of all but extension bits {6:0}	cmpiw 	#0x0038,d0	| if extension = 0x38 then fcmp (dyadic)	jne 	set_monset_dya:	st	a6@(DY_MO_FLG)	| set the inst flag type to dyadic	rtsset_mon:	clrb	a6@(DY_MO_FLG)	| set the inst flag type to monadic	rts||	MK_NORM|| Normalizes unnormalized numbers, sets tag to norm or denorm, sets unfl| exception if denorm.|| CASE opclass 0x0 unsupp|	mk_norm till msb set|	set tag = norm|| CASE opclass 0x0 unimp|	mk_norm till msb set or exp = 0|	if integer bit = 0|	   tag = denorm|	else|	   tag = norm|| CASE opclass 011 unsupp|	mk_norm till msb set or exp = 0|	if integer bit = 0|	   tag = denorm|	   set unfl_nmcexe = 1|	else|	   tag = norm|| if exp <= 0x3fff|   set ete15 or fpte15 = 1| else set ete15 or fpte15 = 0| input:|	a0 = points to operand to be normalized| output:|	L_SCR1{7:5} = operand tag (000 = norm, 100 = denorm)|	L_SCR1{4}   = fpte15 or ete15 (0 = exp > 0x3fff, 1 = exp <=0x3fff)|	the normalized operand is placed back on the fsave stackmk_norm:	clrl	a6@(L_SCR1)	bclr	#sign_bit,a0@(LOCAL_EX)	sne	a0@(LOCAL_SGN)	| transform into internal extended format	cmpib	#0x2c,a6@(1+EXC_VEC) | check if unimp	jne 	uns_data	| branch if unsupp	bsrl	uni_inst	| call if unimp (opclass 0x0)	jra 	reloaduns_data:	btst	#direction_bit,a6@(CMDREG1B) | check transfer direction	jne 	bit_set		| branch if set (opclass 011)	bsrl	uns_opx		| call if opclass 0x0	jra 	reloadbit_set:	bsrl	uns_op3		| opclass 011reload:	cmpw	#0x3fff,a0@(LOCAL_EX) | if exp > 0x3fff	jgt 	end_mk		|    fpte15/ete15 already set to 0	bset	#4,a6@(L_SCR1)	| else set fpte15/ete15 to 1|				| calling routine actually sets the|				| value on the stack (along with the/* |				| tag), since this routine doesn't  */|				| know if it should set ete15 or fpte15/* |				| ie, it doesn't know if this is the  */|				| src op or dest op.end_mk:	bfclr	a0@(LOCAL_SGN){#0:#8}	jeq 	end_mk_pos	bset	#sign_bit,a0@(LOCAL_EX) | convert back to IEEE formatend_mk_pos:	rts||     CASE opclass 011 unsupp|uns_op3:	bsrl	__x_nrm_zero	| normalize till msb = 1 or exp = zero	btst	#7,a0@(LOCAL_HI)	| if msb = 1	jne 	no_unfl		| then branchset_unfl:	orw	#dnrm_tag,a6@(L_SCR1) | set denorm tag	bset	#__x_unfl_bit,a6@(FPSR_EXCEPT) | set unfl exception bitno_unfl:	rts||     CASE opclass 0x0 unsupp|uns_opx:	bsrl	__x_nrm_zero	| normalize the number	btst	#7,a0@(LOCAL_HI)	| check if integer bit (j-bit) is set	jeq 	uns_den		| if clear then now have a denormuns_nrm:	orb	#__x_norm_tag,a6@(L_SCR1) | set tag to norm	rtsuns_den:	orb	#dnrm_tag,a6@(L_SCR1) | set tag to denorm	rts||     CASE opclass 0x0 unimp|uni_inst:	bsrl	__x_nrm_zero	btst	#7,a0@(LOCAL_HI)	| check if integer bit (j-bit) is set	jeq 	uni_den		| if clear then now have a denormuni_nrm:	orb	#__x_norm_tag,a6@(L_SCR1) | set tag to norm	rtsuni_den:	orb	#dnrm_tag,a6@(L_SCR1) | set tag to denorm	rts||	Decimal to binary conversion|| Special cases of inf and NaNs are completed outside of __x_decbin.| If the input is an snan, the snan bit is not set.|| input:|	a6@(ETEMP)	- points to packed decimal string in memory| output:|	fp0	- contains packed string converted to extended precision|	ETEMP	- same as fp0unpack:	movew	a6@(CMDREG1B),d0	/* | examine command word, looking for fmove's */	andw	#0x3b,d0	jeq 	move_unpack	| special handling for fmove: must set FPSR_CC	movew	a6@(ETEMP),d0	| get word with inf information	bfextu	d0{#20:#12},d1	| get exponent into d1	cmpiw	#0x0fff,d1	| test for inf or NaN	jne 	try_zero	| if not equal, it is not special	bfextu	d0{#17:#3},d1	| get SE and y bits into d1	cmpiw	#7,d1		| SE and y bits must be on for special	jne 	try_zero	| if not on, it is not special|input is of the special cases of inf and NaN	tstl	a6@(ETEMP_HI)	| check ms mantissa	jne 	fix_nan		| if non-zero, it is a NaN	tstl	a6@(ETEMP_LO)	| check ls mantissa	jne 	fix_nan		| if non-zero, it is a NaN	jra 	finish		| special already on stackfix_nan:	btst	#signan_bit,a6@(ETEMP_HI) | test for snan	jne 	finish	orl	#__x_snaniop_mask,a6@(USER_FPSR) | always set snan if it is so	jra 	finishtry_zero:	movew	a6@(ETEMP_EX+2),d0 | get word 4	andiw	#0x000f,d0	| clear all but last ni(y)bble	tstw	d0		| check for zero.	jne 	not_spec	tstl	a6@(ETEMP_HI)	| check words 3 and 2	jne 	not_spec	tstl	a6@(ETEMP_LO)	| check words 1 and 0	jne 	not_spec	tstl	a6@(ETEMP)	| test sign of the zero	jge 	pos_zero	movel	#0x80000000,a6@(ETEMP) | write neg zero to etemp	clrl	a6@(ETEMP_HI)	clrl	a6@(ETEMP_LO)	jra 	finishpos_zero:	clrl	a6@(ETEMP)	clrl	a6@(ETEMP_HI)	clrl	a6@(ETEMP_LO)	jra 	finishnot_spec:	fmovemx fp0-fp1,a7@-	| save fp0 - __x_decbin returns in it	bsrl	__x_decbin	fmovex fp0,a6@(ETEMP)	| put the unpacked sop in the fsave stack	fmovemx	a7@+,fp0-fp1	fmovel	#0,FPSR		| clr fpsr from __x_decbin	jra 	finish|| Special handling for packed move in:  Same results as all other| packed cases, but we must set the FPSR condition codes properly.|move_unpack:	movew	a6@(ETEMP),d0	| get word with inf information	bfextu	d0{#20:#12},d1	| get exponent into d1	cmpiw	#0x0fff,d1	| test for inf or NaN	jne 	mtry_zero	| if not equal, it is not special	bfextu	d0{#17:#3},d1	| get SE and y bits into d1	cmpiw	#7,d1		| SE and y bits must be on for special	jne 	mtry_zero	| if not on, it is not special|input is of the special cases of inf and NaN	tstl	a6@(ETEMP_HI)	| check ms mantissa	jne 	mfix_nan		| if non-zero, it is a NaN	tstl	a6@(ETEMP_LO)	| check ls mantissa	jne 	mfix_nan		| if non-zero, it is a NaN|input is inf	orl	#inf_mask,a6@(USER_FPSR) | set I bit	tstl	a6@(ETEMP)	| check sign	jge 	finish	orl	#neg_mask,a6@(USER_FPSR) | set N bit	jra 	finish		| special already on stackmfix_nan:	orl	#nan_mask,a6@(USER_FPSR) | set NaN bit	moveb	#nan_tag,a6@(STAG)	| set stag to NaN	btst	#signan_bit,a6@(ETEMP_HI) | test for snan	jne 	mn_snan	orl	#__x_snaniop_mask,a6@(USER_FPSR) | set snan bit	btst	#__x_snan_bit,a6@(fpcr_ENABLE) | test for snan enabled	jne 	mn_snan	bset	#signan_bit,a6@(ETEMP_HI) | force snans to qnansmn_snan:	tstl	a6@(ETEMP)	| check for sign	jge 	finish		| if clr, go on	orl	#neg_mask,a6@(USER_FPSR) | set N bit	jra 	finishmtry_zero:	movew	a6@(ETEMP_EX+2),d0 | get word 4	andiw	#0x000f,d0	| clear all but last ni(y)bble	tstw	d0		| check for zero.	jne 	mnot_spec	tstl	a6@(ETEMP_HI)	| check words 3 and 2	jne 	mnot_spec	tstl	a6@(ETEMP_LO)	| check words 1 and 0	jne 	mnot_spec	tstl	a6@(ETEMP)	| test sign of the zero	jge 	mpos_zero	orl	#neg_mask+z_mask,a6@(USER_FPSR) | set N and Z	movel	#0x80000000,a6@(ETEMP) | write neg zero to etemp	clrl	a6@(ETEMP_HI)	clrl	a6@(ETEMP_LO)	jra 	finishmpos_zero:	orl	#z_mask,a6@(USER_FPSR) | set Z	clrl	a6@(ETEMP)	clrl	a6@(ETEMP_HI)	clrl	a6@(ETEMP_LO)	jra 	finishmnot_spec:	fmovemx fp0-fp1,a7@-	| save fp0 - __x_decbin returns in it	bsrl	__x_decbin	fmovex fp0,a6@(ETEMP)|				| put the unpacked sop in the fsave stack	fmovemx	a7@+,fp0-fp1finish:	movew	a6@(CMDREG1B),d0	| get the command word	andw	#0xfbff,d0	| change the source specifier field to|				| extended (was packed).	movew	d0,a6@(CMDREG1B)	| write command word back to fsave stack|				| we need to do this so the 040 will|				| re-execute the inst. without taking|				| another packed trap.fix_stag:|Converted result is now in etemp on fsave stack, now set the source|tag (stag)|	if (ete =0x7fff) then INF or NAN|		if (etemp = $x.0----0) then|			stag = INF|		else|			stag = NAN|	else|		if (ete = 0x0000) then|			stag = ZERO|		else|			stag = NORM|| Note also that the etemp_15 bit (just right of the stag) must| be set accordingly.|	movew		a6@(ETEMP_EX),d1	andiw		#0x7fff,d1   | strip sign	cmpw  		#0x7fff,d1	jne   		z_or_nrm	movel		a6@(ETEMP_HI),d1	jne 		is_nan	movel		a6@(ETEMP_LO),d1	jne 		is_nanis_inf:	moveb		#0x40,a6@(STAG)	movel		#0x40,d0	rtsis_nan:	moveb		#0x60,a6@(STAG)	movel		#0x60,d0	rtsz_or_nrm:	tstw		d1	jne 		is_nrmis_zro:| For a zero, set etemp_15	moveb		#0x30,a6@(STAG)	movel		#0x20,d0	rtsis_nrm:| For a norm, check if the exp <= 0x3fff|  if so, set etemp_15	cmpiw		#0x3fff,d1	jle 		set_bit15	moveb		#0,a6@(STAG)	jra 		end_is_nrmset_bit15:	moveb		#0x10,a6@(STAG)end_is_nrm:	movel		#0,d0end_fix:	rtsend_get:	rts|	end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -