r600/sb: replace memset by using member initialization/assignment
[mesa.git] / src / gallium / drivers / r600 / sb / sb_ir.h
index 67c7cd8aa488232ac0bdf376e59b5aacf5570585..2d629443641a1de76224689adc3c1ef0bac6e3f5 100644 (file)
@@ -42,7 +42,11 @@ 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,
+       SV_SCRATCH
 };
 
 class node;
@@ -495,6 +499,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));
@@ -508,6 +518,9 @@ public:
                        v = v->gvn_source;
                return v;
        }
+       bool is_scratch() {
+               return is_special_reg() && select == sel_chan(SV_SCRATCH, 0);
+       }
 
        bool is_float_0_or_1() {
                value *v = gvalue();
@@ -603,6 +616,12 @@ public:
                }
        }
 
+       /* Check whether copy-propagation of src into this would create an access
+        * conflict with relative addressing, i.e. an operation that tries to access
+        * array elements with different address register values.
+        */
+       bool no_reladdr_conflict_with(value *src);
+
        val_set interferences;
        unsigned uid;
 };
@@ -663,6 +682,7 @@ enum node_subtype {
        NST_FETCH_INST,
        NST_TEX_CLAUSE,
        NST_VTX_CLAUSE,
+       NST_GDS_CLAUSE,
 
        NST_BB,
 
@@ -787,7 +807,7 @@ public:
        bool is_alu_clause() { return subtype == NST_ALU_CLAUSE; }
 
        bool is_fetch_clause() {
-               return subtype == NST_TEX_CLAUSE || subtype == NST_VTX_CLAUSE;
+               return subtype == NST_TEX_CLAUSE || subtype == NST_VTX_CLAUSE || subtype == NST_GDS_CLAUSE;
        }
 
        bool is_copy() { return subtype == NST_COPY; }
@@ -832,6 +852,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();
 
@@ -976,7 +1012,7 @@ public:
 
 class alu_node : public node {
 protected:
-       alu_node() : node(NT_OP, NST_ALU_INST) { memset(&bc, 0, sizeof(bc_alu)); };
+       alu_node() : node(NT_OP, NST_ALU_INST) {  }
 public:
        bc_alu bc;