i965/vec4: Add a test for copy propagation behavior.
[mesa.git] / src / mesa / drivers / dri / i965 / brw_fs.h
index fff7d8e474d90e5d20f6193a009a844f31827fd8..3d21ee52cf1c168d44323b33b2dc9b93c5df3905 100644 (file)
@@ -74,7 +74,7 @@ public:
    fs_reg(uint32_t u);
    fs_reg(struct brw_reg fixed_hw_reg);
    fs_reg(enum register_file file, int reg);
-   fs_reg(enum register_file file, int reg, enum brw_reg_type type);
+   fs_reg(enum register_file file, int reg, uint32_t type);
    fs_reg(class fs_visitor *v, const struct glsl_type *type);
 
    bool equals(const fs_reg &r) const;
@@ -91,7 +91,7 @@ public:
    /** Register file: GRF, MRF, IMM. */
    enum register_file file;
    /** Register type.  BRW_REGISTER_TYPE_* */
-   enum brw_reg_type type;
+   uint8_t type;
    /**
     * Register number.  For MRF, it's the hardware register.  For
     * GRF, it's a virtual register number until register allocation
@@ -196,14 +196,14 @@ public:
    fs_inst(enum opcode opcode, fs_reg dst,
            fs_reg src0, fs_reg src1,fs_reg src2);
 
-   bool equals(fs_inst *inst);
-   bool overwrites_reg(const fs_reg &reg);
-   bool is_send_from_grf();
-   bool is_partial_write();
-   int regs_read(fs_visitor *v, int arg);
+   bool equals(fs_inst *inst) const;
+   bool overwrites_reg(const fs_reg &reg) const;
+   bool is_send_from_grf() const;
+   bool is_partial_write() const;
+   int regs_read(fs_visitor *v, int arg) const;
 
-   bool reads_flag();
-   bool writes_flag();
+   bool reads_flag() const;
+   bool writes_flag() const;
 
    fs_reg dst;
    fs_reg src[3];
@@ -357,7 +357,8 @@ public:
    void split_virtual_grfs();
    void compact_virtual_grfs();
    void move_uniform_array_access_to_pull_constants();
-   void setup_pull_constants();
+   void assign_constant_locations();
+   void demote_pull_constants();
    void invalidate_live_intervals();
    void calculate_live_intervals();
    void calculate_register_pressure();
@@ -374,14 +375,15 @@ public:
    bool compute_to_mrf();
    bool dead_code_eliminate();
    bool dead_code_eliminate_local();
-   bool remove_dead_constants();
    bool remove_duplicate_mrf_writes();
    bool virtual_grf_interferes(int a, int b);
    void schedule_instructions(instruction_scheduler_mode mode);
    void insert_gen4_send_dependency_workarounds();
    void insert_gen4_pre_send_dependency_workarounds(fs_inst *inst);
    void insert_gen4_post_send_dependency_workarounds(fs_inst *inst);
+   void vfail(const char *msg, va_list args);
    void fail(const char *msg, ...);
+   void no16(const char *msg, ...);
    void lower_uniform_pull_constant_loads();
 
    void push_force_uncompressed();
@@ -509,13 +511,17 @@ public:
    /** Number of uniform variable components visited. */
    unsigned uniforms;
 
-   /* This is the map from UNIFORM hw_reg + reg_offset as generated by
-    * the visitor to the packed uniform number after
-    * remove_dead_constants() that represents the actual uploaded
-    * uniform index.
+   /**
+    * Array mapping UNIFORM register numbers to the pull parameter index,
+    * or -1 if this uniform register isn't being uploaded as a pull constant.
+    */
+   int *pull_constant_loc;
+
+   /**
+    * Array mapping UNIFORM register numbers to the push parameter index,
+    * or -1 if this uniform register isn't being uploaded as a push constant.
     */
-   int *params_remap;
-   int nr_params_remap;
+   int *push_constant_loc;
 
    struct hash_table *variable_ht;
    fs_reg frag_depth;
@@ -523,6 +529,7 @@ public:
    fs_reg outputs[BRW_MAX_DRAW_BUFFERS];
    unsigned output_components[BRW_MAX_DRAW_BUFFERS];
    fs_reg dual_src_output;
+   bool do_dual_src;
    int first_non_payload_grf;
    /** Either BRW_MAX_GRF or GEN7_MRF_HACK_START */
    int max_grf;
@@ -537,6 +544,8 @@ public:
 
    bool failed;
    char *fail_msg;
+   bool simd16_unsupported;
+   char *no16_msg;
 
    /* Result of last visit() method. */
    fs_reg result;