Signed-off-by: Tobias Klausmann <[email protected]>
---
V2: Handle the instruction right (shift after reverse)
V3: Reverse once, not independently for every TYPE
src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp | 12 ++++++++++--
1 file changed, 10 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 58092f4..538e745 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
@@ -528,9 +528,17 @@ 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;
}
--
1.8.4.5
_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau