arch/m68k/fpsp040/get_op.S

Source file repositories/reference/linux-study-clean/arch/m68k/fpsp040/get_op.S

File Facts

System
Linux kernel
Corpus path
arch/m68k/fpsp040/get_op.S
Extension
.S
Size
20372 bytes
Lines
676
Domain
Architecture Layer
Bucket
arch/m68k
Inferred role
Architecture Layer: arch/m68k
Status
atlas-only

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

bfextu	CMDREG1B(%a6){#3:#3},%d0
	cmpb	#3,%d0
	beq	pack_source	|check for a packed src op, branch if so
uns_notpacked:
	bsr	chk_dy_mo	|set the dyadic/monadic flag
	tstb	DY_MO_FLG(%a6)
	beqs	src_op_ck	|if monadic, go check src op
|				;else, check dst op (fall through)

	btstb	#7,DTAG(%a6)
	beqs	src_op_ck	|if dst op is norm, check src op
	bras	dst_ex_dnrm	|else, handle destination unnorm/dnrm

uni_getop:
	bfextu	CMDREG1B(%a6){#0:#6},%d0 |get opclass and src fields
	cmpil	#0x17,%d0		|if op class and size fields are $17,
|				;it is FMOVECR; if not, continue
|
| If the instruction is fmovecr, exit get_op.  It is handled
| in do_func and smovecr.sa.
|
	bne	not_fmovecr	|handle fmovecr as an unimplemented inst
	rts

not_fmovecr:
	btstb	#E1,E_BYTE(%a6)	|if set, there is a packed operand
	bne	pack_source	|check for packed src op, branch if so

| The following lines of are coded to optimize on normalized operands
	moveb	STAG(%a6),%d0
	orb	DTAG(%a6),%d0	|check if either of STAG/DTAG msb set
	bmis	dest_op_ck	|if so, some op needs to be fixed
	rts

dest_op_ck:
	btstb	#7,DTAG(%a6)	|check for unsupported data types in
	beqs	src_op_ck	|the destination, if not, check src op
	bsr	chk_dy_mo	|set dyadic/monadic flag
	tstb	DY_MO_FLG(%a6)	|
	beqs	src_op_ck	|if monadic, check src op
|
| At this point, destination has an extended denorm or unnorm.
|
dst_ex_dnrm:
	movew	FPTEMP_EX(%a6),%d0 |get destination exponent
	andiw	#0x7fff,%d0	|mask sign, check if exp = 0000
	beqs	src_op_ck	|if denorm then check source op.
|				;denorms are taken care of in res_func
|				;(unsupp) or do_func (unimp)
|				;else unnorm fall through
	leal	FPTEMP(%a6),%a0	|point a0 to dop - used in mk_norm
	bsr	mk_norm		|go normalize - mk_norm returns:
|				;L_SCR1{7:5} = operand tag
|				;	(000 = norm, 100 = denorm)
|				;L_SCR1{4} = fpte15 or ete15
|				;	0 = exp >  $3fff
|				;	1 = exp <= $3fff
|				;and puts the normalized num back
|				;on the fsave stack
|
	moveb L_SCR1(%a6),DTAG(%a6) |write the new tag & fpte15
|				;to the fsave stack and fall
|				;through to check source operand
|
src_op_ck:
	btstb	#7,STAG(%a6)
	beq	end_getop	|check for unsupported data types on the
|				;source operand
	btstb	#5,STAG(%a6)
	bnes	src_sd_dnrm	|if bit 5 set, handle sgl/dbl denorms

Annotation

Implementation Notes