diff options
author | Francisco Jerez <[email protected]> | 2012-04-08 23:14:15 +0200 |
---|---|---|
committer | Christoph Bumiller <[email protected]> | 2012-04-14 21:54:03 +0200 |
commit | 93508b5b0d0a2b1e966973f1d0119b32d2ccf729 (patch) | |
tree | c4744eede50161b404d2c06e61775285db825693 | |
parent | f4dbdcbfcf7370deeb5dcccec2e8d1c471d66517 (diff) |
nv50/ir/opt: Add isOptSupported() check in logical arith optimization.
-rw-r--r-- | src/gallium/drivers/nv50/codegen/nv50_ir_peephole.cpp | 13 |
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); } |