From 9496a67eece5717417b3b44ad1552c57b70b2897 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 4 Mar 2020 12:05:06 -0800 Subject: [PATCH] soft-fp64/fadd: Delete a redundant condition check MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Previous condition checks already guaranteen that expDiff != 0 and !(expDiff > 0), so expDiff < 0 is the only option left. 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: 815491 -> 812590 (-0.36%) instructions in affected programs: 753668 -> 750767 (-0.38%) helped: 74 HURT: 0 helped stats (abs) min: 3 max: 281 x̄: 39.20 x̃: 25 helped stats (rel) min: 0.29% max: 0.73% x̄: 0.42% x̃: 0.40% 95% mean confidence interval for instructions value: -48.50 -29.91 95% mean confidence interval for instructions %-change: -0.45% -0.40% Instructions are helped. total cycles in shared programs: 6813681 -> 6798039 (-0.23%) cycles in affected programs: 6381699 -> 6366057 (-0.25%) helped: 74 HURT: 0 helped stats (abs) min: 24 max: 1488 x̄: 211.38 x̃: 149 helped stats (rel) min: 0.20% max: 0.44% x̄: 0.26% x̃: 0.25% 95% mean confidence interval for cycles value: -261.68 -161.08 95% mean confidence interval for cycles %-change: -0.28% -0.25% Cycles are helped. Reviewed-by: Matt Turner Part-of: --- src/compiler/glsl/float64.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/glsl/float64.glsl b/src/compiler/glsl/float64.glsl index ea33cb1f992..68f79c4c563 100644 --- a/src/compiler/glsl/float64.glsl +++ b/src/compiler/glsl/float64.glsl @@ -708,7 +708,7 @@ __fadd64(uint64_t a, uint64_t b) __shift64ExtraRightJamming( bFracHi, bFracLo, 0u, expDiff, bFracHi, bFracLo, zFrac2); zExp = aExp; - } else if (expDiff < 0) { + } else { if (bExp == 0x7FF) { bool propagate = (bFracHi | bFracLo) != 0u; return mix(__packFloat64(aSign, 0x7ff, 0u, 0u), __propagateFloat64NaN(a, b), propagate); -- 2.30.2