arch/m68k/fpsp040/slog2.S

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

File Facts

System
Linux kernel
Corpus path
arch/m68k/fpsp040/slog2.S
Extension
.S
Size
5198 bytes
Lines
188
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

|
|	slog2.sa 3.1 12/10/90
|
|       The entry point slog10 computes the base-10
|	logarithm of an input argument X.
|	slog10d does the same except the input value is a
|	denormalized number.
|	sLog2 and sLog2d are the base-2 analogues.
|
|       INPUT:	Double-extended value in memory location pointed to
|		by address register a0.
|
|       OUTPUT: log_10(X) or log_2(X) returned in floating-point
|		register fp0.
|
|       ACCURACY and MONOTONICITY: The returned result is within 1.7
|		ulps in 64 significant bit, i.e. within 0.5003 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.
|
|       ALGORITHM and IMPLEMENTATION NOTES:
|
|       slog10d:
|
|       Step 0.   If X < 0, create a NaN and raise the invalid operation
|                 flag. Otherwise, save FPCR in D1; set FpCR to default.
|       Notes:    Default means round-to-nearest mode, no floating-point
|                 traps, and precision control = double extended.
|
|       Step 1.   Call slognd to obtain Y = log(X), the natural log of X.
|       Notes:    Even if X is denormalized, log(X) is always normalized.
|
|       Step 2.   Compute log_10(X) = log(X) * (1/log(10)).
|            2.1  Restore the user FPCR
|            2.2  Return ans := Y * INV_L10.
|
|
|       slog10:
|
|       Step 0.   If X < 0, create a NaN and raise the invalid operation
|                 flag. Otherwise, save FPCR in D1; set FpCR to default.
|       Notes:    Default means round-to-nearest mode, no floating-point
|                 traps, and precision control = double extended.
|
|       Step 1.   Call sLogN to obtain Y = log(X), the natural log of X.
|
|       Step 2.   Compute log_10(X) = log(X) * (1/log(10)).
|            2.1  Restore the user FPCR
|            2.2  Return ans := Y * INV_L10.
|
|
|       sLog2d:
|
|       Step 0.   If X < 0, create a NaN and raise the invalid operation
|                 flag. Otherwise, save FPCR in D1; set FpCR to default.
|       Notes:    Default means round-to-nearest mode, no floating-point
|                 traps, and precision control = double extended.
|
|       Step 1.   Call slognd to obtain Y = log(X), the natural log of X.
|       Notes:    Even if X is denormalized, log(X) is always normalized.
|
|       Step 2.   Compute log_10(X) = log(X) * (1/log(2)).
|            2.1  Restore the user FPCR

Annotation

Implementation Notes