mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 23:35:34 +00:00
Bug 654664 - Optimize JSDOUBLE_IS_NEGZERO after bug 640494. r=jimb
This commit is contained in:
parent
ee66f46ef1
commit
3dc191b56d
@ -92,16 +92,25 @@
|
||||
#define JSDOUBLE_SIGNBIT (((uint64) 1) << 63)
|
||||
#define JSDOUBLE_EXPMASK (((uint64) 0x7ff) << 52)
|
||||
#define JSDOUBLE_MANTMASK ((((uint64) 1) << 52) - 1)
|
||||
#define JSDOUBLE_HI32_SIGNBIT 0x80000000
|
||||
|
||||
static JS_ALWAYS_INLINE JSBool
|
||||
JSDOUBLE_IS_NEGZERO(jsdouble d)
|
||||
{
|
||||
if (d != 0)
|
||||
return false;
|
||||
union {
|
||||
struct {
|
||||
#if defined(IS_LITTLE_ENDIAN) && !defined(FPU_IS_ARM_FPA)
|
||||
uint32 lo, hi;
|
||||
#else
|
||||
uint32 hi, lo;
|
||||
#endif
|
||||
} s;
|
||||
jsdouble d;
|
||||
uint64 bits;
|
||||
} x;
|
||||
x.d = d;
|
||||
return x.bits == JSDOUBLE_SIGNBIT;
|
||||
return (x.s.hi & JSDOUBLE_HI32_SIGNBIT) != 0;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
|
Loading…
Reference in New Issue
Block a user