Mesa (master): aco: fix fp16 *0.5 omod

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Nov 16 13:18:01 UTC 2020


Module: Mesa
Branch: master
Commit: 0c522d3aa7432b72c2ed773218d6f0eb25f58943
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0c522d3aa7432b72c2ed773218d6f0eb25f58943

Author: Rhys Perry <pendingchaos02 at gmail.com>
Date:   Fri Nov 13 15:12:21 2020 +0000

aco: fix fp16 *0.5 omod

We were testing for -0.5 instead.

Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Fixes: 1210e0bd620 ("aco: create 16-bit input and output modifiers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7605>

---

 src/amd/compiler/aco_optimizer.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp
index 62567941541..1d796d4ad03 100644
--- a/src/amd/compiler/aco_optimizer.cpp
+++ b/src/amd/compiler/aco_optimizer.cpp
@@ -1297,7 +1297,7 @@ void label_instruction(opt_ctx &ctx, Block& block, aco_ptr<Instruction>& instr)
                ctx.info[instr->operands[i].tempId()].set_omod2(instr.get());
             } else if (instr->operands[!i].constantValue() == (fp16 ? 0x4400 : 0x40800000)) { /* 4.0 */
                ctx.info[instr->operands[i].tempId()].set_omod4(instr.get());
-            } else if (instr->operands[!i].constantValue() == (fp16 ? 0xb800 : 0x3f000000)) { /* 0.5 */
+            } else if (instr->operands[!i].constantValue() == (fp16 ? 0x3800 : 0x3f000000)) { /* 0.5 */
                ctx.info[instr->operands[i].tempId()].set_omod5(instr.get());
             } else if (instr->operands[!i].constantValue() == (fp16 ? 0x3c00 : 0x3f800000) &&
                        !(fp16 ? block.fp_mode.must_flush_denorms16_64 : block.fp_mode.must_flush_denorms32)) { /* 1.0 */



More information about the mesa-commit mailing list