nvc0: maxwell isa has no per-instruction join modifier
authorBen Skeggs <bskeggs@redhat.com>
Fri, 9 May 2014 05:56:03 +0000 (15:56 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Wed, 14 May 2014 23:54:46 +0000 (09:54 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_target.h
src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp

index cdae3c8c2badde644891c95855d19327304be9dc..3005922d4f935044e2ce1d7350760c619d3e5d95 100644 (file)
@@ -2067,22 +2067,24 @@ FlatteningPass::visit(BasicBlock *bb)
       return true;
 
    // try to attach join to previous instruction
-   Instruction *insn = bb->getExit();
-   if (insn && insn->op == OP_JOIN && !insn->getPredicate()) {
-      insn = insn->prev;
-      if (insn && !insn->getPredicate() &&
-          !insn->asFlow() &&
-          insn->op != OP_TEXBAR &&
-          !isTextureOp(insn->op) && // probably just nve4
-          !isSurfaceOp(insn->op) && // not confirmed
-          insn->op != OP_LINTERP && // probably just nve4
-          insn->op != OP_PINTERP && // probably just nve4
-          ((insn->op != OP_LOAD && insn->op != OP_STORE) ||
-           typeSizeof(insn->dType) <= 4) &&
-          !insn->isNop()) {
-         insn->join = 1;
-         bb->remove(bb->getExit());
-         return true;
+   if (prog->getTarget()->hasJoin) {
+      Instruction *insn = bb->getExit();
+      if (insn && insn->op == OP_JOIN && !insn->getPredicate()) {
+         insn = insn->prev;
+         if (insn && !insn->getPredicate() &&
+             !insn->asFlow() &&
+             insn->op != OP_TEXBAR &&
+             !isTextureOp(insn->op) && // probably just nve4
+             !isSurfaceOp(insn->op) && // not confirmed
+             insn->op != OP_LINTERP && // probably just nve4
+             insn->op != OP_PINTERP && // probably just nve4
+             ((insn->op != OP_LOAD && insn->op != OP_STORE) ||
+              typeSizeof(insn->dType) <= 4) &&
+             !insn->isNop()) {
+            insn->join = 1;
+            bb->remove(bb->getExit());
+            return true;
+         }
       }
    }
 
index 9eb0a1fe0fb8ae89da358a81053811828588501b..711056e59618c048b338642c3527f45e1657bf0f 100644 (file)
@@ -120,7 +120,7 @@ enum OpClass
 class Target
 {
 public:
-   Target(bool j, bool s) : joinAnterior(j), hasSWSched(s) { }
+   Target(bool m, bool j, bool s) : hasJoin(m), joinAnterior(j), hasSWSched(s) { }
    virtual ~Target() { }
 
    static Target *create(uint32_t chipset);
@@ -192,6 +192,7 @@ public:
    virtual uint32_t getSVAddress(DataFile, const Symbol *) const = 0;
 
 public:
+   const bool hasJoin;      // true if instructions have a join modifier
    const bool joinAnterior; // true if join is executed before the op
    const bool hasSWSched;   // true if code should provide scheduling data
 
index 32ba5c82ceb4020634d222fe059a75be2dc6f10b..799ac2fd2ab46d4fda4d737b2ecf1578910e5937 100644 (file)
@@ -29,7 +29,7 @@ Target *getTargetNV50(unsigned int chipset)
    return new TargetNV50(chipset);
 }
 
-TargetNV50::TargetNV50(unsigned int card) : Target(true, false)
+TargetNV50::TargetNV50(unsigned int card) : Target(true, true, false)
 {
    chipset = card;
 
index adf2df8a77bc186d90893f1fcdbde337be12493c..064e7a2c63f91e48ec471485de2bc13e5bd9728f 100644 (file)
@@ -29,7 +29,8 @@ Target *getTargetNVC0(unsigned int chipset)
    return new TargetNVC0(chipset);
 }
 
-TargetNVC0::TargetNVC0(unsigned int card) : Target(false, card >= 0xe4)
+TargetNVC0::TargetNVC0(unsigned int card) :
+   Target(card < 0x110, false, card >= 0xe4)
 {
    chipset = card;
    initOpInfo();