i965: Use enum brw_reg_type for register types.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
This commit is contained in:
Matt Turner 2014-06-29 16:02:59 -07:00
parent 34ef6a7651
commit 3de11cacf0
7 changed files with 14 additions and 13 deletions

View File

@ -26,6 +26,7 @@
#include <stdint.h> #include <stdint.h>
#include "brw_context.h" #include "brw_context.h"
#include "brw_reg.h"
#include "intel_mipmap_tree.h" #include "intel_mipmap_tree.h"
struct brw_context; struct brw_context;
@ -299,7 +300,7 @@ struct brw_blorp_blit_prog_key
/* Type of the data to be read from the texture (one of /* Type of the data to be read from the texture (one of
* BRW_REGISTER_TYPE_{UD,D,F}). * BRW_REGISTER_TYPE_{UD,D,F}).
*/ */
unsigned texture_data_type; enum brw_reg_type texture_data_type;
/* True if the source image is W tiled. If true, the surface state for the /* True if the source image is W tiled. If true, the surface state for the
* source image must be configured as Y tiled, and tex_samples must be 0. * source image must be configured as Y tiled, and tex_samples must be 0.

View File

@ -866,7 +866,7 @@ fs_reg::fs_reg(enum register_file file, int reg)
} }
/** Fixed HW reg constructor. */ /** Fixed HW reg constructor. */
fs_reg::fs_reg(enum register_file file, int reg, uint32_t type) fs_reg::fs_reg(enum register_file file, int reg, enum brw_reg_type type)
{ {
init(); init();
this->file = file; this->file = file;

View File

@ -75,7 +75,7 @@ public:
fs_reg(uint32_t u); fs_reg(uint32_t u);
fs_reg(struct brw_reg fixed_hw_reg); fs_reg(struct brw_reg fixed_hw_reg);
fs_reg(enum register_file file, int reg); fs_reg(enum register_file file, int reg);
fs_reg(enum register_file file, int reg, uint32_t type); fs_reg(enum register_file file, int reg, enum brw_reg_type type);
fs_reg(class fs_visitor *v, const struct glsl_type *type); fs_reg(class fs_visitor *v, const struct glsl_type *type);
bool equals(const fs_reg &r) const; bool equals(const fs_reg &r) const;
@ -99,7 +99,7 @@ public:
}; };
static inline fs_reg static inline fs_reg
retype(fs_reg reg, unsigned type) retype(fs_reg reg, enum brw_reg_type type)
{ {
reg.fixed_hw_reg.type = reg.type = type; reg.fixed_hw_reg.type = reg.type = type;
return reg; return reg;

View File

@ -131,7 +131,7 @@ const char *brw_reg_type_letters(unsigned brw_reg_type);
* or "structure of array" form: * or "structure of array" form:
*/ */
struct brw_reg { struct brw_reg {
unsigned type:4; enum brw_reg_type type:4;
unsigned file:2; unsigned file:2;
unsigned nr:8; unsigned nr:8;
unsigned subnr:5; /* :1 in align16 */ unsigned subnr:5; /* :1 in align16 */
@ -227,7 +227,7 @@ static inline struct brw_reg
brw_reg(unsigned file, brw_reg(unsigned file,
unsigned nr, unsigned nr,
unsigned subnr, unsigned subnr,
unsigned type, enum brw_reg_type type,
unsigned vstride, unsigned vstride,
unsigned width, unsigned width,
unsigned hstride, unsigned hstride,
@ -362,7 +362,7 @@ brw_vecn_reg(unsigned width, unsigned file, unsigned nr, unsigned subnr)
} }
static inline struct brw_reg static inline struct brw_reg
retype(struct brw_reg reg, unsigned type) retype(struct brw_reg reg, enum brw_reg_type type)
{ {
reg.type = type; reg.type = type;
return reg; return reg;
@ -424,7 +424,7 @@ brw_uw1_reg(unsigned file, unsigned nr, unsigned subnr)
} }
static inline struct brw_reg static inline struct brw_reg
brw_imm_reg(unsigned type) brw_imm_reg(enum brw_reg_type type)
{ {
return brw_reg(BRW_IMMEDIATE_VALUE, return brw_reg(BRW_IMMEDIATE_VALUE,
0, 0,

View File

@ -279,7 +279,7 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)
} }
int enum brw_reg_type
brw_type_for_base_type(const struct glsl_type *type) brw_type_for_base_type(const struct glsl_type *type)
{ {
switch (type->base_type) { switch (type->base_type) {

View File

@ -50,7 +50,7 @@ struct backend_reg
#endif #endif
enum register_file file; /**< Register file: GRF, MRF, IMM. */ enum register_file file; /**< Register file: GRF, MRF, IMM. */
uint8_t type; /**< Register type: BRW_REGISTER_TYPE_* */ enum brw_reg_type type; /**< Register type: BRW_REGISTER_TYPE_* */
/** /**
* Register number. * Register number.
@ -166,7 +166,7 @@ void annotation_finalize(struct annotation_info *annotation, unsigned offset);
#endif /* __cplusplus */ #endif /* __cplusplus */
int brw_type_for_base_type(const struct glsl_type *type); enum brw_reg_type brw_type_for_base_type(const struct glsl_type *type);
uint32_t brw_conditional_for_comparison(unsigned int op); uint32_t brw_conditional_for_comparison(unsigned int op);
uint32_t brw_math_function(enum opcode op); uint32_t brw_math_function(enum opcode op);
const char *brw_instruction_name(enum opcode op); const char *brw_instruction_name(enum opcode op);

View File

@ -117,7 +117,7 @@ public:
}; };
static inline src_reg static inline src_reg
retype(src_reg reg, unsigned type) retype(src_reg reg, enum brw_reg_type type)
{ {
reg.fixed_hw_reg.type = reg.type = type; reg.fixed_hw_reg.type = reg.type = type;
return reg; return reg;
@ -176,7 +176,7 @@ public:
}; };
static inline dst_reg static inline dst_reg
retype(dst_reg reg, unsigned type) retype(dst_reg reg, enum brw_reg_type type)
{ {
reg.fixed_hw_reg.type = reg.type = type; reg.fixed_hw_reg.type = reg.type = type;
return reg; return reg;