enum brw_reg_type type, unsigned imm)
{
if (devinfo->gen >= 12) {
+ /* 16-bit immediates need to be replicated through the 32-bit immediate
+ * field
+ */
+ switch (type) {
+ case BRW_REGISTER_TYPE_W:
+ case BRW_REGISTER_TYPE_UW:
+ case BRW_REGISTER_TYPE_HF:
+ if ((imm >> 16) != (imm & 0xffff))
+ return -1;
+ break;
+ default:
+ break;
+ }
+
switch (type) {
case BRW_REGISTER_TYPE_F:
/* We get the high 12-bits as-is; rest must be zero */
case BRW_REGISTER_TYPE_UQ:
case BRW_REGISTER_TYPE_B:
case BRW_REGISTER_TYPE_UB:
- unreachable("not reached");
+ return -1;
}
} else {
/* We get the low 12 bits as-is; 13th is replicated */