-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make inline __isnan, __isinf_ns, __finite generic.
For code generation to stay identical on x86_64, this requires that we define the fp word manipulation macros before including the generic header.
- Loading branch information
Richard Henderson
committed
Mar 19, 2012
1 parent
e79d442
commit 4851a94
Showing
5 changed files
with
111 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#ifndef _MATH_PRIVATE_H_ | ||
|
||
#include_next <math_private.h> | ||
|
||
#ifndef __isnan | ||
extern __always_inline int | ||
__isnan (double d) | ||
{ | ||
uint64_t di; | ||
EXTRACT_WORDS64 (di, d); | ||
return (di & 0x7fffffffffffffffull) > 0x7ff0000000000000ull; | ||
} | ||
#endif | ||
|
||
#ifndef __isinf_ns | ||
extern __always_inline int | ||
__isinf_ns (double d) | ||
{ | ||
uint64_t di; | ||
EXTRACT_WORDS64 (di, d); | ||
return (di & 0x7fffffffffffffffull) == 0x7ff0000000000000ull; | ||
} | ||
#endif | ||
|
||
#ifndef __finite | ||
extern __always_inline int | ||
__finite (double d) | ||
{ | ||
uint64_t di; | ||
EXTRACT_WORDS64 (di, d); | ||
return (di & 0x7fffffffffffffffull) < 0x7ff0000000000000ull; | ||
} | ||
#endif | ||
|
||
#endif /* _MATH_PRIVATE_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#ifndef _MATH_PRIVATE_H_ | ||
|
||
#include_next <math_private.h> | ||
|
||
#ifndef __isnanf | ||
extern __always_inline int | ||
__isnanf (float d) | ||
{ | ||
u_int32_t di; | ||
GET_FLOAT_WORD (di, d); | ||
return (di & 0x7fffffff) > 0x7f800000; | ||
} | ||
#endif | ||
|
||
#ifndef __isinf_nsf | ||
extern __always_inline int | ||
__isinf_nsf (float d) | ||
{ | ||
u_int32_t di; | ||
GET_FLOAT_WORD (di, d); | ||
return (di & 0x7fffffff) == 0x7f800000; | ||
} | ||
#endif | ||
|
||
#ifndef __finitef | ||
extern __always_inline int | ||
__finitef (float d) | ||
{ | ||
u_int32_t di; | ||
GET_FLOAT_WORD (di, d); | ||
return (di & 0x7fffffff) < 0x7f800000; | ||
} | ||
#endif | ||
|
||
#endif /* _MATH_PRIVATE_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters