[Mesa-dev] [PATCH 5/5] nv50/ir: detect when a SLCT is equivalent to a SET
Karol Herbst
karolherbst at gmail.com
Fri Oct 21 06:39:09 UTC 2016
On 21 October 2016 8:30:33 a.m. GMT+02:00, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
>Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
>---
>.../drivers/nouveau/codegen/nv50_ir_peephole.cpp | 23
>++++++++++++++++++----
> 1 file changed, 19 insertions(+), 4 deletions(-)
>
>diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
>b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
>index f6fce44..c555430 100644
>--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
>+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
>@@ -637,10 +637,25 @@ ConstantFolding::expr(Instruction *i,
> }
> break;
> case OP_SLCT:
>- if (a->data.u32 != b->data.u32)
>- return;
>- res.data.u32 = a->data.u32;
>- break;
>+ if (a->data.u32 == b->data.u32) {
>+ res.data.u32 = a->data.u32;
>+ break;
>+ }
>+ if ((a->data.u32 == 0 && b->data.u32 == 0xffffffff) ||
>+ (b->data.u32 == 0 && a->data.u32 == 0xffffffff)) {
>+ bld.setPosition(i, false);
why do you need the bld.setPosition here?
>+ CmpInstruction *ci = i->asCmp();
>+ i->op = OP_SET;
>+ i->dType = TYPE_U32;
>+ if (a->data.u32 == 0) {
>+ ci->setCond = inverseCondCode(ci->setCond);
>+ i->setSrc(1, i->getSrc(0));
>+ }
>+ i->setSrc(0, i->getSrc(2));
>+ i->moveSources(3, -1);
>+ ++foldCount;
>+ }
>+ return;
> case OP_EXTBF: {
> int offset = b->data.u32 & 0xff;
> int width = (b->data.u32 >> 8) & 0xff;
>--
>2.7.3
>
>_______________________________________________
>mesa-dev mailing list
>mesa-dev at lists.freedesktop.org
>https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list