BRW_GENERAL_REGISTER_FILE = 1,
BRW_MESSAGE_REGISTER_FILE = 2,
BRW_IMMEDIATE_VALUE = 3,
+
+ ARF = BRW_ARCHITECTURE_REGISTER_FILE,
+ FIXED_GRF = BRW_GENERAL_REGISTER_FILE,
+ MRF = BRW_MESSAGE_REGISTER_FILE,
+ IMM = BRW_IMMEDIATE_VALUE,
+
+ /* These are not hardware values */
+ VGRF,
+ ATTR,
+ UNIFORM, /* prog_data->params[reg] */
+ BAD_FILE,
};
#define BRW_HW_REG_TYPE_UD 0
fs_reg::fs_reg(struct brw_reg reg) :
backend_reg(reg)
{
- this->file = (enum register_file)reg.file;
this->reg_offset = 0;
this->subreg_offset = 0;
this->reladdr = NULL;
brw_type_for_base_type(type));
}
-fs_reg::fs_reg(enum register_file file, int nr)
+fs_reg::fs_reg(enum brw_reg_file file, int nr)
{
init();
this->file = file;
this->stride = (file == UNIFORM ? 0 : 1);
}
-fs_reg::fs_reg(enum register_file file, int nr, enum brw_reg_type type)
+fs_reg::fs_reg(enum brw_reg_file file, int nr, enum brw_reg_type type)
{
init();
this->file = file;
explicit fs_reg(uint8_t vf[4]);
explicit fs_reg(uint8_t vf0, uint8_t vf1, uint8_t vf2, uint8_t vf3);
fs_reg(struct brw_reg reg);
- fs_reg(enum register_file file, int nr);
- fs_reg(enum register_file file, int nr, enum brw_reg_type type);
+ fs_reg(enum brw_reg_file file, int nr);
+ fs_reg(enum brw_reg_file file, int nr, enum brw_reg_type type);
bool equals(const fs_reg &r) const;
bool is_contiguous() const;
void init();
- src_reg(register_file file, int nr, const glsl_type *type);
+ src_reg(enum brw_reg_file file, int nr, const glsl_type *type);
src_reg();
src_reg(float f);
src_reg(uint32_t u);
void init();
dst_reg();
- dst_reg(register_file file, int nr);
- dst_reg(register_file file, int nr, const glsl_type *type,
+ dst_reg(enum brw_reg_file file, int nr);
+ dst_reg(enum brw_reg_file file, int nr, const glsl_type *type,
unsigned writemask);
- dst_reg(register_file file, int nr, brw_reg_type type,
+ dst_reg(enum brw_reg_file file, int nr, brw_reg_type type,
unsigned writemask);
dst_reg(struct brw_reg reg);
dst_reg(class vec4_visitor *v, const struct glsl_type *type);
*/
struct brw_reg {
enum brw_reg_type type:4;
- enum brw_reg_file file:2;
+ enum brw_reg_file file:3; /* :2 hardware format */
unsigned negate:1; /* source only */
unsigned abs:1; /* source only */
unsigned address_mode:1; /* relative addressing, hopefully! */
- unsigned pad0:2;
+ unsigned pad0:1;
unsigned subnr:5; /* :1 in align16 */
unsigned nr:16;
#define MAX_SAMPLER_MESSAGE_SIZE 11
#define MAX_VGRF_SIZE 16
-enum PACKED register_file {
- ARF,
- FIXED_GRF,
- MRF,
- IMM,
- VGRF,
- ATTR,
- UNIFORM, /* prog_data->params[reg] */
- BAD_FILE,
-};
-
#ifdef __cplusplus
struct backend_reg : public brw_reg
{
bool is_accumulator() const;
bool in_range(const backend_reg &r, unsigned n) const;
- enum register_file file; /**< Register file: VGRF, MRF, IMM. */
-
/**
* Offset within the virtual register.
*
this->file = BAD_FILE;
}
-src_reg::src_reg(register_file file, int nr, const glsl_type *type)
+src_reg::src_reg(enum brw_reg_file file, int nr, const glsl_type *type)
{
init();
src_reg::src_reg(struct brw_reg reg) :
backend_reg(reg)
{
- this->file = (enum register_file)reg.file;
this->reg_offset = 0;
this->reladdr = NULL;
}
src_reg::src_reg(const dst_reg ®) :
backend_reg(static_cast<struct brw_reg>(reg))
{
- this->file = (enum register_file)reg.file;
this->reg_offset = reg.reg_offset;
this->reladdr = reg.reladdr;
this->swizzle = brw_swizzle_for_mask(reg.writemask);
init();
}
-dst_reg::dst_reg(register_file file, int nr)
+dst_reg::dst_reg(enum brw_reg_file file, int nr)
{
init();
this->nr = nr;
}
-dst_reg::dst_reg(register_file file, int nr, const glsl_type *type,
+dst_reg::dst_reg(enum brw_reg_file file, int nr, const glsl_type *type,
unsigned writemask)
{
init();
- this->file = (enum register_file)file;
+ this->file = file;
this->nr = nr;
this->type = brw_type_for_base_type(type);
this->writemask = writemask;
}
-dst_reg::dst_reg(register_file file, int nr, brw_reg_type type,
+dst_reg::dst_reg(enum brw_reg_file file, int nr, brw_reg_type type,
unsigned writemask)
{
init();
dst_reg::dst_reg(struct brw_reg reg) :
backend_reg(reg)
{
- this->file = (enum register_file)reg.file;
this->reg_offset = 0;
this->reladdr = NULL;
}
dst_reg::dst_reg(const src_reg ®) :
backend_reg(static_cast<struct brw_reg>(reg))
{
- this->file = reg.file;
this->reg_offset = reg.reg_offset;
this->writemask = brw_mask_for_swizzle(reg.swizzle);
this->reladdr = reg.reladdr;
bool progress = false;
int last_reg = -1, last_reg_offset = -1;
- enum register_file last_reg_file = BAD_FILE;
+ enum brw_reg_file last_reg_file = BAD_FILE;
int remaining_channels = 0;
uint8_t imm[4];