From 25b8f1c15a2b8c7b28f570bfe33239ffd07377c4 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Fri, 13 Nov 2020 15:12:21 +0000 Subject: [PATCH] aco: fix fp16 *0.5 omod We were testing for -0.5 instead. Signed-off-by: Rhys Perry Reviewed-by: Samuel Pitoiset Fixes: 1210e0bd620 ("aco: create 16-bit input and output modifiers") Part-of: --- .pick_status.json | 2 +- src/amd/compiler/aco_optimizer.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 7099de00f18..25d4a9ef33c 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -7537,7 +7537,7 @@ "description": "aco: fix fp16 *0.5 omod", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 3, "master_sha": null, "because_sha": "1210e0bd6205c5f5365a29c91425dea3e49d89a7" }, diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp index 62a1cad97e5..8aef3809cec 100644 --- a/src/amd/compiler/aco_optimizer.cpp +++ b/src/amd/compiler/aco_optimizer.cpp @@ -1232,7 +1232,7 @@ void label_instruction(opt_ctx &ctx, Block& block, aco_ptr& instr) ctx.info[instr->operands[i].tempId()].set_omod2(instr->definitions[0].getTemp()); } else if (instr->operands[!i].constantValue() == (fp16 ? 0x4400 : 0x40800000)) { /* 4.0 */ ctx.info[instr->operands[i].tempId()].set_omod4(instr->definitions[0].getTemp()); - } 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->definitions[0].getTemp()); } 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 */