summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2014-03-14 08:16:00 -0400
committerIlia Mirkin <[email protected]>2014-03-18 05:56:55 -0400
commitb56e50b8afbb386bcf30f9a4f07981a123dba1c1 (patch)
tree5eafc72032571d1e3bd2e04cb03481366f78d4fc /src/gallium/drivers/nouveau
parent34bf5e27c6d798bcaa63c7541ecea1d3e99fdd3b (diff)
nv50/ir/gk110: use shl/shr instead of lshf/rshf so that c[] is supported
Signed-off-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau')
-rw-r--r--src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp23
1 files changed, 6 insertions, 17 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 d248a1a8c1b..07d7e1929fe 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp
@@ -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