Fixed clang 13+ optimizer issue. Related to PR #278.

This commit is contained in:
Бранимир Караџић
2022-08-11 07:18:17 -07:00
parent ba7024418d
commit 480bbc7eba

View File

@@ -96,12 +96,18 @@ namespace bx
return tmp == UINT64_C(0x7ff0000000000000);
}
inline float forceEval(float _a)
{
volatile float result = _a;
return result;
}
inline BX_CONSTEXPR_FUNC float floor(float _a)
{
if (_a < 0.0f)
{
const float fr = fract(-_a);
const float result = -_a - fr;
const float result = forceEval(-_a - fr);
return -(0.0f != fr
? result + 1.0f