nv50/ir/gk110: use shl/shr instead of lshf/rshf so that c[] is supported
authorIlia Mirkin <imirkin@alum.mit.edu>
Fri, 14 Mar 2014 12:16:00 +0000 (08:16 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Tue, 18 Mar 2014 09:56:55 +0000 (05:56 -0400)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp

index d248a1a8c1b77a3d70444c99f7c9e2fad5c5448e..07d7e1929fe15ae2cfa2dc7617c858980bac68c4 100644 (file)
@@ -695,27 +695,16 @@ CodeEmitterGK110::emitINSBF(const Instruction *i)
 void
 CodeEmitterGK110::emitShift(const Instruction *i)
 {
-   const bool sar = i->op == OP_SHR && isSignedType(i->sType);
-
-   if (sar) {
-      emitForm_21(i, 0x214, 0x014);
-      code[1] |= 1 << 19;
-   } else
    if (i->op == OP_SHR) {
-      // this is actually RSHF
-      emitForm_21(i, 0x27c, 0x87c);
-      code[1] |= GK110_GPR_ZERO << 10;
+      emitForm_21(i, 0x214, 0xc14);
+      if (isSignedType(i->dType))
+         code[1] |= 1 << 19;
    } else {
-      // this is actually LSHF
-      emitForm_21(i, 0x1fc, 0xb7c);
-      code[1] |= GK110_GPR_ZERO << 10;
+      emitForm_21(i, 0x224, 0xc24);
    }
 
-   if (i->subOp == NV50_IR_SUBOP_SHIFT_WRAP) {
-      if (!sar)
-         code[1] |= 1 << 21;
-      // XXX: find wrap modifier for SHR S32
-   }
+   if (i->subOp == NV50_IR_SUBOP_SHIFT_WRAP)
+      code[1] |= 1 << 10;
 }
 
 void