Revert "Use intermOut.cpp's IsNan and IsInfinity for parse-time constant folding"

This commit is contained in:
Greg Fischer 2021-11-10 14:13:37 -07:00 committed by GitHub
parent 9c5309a22a
commit 22a5e36446
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 62 additions and 31 deletions

View file

@ -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 {