intel/compiler: INT DIV function does not support source modifiers

BSpec says that for all generations.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5281
CC: mesa-stable

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12518>
This commit is contained in:
Marcin Ślusarz
2021-08-24 10:50:42 +02:00
committed by Marge Bot
parent 346eb08a3d
commit e0533ebf16
3 changed files with 32 additions and 0 deletions

View File

@@ -2025,6 +2025,29 @@ instruction_restrictions(const struct intel_device_info *devinfo,
}
}
if (brw_inst_opcode(devinfo, inst) == BRW_OPCODE_MATH) {
unsigned math_function = brw_inst_math_function(devinfo, inst);
switch (math_function) {
case BRW_MATH_FUNCTION_INT_DIV_QUOTIENT_AND_REMAINDER:
case BRW_MATH_FUNCTION_INT_DIV_QUOTIENT:
case BRW_MATH_FUNCTION_INT_DIV_REMAINDER: {
/* Page 442 of the Broadwell PRM Volume 2a "Extended Math Function" says:
* INT DIV function does not support source modifiers.
* Bspec 6647 extends it back to Ivy Bridge.
*/
bool src0_valid = !brw_inst_src0_negate(devinfo, inst) &&
!brw_inst_src0_abs(devinfo, inst);
bool src1_valid = !brw_inst_src1_negate(devinfo, inst) &&
!brw_inst_src1_abs(devinfo, inst);
ERROR_IF(!src0_valid || !src1_valid,
"INT DIV function does not support source modifiers.");
break;
}
default:
break;
}
}
if (brw_inst_opcode(devinfo, inst) == BRW_OPCODE_DP4A) {
/* Page 396 (page 412 of the PDF) of the DG1 PRM volume 2a says:
*