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.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
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
- Atlas domain: Architecture Layer / arch/m68k.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.