From: Ilia Mirkin Date: Tue, 29 Dec 2015 20:05:34 +0000 (-0500) Subject: nv50/ir: float(s32 & 0xff) = float(u8), not s8 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=724134f68322087ef88bc590febd0011167ae367;p=mesa.git 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 Cc: "11.0 11.1" --- diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp index 022626ccb8f..c2842c2186f 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp @@ -1889,6 +1889,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)) {