arch/m68k/fpsp040/sgetem.S

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

File Facts

System
Linux kernel
Corpus path
arch/m68k/fpsp040/sgetem.S
Extension
.S
Size
3666 bytes
Lines
141
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

|
|	sgetem.sa 3.1 12/10/90
|
|	The entry point sGETEXP returns the exponent portion
|	of the input argument.  The exponent bias is removed
|	and the exponent value is returned as an extended
|	precision number in fp0.  sGETEXPD handles denormalized
|	numbers.
|
|	The entry point sGETMAN extracts the mantissa of the
|	input argument.  The mantissa is converted to an
|	extended precision number and returned in fp0.  The
|	range of the result is [1.0 - 2.0).
|
|
|	Input:  Double-extended number X in the ETEMP space in
|		the floating-point save stack.
|
|	Output:	The functions return exp(X) or man(X) in fp0.
|
|	Modified: fp0.
|
|
|		Copyright (C) Motorola, Inc. 1990
|			All Rights Reserved
|
|       For details on the license for this file, please see the
|       file, README, in this same directory.

|SGETEM	idnt	2,1 | Motorola 040 Floating Point Software Package

	|section 8

#include "fpsp.h"

	|xref	nrm_set

|
| This entry point is used by the unimplemented instruction exception
| handler.  It points a0 to the input operand.
|
|
|
|	SGETEXP
|

	.global	sgetexp
sgetexp:
	movew	LOCAL_EX(%a0),%d0	|get the exponent
	bclrl	#15,%d0		|clear the sign bit
	subw	#0x3fff,%d0	|subtract off the bias
	fmovew  %d0,%fp0		|move the exp to fp0
	rts

	.global	sgetexpd
sgetexpd:
	bclrb	#sign_bit,LOCAL_EX(%a0)
	bsr	nrm_set		|normalize (exp will go negative)
	movew	LOCAL_EX(%a0),%d0	|load resulting exponent into d0
	subw	#0x3fff,%d0	|subtract off the bias
	fmovew	%d0,%fp0		|move the exp to fp0
	rts
|
|
| This entry point is used by the unimplemented instruction exception
| handler.  It points a0 to the input operand.
|
|
|
|	SGETMAN

Annotation

Implementation Notes