diff options
author | Ian Romanick <[email protected]> | 2020-03-02 18:42:04 -0800 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-03-18 20:36:29 +0000 |
commit | b6f58b4709c240c7dd17c59674e0f63d70af70e5 (patch) | |
tree | 9a77b160929b719382e2baf02a05d2851da7f76c /src/compiler | |
parent | 7673dcbd21150e67c5a36bdcc3eee419c025604b (diff) |
soft-fp64/fsat: Micro-optimize x < 0 test
Results on the 308 shaders extracted from the fp64 portion of the OpenGL
CTS:
Tiger Lake and Ice Lake had similar results. (Tiger Lake shown)
total instructions in shared programs: 841647 -> 841590 (<.01%)
instructions in affected programs: 122014 -> 121957 (-0.05%)
helped: 7
HURT: 0
helped stats (abs) min: 3 max: 12 x̄: 8.14 x̃: 9
helped stats (rel) min: 0.04% max: 0.07% x̄: 0.05% x̃: 0.04%
95% mean confidence interval for instructions value: -11.23 -5.06
95% mean confidence interval for instructions %-change: -0.06% -0.03%
Instructions are helped.
total cycles in shared programs: 6926904 -> 6926828 (<.01%)
cycles in affected programs: 1038645 -> 1038569 (<.01%)
helped: 7
HURT: 0
helped stats (abs) min: 4 max: 16 x̄: 10.86 x̃: 12
helped stats (rel) min: <.01% max: 0.01% x̄: <.01% x̃: <.01%
95% mean confidence interval for cycles value: -14.97 -6.74
95% mean confidence interval for cycles %-change: -0.01% <.01%
Cycles are helped.
Reviewed-by: Jason Ekstrand <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4142>
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/glsl/float64.glsl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler/glsl/float64.glsl b/src/compiler/glsl/float64.glsl index 363248c9f59..e7a7e7860fc 100644 --- a/src/compiler/glsl/float64.glsl +++ b/src/compiler/glsl/float64.glsl @@ -258,8 +258,10 @@ __fge64(uint64_t a, uint64_t b) uint64_t __fsat64(uint64_t __a) { + uvec2 a = unpackUint2x32(__a); + /* fsat(NaN) should be zero. */ - if (__is_nan(__a) || __flt64_nonnan(__a, 0ul)) + if (__is_nan(__a) || int(a.y) < 0) return 0ul; if (!__flt64_nonnan(__a, 0x3FF0000000000000ul /* 1.0 */)) |