[Mesa-dev] [PATCH 3/8] nvc0/ir: fix SET and SLCT emission
Ilia Mirkin
imirkin at alum.mit.edu
Sun Feb 5 18:20:33 UTC 2017
We were never emitting a .X flag for consuming condition code on SET,
and weren't emitting a signed type for SLCT comparison. Discovered while
working on int64 logic.
Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp | 4 ++++
src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp | 2 ++
2 files changed, 6 insertions(+)
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp
index 4f2d817..4b1caa4 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp
@@ -1142,6 +1142,8 @@ CodeEmitterGK110::emitSET(const CmpInstruction *i)
} else {
code[1] |= 0x7 << 10;
}
+ if (i->flagsSrc >= 0)
+ code[1] |= 1 << 14;
emitCondCode(i->setCond,
isFloatType(i->sType) ? 0x33 : 0x34,
isFloatType(i->sType) ? 0xf : 0x7);
@@ -1161,6 +1163,8 @@ CodeEmitterGK110::emitSLCT(const CmpInstruction *i)
} else {
emitForm_21(i, 0x1a0, 0xb20);
emitCondCode(cc, 0x34, 0x7);
+ if (i->dType == TYPE_S32)
+ code[1] |= 1 << 19;
}
}
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 b64ac61..1458688 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp
@@ -1194,6 +1194,8 @@ CodeEmitterNVC0::emitSET(const CmpInstruction *i)
if (i->ftz)
code[1] |= 1 << 27;
+ if (i->flagsSrc >= 0)
+ code[0] |= 1 << 6;
emitCondCode(i->setCond, 32 + 23);
emitNegAbs12(i);
--
2.10.2
More information about the mesa-dev
mailing list