Module: Mesa
Branch: 11.0
Commit: 4d688ec9ad803e227a51908513bb53cfa689b8f7
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=4d688ec9ad803e227a51908513bb53cfa689b8f7

Author: Ilia Mirkin <[email protected]>
Date:   Tue Dec 29 15:05:34 2015 -0500

nv50/ir: float(s32 & 0xff) = float(u8), not s8

Make sure to make conversion unsigned when we're ANDing the high bits
away. Fixes corruption in dolphin.

Signed-off-by: Ilia Mirkin <[email protected]>
Cc: "11.0 11.1" <[email protected]>
(cherry picked from commit 724134f68322087ef88bc590febd0011167ae367)

---

 src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp 
b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
index 13f36d0..7e52409 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
@@ -1664,6 +1664,9 @@ AlgebraicOpt::handleCVT_EXTBF(Instruction *cvt)
          arg = shift->getSrc(0);
          offset = imm.reg.data.u32;
       }
+      // We just AND'd the high bits away, which means this is effectively an
+      // unsigned value.
+      cvt->sType = TYPE_U32;
    } else if (insn->op == OP_SHR &&
               insn->sType == cvt->sType &&
               insn->src(1).getImmediate(imm)) {

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to