From fc00c656c96528112d05cf0edf8631bd5eaea446 Mon Sep 17 00:00:00 2001 From: Kacper Date: Sun, 7 Dec 2025 20:10:31 +0100 Subject: Add build system scaffolding and libc headers --- include/arch/x86_64/asm/fpmath.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 include/arch/x86_64/asm/fpmath.h (limited to 'include/arch/x86_64/asm/fpmath.h') diff --git a/include/arch/x86_64/asm/fpmath.h b/include/arch/x86_64/asm/fpmath.h new file mode 100644 index 00000000..43ee6cfb --- /dev/null +++ b/include/arch/x86_64/asm/fpmath.h @@ -0,0 +1,33 @@ +#ifndef __ASM_FPMATH_H +#define __ASM_FPMATH_H + +union l2bits { + long double e; + struct { + unsigned int manl : 32; + unsigned int manh : 32; + unsigned int exp : 15; + unsigned int sign : 1; + unsigned int junkl : 16; + unsigned int junkh : 32; + } bits; + struct { + unsigned long man : 64; + unsigned int expsign : 16; + unsigned long junk : 48; + } xbits; +}; + +#define LDBL_NBIT 0x80000000 +#define mask_nbit_l(u) ((u).bits.manh &= ~LDBL_NBIT) + +#define LDBL_MANH_SIZE 32 +#define LDBL_MANL_SIZE 32 + +#define LDBL_TO_ARRAY32(u, a) \ + do { \ + (a)[0] = (uint32_t)(u).bits.manl; \ + (a)[1] = (uint32_t)(u).bits.manh; \ + } while (0) + +#endif -- cgit v1.2.3