summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2020-03-04 12:13:32 -0800
committerMarge Bot <[email protected]>2020-03-18 20:36:29 +0000
commit3c9ff97215b0c13c82f460dcc59cb61f6b02d78c (patch)
treec4756fe31b70f4e56bb7547eb413ae6d7e77ced8
parent480565812c1472faf440b3a27864c8c34610a0f5 (diff)
soft-fp64/fadd: Combine an if-statement into the preceeding else-clause
The main purpose of this commit is to prepare for "soft-fp64/fadd: Move common code out of both branches of an if-statement". 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: 812590 -> 812094 (-0.06%) instructions in affected programs: 672135 -> 671639 (-0.07%) helped: 57 HURT: 0 helped stats (abs) min: 1 max: 32 x̄: 8.70 x̃: 7 helped stats (rel) min: <.01% max: 0.49% x̄: 0.12% x̃: 0.09% 95% mean confidence interval for instructions value: -10.46 -6.94 95% mean confidence interval for instructions %-change: -0.15% -0.09% Instructions are helped. total cycles in shared programs: 6798039 -> 6797157 (-0.01%) cycles in affected programs: 5810059 -> 5809177 (-0.02%) helped: 54 HURT: 2 helped stats (abs) min: 2 max: 68 x̄: 16.44 x̃: 12 helped stats (rel) min: <.01% max: 0.12% x̄: 0.03% x̃: 0.02% HURT stats (abs) min: 2 max: 4 x̄: 3.00 x̃: 3 HURT stats (rel) min: <.01% max: <.01% x̄: <.01% x̃: <.01% 95% mean confidence interval for cycles value: -19.50 -12.00 95% mean confidence interval for cycles %-change: -0.03% -0.02% Cycles are helped. Reviewed-by: Matt Turner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4142>
-rw-r--r--src/compiler/glsl/float64.glsl6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/compiler/glsl/float64.glsl b/src/compiler/glsl/float64.glsl
index b24a7812b92..40cc84439fb 100644
--- a/src/compiler/glsl/float64.glsl
+++ b/src/compiler/glsl/float64.glsl
@@ -682,9 +682,8 @@ __fadd64(uint64_t a, uint64_t b)
uint zFrac1;
uint zFrac2;
int zExp;
- bool orig_exp_diff_is_zero = (expDiff == 0);
- if (orig_exp_diff_is_zero) {
+ if (expDiff == 0) {
if (aExp == 0x7FF) {
bool propagate = ((aFracHi | bFracHi) | (aFracLo| bFracLo)) != 0u;
return mix(a, __propagateFloat64NaN(a, b), propagate);
@@ -720,8 +719,7 @@ __fadd64(uint64_t a, uint64_t b)
aFracHi, aFracLo, 0u, - expDiff, aFracHi, aFracLo, zFrac2);
zExp = bExp;
}
- }
- if (!orig_exp_diff_is_zero) {
+
aFracHi |= 0x00100000u;
__add64(aFracHi, aFracLo, bFracHi, bFracLo, zFrac0, zFrac1);
--zExp;