Since the enum brw_reg_type is packed, comparisons with -1 don't work
directly, necessitating the cast. Add a macro to avoid this confusion.
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2635>
{
if (brw_inst_src0_reg_file(devinfo, inst) == BRW_IMMEDIATE_VALUE) {
*type = brw_inst_src0_type(devinfo, inst);
- return *type != (enum brw_reg_type)-1;
+ return *type != INVALID_REG_TYPE;
} else if (brw_inst_src1_reg_file(devinfo, inst) == BRW_IMMEDIATE_VALUE) {
*type = brw_inst_src1_type(devinfo, inst);
- return *type != (enum brw_reg_type)-1;
+ return *type != INVALID_REG_TYPE;
}
return false;
}
}
}
- return (enum brw_reg_type)-1;
+ return INVALID_REG_TYPE;
}
/**
return i;
}
}
- return (enum brw_reg_type)-1;
+ return INVALID_REG_TYPE;
}
/**
return i;
}
}
- return (enum brw_reg_type)-1;
+ return INVALID_REG_TYPE;
}
/**
}
}
+#define INVALID_REG_TYPE ((enum brw_reg_type)-1)
+#define INVALID_HW_REG_TYPE ((unsigned)-1)
+
unsigned
brw_reg_type_to_hw_type(const struct gen_device_info *devinfo,
enum brw_reg_file file, enum brw_reg_type type);