i915: Remove most of the code under gen >= 4 checks.
[mesa.git] / src / mesa / drivers / dri / i965 / brw_fs.h
index d9d17a2520e6a9d270434ab249b8baf27e20fb0d..bcda339f857fc46bd2e969465503cd9da3663022 100644 (file)
@@ -55,16 +55,6 @@ namespace {
    struct acp_entry;
 }
 
-enum register_file {
-   BAD_FILE,
-   ARF,
-   GRF,
-   MRF,
-   IMM,
-   FIXED_HW_REG, /* a struct brw_reg */
-   UNIFORM, /* prog_data->params[reg] */
-};
-
 class fs_reg {
 public:
    /* Callers of this ralloc-based new need not call delete. It's
@@ -93,6 +83,7 @@ public:
    bool equals(const fs_reg &r) const;
    bool is_zero() const;
    bool is_one() const;
+   bool is_valid_3src() const;
 
    /** Register file: ARF, GRF, MRF, IMM. */
    enum register_file file;
@@ -174,12 +165,9 @@ public:
            fs_reg src0, fs_reg src1,fs_reg src2);
 
    bool equals(fs_inst *inst);
-   int regs_written();
    bool overwrites_reg(const fs_reg &reg);
-   bool is_tex();
-   bool is_math();
-   bool is_control_flow();
    bool is_send_from_grf();
+   bool is_partial_write();
 
    fs_reg dst;
    fs_reg src[3];
@@ -192,6 +180,7 @@ public:
    uint8_t flag_subreg;
 
    int mlen; /**< SEND message length */
+   int regs_written; /**< Number of vgrfs written by a SEND message, or 1 */
    int base_mrf; /**< First MRF in the SEND message, if mlen is nonzero. */
    uint32_t texture_offset; /**< Texture offset bitfield */
    int sampler;
@@ -223,7 +212,7 @@ public:
 
    fs_visitor(struct brw_context *brw,
               struct brw_wm_compile *c,
-              struct gl_shader_program *prog,
+              struct gl_shader_program *shader_prog,
               struct gl_fragment_program *fp,
               unsigned dispatch_width);
    ~fs_visitor();
@@ -287,6 +276,13 @@ public:
                 uint32_t condition);
    fs_inst *LRP(fs_reg dst, fs_reg a, fs_reg y, fs_reg x);
    fs_inst *DEP_RESOLVE_MOV(int grf);
+   fs_inst *BFREV(fs_reg dst, fs_reg value);
+   fs_inst *BFE(fs_reg dst, fs_reg bits, fs_reg offset, fs_reg value);
+   fs_inst *BFI1(fs_reg dst, fs_reg bits, fs_reg offset);
+   fs_inst *BFI2(fs_reg dst, fs_reg bfi1_dst, fs_reg insert, fs_reg base);
+   fs_inst *FBH(fs_reg dst, fs_reg value);
+   fs_inst *FBL(fs_reg dst, fs_reg value);
+   fs_inst *CBIT(fs_reg dst, fs_reg value);
 
    int type_size(const struct glsl_type *type);
    fs_inst *get_instruction_generating_reg(fs_inst *start,
@@ -294,7 +290,8 @@ public:
                                           fs_reg reg);
 
    exec_list VARYING_PULL_CONSTANT_LOAD(fs_reg dst, fs_reg surf_index,
-                                        fs_reg offset);
+                                        fs_reg varying_offset,
+                                        uint32_t const_offset);
 
    bool run();
    void setup_payload_gen4();
@@ -327,6 +324,7 @@ public:
    bool register_coalesce_2();
    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);
@@ -421,8 +419,7 @@ public:
    void setup_builtin_uniform_values(ir_variable *ir);
    int implied_mrf_writes(fs_inst *inst);
 
-   void dump_instructions();
-   void dump_instruction(fs_inst *inst);
+   void dump_instruction(backend_instruction *inst);
 
    struct gl_fragment_program *fp;
    struct brw_wm_compile *c;
@@ -433,8 +430,8 @@ public:
    int *virtual_grf_sizes;
    int virtual_grf_count;
    int virtual_grf_array_size;
-   int *virtual_grf_def;
-   int *virtual_grf_use;
+   int *virtual_grf_start;
+   int *virtual_grf_end;
    bool live_intervals_valid;
 
    /* This is the map from UNIFORM hw_reg + reg_offset as generated by
@@ -443,6 +440,7 @@ public:
     * uniform index.
     */
    int *params_remap;
+   int nr_params_remap;
 
    struct hash_table *variable_ht;
    fs_reg frag_depth;
@@ -527,6 +525,9 @@ private:
    void generate_math_gen4(fs_inst *inst,
                           struct brw_reg dst,
                           struct brw_reg src);
+   void generate_math_g45(fs_inst *inst,
+                         struct brw_reg dst,
+                         struct brw_reg src);
    void generate_ddx(fs_inst *inst, struct brw_reg dst, struct brw_reg src);
    void generate_ddy(fs_inst *inst, struct brw_reg dst, struct brw_reg src,
                      bool negate_value);
@@ -540,7 +541,8 @@ private:
                                                  struct brw_reg surf_index,
                                                  struct brw_reg offset);
    void generate_varying_pull_constant_load(fs_inst *inst, struct brw_reg dst,
-                                            struct brw_reg index);
+                                            struct brw_reg index,
+                                            struct brw_reg offset);
    void generate_varying_pull_constant_load_gen7(fs_inst *inst,
                                                  struct brw_reg dst,
                                                  struct brw_reg index,