r600/sb: introduce special register values for lds support.
authorDave Airlie <airlied@redhat.com>
Wed, 10 Jan 2018 03:52:50 +0000 (03:52 +0000)
committerDave Airlie <airlied@redhat.com>
Thu, 18 Jan 2018 03:36:47 +0000 (03:36 +0000)
For LDS read/write ordering we use the LDS_RW value, reads
will wait on previous writes.
For LDS read/read from LDS queue ordering we use the LDS_OQ
values, we define two for now, though initially we'll just
support OQA.

Also add the check for the lds oq values

Acked-By: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/r600/sb/sb_bc.h
src/gallium/drivers/r600/sb/sb_ir.h
src/gallium/drivers/r600/sb/sb_valtable.cpp

index fc3fa5082d0a0121c7afb6fb0cca1b1ea9a5c911..3a3bae9d445cf76c07da1cb24b3cdb6592d5a3b4 100644 (file)
@@ -722,6 +722,10 @@ public:
                return ((sel >= 128 && sel < 192) || (sel >= 256 && sel < 320));
        }
 
+       bool is_lds_oq(unsigned sel) {
+               return (sel >= 0xdb && sel <= 0xde);
+       }
+
        const char * get_hw_class_name();
        const char * get_hw_chip_name();
 
index 2390babfcfe0e0eb03445ef67a30eb4ddf5f1c86..bee947504ed272089ea3155bf41702cc2fe9d3be 100644 (file)
@@ -42,7 +42,10 @@ enum special_regs {
        SV_EXEC_MASK,
        SV_AR_INDEX,
        SV_VALID_MASK,
-       SV_GEOMETRY_EMIT
+       SV_GEOMETRY_EMIT,
+       SV_LDS_RW,
+       SV_LDS_OQA,
+       SV_LDS_OQB,
 };
 
 class node;
@@ -495,6 +498,12 @@ public:
        bool is_geometry_emit() {
                return is_special_reg() && select == sel_chan(SV_GEOMETRY_EMIT, 0);
        }
+       bool is_lds_access() {
+               return is_special_reg() && select == sel_chan(SV_LDS_RW, 0);
+       }
+       bool is_lds_oq() {
+               return is_special_reg() && (select == sel_chan(SV_LDS_OQA, 0) || select == sel_chan(SV_LDS_OQB, 0));
+       }
 
        node* any_def() {
                assert(!(def && adef));
@@ -833,6 +842,22 @@ public:
                return vec_uses_ar(dst) || vec_uses_ar(src);
        }
 
+       bool vec_uses_lds_oq(vvec &vv) {
+               for (vvec::iterator I = vv.begin(), E = vv.end(); I != E; ++I) {
+                       value *v = *I;
+                       if (v && v->is_lds_oq())
+                               return true;
+               }
+               return false;
+       }
+
+       bool consumes_lds_oq() {
+               return vec_uses_lds_oq(src);
+       }
+
+       bool produces_lds_oq() {
+               return vec_uses_lds_oq(dst);
+       }
 
        region_node* get_parent_region();
 
index a85537c2ad67282ec2e30c5cecd70e66ef981906..41cfbf0946afa7abc1976847e50c133af717d71c 100644 (file)
@@ -56,6 +56,9 @@ sb_ostream& operator << (sb_ostream &o, value &v) {
                        case SV_EXEC_MASK: o << "EM"; break;
                        case SV_VALID_MASK: o << "VM"; break;
                        case SV_GEOMETRY_EMIT: o << "GEOMETRY_EMIT"; break;
+                       case SV_LDS_RW: o << "LDS_RW"; break;
+                       case SV_LDS_OQA: o << "LDS_OQA"; break;
+                       case SV_LDS_OQB: o << "LDS_OQB"; break;
                        default: o << "???specialreg"; break;
                }
                break;