summaryrefslogtreecommitdiff
path: root/src/gallium
diff options
context:
space:
mode:
authorTobias Klausmann <tobias.johannes.klausmann@mni.thm.de>2014-06-04 00:35:48 +0200
committerIlia Mirkin <imirkin@alum.mit.edu>2014-06-06 00:00:26 -0400
commit4674343e8f37f336b68bb04212c928f28af66958 (patch)
tree496055de5aeaf2f2fa38c9ace6a2b69980e34e81 /src/gallium
parent3164bfc73418e2e046c7a750eaac8a6d66dfe02d (diff)
nvc0/ir: Handle reverse subop for OP_EXTBF when folding constant expressions
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
index 58092f4658c..5254617d238 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
@@ -528,9 +528,13 @@ ConstantFolding::expr(Instruction *i,
rshift = 32 - width;
lshift = 32 - width - offset;
}
+ if (i->subOp == NV50_IR_SUBOP_EXTBF_REV)
+ res.data.u32 = util_bitreverse(a->data.u32);
+ else
+ res.data.u32 = a->data.u32;
switch (i->dType) {
- case TYPE_S32: res.data.s32 = (a->data.s32 << lshift) >> rshift; break;
- case TYPE_U32: res.data.u32 = (a->data.u32 << lshift) >> rshift; break;
+ case TYPE_S32: res.data.s32 = (res.data.s32 << lshift) >> rshift; break;
+ case TYPE_U32: res.data.u32 = (res.data.u32 << lshift) >> rshift; break;
default:
return;
}