mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
intel/brw: Rename brw_reg_type_to_hw_type to brw_type_encode
And similarly brw_hw_type_to_reg_type to brw_type_decode. Reviewed-by: Caio Oliveira <caio.oliveira@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28847>
This commit is contained in:
parent
9205f6ff51
commit
df6cfb4dd0
4 changed files with 11 additions and 12 deletions
|
|
@ -994,7 +994,7 @@ brw_inst_set_##reg##_file_type(const struct intel_device_info *devinfo, \
|
|||
enum brw_reg_type type) \
|
||||
{ \
|
||||
assert(file <= BRW_IMMEDIATE_VALUE); \
|
||||
unsigned hw_type = brw_reg_type_to_hw_type(devinfo, file, type); \
|
||||
unsigned hw_type = brw_type_encode(devinfo, file, type); \
|
||||
brw_inst_set_##reg##_reg_file(devinfo, inst, file); \
|
||||
brw_inst_set_##reg##_reg_hw_type(devinfo, inst, hw_type); \
|
||||
} \
|
||||
|
|
@ -1007,7 +1007,7 @@ brw_inst_##reg##_type(const struct intel_device_info *devinfo, \
|
|||
(unsigned) BRW_GENERAL_REGISTER_FILE : \
|
||||
brw_inst_##reg##_reg_file(devinfo, inst); \
|
||||
unsigned hw_type = brw_inst_##reg##_reg_hw_type(devinfo, inst); \
|
||||
return brw_hw_type_to_reg_type(devinfo, (enum brw_reg_file)file, hw_type); \
|
||||
return brw_type_decode(devinfo, (enum brw_reg_file)file, hw_type); \
|
||||
}
|
||||
|
||||
REG_TYPE(dst)
|
||||
|
|
|
|||
|
|
@ -31,9 +31,8 @@
|
|||
* The hardware encoding may depend on whether the value is an immediate.
|
||||
*/
|
||||
unsigned
|
||||
brw_reg_type_to_hw_type(const struct intel_device_info *devinfo,
|
||||
enum brw_reg_file file,
|
||||
enum brw_reg_type type)
|
||||
brw_type_encode(const struct intel_device_info *devinfo,
|
||||
enum brw_reg_file file, enum brw_reg_type type)
|
||||
{
|
||||
assert(file != IMM ||
|
||||
brw_type_is_vector_imm(type) ||
|
||||
|
|
@ -108,8 +107,8 @@ brw_reg_type_to_hw_type(const struct intel_device_info *devinfo,
|
|||
* The hardware encoding may depend on whether the value is an immediate.
|
||||
*/
|
||||
enum brw_reg_type
|
||||
brw_hw_type_to_reg_type(const struct intel_device_info *devinfo,
|
||||
enum brw_reg_file file, unsigned hw_type)
|
||||
brw_type_decode(const struct intel_device_info *devinfo,
|
||||
enum brw_reg_file file, unsigned hw_type)
|
||||
{
|
||||
if (hw_type >= (1 << 4))
|
||||
return BRW_TYPE_INVALID;
|
||||
|
|
|
|||
|
|
@ -154,12 +154,12 @@ brw_type_with_size(enum brw_reg_type ref_type, unsigned bit_size)
|
|||
/* -------------------------------------------------------------- */
|
||||
|
||||
unsigned
|
||||
brw_reg_type_to_hw_type(const struct intel_device_info *devinfo,
|
||||
enum brw_reg_file file, enum brw_reg_type type);
|
||||
brw_type_encode(const struct intel_device_info *devinfo,
|
||||
enum brw_reg_file file, enum brw_reg_type type);
|
||||
|
||||
enum brw_reg_type ATTRIBUTE_PURE
|
||||
brw_hw_type_to_reg_type(const struct intel_device_info *devinfo,
|
||||
enum brw_reg_file file, unsigned hw_type);
|
||||
brw_type_decode(const struct intel_device_info *devinfo,
|
||||
enum brw_reg_file file, unsigned hw_type);
|
||||
|
||||
unsigned
|
||||
brw_type_encode_for_3src(const struct intel_device_info *devinfo,
|
||||
|
|
|
|||
|
|
@ -267,7 +267,7 @@ TEST_P(validation_test, invalid_type_encoding)
|
|||
|
||||
for (unsigned i = 0; i < ARRAY_SIZE(test_case); i++) {
|
||||
if (test_case[i].expected_result) {
|
||||
unsigned hw_type = brw_reg_type_to_hw_type(&devinfo, file, test_case[i].type);
|
||||
unsigned hw_type = brw_type_encode(&devinfo, file, test_case[i].type);
|
||||
if (hw_type != INVALID_HW_REG_TYPE) {
|
||||
/* ... and remove valid encodings from the set */
|
||||
assert(BITSET_TEST(invalid_encodings, hw_type));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue