Mesa (nv50-compiler): nv50: MOV TEMP[0], -CONST[0] must be float32 negation
Christoph Bumiller
chrisbmr at kemper.freedesktop.org
Mon Sep 13 15:26:47 UTC 2010
Module: Mesa
Branch: nv50-compiler
Commit: 3b3c20744f2ea90f6aaae33b337bdc5e135f3198
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=3b3c20744f2ea90f6aaae33b337bdc5e135f3198
Author: Christoph Bumiller <e0425955 at student.tuwien.ac.at>
Date: Sun Sep 12 23:11:30 2010 +0200
nv50: MOV TEMP[0], -CONST[0] must be float32 negation
---
src/gallium/drivers/nv50/nv50_tgsi_to_nc.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/gallium/drivers/nv50/nv50_tgsi_to_nc.c b/src/gallium/drivers/nv50/nv50_tgsi_to_nc.c
index 8ad0b18..54d6fb9 100644
--- a/src/gallium/drivers/nv50/nv50_tgsi_to_nc.c
+++ b/src/gallium/drivers/nv50/nv50_tgsi_to_nc.c
@@ -1075,7 +1075,7 @@ emit_fetch(struct bld_context *bld, const struct tgsi_full_instruction *insn,
const struct tgsi_full_src_register *src = &insn->Src[s];
struct nv_value *res;
struct nv_value *ptr = NULL;
- unsigned idx, swz, dim_idx, ind_idx, ind_swz;
+ unsigned idx, swz, dim_idx, ind_idx, ind_swz, sgn;
ubyte type = infer_src_type(insn->Instruction.Opcode);
idx = src->Register.Index;
@@ -1157,10 +1157,15 @@ emit_fetch(struct bld_context *bld, const struct tgsi_full_instruction *insn,
if (!res)
return bld_undef(bld, NV_FILE_GPR);
+ sgn = tgsi_util_get_full_src_register_sign_mode(src, chan);
+
if (insn->Instruction.Opcode != TGSI_OPCODE_MOV)
res->reg.as_type = type;
+ else
+ if (sgn != TGSI_UTIL_SIGN_KEEP) /* apparently "MOV A, -B" assumes float */
+ res->reg.as_type = NV_TYPE_F32;
- switch (tgsi_util_get_full_src_register_sign_mode(src, chan)) {
+ switch (sgn) {
case TGSI_UTIL_SIGN_KEEP:
break;
case TGSI_UTIL_SIGN_CLEAR:
More information about the mesa-commit
mailing list