/* Calculate the maximum execution size of the instruction based on the
* factor by which it goes over the hardware limit of 2 GRFs.
*/
- if (reg_count > 2)
- max_width = MIN2(max_width, inst->exec_size / DIV_ROUND_UP(reg_count, 2));
+ const unsigned max_reg_count = 2 * reg_unit(devinfo);
+ if (reg_count > max_reg_count)
+ max_width = MIN2(max_width, inst->exec_size / DIV_ROUND_UP(reg_count, max_reg_count));
/* According to the IVB PRMs:
* "When destination spans two registers, the source MUST span two
* From the BDW PRMs (applies to later hardware too):
* "Ternary instruction with condition modifiers must not use SIMD32."
*/
- if (inst->conditional_mod && (devinfo->ver < 8 || inst->is_3src(compiler)))
+ if (inst->conditional_mod && (devinfo->ver < 8 ||
+ (inst->is_3src(compiler) && devinfo->ver < 12)))
max_width = MIN2(max_width, 16);
/* From the IVB PRMs (applies to other devices that don't have the
* instructions do not support HF types and conversions from/to F are
* required.
*/
- if (is_mixed_float_with_fp32_dst(inst))
+ if (is_mixed_float_with_fp32_dst(inst) && devinfo->ver < 20)
max_width = MIN2(max_width, 8);
/* From the SKL PRM, Special Restrictions for Handling Mixed Mode
* "No SIMD16 in mixed mode when destination is packed f16 for both
* Align1 and Align16."
*/
- if (is_mixed_float_with_packed_fp16_dst(inst))
+ if (is_mixed_float_with_packed_fp16_dst(inst) && devinfo->ver < 20)
max_width = MIN2(max_width, 8);
/* Only power-of-two execution sizes are representable in the instruction