Revert "Use intermOut.cpp's IsNan and IsInfinity for parse-time constant folding"
This commit is contained in:
parent
9c5309a22a
commit
22a5e36446
3 changed files with 62 additions and 31 deletions
|
|
@ -48,6 +48,37 @@
|
|||
#endif
|
||||
#include <cstdint>
|
||||
|
||||
namespace {
|
||||
|
||||
bool IsInfinity(double x) {
|
||||
#ifdef _MSC_VER
|
||||
switch (_fpclass(x)) {
|
||||
case _FPCLASS_NINF:
|
||||
case _FPCLASS_PINF:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
return std::isinf(x);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool IsNan(double x) {
|
||||
#ifdef _MSC_VER
|
||||
switch (_fpclass(x)) {
|
||||
case _FPCLASS_SNAN:
|
||||
case _FPCLASS_QNAN:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
return std::isnan(x);
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace glslang {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue