return false;
if (inst->src[arg].abs) {
- if (value.type == BRW_REGISTER_TYPE_F) {
- value.fixed_hw_reg.dw1.f = fabs(value.fixed_hw_reg.dw1.f);
- } else if (value.type == BRW_REGISTER_TYPE_VF) {
- value.fixed_hw_reg.dw1.ud &= ~0x80808080;
- } else if (value.type == BRW_REGISTER_TYPE_D) {
- if (value.fixed_hw_reg.dw1.d < 0)
- value.fixed_hw_reg.dw1.d = -value.fixed_hw_reg.dw1.d;
+ if (!brw_abs_immediate(value.type, &value.fixed_hw_reg)) {
+ return false;
}
}
if (inst->src[arg].negate) {
- if (value.type == BRW_REGISTER_TYPE_F)
- value.fixed_hw_reg.dw1.f = -value.fixed_hw_reg.dw1.f;
- else if (value.type == BRW_REGISTER_TYPE_VF)
- value.fixed_hw_reg.dw1.ud ^= 0x80808080;
- else
- value.fixed_hw_reg.dw1.ud = -value.fixed_hw_reg.dw1.ud;
+ if (!brw_negate_immediate(value.type, &value.fixed_hw_reg)) {
+ return false;
+ }
}
if (value.type == BRW_REGISTER_TYPE_VF)