Mesa (master): nv50/ir: UCMP arguments are float, so make sure modifiers are applied

Ilia Mirkin imirkin at kemper.freedesktop.org
Sat Jul 4 00:25:33 UTC 2015


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

Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date:   Fri Jul  3 19:09:09 2015 -0400

nv50/ir: UCMP arguments are float, so make sure modifiers are applied

The first argument to UCMP needs to be compared against 0, but the
latter arguments are treated as float and need to be able to properly
apply neg/abs arguments. Adjust the inferSrcType function accordingly.

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
Cc: "10.5 10.6" <mesa-stable at lists.freedesktop.org>

---

 src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
index 9839a0e..018a1ec 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
@@ -434,7 +434,6 @@ nv50_ir::DataType Instruction::inferSrcType() const
    case TGSI_OPCODE_USLT:
    case TGSI_OPCODE_USNE:
    case TGSI_OPCODE_USHR:
-   case TGSI_OPCODE_UCMP:
    case TGSI_OPCODE_ATOMUADD:
    case TGSI_OPCODE_ATOMXCHG:
    case TGSI_OPCODE_ATOMCAS:
@@ -2570,6 +2569,8 @@ Converter::handleInstruction(const struct tgsi_full_instruction *insn)
       }
       break;
    case TGSI_OPCODE_UCMP:
+      srcTy = TYPE_U32;
+      /* fallthrough */
    case TGSI_OPCODE_CMP:
       FOR_EACH_DST_ENABLED_CHANNEL(0, c, tgsi) {
          src0 = fetchSrc(0, c);




More information about the mesa-commit mailing list