init();
this->file = IMM;
this->type = BRW_REGISTER_TYPE_F;
- this->imm.f = f;
+ this->fixed_hw_reg.dw1.f = f;
}
/** Immediate value constructor. */
init();
this->file = IMM;
this->type = BRW_REGISTER_TYPE_D;
- this->imm.i = i;
+ this->fixed_hw_reg.dw1.d = i;
}
/** Immediate value constructor. */
init();
this->file = IMM;
this->type = BRW_REGISTER_TYPE_UD;
- this->imm.u = u;
+ this->fixed_hw_reg.dw1.ud = u;
}
/** Fixed brw_reg. */
!reladdr && !r.reladdr &&
memcmp(&fixed_hw_reg, &r.fixed_hw_reg,
sizeof(fixed_hw_reg)) == 0 &&
- stride == r.stride &&
- imm.u == r.imm.u);
+ stride == r.stride);
}
fs_reg &
if (file != IMM)
return false;
- return type == BRW_REGISTER_TYPE_F ? imm.f == 0.0 : imm.i == 0;
+ return fixed_hw_reg.dw1.d == 0;
}
bool
if (file != IMM)
return false;
- return type == BRW_REGISTER_TYPE_F ? imm.f == 1.0 : imm.i == 1;
+ return type == BRW_REGISTER_TYPE_F
+ ? fixed_hw_reg.dw1.f == 1.0
+ : fixed_hw_reg.dw1.d == 1;
}
bool
case BRW_CONDITIONAL_L:
switch (inst->src[1].type) {
case BRW_REGISTER_TYPE_F:
- if (inst->src[1].imm.f >= 1.0f) {
+ if (inst->src[1].fixed_hw_reg.dw1.f >= 1.0f) {
inst->opcode = BRW_OPCODE_MOV;
inst->src[1] = reg_undef;
progress = true;
case BRW_CONDITIONAL_G:
switch (inst->src[1].type) {
case BRW_REGISTER_TYPE_F:
- if (inst->src[1].imm.f <= 0.0f) {
+ if (inst->src[1].fixed_hw_reg.dw1.f <= 0.0f) {
inst->opcode = BRW_OPCODE_MOV;
inst->src[1] = reg_undef;
inst->conditional_mod = BRW_CONDITIONAL_NONE;
fs_reg const_offset_reg = inst->src[1];
assert(const_offset_reg.file == IMM &&
const_offset_reg.type == BRW_REGISTER_TYPE_UD);
- const_offset_reg.imm.u /= 4;
+ const_offset_reg.fixed_hw_reg.dw1.ud /= 4;
fs_reg payload = fs_reg(this, glsl_type::uint_type);
/* This is actually going to be a MOV, but since only the first dword
case IMM:
switch (inst->src[i].type) {
case BRW_REGISTER_TYPE_F:
- fprintf(file, "%ff", inst->src[i].imm.f);
+ fprintf(file, "%ff", inst->src[i].fixed_hw_reg.dw1.f);
break;
case BRW_REGISTER_TYPE_D:
- fprintf(file, "%dd", inst->src[i].imm.i);
+ fprintf(file, "%dd", inst->src[i].fixed_hw_reg.dw1.d);
break;
case BRW_REGISTER_TYPE_UD:
- fprintf(file, "%uu", inst->src[i].imm.u);
+ fprintf(file, "%uu", inst->src[i].fixed_hw_reg.dw1.ud);
break;
default:
fprintf(file, "???");
* anyway.
*/
assert(i == 0);
- if (inst->src[0].imm.f != 0.0f) {
+ if (inst->src[0].fixed_hw_reg.dw1.f != 0.0f) {
inst->opcode = BRW_OPCODE_MOV;
inst->src[0] = entry->src;
- inst->src[0].imm.f = 1.0f / inst->src[0].imm.f;
+ inst->src[0].fixed_hw_reg.dw1.f = 1.0f / inst->src[0].fixed_hw_reg.dw1.f;
progress = true;
}
break;
case IMM:
switch (reg->type) {
case BRW_REGISTER_TYPE_F:
- brw_reg = brw_imm_f(reg->imm.f);
+ brw_reg = brw_imm_f(reg->fixed_hw_reg.dw1.f);
break;
case BRW_REGISTER_TYPE_D:
- brw_reg = brw_imm_d(reg->imm.i);
+ brw_reg = brw_imm_d(reg->fixed_hw_reg.dw1.d);
break;
case BRW_REGISTER_TYPE_UD:
- brw_reg = brw_imm_ud(reg->imm.u);
+ brw_reg = brw_imm_ud(reg->fixed_hw_reg.dw1.ud);
break;
default:
unreachable("not reached");
this->file = IMM;
this->type = BRW_REGISTER_TYPE_F;
- this->imm.f = f;
+ this->fixed_hw_reg.dw1.f = f;
}
src_reg::src_reg(uint32_t u)
this->file = IMM;
this->type = BRW_REGISTER_TYPE_UD;
- this->imm.u = u;
+ this->fixed_hw_reg.dw1.ud = u;
}
src_reg::src_reg(int32_t i)
this->file = IMM;
this->type = BRW_REGISTER_TYPE_D;
- this->imm.i = i;
+ this->fixed_hw_reg.dw1.d = i;
}
src_reg::src_reg(struct brw_reg reg)
swizzle == r.swizzle &&
!reladdr && !r.reladdr &&
memcmp(&fixed_hw_reg, &r.fixed_hw_reg,
- sizeof(fixed_hw_reg)) == 0 &&
- imm.u == r.imm.u);
+ sizeof(fixed_hw_reg)) == 0);
}
static bool
if (file != IMM)
return false;
- if (type == BRW_REGISTER_TYPE_F) {
- return imm.f == 0.0;
- } else {
- return imm.i == 0;
- }
+ return fixed_hw_reg.dw1.d == 0;
}
bool
return false;
if (type == BRW_REGISTER_TYPE_F) {
- return imm.f == 1.0;
+ return fixed_hw_reg.dw1.f == 1.0;
} else {
- return imm.i == 1;
+ return fixed_hw_reg.dw1.d == 1;
}
}
case IMM:
switch (inst->src[i].type) {
case BRW_REGISTER_TYPE_F:
- fprintf(file, "%fF", inst->src[i].imm.f);
+ fprintf(file, "%fF", inst->src[i].fixed_hw_reg.dw1.f);
break;
case BRW_REGISTER_TYPE_D:
- fprintf(file, "%dD", inst->src[i].imm.i);
+ fprintf(file, "%dD", inst->src[i].fixed_hw_reg.dw1.d);
break;
case BRW_REGISTER_TYPE_UD:
- fprintf(file, "%uU", inst->src[i].imm.u);
+ fprintf(file, "%uU", inst->src[i].fixed_hw_reg.dw1.ud);
break;
default:
fprintf(file, "???");
if (inst->src[arg].abs) {
if (value.type == BRW_REGISTER_TYPE_F) {
- value.imm.f = fabs(value.imm.f);
+ value.fixed_hw_reg.dw1.f = fabs(value.fixed_hw_reg.dw1.f);
} else if (value.type == BRW_REGISTER_TYPE_D) {
- if (value.imm.i < 0)
- value.imm.i = -value.imm.i;
+ if (value.fixed_hw_reg.dw1.d < 0)
+ value.fixed_hw_reg.dw1.d = -value.fixed_hw_reg.dw1.d;
}
}
if (inst->src[arg].negate) {
if (value.type == BRW_REGISTER_TYPE_F)
- value.imm.f = -value.imm.f;
+ value.fixed_hw_reg.dw1.f = -value.fixed_hw_reg.dw1.f;
else
- value.imm.u = -value.imm.u;
+ value.fixed_hw_reg.dw1.ud = -value.fixed_hw_reg.dw1.ud;
}
switch (inst->opcode) {
case IMM:
switch (src[i].type) {
case BRW_REGISTER_TYPE_F:
- brw_reg = brw_imm_f(src[i].imm.f);
+ brw_reg = brw_imm_f(src[i].fixed_hw_reg.dw1.f);
break;
case BRW_REGISTER_TYPE_D:
- brw_reg = brw_imm_d(src[i].imm.i);
+ brw_reg = brw_imm_d(src[i].fixed_hw_reg.dw1.d);
break;
case BRW_REGISTER_TYPE_UD:
- brw_reg = brw_imm_ud(src[i].imm.u);
+ brw_reg = brw_imm_ud(src[i].fixed_hw_reg.dw1.ud);
break;
default:
unreachable("not reached");