(vf3 << 24);
}
-/** Fixed brw_reg. */
-fs_reg::fs_reg(struct brw_reg fixed_hw_reg)
+fs_reg::fs_reg(struct brw_reg reg) :
+ backend_reg(reg)
{
- init();
this->file = HW_REG;
- this->fixed_hw_reg = fixed_hw_reg;
- this->type = fixed_hw_reg.type;
+ this->reg = 0;
+ this->reg_offset = 0;
+ this->subreg_offset = 0;
+ this->reladdr = NULL;
+ this->stride = 1;
}
bool
abs == r.abs &&
!reladdr && !r.reladdr &&
(file != HW_REG ||
- memcmp(&fixed_hw_reg, &r.fixed_hw_reg,
- sizeof(fixed_hw_reg)) == 0) &&
+ memcmp((brw_reg *)this, (brw_reg *)&r, sizeof(brw_reg)) == 0) &&
(file != IMM || d == r.d) &&
stride == r.stride);
}
fs_reg::component_size(unsigned width) const
{
const unsigned stride = (file != HW_REG ? this->stride :
- fixed_hw_reg.hstride == 0 ? 0 :
- 1 << (fixed_hw_reg.hstride - 1));
+ hstride == 0 ? 0 :
+ 1 << (hstride - 1));
return MAX2(width * stride, 1) * type_sz(type);
}
brw_type_for_base_type(type));
}
-/** Fixed HW reg constructor. */
fs_reg::fs_reg(enum register_file file, int reg)
{
init();
this->stride = (file == UNIFORM ? 0 : 1);
}
-/** Fixed HW reg constructor. */
fs_reg::fs_reg(enum register_file file, int reg, enum brw_reg_type type)
{
init();
struct brw_reg brw_reg = brw_vec1_grf(payload.num_regs +
constant_nr / 8,
constant_nr % 8);
+ brw_reg.abs = inst->src[i].abs;
+ brw_reg.negate = inst->src[i].negate;
assert(inst->src[i].stride == 0);
- inst->src[i].file = HW_REG;
- inst->src[i].fixed_hw_reg = byte_offset(
+ inst->src[i] = byte_offset(
retype(brw_reg, inst->src[i].type),
inst->src[i].subreg_offset);
}
foreach_block_and_inst(block, fs_inst, inst, cfg) {
if (inst->opcode == FS_OPCODE_LINTERP) {
assert(inst->src[1].file == HW_REG);
- inst->src[1].fixed_hw_reg.nr += urb_start;
+ inst->src[1].nr += urb_start;
}
if (inst->opcode == FS_OPCODE_CINTERP) {
assert(inst->src[0].file == HW_REG);
- inst->src[0].fixed_hw_reg.nr += urb_start;
+ inst->src[0].nr += urb_start;
}
}
inst->src[i].reg +
inst->src[i].reg_offset;
- inst->src[i].file = HW_REG;
- inst->src[i].fixed_hw_reg =
+ struct brw_reg reg =
stride(byte_offset(retype(brw_vec8_grf(grf, 0), inst->src[i].type),
inst->src[i].subreg_offset),
inst->exec_size * inst->src[i].stride,
inst->exec_size, inst->src[i].stride);
+ reg.abs = inst->src[i].abs;
+ reg.negate = inst->src[i].negate;
+
+ inst->src[i] = reg;
}
}
}
/* Now that we have the uniform assigned, go ahead and force it to a vec4. */
assert(mov->src[0].file == HW_REG);
- mov->src[0] = brw_vec4_grf(mov->src[0].fixed_hw_reg.nr, 0);
+ mov->src[0] = brw_vec4_grf(mov->src[0].nr, 0);
}
/**
if (inst->src[i].file == GRF) {
grf = inst->src[i].reg;
} else if (inst->src[i].file == HW_REG &&
- inst->src[i].fixed_hw_reg.file == BRW_GENERAL_REGISTER_FILE) {
- grf = inst->src[i].fixed_hw_reg.nr;
+ inst->src[i].brw_reg::file == BRW_GENERAL_REGISTER_FILE) {
+ grf = inst->src[i].nr;
} else {
continue;
}
fprintf(file, "***attr%d***", inst->dst.reg + inst->dst.reg_offset);
break;
case HW_REG:
- if (inst->dst.fixed_hw_reg.file == BRW_ARCHITECTURE_REGISTER_FILE) {
- switch (inst->dst.fixed_hw_reg.nr) {
+ if (inst->dst.brw_reg::file == BRW_ARCHITECTURE_REGISTER_FILE) {
+ switch (inst->dst.nr) {
case BRW_ARF_NULL:
fprintf(file, "null");
break;
case BRW_ARF_ADDRESS:
- fprintf(file, "a0.%d", inst->dst.fixed_hw_reg.subnr);
+ fprintf(file, "a0.%d", inst->dst.subnr);
break;
case BRW_ARF_ACCUMULATOR:
- fprintf(file, "acc%d", inst->dst.fixed_hw_reg.subnr);
+ fprintf(file, "acc%d", inst->dst.subnr);
break;
case BRW_ARF_FLAG:
- fprintf(file, "f%d.%d", inst->dst.fixed_hw_reg.nr & 0xf,
- inst->dst.fixed_hw_reg.subnr);
+ fprintf(file, "f%d.%d", inst->dst.nr & 0xf,
+ inst->dst.subnr);
break;
default:
- fprintf(file, "arf%d.%d", inst->dst.fixed_hw_reg.nr & 0xf,
- inst->dst.fixed_hw_reg.subnr);
+ fprintf(file, "arf%d.%d", inst->dst.nr & 0xf,
+ inst->dst.subnr);
break;
}
} else {
- fprintf(file, "hw_reg%d", inst->dst.fixed_hw_reg.nr);
+ fprintf(file, "hw_reg%d", inst->dst.nr);
}
- if (inst->dst.fixed_hw_reg.subnr)
- fprintf(file, "+%d", inst->dst.fixed_hw_reg.subnr);
+ if (inst->dst.subnr)
+ fprintf(file, "+%d", inst->dst.subnr);
break;
case IMM:
unreachable("not reached");
}
break;
case HW_REG:
- if (inst->src[i].fixed_hw_reg.negate)
- fprintf(file, "-");
- if (inst->src[i].fixed_hw_reg.abs)
- fprintf(file, "|");
- if (inst->src[i].fixed_hw_reg.file == BRW_ARCHITECTURE_REGISTER_FILE) {
- switch (inst->src[i].fixed_hw_reg.nr) {
+ if (inst->src[i].brw_reg::file == BRW_ARCHITECTURE_REGISTER_FILE) {
+ switch (inst->src[i].nr) {
case BRW_ARF_NULL:
fprintf(file, "null");
break;
case BRW_ARF_ADDRESS:
- fprintf(file, "a0.%d", inst->src[i].fixed_hw_reg.subnr);
+ fprintf(file, "a0.%d", inst->src[i].subnr);
break;
case BRW_ARF_ACCUMULATOR:
- fprintf(file, "acc%d", inst->src[i].fixed_hw_reg.subnr);
+ fprintf(file, "acc%d", inst->src[i].subnr);
break;
case BRW_ARF_FLAG:
- fprintf(file, "f%d.%d", inst->src[i].fixed_hw_reg.nr & 0xf,
- inst->src[i].fixed_hw_reg.subnr);
+ fprintf(file, "f%d.%d", inst->src[i].nr & 0xf,
+ inst->src[i].subnr);
break;
default:
- fprintf(file, "arf%d.%d", inst->src[i].fixed_hw_reg.nr & 0xf,
- inst->src[i].fixed_hw_reg.subnr);
+ fprintf(file, "arf%d.%d", inst->src[i].nr & 0xf,
+ inst->src[i].subnr);
break;
}
} else {
- fprintf(file, "hw_reg%d", inst->src[i].fixed_hw_reg.nr);
+ fprintf(file, "hw_reg%d", inst->src[i].nr);
}
- if (inst->src[i].fixed_hw_reg.subnr)
- fprintf(file, "+%d", inst->src[i].fixed_hw_reg.subnr);
- if (inst->src[i].fixed_hw_reg.abs)
- fprintf(file, "|");
+ if (inst->src[i].subnr)
+ fprintf(file, "+%d", inst->src[i].subnr);
break;
}
if (inst->src[i].abs)
brw_reg = retype(brw_reg, reg->type);
brw_reg = byte_offset(brw_reg, reg->subreg_offset);
+ brw_reg.abs = reg->abs;
+ brw_reg.negate = reg->negate;
break;
case IMM:
assert(reg->stride == ((reg->type == BRW_REGISTER_TYPE_V ||
}
break;
case HW_REG:
- assert(reg->type == reg->fixed_hw_reg.type);
- brw_reg = reg->fixed_hw_reg;
+ brw_reg = *static_cast<struct brw_reg *>(reg);
break;
case BAD_FILE:
/* Probably unused. */
case UNIFORM:
unreachable("not reached");
}
- if (reg->abs)
- brw_reg = brw_abs(brw_reg);
- if (reg->negate)
- brw_reg = negate(brw_reg);
return brw_reg;
}
*/
for (int i = 0; i < inst->sources; i++) {
if (inst->src[i].file == HW_REG &&
- inst->src[i].fixed_hw_reg.file == BRW_GENERAL_REGISTER_FILE) {
- int node_nr = inst->src[i].fixed_hw_reg.nr;
+ inst->src[i].brw_reg::file == BRW_GENERAL_REGISTER_FILE) {
+ int node_nr = inst->src[i].nr;
if (node_nr >= payload_node_count)
continue;
explicit fs_reg(uint32_t u);
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 fixed_hw_reg);
+ fs_reg(struct brw_reg reg);
fs_reg(enum register_file file, int reg);
fs_reg(enum register_file file, int reg, enum brw_reg_type type);
static inline fs_reg
retype(fs_reg reg, enum brw_reg_type type)
{
- reg.fixed_hw_reg.type = reg.type = type;
+ reg.type = type;
return reg;
}
static inline src_reg
retype(src_reg reg, enum brw_reg_type type)
{
- reg.fixed_hw_reg.type = reg.type = type;
+ reg.type = type;
return reg;
}
static inline dst_reg
retype(dst_reg reg, enum brw_reg_type type)
{
- reg.fixed_hw_reg.type = reg.type = type;
+ reg.type = type;
return reg;
}
if (inst->src[i].file == GRF) {
reads_remaining[inst->src[i].reg]++;
} else if (inst->src[i].file == HW_REG &&
- inst->src[i].fixed_hw_reg.file == BRW_GENERAL_REGISTER_FILE) {
- if (inst->src[i].fixed_hw_reg.nr >= hw_reg_count)
+ inst->src[i].brw_reg::file == BRW_GENERAL_REGISTER_FILE) {
+ if (inst->src[i].nr >= hw_reg_count)
continue;
for (int j = 0; j < inst->regs_read(i); j++)
- hw_reads_remaining[inst->src[i].fixed_hw_reg.nr + j]++;
+ hw_reads_remaining[inst->src[i].nr + j]++;
}
}
}
if (inst->src[i].file == GRF) {
reads_remaining[inst->src[i].reg]--;
} else if (inst->src[i].file == HW_REG &&
- inst->src[i].fixed_hw_reg.file == BRW_GENERAL_REGISTER_FILE &&
- inst->src[i].fixed_hw_reg.nr < hw_reg_count) {
+ inst->src[i].brw_reg::file == BRW_GENERAL_REGISTER_FILE &&
+ inst->src[i].nr < hw_reg_count) {
for (int off = 0; off < inst->regs_read(i); off++)
- hw_reads_remaining[inst->src[i].fixed_hw_reg.nr + off]--;
+ hw_reads_remaining[inst->src[i].nr + off]--;
}
}
}
benefit += v->alloc.sizes[inst->src[i].reg];
if (inst->src[i].file == HW_REG &&
- inst->src[i].fixed_hw_reg.file == BRW_GENERAL_REGISTER_FILE &&
- inst->src[i].fixed_hw_reg.nr < hw_reg_count) {
+ inst->src[i].brw_reg::file == BRW_GENERAL_REGISTER_FILE &&
+ inst->src[i].nr < hw_reg_count) {
for (int off = 0; off < inst->regs_read(i); off++) {
- int reg = inst->src[i].fixed_hw_reg.nr + off;
+ int reg = inst->src[i].nr + off;
if (!BITSET_TEST(hw_liveout[block_idx], reg) &&
hw_reads_remaining[reg] == 1) {
benefit++;
}
}
} else if (inst->src[i].file == HW_REG &&
- (inst->src[i].fixed_hw_reg.file ==
+ (inst->src[i].brw_reg::file ==
BRW_GENERAL_REGISTER_FILE)) {
if (post_reg_alloc) {
for (int r = 0; r < inst->regs_read(i); r++)
- add_dep(last_grf_write[inst->src[i].fixed_hw_reg.nr + r], n);
+ add_dep(last_grf_write[inst->src[i].nr + r], n);
} else {
add_dep(last_fixed_grf_write, n);
}
inst->src[i].file != IMM &&
inst->src[i].file != UNIFORM &&
(inst->src[i].file != HW_REG ||
- inst->src[i].fixed_hw_reg.file != BRW_IMMEDIATE_VALUE)) {
+ inst->src[i].brw_reg::file != BRW_IMMEDIATE_VALUE)) {
assert(inst->src[i].file != MRF);
add_barrier_deps(n);
}
last_mrf_write[reg] = n;
}
} else if (inst->dst.file == HW_REG &&
- inst->dst.fixed_hw_reg.file == BRW_GENERAL_REGISTER_FILE) {
+ inst->dst.brw_reg::file == BRW_GENERAL_REGISTER_FILE) {
if (post_reg_alloc) {
for (int r = 0; r < inst->regs_written; r++)
- last_grf_write[inst->dst.fixed_hw_reg.nr + r] = n;
+ last_grf_write[inst->dst.nr + r] = n;
} else {
last_fixed_grf_write = n;
}
}
}
} else if (inst->src[i].file == HW_REG &&
- (inst->src[i].fixed_hw_reg.file ==
+ (inst->src[i].brw_reg::file ==
BRW_GENERAL_REGISTER_FILE)) {
if (post_reg_alloc) {
for (int r = 0; r < inst->regs_read(i); r++)
- add_dep(n, last_grf_write[inst->src[i].fixed_hw_reg.nr + r], 0);
+ add_dep(n, last_grf_write[inst->src[i].nr + r], 0);
} else {
add_dep(n, last_fixed_grf_write, 0);
}
inst->src[i].file != IMM &&
inst->src[i].file != UNIFORM &&
(inst->src[i].file != HW_REG ||
- inst->src[i].fixed_hw_reg.file != BRW_IMMEDIATE_VALUE)) {
+ inst->src[i].brw_reg::file != BRW_IMMEDIATE_VALUE)) {
assert(inst->src[i].file != MRF);
add_barrier_deps(n);
}
last_mrf_write[reg] = n;
}
} else if (inst->dst.file == HW_REG &&
- inst->dst.fixed_hw_reg.file == BRW_GENERAL_REGISTER_FILE) {
+ inst->dst.brw_reg::file == BRW_GENERAL_REGISTER_FILE) {
if (post_reg_alloc) {
for (int r = 0; r < inst->regs_written; r++)
- last_grf_write[inst->dst.fixed_hw_reg.nr + r] = n;
+ last_grf_write[inst->dst.nr + r] = n;
} else {
last_fixed_grf_write = n;
}
for (unsigned j = 0; j < inst->regs_read(i); ++j)
add_dep(last_grf_write[inst->src[i].reg + j], n);
} else if (inst->src[i].file == HW_REG &&
- (inst->src[i].fixed_hw_reg.file ==
+ (inst->src[i].brw_reg::file ==
BRW_GENERAL_REGISTER_FILE)) {
add_dep(last_fixed_grf_write, n);
} else if (inst->src[i].is_accumulator()) {
inst->src[i].file != IMM &&
inst->src[i].file != UNIFORM &&
(inst->src[i].file != HW_REG ||
- inst->src[i].fixed_hw_reg.file != BRW_IMMEDIATE_VALUE)) {
+ inst->src[i].brw_reg::file != BRW_IMMEDIATE_VALUE)) {
/* No reads from MRF, and ATTR is already translated away */
assert(inst->src[i].file != MRF &&
inst->src[i].file != ATTR);
add_dep(last_mrf_write[inst->dst.reg], n);
last_mrf_write[inst->dst.reg] = n;
} else if (inst->dst.file == HW_REG &&
- inst->dst.fixed_hw_reg.file == BRW_GENERAL_REGISTER_FILE) {
+ inst->dst.brw_reg::file == BRW_GENERAL_REGISTER_FILE) {
last_fixed_grf_write = n;
} else if (inst->dst.is_accumulator()) {
add_dep(last_accumulator_write, n);
for (unsigned j = 0; j < inst->regs_read(i); ++j)
add_dep(n, last_grf_write[inst->src[i].reg + j]);
} else if (inst->src[i].file == HW_REG &&
- (inst->src[i].fixed_hw_reg.file ==
+ (inst->src[i].brw_reg::file ==
BRW_GENERAL_REGISTER_FILE)) {
add_dep(n, last_fixed_grf_write);
} else if (inst->src[i].is_accumulator()) {
inst->src[i].file != IMM &&
inst->src[i].file != UNIFORM &&
(inst->src[i].file != HW_REG ||
- inst->src[i].fixed_hw_reg.file != BRW_IMMEDIATE_VALUE)) {
+ inst->src[i].brw_reg::file != BRW_IMMEDIATE_VALUE)) {
assert(inst->src[i].file != MRF &&
inst->src[i].file != ATTR);
add_barrier_deps(n);
} else if (inst->dst.file == MRF) {
last_mrf_write[inst->dst.reg] = n;
} else if (inst->dst.file == HW_REG &&
- inst->dst.fixed_hw_reg.file == BRW_GENERAL_REGISTER_FILE) {
+ inst->dst.brw_reg::file == BRW_GENERAL_REGISTER_FILE) {
last_fixed_grf_write = n;
} else if (inst->dst.is_accumulator()) {
last_accumulator_write = n;
backend_reg::is_null() const
{
return file == HW_REG &&
- fixed_hw_reg.file == BRW_ARCHITECTURE_REGISTER_FILE &&
- fixed_hw_reg.nr == BRW_ARF_NULL;
+ brw_reg::file == BRW_ARCHITECTURE_REGISTER_FILE &&
+ nr == BRW_ARF_NULL;
}
backend_reg::is_accumulator() const
{
return file == HW_REG &&
- fixed_hw_reg.file == BRW_ARCHITECTURE_REGISTER_FILE &&
- fixed_hw_reg.nr == BRW_ARF_ACCUMULATOR;
+ brw_reg::file == BRW_ARCHITECTURE_REGISTER_FILE &&
+ nr == BRW_ARF_ACCUMULATOR;
}
bool
#ifdef __cplusplus
struct backend_reg : public brw_reg
{
+ backend_reg() {}
+ backend_reg(struct brw_reg reg) : brw_reg(reg) {}
+
bool is_zero() const;
bool is_one() const;
bool is_negative_one() const;
* For uniforms, this is in units of 1 float.
*/
uint16_t reg_offset;
-
- struct brw_reg fixed_hw_reg;
};
#endif
(vf3 << 24);
}
-src_reg::src_reg(struct brw_reg reg)
+src_reg::src_reg(struct brw_reg reg) :
+ backend_reg(reg)
{
- init();
-
this->file = HW_REG;
- this->fixed_hw_reg = reg;
- this->type = reg.type;
+ this->reg = 0;
+ this->reg_offset = 0;
+ this->swizzle = BRW_SWIZZLE_XXXX;
+ this->reladdr = NULL;
}
-src_reg::src_reg(const dst_reg ®)
+src_reg::src_reg(const dst_reg ®) :
+ backend_reg(static_cast<struct brw_reg>(reg))
{
- init();
-
this->file = reg.file;
this->reg = reg.reg;
this->reg_offset = reg.reg_offset;
- this->type = reg.type;
this->reladdr = reg.reladdr;
- this->fixed_hw_reg = reg.fixed_hw_reg;
this->swizzle = brw_swizzle_for_mask(reg.writemask);
}
this->writemask = writemask;
}
-dst_reg::dst_reg(struct brw_reg reg)
+dst_reg::dst_reg(struct brw_reg reg) :
+ backend_reg(reg)
{
- init();
-
this->file = HW_REG;
- this->fixed_hw_reg = reg;
- this->type = reg.type;
+ this->reg = 0;
+ this->reg_offset = 0;
+ this->writemask = WRITEMASK_XYZW;
+ this->reladdr = NULL;
}
-dst_reg::dst_reg(const src_reg ®)
+dst_reg::dst_reg(const src_reg ®) :
+ backend_reg(static_cast<struct brw_reg>(reg))
{
- init();
-
this->file = reg.file;
this->reg = reg.reg;
this->reg_offset = reg.reg_offset;
- this->type = reg.type;
this->writemask = brw_mask_for_swizzle(reg.swizzle);
this->reladdr = reg.reladdr;
- this->fixed_hw_reg = reg.fixed_hw_reg;
}
bool
(reladdr == r.reladdr ||
(reladdr && r.reladdr && reladdr->equals(*r.reladdr))) &&
(file != HW_REG ||
- memcmp(&fixed_hw_reg, &r.fixed_hw_reg,
- sizeof(fixed_hw_reg)) == 0));
+ memcmp((brw_reg *)this, (brw_reg *)&r, sizeof(brw_reg)) == 0));
}
bool
swizzle == r.swizzle &&
!reladdr && !r.reladdr &&
(file != HW_REG ||
- memcmp(&fixed_hw_reg, &r.fixed_hw_reg,
- sizeof(fixed_hw_reg)) == 0) &&
+ memcmp((brw_reg *)this, (brw_reg *)&r, sizeof(brw_reg)) == 0) &&
(file != IMM || d == r.d));
}
last_mrf_write[reg] = inst;
mrf_channels_written[reg] |= inst->dst.writemask;
} else if (inst->dst.reg == HW_REG) {
- if (inst->dst.fixed_hw_reg.file == BRW_GENERAL_REGISTER_FILE)
+ if (inst->dst.brw_reg::file == BRW_GENERAL_REGISTER_FILE)
memset(last_grf_write, 0, sizeof(last_grf_write));
- if (inst->dst.fixed_hw_reg.file == BRW_MESSAGE_REGISTER_FILE)
+ if (inst->dst.brw_reg::file == BRW_MESSAGE_REGISTER_FILE)
memset(last_mrf_write, 0, sizeof(last_mrf_write));
}
}
fprintf(file, "m%d", inst->dst.reg);
break;
case HW_REG:
- if (inst->dst.fixed_hw_reg.file == BRW_ARCHITECTURE_REGISTER_FILE) {
- switch (inst->dst.fixed_hw_reg.nr) {
+ if (inst->dst.brw_reg::file == BRW_ARCHITECTURE_REGISTER_FILE) {
+ switch (inst->dst.nr) {
case BRW_ARF_NULL:
fprintf(file, "null");
break;
case BRW_ARF_ADDRESS:
- fprintf(file, "a0.%d", inst->dst.fixed_hw_reg.subnr);
+ fprintf(file, "a0.%d", inst->dst.subnr);
break;
case BRW_ARF_ACCUMULATOR:
- fprintf(file, "acc%d", inst->dst.fixed_hw_reg.subnr);
+ fprintf(file, "acc%d", inst->dst.subnr);
break;
case BRW_ARF_FLAG:
- fprintf(file, "f%d.%d", inst->dst.fixed_hw_reg.nr & 0xf,
- inst->dst.fixed_hw_reg.subnr);
+ fprintf(file, "f%d.%d", inst->dst.nr & 0xf,
+ inst->dst.subnr);
break;
default:
- fprintf(file, "arf%d.%d", inst->dst.fixed_hw_reg.nr & 0xf,
- inst->dst.fixed_hw_reg.subnr);
+ fprintf(file, "arf%d.%d", inst->dst.nr & 0xf,
+ inst->dst.subnr);
break;
}
} else {
- fprintf(file, "hw_reg%d", inst->dst.fixed_hw_reg.nr);
+ fprintf(file, "hw_reg%d", inst->dst.nr);
}
- if (inst->dst.fixed_hw_reg.subnr)
- fprintf(file, "+%d", inst->dst.fixed_hw_reg.subnr);
+ if (inst->dst.subnr)
+ fprintf(file, "+%d", inst->dst.subnr);
break;
case BAD_FILE:
fprintf(file, "(null)");
}
break;
case HW_REG:
- if (inst->src[i].fixed_hw_reg.negate)
- fprintf(file, "-");
- if (inst->src[i].fixed_hw_reg.abs)
- fprintf(file, "|");
- if (inst->src[i].fixed_hw_reg.file == BRW_ARCHITECTURE_REGISTER_FILE) {
- switch (inst->src[i].fixed_hw_reg.nr) {
+ if (inst->src[i].brw_reg::file == BRW_ARCHITECTURE_REGISTER_FILE) {
+ switch (inst->src[i].nr) {
case BRW_ARF_NULL:
fprintf(file, "null");
break;
case BRW_ARF_ADDRESS:
- fprintf(file, "a0.%d", inst->src[i].fixed_hw_reg.subnr);
+ fprintf(file, "a0.%d", inst->src[i].subnr);
break;
case BRW_ARF_ACCUMULATOR:
- fprintf(file, "acc%d", inst->src[i].fixed_hw_reg.subnr);
+ fprintf(file, "acc%d", inst->src[i].subnr);
break;
case BRW_ARF_FLAG:
- fprintf(file, "f%d.%d", inst->src[i].fixed_hw_reg.nr & 0xf,
- inst->src[i].fixed_hw_reg.subnr);
+ fprintf(file, "f%d.%d", inst->src[i].nr & 0xf,
+ inst->src[i].subnr);
break;
default:
- fprintf(file, "arf%d.%d", inst->src[i].fixed_hw_reg.nr & 0xf,
- inst->src[i].fixed_hw_reg.subnr);
+ fprintf(file, "arf%d.%d", inst->src[i].nr & 0xf,
+ inst->src[i].subnr);
break;
}
} else {
- fprintf(file, "hw_reg%d", inst->src[i].fixed_hw_reg.nr);
+ fprintf(file, "hw_reg%d", inst->src[i].nr);
}
- if (inst->src[i].fixed_hw_reg.subnr)
- fprintf(file, "+%d", inst->src[i].fixed_hw_reg.subnr);
- if (inst->src[i].fixed_hw_reg.abs)
- fprintf(file, "|");
+ if (inst->src[i].subnr)
+ fprintf(file, "+%d", inst->src[i].subnr);
break;
case BAD_FILE:
fprintf(file, "(null)");
reg.type = inst->dst.type;
reg.writemask = inst->dst.writemask;
- inst->dst.file = HW_REG;
- inst->dst.fixed_hw_reg = reg;
+ inst->dst = reg;
}
for (int i = 0; i < 3; i++) {
if (inst->src[i].negate)
reg = negate(reg);
- inst->src[i].file = HW_REG;
- inst->src[i].fixed_hw_reg = reg;
+ inst->src[i] = reg;
}
}
}
break;
case HW_REG:
- assert(src.type == src.fixed_hw_reg.type);
continue;
case BAD_FILE:
case ATTR:
unreachable("not reached");
}
- src.fixed_hw_reg = reg;
+ src = reg;
}
dst_reg &dst = inst->dst;
break;
case HW_REG:
- assert(dst.type == dst.fixed_hw_reg.type);
- reg = dst.fixed_hw_reg;
+ reg = dst;
break;
case BAD_FILE:
unreachable("not reached");
}
- dst.fixed_hw_reg = reg;
+ dst = reg;
}
}
/* We pass the temporary passed in src0 as the writeback register */
brw_urb_WRITE(p,
- inst->src[0].fixed_hw_reg, /* dest */
+ inst->src[0], /* dest */
inst->base_mrf, /* starting mrf reg nr */
src,
BRW_URB_WRITE_ALLOCATE_COMPLETE,
brw_push_insn_state(p);
brw_set_default_access_mode(p, BRW_ALIGN_1);
brw_set_default_mask_control(p, BRW_MASK_DISABLE);
- brw_MOV(p, get_element_ud(inst->dst.fixed_hw_reg, 0),
- get_element_ud(inst->src[0].fixed_hw_reg, 0));
+ brw_MOV(p, get_element_ud(inst->dst, 0),
+ get_element_ud(inst->src[0], 0));
brw_pop_insn_state(p);
}
annotate(p->devinfo, &annotation, cfg, inst, p->next_insn_offset);
for (unsigned int i = 0; i < 3; i++) {
- src[i] = inst->src[i].fixed_hw_reg;
+ src[i] = inst->src[i];
}
- dst = inst->dst.fixed_hw_reg;
+ dst = inst->dst;
brw_set_default_predicate_control(p, inst->predicate);
brw_set_default_predicate_inverse(p, inst->predicate_inverse);
break;
case BRW_OPCODE_IF:
- if (inst->src[0].file != BAD_FILE) {
+ if (!inst->src[0].is_null()) {
/* The instruction has an embedded compare (only allowed on gen6) */
assert(devinfo->gen == 6);
gen6_IF(p, inst->conditional_mod, src[0], src[1]);
* type to match src0 so we can compact the instruction.
*/
dst.type = src0.type;
- if (dst.file == HW_REG)
- dst.fixed_hw_reg.type = dst.type;
resolve_ud_negate(&src0);
resolve_ud_negate(&src1);