diff options
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/glsl/float64.glsl | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/compiler/glsl/float64.glsl b/src/compiler/glsl/float64.glsl index 3cc8aa7fa4b..46cae0a4cdb 100644 --- a/src/compiler/glsl/float64.glsl +++ b/src/compiler/glsl/float64.glsl @@ -771,14 +771,14 @@ __fadd64(uint64_t a, uint64_t b) bExp = mix(bExp, 1, aExp == 0); aExp = mix(aExp, 1, aExp == 0); bool zexp_normal = false; - bool blta = true; + uint sign_of_difference = 0; if (bFracHi < aFracHi) { __sub64(aFracHi, aFracLo, bFracHi, bFracLo, zFrac0, zFrac1); zexp_normal = true; } else if (aFracHi < bFracHi) { __sub64(bFracHi, bFracLo, aFracHi, aFracLo, zFrac0, zFrac1); - blta = false; + sign_of_difference = 0x80000000; zexp_normal = true; } else if (bFracLo < aFracLo) { @@ -787,11 +787,11 @@ __fadd64(uint64_t a, uint64_t b) } else if (aFracLo < bFracLo) { __sub64(bFracHi, bFracLo, aFracHi, aFracLo, zFrac0, zFrac1); - blta = false; + sign_of_difference = 0x80000000; zexp_normal = true; } - zExp = mix(bExp, aExp, blta); - aSign = mix(aSign ^ 0x80000000u, aSign, blta); + zExp = mix(bExp, aExp, sign_of_difference == 0u); + aSign ^= sign_of_difference; uint64_t retval_0 = __packFloat64(uint(FLOAT_ROUNDING_MODE == FLOAT_ROUND_DOWN) << 31, 0, 0u, 0u); uint64_t retval_1 = __normalizeRoundAndPackFloat64(aSign, zExp - 11, zFrac0, zFrac1); return mix(retval_0, retval_1, zexp_normal); |