Mesa (9.2): nvc0/ir: add f32 long immediate cannot saturate

Carl Worth cworth at kemper.freedesktop.org
Fri Sep 27 23:03:18 UTC 2013


Module: Mesa
Branch: 9.2
Commit: 50ffa8bac573691c8a1e018ed2a04e8aa3b2af5f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=50ffa8bac573691c8a1e018ed2a04e8aa3b2af5f

Author: Christoph Bumiller <christoph.bumiller at speed.at>
Date:   Sun Jun 30 15:23:15 2013 +0200

nvc0/ir: add f32 long immediate cannot saturate

Cc: "9.2" <mesa-stable at lists.freedesktop.org>
(cherry picked from commit 53992060564bd66f167342e0864cee9406147b04)

---

 .../drivers/nvc0/codegen/nv50_ir_target_nvc0.cpp   |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/nvc0/codegen/nv50_ir_target_nvc0.cpp b/src/gallium/drivers/nvc0/codegen/nv50_ir_target_nvc0.cpp
index 2dd7fd2..4ee1a67 100644
--- a/src/gallium/drivers/nvc0/codegen/nv50_ir_target_nvc0.cpp
+++ b/src/gallium/drivers/nvc0/codegen/nv50_ir_target_nvc0.cpp
@@ -337,6 +337,11 @@ TargetNVC0::insnCanLoad(const Instruction *i, int s,
          // (except if we implement more constraints)
          if (ld->getSrc(0)->asImm()->reg.data.u32 & 0xfff)
             return false;
+      } else
+      if (i->op == OP_ADD && i->sType == TYPE_F32) {
+         // add f32 LIMM cannot saturate
+         if (i->saturate && (reg.data.u32 & 0xfff))
+            return false;
       }
    }
 
@@ -431,6 +436,13 @@ TargetNVC0::isSatSupported(const Instruction *insn) const
    if (insn->dType == TYPE_U32)
       return (insn->op == OP_ADD) || (insn->op == OP_MAD);
 
+   // add f32 LIMM cannot saturate
+   if (insn->op == OP_ADD && insn->sType == TYPE_F32) {
+      if (insn->getSrc(1)->asImm() &&
+          insn->getSrc(1)->reg.data.u32 & 0xfff)
+         return false;
+   }
+
    return insn->dType == TYPE_F32;
 }
 




More information about the mesa-commit mailing list