arch/arm/vfp/vfpsingle.c
Source file repositories/reference/linux-study-clean/arch/arm/vfp/vfpsingle.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/vfp/vfpsingle.c- Extension
.c- Size
- 29622 bytes
- Lines
- 1247
- Domain
- Architecture Layer
- Bucket
- arch/arm
- 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
linux/kernel.hlinux/bitops.hasm/div64.hasm/vfp.hvfpinstr.hvfp.h
Detected Declarations
function vfp_single_dumpfunction vfp_single_normalise_denormalfunction vfp_propagate_nanfunction vfp_single_fabsfunction vfp_single_fcpyfunction vfp_single_fnegfunction vfp_estimate_sqrt_significandfunction vfp_single_fsqrtfunction vfp_comparefunction vfp_single_fcmpfunction vfp_single_fcmpefunction vfp_single_fcmpzfunction vfp_single_fcmpezfunction vfp_single_fcvtdfunction vfp_single_fuitofunction vfp_single_fsitofunction vfp_single_ftouifunction vfp_single_ftouizfunction vfp_single_ftosifunction vfp_single_ftosizfunction vfp_single_fadd_nonnumberfunction vfp_single_addfunction vfp_single_multiplyfunction vfp_single_multiply_accumulatefunction vfp_single_fmacfunction vfp_single_fnmacfunction vfp_single_fmscfunction vfp_single_fnmscfunction vfp_single_fmulfunction vfp_single_fnmulfunction vfp_single_faddfunction vfp_single_fsubfunction vfp_single_fdivfunction vfp_single_cpdo
Annotated Snippet
if (incr == 0) {
vs->exponent = 253;
vs->significand = 0x7fffffff;
} else {
vs->exponent = 255; /* infinity */
vs->significand = 0;
}
} else {
if (significand >> (VFP_SINGLE_LOW_BITS + 1) == 0)
exponent = 0;
if (exponent || significand > 0x80000000)
underflow = 0;
if (underflow)
exceptions |= FPSCR_UFC;
vs->exponent = exponent;
vs->significand = significand >> 1;
}
pack:
vfp_single_dump("pack: final", vs);
{
s32 d = vfp_single_pack(vs);
#ifdef DEBUG
pr_debug("VFP: %s: d(s%d)=%08x exceptions=%08x\n", func,
sd, d, exceptions);
#endif
vfp_put_float(d, sd);
}
return exceptions;
}
/*
* Propagate the NaN, setting exceptions if it is signalling.
* 'n' is always a NaN. 'm' may be a number, NaN or infinity.
*/
static u32
vfp_propagate_nan(struct vfp_single *vsd, struct vfp_single *vsn,
struct vfp_single *vsm, u32 fpscr)
{
struct vfp_single *nan;
int tn, tm = 0;
tn = vfp_single_type(vsn);
if (vsm)
tm = vfp_single_type(vsm);
if (fpscr & FPSCR_DEFAULT_NAN)
/*
* Default NaN mode - always returns a quiet NaN
*/
nan = &vfp_single_default_qnan;
else {
/*
* Contemporary mode - select the first signalling
* NAN, or if neither are signalling, the first
* quiet NAN.
*/
if (tn == VFP_SNAN || (tm != VFP_SNAN && tn == VFP_QNAN))
nan = vsn;
else
nan = vsm;
/*
* Make the NaN quiet.
*/
nan->significand |= VFP_SINGLE_SIGNIFICAND_QNAN;
}
*vsd = *nan;
/*
* If one was a signalling NAN, raise invalid operation.
*/
return tn == VFP_SNAN || tm == VFP_SNAN ? FPSCR_IOC : VFP_NAN_FLAG;
}
/*
* Extended operations
*/
static u32 vfp_single_fabs(int sd, int unused, s32 m, u32 fpscr)
{
vfp_put_float(vfp_single_packed_abs(m), sd);
return 0;
}
static u32 vfp_single_fcpy(int sd, int unused, s32 m, u32 fpscr)
{
vfp_put_float(m, sd);
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/bitops.h`, `asm/div64.h`, `asm/vfp.h`, `vfpinstr.h`, `vfp.h`.
- Detected declarations: `function vfp_single_dump`, `function vfp_single_normalise_denormal`, `function vfp_propagate_nan`, `function vfp_single_fabs`, `function vfp_single_fcpy`, `function vfp_single_fneg`, `function vfp_estimate_sqrt_significand`, `function vfp_single_fsqrt`, `function vfp_compare`, `function vfp_single_fcmp`.
- Atlas domain: Architecture Layer / arch/arm.
- 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.