arch/m68k/fpsp040/scale.S
Source file repositories/reference/linux-study-clean/arch/m68k/fpsp040/scale.S
File Facts
- System
- Linux kernel
- Corpus path
arch/m68k/fpsp040/scale.S- Extension
.S- Size
- 8926 bytes
- Lines
- 371
- 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
fpsp.h
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
|
| scale.sa 3.3 7/30/91
|
| The entry point sSCALE computes the destination operand
| scaled by the source operand. If the absolute value of
| the source operand is (>= 2^14) an overflow or underflow
| is returned.
|
| The entry point sscale is called from do_func to emulate
| the fscale unimplemented instruction.
|
| Input: Double-extended destination operand in FPTEMP,
| double-extended source operand in ETEMP.
|
| Output: The function returns scale(X,Y) to fp0.
|
| Modifies: fp0.
|
| Algorithm:
|
| 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.
|SCALE idnt 2,1 | Motorola 040 Floating Point Software Package
|section 8
#include "fpsp.h"
|xref t_ovfl2
|xref t_unfl
|xref round
|xref t_resdnrm
SRC_BNDS: .short 0x3fff,0x400c
|
| This entry point is used by the unimplemented instruction exception
| handler.
|
|
|
| FSCALE
|
.global sscale
sscale:
fmovel #0,%fpcr |clr user enabled exc
clrl %d1
movew FPTEMP(%a6),%d1 |get dest exponent
smi L_SCR1(%a6) |use L_SCR1 to hold sign
andil #0x7fff,%d1 |strip sign
movew ETEMP(%a6),%d0 |check src bounds
andiw #0x7fff,%d0 |clr sign bit
cmp2w SRC_BNDS,%d0
bccs src_in
cmpiw #0x400c,%d0 |test for too large
bge src_out
|
| The source input is below 1, so we check for denormalized numbers
| and set unfl.
|
src_small:
moveb DTAG(%a6),%d0
andib #0xe0,%d0
tstb %d0
beqs no_denorm
st STORE_FLG(%a6) |dest already contains result
Annotation
- Immediate include surface: `fpsp.h`.
- 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.