aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRhys Perry <[email protected]>2019-12-11 19:41:22 +0000
committerRhys Perry <[email protected]>2020-01-13 13:26:43 +0000
commitf29a5a205c11990111fc4eedee423e2b904537b2 (patch)
treee408e8fbf7c274dcae0eae706664d8f118e88485 /src
parent46fb341b8d719426c843138595949d16bf1b7dc4 (diff)
aco: check usesModifiers() when identifying a neg/abs
This was fine because a literal used to mean that it didn't use modifiers, but now VOP3 can take a literal on GFX10. Signed-off-by: Rhys Perry <[email protected]> Reviewed-By: Timur Kristóf <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3081>
Diffstat (limited to 'src')
-rw-r--r--src/amd/compiler/aco_optimizer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp
index 58c5704edba..eef2532e3cd 100644
--- a/src/amd/compiler/aco_optimizer.cpp
+++ b/src/amd/compiler/aco_optimizer.cpp
@@ -924,13 +924,13 @@ void label_instruction(opt_ctx &ctx, Block& block, aco_ptr<Instruction>& instr)
break;
}
case aco_opcode::v_and_b32: /* abs */
- if (instr->operands[0].constantEquals(0x7FFFFFFF) && instr->operands[1].isTemp())
+ if (!instr->usesModifiers() && instr->operands[0].constantEquals(0x7FFFFFFF) && instr->operands[1].isTemp())
ctx.info[instr->definitions[0].tempId()].set_abs(instr->operands[1].getTemp());
else
ctx.info[instr->definitions[0].tempId()].set_bitwise(instr.get());
break;
case aco_opcode::v_xor_b32: { /* neg */
- if (instr->operands[0].constantEquals(0x80000000u) && instr->operands[1].isTemp()) {
+ if (!instr->usesModifiers() && instr->operands[0].constantEquals(0x80000000u) && instr->operands[1].isTemp()) {
if (ctx.info[instr->operands[1].tempId()].is_neg()) {
ctx.info[instr->definitions[0].tempId()].set_temp(ctx.info[instr->operands[1].tempId()].temp);
} else {