i965: Make backend_reg inherit from brw_reg.
authorMatt Turner <mattst88@gmail.com>
Sat, 24 Oct 2015 21:32:03 +0000 (14:32 -0700)
committerMatt Turner <mattst88@gmail.com>
Fri, 13 Nov 2015 19:27:50 +0000 (11:27 -0800)
Some fields (file, type, abs, negate) in brw_reg are shadowed by
backend_reg.

Reviewed-by: Emil Velikov <emil.velikov@collabora.co.uk>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_shader.h

index 29baebf0cc1616aad31d2729e717bdf37b6f8a06..e1e89dd32122179700e93deeaa37fd3815f42e0f 100644 (file)
@@ -48,16 +48,15 @@ enum PACKED register_file {
    UNIFORM, /* prog_data->params[reg] */
 };
 
-struct backend_reg
-{
 #ifdef __cplusplus
+struct backend_reg : public brw_reg
+{
    bool is_zero() const;
    bool is_one() const;
    bool is_negative_one() const;
    bool is_null() const;
    bool is_accumulator() const;
    bool in_range(const backend_reg &r, unsigned n) const;
-#endif
 
    enum register_file file; /**< Register file: GRF, MRF, IMM. */
    enum brw_reg_type type;  /**< Register type: BRW_REGISTER_TYPE_* */
@@ -87,6 +86,7 @@ struct backend_reg
    bool negate;
    bool abs;
 };
+#endif
 
 struct cfg_t;
 struct bblock_t;