Mesa (master): nvc0/ir/emit: fix modifiers of f32 add with long immediate

Christoph Bumiller chrisbmr at kemper.freedesktop.org
Mon Jan 9 23:44:33 UTC 2012


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

Author: Christoph Bumiller <e0425955 at student.tuwien.ac.at>
Date:   Sat Jan  7 00:21:57 2012 +0100

nvc0/ir/emit: fix modifiers of f32 add with long immediate

---

 .../drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp     |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp b/src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp
index ecff421..da2c885 100644
--- a/src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp
+++ b/src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp
@@ -511,20 +511,26 @@ CodeEmitterNVC0::emitFADD(const Instruction *i)
 {
    if (i->encSize == 8) {
       if (isLIMM(i->src[1], TYPE_F32)) {
+         assert(!i->saturate);
          emitForm_A(i, HEX64(28000000, 00000002));
 
-         assert(!i->src[1].mod.neg() && !i->src[1].mod.abs() && !i->saturate);
+         code[0] |= i->src[0].mod.abs() << 7;
+         code[0] |= i->src[0].mod.neg() << 9;
+
+         if (i->src[1].mod.abs())
+            code[1] &= 0xfdffffff;
+         if ((i->op == OP_SUB) != static_cast<bool>(i->src[1].mod.neg()))
+            code[1] ^= 0x02000000;
       } else {
          emitForm_A(i, HEX64(50000000, 00000000));
 
          roundMode_A(i);
          if (i->saturate)
             code[1] |= 1 << 17;
-      }
-      emitNegAbs12(i);
-
-      if (i->op == OP_SUB) code[0] ^= 1 << 8;
 
+         emitNegAbs12(i);
+         if (i->op == OP_SUB) code[0] ^= 1 << 8;
+      }
       if (i->ftz)
          code[0] |= 1 << 5;
    } else {




More information about the mesa-commit mailing list