summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>2016-04-26 18:14:05 +0200
committerEmil Velikov <emil.l.velikov@gmail.com>2016-05-05 11:47:52 +0100
commit98c07b6af1ee666cc1038ad711254a14563931f0 (patch)
tree0dcfcf7f4a654df238809d9568db65f09ac5ae8f
parent4a5f2332b2cda4557b356edea55ad267adf0f1b8 (diff)
gk110/ir: add emission for (a OP b) OP c
This is pretty similar to NVC0 except that offsets have changed. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit c62b1b92f7da2563511581a2a74048334585da27)
-rw-r--r--src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp26
1 files changed, 26 insertions, 0 deletions
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 b776cd36171..449bdf38790 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp
@@ -739,6 +739,32 @@ CodeEmitterGK110::emitNOT(const Instruction *i)
void
CodeEmitterGK110::emitLogicOp(const Instruction *i, uint8_t subOp)
{
+ if (i->def(0).getFile() == FILE_PREDICATE) {
+ code[0] = 0x00000002 | (subOp << 27);
+ code[1] = 0x84800000;
+
+ emitPredicate(i);
+
+ defId(i->def(0), 5);
+ srcId(i->src(0), 14);
+ if (i->src(0).mod == Modifier(NV50_IR_MOD_NOT)) code[0] |= 1 << 17;
+ srcId(i->src(1), 32);
+ if (i->src(1).mod == Modifier(NV50_IR_MOD_NOT)) code[1] |= 1 << 3;
+
+ if (i->defExists(1)) {
+ defId(i->def(1), 2);
+ } else {
+ code[0] |= 7 << 2;
+ }
+ // (a OP b) OP c
+ if (i->predSrc != 2 && i->srcExists(2)) {
+ code[1] |= subOp << 16;
+ srcId(i->src(2), 42);
+ if (i->src(2).mod == Modifier(NV50_IR_MOD_NOT)) code[1] |= 1 << 13;
+ } else {
+ code[1] |= 7 << 10;
+ }
+ } else
if (isLIMM(i->src(1), TYPE_S32)) {
emitForm_L(i, 0x200, 0, i->src(1).mod);
code[1] |= subOp << 24;