Skip to contentSkip to conversation

nv50/ir: only enable mul saturate on G200+

PATCH In review Ilia Mirkin 3 participants 3 messages May 9, 2015 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nv50/ir: only enable mul saturate on G200+

Commit 44673512a84 enabled support for saturating fmul. However experimentally this does not seem to work on the older chips. Restrict the feature to G200 (NVA0) and later.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90350

---
 src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp +4 -1
index 70180eb..ca545a6 100644
@@ -84,7 +84,7 @@ static const struct opProperties _initProps[] =
    //           neg  abs  not  sat  c[]  s[], a[], imm
    { OP_ADD,    0x3, 0x0, 0x0, 0x8, 0x2, 0x1, 0x1, 0x2 },
    { OP_SUB,    0x3, 0x0, 0x0, 0x8, 0x2, 0x1, 0x1, 0x2 },
-   { OP_MUL,    0x3, 0x0, 0x0, 0x8, 0x2, 0x1, 0x1, 0x2 },
+   { OP_MUL,    0x3, 0x0, 0x0, 0x0, 0x2, 0x1, 0x1, 0x2 },
    { OP_MAX,    0x3, 0x3, 0x0, 0x0, 0x2, 0x1, 0x1, 0x0 },
    { OP_MIN,    0x3, 0x3, 0x0, 0x0, 0x2, 0x1, 0x1, 0x0 },
    { OP_MAD,    0x7, 0x0, 0x0, 0x8, 0x6, 0x1, 0x1, 0x0 }, // special constraint
@@ -188,6 +188,9 @@ void TargetNV50::initOpInfo()
       if (prop->mSat & 8)
          opInfo[prop->op].dstMods = NV50_IR_MOD_SAT;
    }
+
+   if (chipset >= 0xa0)
+      opInfo[OP_MUL].dstMods = NV50_IR_MOD_SAT;
 }
 
 unsigned int
Signature · 6 lines
2.3.6

_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

A message that is not in the archive (sent off-list or not yet received): 1431156678-1981-1-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/[email protected]

Tested-by
#2 lore raw

----- Mail original -----

Quoted 43 lines

Commit 44673512a84 enabled support for saturating fmul. However experimentally this does not seem to work on the older chips. Restrict
the feature to G200 (NVA0) and later.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90350

---
 src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp | 5
 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp index 70180eb..ca545a6 100644

src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp +1 -1
@@ -84,7 +84,7 @@ static const struct opProperties _initProps[] =
    //           neg  abs  not  sat  c[]  s[], a[], imm
    { OP_ADD,    0x3, 0x0, 0x0, 0x8, 0x2, 0x1, 0x1, 0x2 },
    { OP_SUB,    0x3, 0x0, 0x0, 0x8, 0x2, 0x1, 0x1, 0x2 },
-   { OP_MUL,    0x3, 0x0, 0x0, 0x8, 0x2, 0x1, 0x1, 0x2 },
+   { OP_MUL,    0x3, 0x0, 0x0, 0x0, 0x2, 0x1, 0x1, 0x2 },
    { OP_MAX,    0x3, 0x3, 0x0, 0x0, 0x2, 0x1, 0x1, 0x0 },
    { OP_MIN,    0x3, 0x3, 0x0, 0x0, 0x2, 0x1, 0x1, 0x0 },
    { OP_MAD,    0x7, 0x0, 0x0, 0x8, 0x6, 0x1, 0x1, 0x0 }, // special

constraint

src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp +3 -1
@@ -188,6 +188,9 @@ void TargetNV50::initOpInfo()
       if (prop->mSat & 8)
          opInfo[prop->op].dstMods = NV50_IR_MOD_SAT;
    }
+
+   if (chipset >= 0xa0)
+      opInfo[OP_MUL].dstMods = NV50_IR_MOD_SAT;
 }
 
 unsigned int
--

2.3.6

Quoted 5 lines

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

Reviewed-by on v1 1/1
#3 lore raw
In reply to Ilia Mirkin
Quoted 26 lines · Ilia Mirkin

Commit 44673512a84 enabled support for saturating fmul. However experimentally this does not seem to work on the older chips. Restrict the feature to G200 (NVA0) and later.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90350

---
  src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp +1 -1
index 70180eb..ca545a6 100644
@@ -84,7 +84,7 @@ static const struct opProperties _initProps[] =
     //           neg  abs  not  sat  c[]  s[], a[], imm
     { OP_ADD,    0x3, 0x0, 0x0, 0x8, 0x2, 0x1, 0x1, 0x2 },
     { OP_SUB,    0x3, 0x0, 0x0, 0x8, 0x2, 0x1, 0x1, 0x2 },
-   { OP_MUL,    0x3, 0x0, 0x0, 0x8, 0x2, 0x1, 0x1, 0x2 },
+   { OP_MUL,    0x3, 0x0, 0x0, 0x0, 0x2, 0x1, 0x1, 0x2 },
     { OP_MAX,    0x3, 0x3, 0x0, 0x0, 0x2, 0x1, 0x1, 0x0 },
     { OP_MIN,    0x3, 0x3, 0x0, 0x0, 0x2, 0x1, 0x1, 0x0 },
     { OP_MAD,    0x7, 0x0, 0x0, 0x8, 0x6, 0x1, 0x1, 0x0 }, // special constraint

src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp void TargetNV50::initOpInfo() · line 196

Quoted 9 lines
src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp +3 -0
@@ -188,6 +188,9 @@ void TargetNV50::initOpInfo()
        if (prop->mSat & 8)
           opInfo[prop->op].dstMods = NV50_IR_MOD_SAT;
     }
+
+   if (chipset >= 0xa0)
+      opInfo[OP_MUL].dstMods = NV50_IR_MOD_SAT;
  }
 
  unsigned int

_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev