From: Ian Romanick Date: Tue, 3 Mar 2020 02:31:01 +0000 (-0800) Subject: soft-fp64/fneg: Don't treat NaN specially X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f6992bf62440e847ca129ea9f79862fa5ff4c35f;p=mesa.git soft-fp64/fneg: Don't treat NaN specially __fabs64 doesn't do anything special, and the value is still NaN regardless of the value of the MSB. In a strict sense, it's possible that both functions should set the "signal" bit. lts 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: 844558 -> 843005 (-0.18%) instructions in affected programs: 725975 -> 724422 (-0.21%) helped: 53 HURT: 4 helped stats (abs) min: 1 max: 313 x̄: 29.87 x̃: 21 helped stats (rel) min: 0.01% max: 0.94% x̄: 0.30% x̃: 0.22% HURT stats (abs) min: 4 max: 11 x̄: 7.50 x̃: 7 HURT stats (rel) min: 0.03% max: 0.09% x̄: 0.05% x̃: 0.04% 95% mean confidence interval for instructions value: -39.02 -15.47 95% mean confidence interval for instructions %-change: -0.34% -0.21% Instructions are helped. total cycles in shared programs: 6962024 -> 6944998 (-0.24%) cycles in affected programs: 6185470 -> 6168444 (-0.28%) helped: 59 HURT: 0 helped stats (abs) min: 64 max: 2863 x̄: 288.58 x̃: 208 helped stats (rel) min: 0.11% max: 0.87% x̄: 0.33% x̃: 0.27% 95% mean confidence interval for cycles value: -387.15 -190.00 95% mean confidence interval for cycles %-change: -0.38% -0.28% Cycles are helped. Reviewed-by: Jason Ekstrand Reviewed-by: Matt Turner Part-of: --- diff --git a/src/compiler/glsl/float64.glsl b/src/compiler/glsl/float64.glsl index 7c6f18d962e..7f6d3a86e34 100644 --- a/src/compiler/glsl/float64.glsl +++ b/src/compiler/glsl/float64.glsl @@ -88,10 +88,7 @@ uint64_t __fneg64(uint64_t __a) { uvec2 a = unpackUint2x32(__a); - uint t = a.y; - - t ^= (1u << 31); - a.y = mix(t, a.y, __is_nan(__a)); + a.y ^= (1u << 31); return packUint2x32(a); }