arch/m68k/fpsp040/setox.S

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

File Facts

System
Linux kernel
Corpus path
arch/m68k/fpsp040/setox.S
Extension
.S
Size
28388 bytes
Lines
865
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

|
|	setox.sa 3.1 12/10/90
|
|	The entry point setox computes the exponential of a value.
|	setoxd does the same except the input value is a denormalized
|	number.	setoxm1 computes exp(X)-1, and setoxm1d computes
|	exp(X)-1 for denormalized X.
|
|	INPUT
|	-----
|	Double-extended value in memory location pointed to by address
|	register a0.
|
|	OUTPUT
|	------
|	exp(X) or exp(X)-1 returned in floating-point register fp0.
|
|	ACCURACY and MONOTONICITY
|	-------------------------
|	The returned result is within 0.85 ulps in 64 significant bit, i.e.
|	within 0.5001 ulp to 53 bits if the result is subsequently rounded
|	to double precision. The result is provably monotonic in double
|	precision.
|
|	SPEED
|	-----
|	Two timings are measured, both in the copy-back mode. The
|	first one is measured when the function is invoked the first time
|	(so the instructions and data are not in cache), and the
|	second one is measured when the function is reinvoked at the same
|	input argument.
|
|	The program setox takes approximately 210/190 cycles for input
|	argument X whose magnitude is less than 16380 log2, which
|	is the usual situation.	For the less common arguments,
|	depending on their values, the program may run faster or slower --
|	but no worse than 10% slower even in the extreme cases.
|
|	The program setoxm1 takes approximately ??? / ??? cycles for input
|	argument X, 0.25 <= |X| < 70log2. For |X| < 0.25, it takes
|	approximately ??? / ??? cycles. For the less common arguments,
|	depending on their values, the program may run faster or slower --
|	but no worse than 10% slower even in the extreme cases.
|
|	ALGORITHM and IMPLEMENTATION NOTES
|	----------------------------------
|
|	setoxd
|	------
|	Step 1.	Set ans := 1.0
|
|	Step 2.	Return	ans := ans + sign(X)*2^(-126). Exit.
|	Notes:	This will always generate one exception -- inexact.
|
|
|	setox
|	-----
|
|	Step 1.	Filter out extreme cases of input argument.
|		1.1	If |X| >= 2^(-65), go to Step 1.3.
|		1.2	Go to Step 7.
|		1.3	If |X| < 16380 log(2), go to Step 2.
|		1.4	Go to Step 8.
|	Notes:	The usual case should take the branches 1.1 -> 1.3 -> 2.
|		 To avoid the use of floating-point comparisons, a
|		 compact representation of |X| is used. This format is a
|		 32-bit integer, the upper (more significant) 16 bits are
|		 the sign and biased exponent field of |X|; the lower 16
|		 bits are the 16 most significant fraction (including the
|		 explicit bit) bits of |X|. Consequently, the comparisons

Annotation

Implementation Notes