diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2014-04-25 15:48:40 +0200 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2014-05-23 15:11:15 +0200 |
commit | 49548b09e0fa9fddb64e3cd47266193e36b73144 (patch) | |
tree | 3f8016953efebe347fdd0101f67adea87adb45e7 /arch/mips/math-emu/ieee754.h | |
parent | MIPS: math-emu: Rename get_rounding() functions. (diff) | |
download | linux-49548b09e0fa9fddb64e3cd47266193e36b73144.tar.xz linux-49548b09e0fa9fddb64e3cd47266193e36b73144.zip |
MIPS: math-emu: Cleanup definition of structs describe sp/dp floats.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/math-emu/ieee754.h')
-rw-r--r-- | arch/mips/math-emu/ieee754.h | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/arch/mips/math-emu/ieee754.h b/arch/mips/math-emu/ieee754.h index e87a6361149b..4f89f854bb45 100644 --- a/arch/mips/math-emu/ieee754.h +++ b/arch/mips/math-emu/ieee754.h @@ -31,36 +31,23 @@ #include <linux/sched.h> #include <asm/bitfield.h> -struct ieee754dp_const { - __BITFIELD_FIELD(unsigned sign:1, - __BITFIELD_FIELD(unsigned bexp:11, - __BITFIELD_FIELD(unsigned manthi:20, - __BITFIELD_FIELD(unsigned mantlo:32, - ;)))) -}; - union ieee754dp { - struct ieee754dp_const oparts; struct { __BITFIELD_FIELD(unsigned int sign:1, __BITFIELD_FIELD(unsigned int bexp:11, __BITFIELD_FIELD(u64 mant:52, ;))) - } parts; - double d; + }; u64 bits; }; -struct ieee754sp_const { - __BITFIELD_FIELD(unsigned sign:1, - __BITFIELD_FIELD(unsigned bexp:8, - __BITFIELD_FIELD(unsigned mant:23, - ;))) -}; - union ieee754sp { - struct ieee754sp_const parts; - float f; + struct { + __BITFIELD_FIELD(unsigned sign:1, + __BITFIELD_FIELD(unsigned bexp:8, + __BITFIELD_FIELD(unsigned mant:23, + ;))) + }; u32 bits; }; @@ -299,8 +286,8 @@ union ieee754dp ieee754dp_dump(char *s, union ieee754dp x); #define IEEE754_SPCVAL_P1E31 15 /* + 1.0e31 */ #define IEEE754_SPCVAL_P1E63 16 /* + 1.0e63 */ -extern const struct ieee754dp_const __ieee754dp_spcvals[]; -extern const struct ieee754sp_const __ieee754sp_spcvals[]; +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) |