arch/mips/math-emu/ieee754.h
Source file repositories/reference/linux-study-clean/arch/mips/math-emu/ieee754.h
File Facts
- System
- Linux kernel
- Corpus path
arch/mips/math-emu/ieee754.h- Extension
.h- Size
- 9992 bytes
- Lines
- 312
- Domain
- Architecture Layer
- Bucket
- arch/mips
- 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/compiler.hasm/byteorder.hlinux/kernel.hlinux/types.hlinux/sched.hasm/bitfield.h
Detected Declarations
struct _ieee754_csrfunction ieee754_getrmfunction ieee754_setrmfunction ieee754_getcxfunction ieee754_cxtestfunction ieee754_getsxfunction ieee754_clrsxfunction ieee754_sxtestfunction ieee754si_indeffunction ieee754di_indeffunction ieee754si_overflowfunction ieee754di_overflow
Annotated Snippet
struct _ieee754_csr {
__BITFIELD_FIELD(unsigned fcc:7, /* condition[7:1] */
__BITFIELD_FIELD(unsigned nod:1, /* set 1 for no denormals */
__BITFIELD_FIELD(unsigned c:1, /* condition[0] */
__BITFIELD_FIELD(unsigned pad0:3,
__BITFIELD_FIELD(unsigned abs2008:1, /* IEEE 754-2008 ABS/NEG.fmt */
__BITFIELD_FIELD(unsigned nan2008:1, /* IEEE 754-2008 NaN mode */
__BITFIELD_FIELD(unsigned cx:6, /* exceptions this operation */
__BITFIELD_FIELD(unsigned mx:5, /* exception enable mask */
__BITFIELD_FIELD(unsigned sx:5, /* exceptions total */
__BITFIELD_FIELD(unsigned rm:2, /* current rounding mode */
;))))))))))
};
#define ieee754_csr (*(struct _ieee754_csr *)(¤t->thread.fpu.fcr31))
static inline unsigned int ieee754_getrm(void)
{
return (ieee754_csr.rm);
}
static inline unsigned int ieee754_setrm(unsigned int rm)
{
return (ieee754_csr.rm = rm);
}
/*
* get current exceptions
*/
static inline unsigned int ieee754_getcx(void)
{
return (ieee754_csr.cx);
}
/* test for current exception condition
*/
static inline int ieee754_cxtest(unsigned int n)
{
return (ieee754_csr.cx & n);
}
/*
* get sticky exceptions
*/
static inline unsigned int ieee754_getsx(void)
{
return (ieee754_csr.sx);
}
/* clear sticky conditions
*/
static inline unsigned int ieee754_clrsx(void)
{
return (ieee754_csr.sx = 0);
}
/* test for sticky exception condition
*/
static inline int ieee754_sxtest(unsigned int n)
{
return (ieee754_csr.sx & n);
}
/* debugging */
union ieee754sp ieee754sp_dump(char *s, union ieee754sp x);
union ieee754dp ieee754dp_dump(char *s, union ieee754dp x);
#define IEEE754_SPCVAL_PZERO 0 /* +0.0 */
#define IEEE754_SPCVAL_NZERO 1 /* -0.0 */
#define IEEE754_SPCVAL_PONE 2 /* +1.0 */
#define IEEE754_SPCVAL_NONE 3 /* -1.0 */
#define IEEE754_SPCVAL_PTEN 4 /* +10.0 */
#define IEEE754_SPCVAL_NTEN 5 /* -10.0 */
#define IEEE754_SPCVAL_PINFINITY 6 /* +inf */
#define IEEE754_SPCVAL_NINFINITY 7 /* -inf */
#define IEEE754_SPCVAL_INDEF_LEG 8 /* legacy quiet NaN */
#define IEEE754_SPCVAL_INDEF_2008 9 /* IEEE 754-2008 quiet NaN */
#define IEEE754_SPCVAL_PMAX 10 /* +max norm */
#define IEEE754_SPCVAL_NMAX 11 /* -max norm */
#define IEEE754_SPCVAL_PMIN 12 /* +min norm */
#define IEEE754_SPCVAL_NMIN 13 /* -min norm */
#define IEEE754_SPCVAL_PMIND 14 /* +min denorm */
#define IEEE754_SPCVAL_NMIND 15 /* -min denorm */
#define IEEE754_SPCVAL_P1E31 16 /* + 1.0e31 */
#define IEEE754_SPCVAL_P1E63 17 /* + 1.0e63 */
extern const union ieee754dp __ieee754dp_spcvals[];
extern const union ieee754sp __ieee754sp_spcvals[];
#define ieee754dp_spcvals ((const union ieee754dp *)__ieee754dp_spcvals)
#define ieee754sp_spcvals ((const union ieee754sp *)__ieee754sp_spcvals)
Annotation
- Immediate include surface: `linux/compiler.h`, `asm/byteorder.h`, `linux/kernel.h`, `linux/types.h`, `linux/sched.h`, `asm/bitfield.h`.
- Detected declarations: `struct _ieee754_csr`, `function ieee754_getrm`, `function ieee754_setrm`, `function ieee754_getcx`, `function ieee754_cxtest`, `function ieee754_getsx`, `function ieee754_clrsx`, `function ieee754_sxtest`, `function ieee754si_indef`, `function ieee754di_indef`.
- Atlas domain: Architecture Layer / arch/mips.
- 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.