diff options
-rw-r--r-- | src/compiler/glsl/float64.glsl | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/compiler/glsl/float64.glsl b/src/compiler/glsl/float64.glsl index d41f0740bed..dd1179012ca 100644 --- a/src/compiler/glsl/float64.glsl +++ b/src/compiler/glsl/float64.glsl @@ -500,23 +500,25 @@ __roundAndPackFloat64(uint zSign, } return __packFloat64(zSign, 0x7FF, 0u, 0u); } - if (zExp < 0) { - __shift64ExtraRightJamming( - zFrac0, zFrac1, zFrac2, -zExp, zFrac0, zFrac1, zFrac2); - zExp = 0; - if (roundNearestEven) { - increment = zFrac2 < 0u; + } + + if (zExp < 0) { + __shift64ExtraRightJamming( + zFrac0, zFrac1, zFrac2, -zExp, zFrac0, zFrac1, zFrac2); + zExp = 0; + if (roundNearestEven) { + increment = zFrac2 < 0u; + } else { + if (zSign != 0u) { + increment = (FLOAT_ROUNDING_MODE == FLOAT_ROUND_DOWN) && + (zFrac2 != 0u); } else { - if (zSign != 0u) { - increment = (FLOAT_ROUNDING_MODE == FLOAT_ROUND_DOWN) && - (zFrac2 != 0u); - } else { - increment = (FLOAT_ROUNDING_MODE == FLOAT_ROUND_UP) && - (zFrac2 != 0u); - } + increment = (FLOAT_ROUNDING_MODE == FLOAT_ROUND_UP) && + (zFrac2 != 0u); } } } + if (increment) { __add64(zFrac0, zFrac1, 0u, 1u, zFrac0, zFrac1); zFrac1 &= ~((zFrac2 + uint(zFrac2 == 0u)) & uint(roundNearestEven)); |