mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-12 09:09:29 +01:00
Custom implementations of isnan/isinf as it's just a mess portability-wise..
This commit is contained in:
1 parent
25711066df
commit
1ef32d13ab
1 file changed
+20
@@ -4,6 +4,8 @@
|
||||
#include <cmath>
|
||||
#include <cstring>
|
||||
|
||||
#include "base/basictypes.h"
|
||||
|
||||
inline float sqr(float f) {return f*f;}
|
||||
inline float sqr_signed(float f) {return f<0 ? -f*f : f*f;}
|
||||
|
||||
@@ -73,6 +75,24 @@ inline float dB2lin(float dB) {
|
||||
return expf(dB * DB_2_LOG);
|
||||
}
|
||||
|
||||
inline bool my_isinf(float f) {
|
||||
union {
|
||||
float f;
|
||||
uint32_t u;
|
||||
} f2u;
|
||||
f2u.f = f;
|
||||
return f2u.u == 0x7f800000 ||
|
||||
f2u.u == 0xff800000;
|
||||
}
|
||||
|
||||
inline bool my_isnan(float f) {
|
||||
union {
|
||||
float f;
|
||||
uint32_t u;
|
||||
} f2u;
|
||||
f2u.f = f;
|
||||
return (f2u.u & 0x7F800000) == 0x7F800000;
|
||||
}
|
||||
|
||||
// FPU control.
|
||||
void EnableFZ();
|
||||
|
||||
Reference in new issue
Block a user