arch/arm/nwfpe/softfloat.c
Source file repositories/reference/linux-study-clean/arch/arm/nwfpe/softfloat.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/nwfpe/softfloat.c- Extension
.c- Size
- 118936 bytes
- Lines
- 3436
- 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
asm/div64.hfpa11.hsoftfloat-macrossoftfloat-specialize
Detected Declarations
function roundAndPackInt32function extractFloat32Fracfunction extractFloat32Expfunction extractFloat32Signfunction normalizeFloat32Subnormalfunction packFloat32function roundAndPackFloat32function normalizeRoundAndPackFloat32function extractFloat64Fracfunction extractFloat64Expfunction extractFloat64Signfunction normalizeFloat64Subnormalfunction packFloat64function roundAndPackFloat64function normalizeRoundAndPackFloat64function extractFloatx80Fracfunction extractFloatx80Expfunction extractFloatx80Signfunction normalizeFloatx80Subnormalfunction packFloatx80function roundAndPackFloatx80function normalizeRoundAndPackFloatx80function int32_to_float32function int32_to_float64function int32_to_floatx80function float32_to_int32function float32_to_int32_round_to_zerofunction float32_to_float64function float32_to_floatx80function float32_round_to_intfunction addFloat32Sigsfunction subFloat32Sigsfunction float32_addfunction float32_subfunction float32_mulfunction float32_divfunction float32_remfunction float32_sqrtfunction float32_eqfunction float32_lefunction float32_ltfunction float32_eq_signalingfunction float32_le_quietfunction float32_lt_quietfunction float64_to_int32function float64_to_int32_round_to_zerofunction float64_to_uint32function float64_to_uint32_round_to_zero
Annotated Snippet
if ( ! roundNearestEven ) {
if ( roundingMode == float_round_to_zero ) {
roundIncrement = 0;
}
else {
roundIncrement = 0x7F;
if ( zSign ) {
if ( roundingMode == float_round_up ) roundIncrement = 0;
}
else {
if ( roundingMode == float_round_down ) roundIncrement = 0;
}
}
}
roundBits = absZ & 0x7F;
absZ = ( absZ + roundIncrement )>>7;
absZ &= ~ ( ( ( roundBits ^ 0x40 ) == 0 ) & roundNearestEven );
z = absZ;
if ( zSign ) z = - z;
if ( ( absZ>>32 ) || ( z && ( ( z < 0 ) ^ zSign ) ) ) {
roundData->exception |= float_flag_invalid;
return zSign ? 0x80000000 : 0x7FFFFFFF;
}
if ( roundBits ) roundData->exception |= float_flag_inexact;
return z;
}
/*
-------------------------------------------------------------------------------
Returns the fraction bits of the single-precision floating-point value `a'.
-------------------------------------------------------------------------------
*/
INLINE bits32 extractFloat32Frac( float32 a )
{
return a & 0x007FFFFF;
}
/*
-------------------------------------------------------------------------------
Returns the exponent bits of the single-precision floating-point value `a'.
-------------------------------------------------------------------------------
*/
INLINE int16 extractFloat32Exp( float32 a )
{
return ( a>>23 ) & 0xFF;
}
/*
-------------------------------------------------------------------------------
Returns the sign bit of the single-precision floating-point value `a'.
-------------------------------------------------------------------------------
*/
#if 0 /* in softfloat.h */
INLINE flag extractFloat32Sign( float32 a )
{
return a>>31;
}
#endif
/*
-------------------------------------------------------------------------------
Normalizes the subnormal single-precision floating-point value represented
by the denormalized significand `aSig'. The normalized exponent and
significand are stored at the locations pointed to by `zExpPtr' and
`zSigPtr', respectively.
-------------------------------------------------------------------------------
*/
static void
normalizeFloat32Subnormal( bits32 aSig, int16 *zExpPtr, bits32 *zSigPtr )
{
int8 shiftCount;
shiftCount = countLeadingZeros32( aSig ) - 8;
*zSigPtr = aSig<<shiftCount;
*zExpPtr = 1 - shiftCount;
}
/*
-------------------------------------------------------------------------------
Packs the sign `zSign', exponent `zExp', and significand `zSig' into a
single-precision floating-point value, returning the result. After being
shifted into the proper positions, the three fields are simply added
Annotation
- Immediate include surface: `asm/div64.h`, `fpa11.h`, `softfloat-macros`, `softfloat-specialize`.
- Detected declarations: `function roundAndPackInt32`, `function extractFloat32Frac`, `function extractFloat32Exp`, `function extractFloat32Sign`, `function normalizeFloat32Subnormal`, `function packFloat32`, `function roundAndPackFloat32`, `function normalizeRoundAndPackFloat32`, `function extractFloat64Frac`, `function extractFloat64Exp`.
- 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.