aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv50/codegen/nv50_ir_peephole.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/nv50/codegen/nv50_ir_peephole.cpp')
-rw-r--r--src/gallium/drivers/nv50/codegen/nv50_ir_peephole.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nv50/codegen/nv50_ir_peephole.cpp
index 85e08579714..29704c47f03 100644
--- a/src/gallium/drivers/nv50/codegen/nv50_ir_peephole.cpp
+++ b/src/gallium/drivers/nv50/codegen/nv50_ir_peephole.cpp
@@ -1042,6 +1042,10 @@ AlgebraicOpt::handleLOGOP(Instruction *logop)
if (set1->op != OP_SET)
return;
}
+ operation redOp = (logop->op == OP_AND ? OP_SET_AND :
+ logop->op == OP_XOR ? OP_SET_XOR : OP_SET_OR);
+ if (!prog->getTarget()->isOpSupported(redOp, set1->sType))
+ return;
if (set0->op != OP_SET &&
set0->op != OP_SET_AND &&
set0->op != OP_SET_OR &&
@@ -1067,14 +1071,7 @@ AlgebraicOpt::handleLOGOP(Instruction *logop)
set0->getDef(0)->reg.file = FILE_PREDICATE;
set0->getDef(0)->reg.size = 1;
set1->setSrc(2, set0->getDef(0));
- switch (logop->op) {
- case OP_AND: set1->op = OP_SET_AND; break;
- case OP_OR: set1->op = OP_SET_OR; break;
- case OP_XOR: set1->op = OP_SET_XOR; break;
- default:
- assert(0);
- break;
- }
+ set1->op = redOp;
set1->setDef(0, logop->getDef(0));
delete_Instruction(prog, logop);
}