summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2016-07-23 03:08:34 +0200
committerSamuel Pitoiset <[email protected]>2016-07-24 00:42:47 +0200
commit3a2e67bf781d88253d81b20de72ce22acf75916d (patch)
treead0fdbff798f596c0e732e04e8fa6210d2184757
parenta159a3d5cb0afc7f8a160c62fa82cd906a309930 (diff)
nvc0/ir: fix up an assertion in emitUADD()
It's illegal to have neg modifiers on both sources for OP_ADD, and it's illegal to have OP_SUB with just src0 neg. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
-rw-r--r--src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp
index 1c3e5198c96..8c9b867e8ba 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp
@@ -698,16 +698,15 @@ CodeEmitterNVC0::emitUADD(const Instruction *i)
uint32_t addOp = 0;
assert(!i->src(0).mod.abs() && !i->src(1).mod.abs());
- assert(!i->src(0).mod.neg() || !i->src(1).mod.neg());
if (i->src(0).mod.neg())
addOp |= 0x200;
if (i->src(1).mod.neg())
addOp |= 0x100;
- if (i->op == OP_SUB) {
+ if (i->op == OP_SUB)
addOp ^= 0x100;
- assert(addOp != 0x300); // would be add-plus-one
- }
+
+ assert(addOp != 0x300); // would be add-plus-one
if (i->encSize == 8) {
if (isLIMM(i->src(1), TYPE_U32)) {