Mesa (master): gm107/ir: take relative pfetch offset into account

Ilia Mirkin imirkin at kemper.freedesktop.org
Fri Sep 26 05:15:41 UTC 2014


Module: Mesa
Branch: master
Commit: a5bbfeda977a62aa3349f0c7d04c5c20156c1faf
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a5bbfeda977a62aa3349f0c7d04c5c20156c1faf

Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date:   Fri Sep 26 00:18:38 2014 -0400

gm107/ir: take relative pfetch offset into account

There is no dedicated instruction for this, so just combine it with the
constant offset.

Acked-by: Ben Skeggs <bskeggs at redhat.com>
Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
Cc: "10.3" <mesa-stable at lists.freedesktop.org>

---

 src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_gm107.cpp |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_gm107.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_gm107.cpp
index 113f372..64989ac 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_gm107.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_gm107.cpp
@@ -159,7 +159,10 @@ GM107LoweringPass::handlePFETCH(Instruction *i)
    bld.mkOp2(OP_SHR , TYPE_U32, tmp1, tmp0, bld.mkImm(16));
    bld.mkOp2(OP_AND , TYPE_U32, tmp0, tmp0, bld.mkImm(0xff));
    bld.mkOp2(OP_AND , TYPE_U32, tmp1, tmp1, bld.mkImm(0xff));
-   bld.mkOp1(OP_MOV , TYPE_U32, tmp2, bld.mkImm(i->getSrc(0)->reg.data.u32));
+   if (i->getSrc(1))
+      bld.mkOp2(OP_ADD , TYPE_U32, tmp2, i->getSrc(0), i->getSrc(1));
+   else
+      bld.mkOp1(OP_MOV , TYPE_U32, tmp2, i->getSrc(0));
    bld.mkOp3(OP_MAD , TYPE_U32, tmp0, tmp0, tmp1, tmp2);
    i->setSrc(0, tmp0);
    i->setSrc(1, NULL);




More information about the mesa-commit mailing list