arch/m68k/math-emu/multi_arith.h
Source file repositories/reference/linux-study-clean/arch/m68k/math-emu/multi_arith.h
File Facts
- System
- Linux kernel
- Corpus path
arch/m68k/math-emu/multi_arith.h- Extension
.h- Size
- 8911 bytes
- Lines
- 291
- Domain
- Architecture Layer
- Bucket
- arch/m68k
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
fp_emu.h
Detected Declarations
function fp_denormalizefunction fp_overnormalizefunction fp_addmantfunction fp_addcarryfunction fp_submantfunction fp_multiplymantfunction fp_dividemantfunction fp_putmant128
Annotated Snippet
if (src->mant.m32[0] == div->mant.m32[0]) {
fp_div64(first, rem, 0, src->mant.m32[1], div->mant.m32[0]);
fp_mul64(*mantp, dummy, first, fix);
*mantp += fix;
} else {
fp_div64(first, rem, src->mant.m32[0], src->mant.m32[1], div->mant.m32[0]);
fp_mul64(*mantp, dummy, first, fix);
}
fp_mul64(tmp.m32[0], tmp.m32[1], div->mant.m32[0], first - *mantp);
fp_add64(tmp.m32[0], tmp.m32[1], 0, rem);
tmp.m32[2] = 0;
fp_mul64(tmp64.m32[0], tmp64.m32[1], *mantp, div->mant.m32[1]);
fp_sub96c(tmp, 0, tmp64.m32[0], tmp64.m32[1]);
src->mant.m32[0] = tmp.m32[1];
src->mant.m32[1] = tmp.m32[2];
while (!fp_sub96c(tmp, 0, div->mant.m32[0], div->mant.m32[1])) {
src->mant.m32[0] = tmp.m32[1];
src->mant.m32[1] = tmp.m32[2];
*mantp += 1;
}
}
}
static inline void fp_putmant128(struct fp_ext *dest, union fp_mant128 *src,
int shift)
{
unsigned long tmp;
switch (shift) {
case 0:
dest->mant.m64 = src->m64[0];
dest->lowmant = src->m32[2] >> 24;
if (src->m32[3] || (src->m32[2] << 8))
dest->lowmant |= 1;
break;
case 1:
asm volatile ("lsl.l #1,%0"
: "=d" (tmp) : "0" (src->m32[2]));
asm volatile ("roxl.l #1,%0"
: "=d" (dest->mant.m32[1]) : "0" (src->m32[1]));
asm volatile ("roxl.l #1,%0"
: "=d" (dest->mant.m32[0]) : "0" (src->m32[0]));
dest->lowmant = tmp >> 24;
if (src->m32[3] || (tmp << 8))
dest->lowmant |= 1;
break;
case 31:
asm volatile ("lsr.l #1,%1; roxr.l #1,%0"
: "=d" (dest->mant.m32[0])
: "d" (src->m32[0]), "0" (src->m32[1]));
asm volatile ("roxr.l #1,%0"
: "=d" (dest->mant.m32[1]) : "0" (src->m32[2]));
asm volatile ("roxr.l #1,%0"
: "=d" (tmp) : "0" (src->m32[3]));
dest->lowmant = tmp >> 24;
if (src->m32[3] << 7)
dest->lowmant |= 1;
break;
case 32:
dest->mant.m32[0] = src->m32[1];
dest->mant.m32[1] = src->m32[2];
dest->lowmant = src->m32[3] >> 24;
if (src->m32[3] << 8)
dest->lowmant |= 1;
break;
}
}
#endif /* _MULTI_ARITH_H */
Annotation
- Immediate include surface: `fp_emu.h`.
- Detected declarations: `function fp_denormalize`, `function fp_overnormalize`, `function fp_addmant`, `function fp_addcarry`, `function fp_submant`, `function fp_multiplymant`, `function fp_dividemant`, `function fp_putmant128`.
- Atlas domain: Architecture Layer / arch/m68k.
- Implementation status: source implementation candidate.
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.