2 * Copyright © 2017 Intel Corporation
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24 #ifndef BRW_REG_TYPE_H
25 #define BRW_REG_TYPE_H
33 #ifdef HAVE_FUNC_ATTRIBUTE_PURE
34 #define ATTRIBUTE_PURE __attribute__((__pure__))
36 #define ATTRIBUTE_PURE
40 struct gen_device_info
;
43 * The ordering has been chosen so that no enum value is the same as a
44 * compatible hardware encoding.
46 enum PACKED brw_reg_type
{
47 /** Floating-point types: @{ */
55 /** Integer types: @{ */
68 BRW_REGISTER_TYPE_LAST
= BRW_REGISTER_TYPE_UV
72 brw_reg_type_is_floating_point(enum brw_reg_type type
)
75 case BRW_REGISTER_TYPE_NF
:
76 case BRW_REGISTER_TYPE_DF
:
77 case BRW_REGISTER_TYPE_F
:
78 case BRW_REGISTER_TYPE_HF
:
86 brw_reg_type_to_hw_type(const struct gen_device_info
*devinfo
,
87 enum brw_reg_file file
, enum brw_reg_type type
);
89 enum brw_reg_type ATTRIBUTE_PURE
90 brw_hw_type_to_reg_type(const struct gen_device_info
*devinfo
,
91 enum brw_reg_file file
, unsigned hw_type
);
94 brw_reg_type_to_a16_hw_3src_type(const struct gen_device_info
*devinfo
,
95 enum brw_reg_type type
);
98 brw_reg_type_to_a1_hw_3src_type(const struct gen_device_info
*devinfo
,
99 enum brw_reg_type type
);
102 brw_a16_hw_3src_type_to_reg_type(const struct gen_device_info
*devinfo
,
106 brw_a1_hw_3src_type_to_reg_type(const struct gen_device_info
*devinfo
,
107 unsigned hw_type
, unsigned exec_type
);
110 brw_reg_type_to_size(enum brw_reg_type type
);
113 brw_reg_type_to_letters(enum brw_reg_type type
);