summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2020-03-04 16:53:36 -0800
committerMarge Bot <[email protected]>2020-03-18 20:36:29 +0000
commitd1e0227ef14291242886be48424f723bf60bc439 (patch)
tree903677852abcad3332daee663d64e9a79cdab82b /src/compiler
parent4e3d69ad07d9c439fc99b7c1b1e999ce556d260f (diff)
soft-fp64/b2f: Reimplement using bitwise logic ops
This doesn't help a lot of shaders, but it helps those few a LOT. This could also be implemented using bcsel. That version is very slightly worse because the generated SEL instruction wants to have two immediate sources, so one of them usually needs an extra MOV instruction to load. 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: 929619 -> 928859 (-0.08%) instructions in affected programs: 1651 -> 891 (-46.03%) helped: 8 HURT: 0 helped stats (abs) min: 38 max: 152 x̄: 95.00 x̃: 95 helped stats (rel) min: 42.70% max: 86.36% x̄: 49.88% x̃: 44.66% 95% mean confidence interval for instructions value: -132.97 -57.03 95% mean confidence interval for instructions %-change: -62.28% -37.49% Instructions are helped. total cycles in shared programs: 7280180 -> 7272912 (-0.10%) cycles in affected programs: 12960 -> 5692 (-56.08%) helped: 8 HURT: 0 helped stats (abs) min: 352 max: 1456 x̄: 908.50 x̃: 910 helped stats (rel) min: 52.45% max: 91.19% x̄: 59.24% x̃: 55.15% 95% mean confidence interval for cycles value: -1274.03 -542.97 95% mean confidence interval for cycles %-change: -70.06% -48.41% Cycles are helped. 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.glsl2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/glsl/float64.glsl b/src/compiler/glsl/float64.glsl
index 5f201c8f725..7d58da3d18c 100644
--- a/src/compiler/glsl/float64.glsl
+++ b/src/compiler/glsl/float64.glsl
@@ -1192,7 +1192,7 @@ __fp64_to_bool(uint64_t a)
uint64_t
__bool_to_fp64(bool a)
{
- return __int_to_fp64(int(a));
+ return packUint2x32(uvec2(0x00000000u, uint(-int(a) & 0x3ff00000)));
}
/* Packs the sign `zSign', exponent `zExp', and significand `zFrac' into a