X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fintel%2Fcompiler%2Fbrw_reg_type.h;h=086770d2e035758734d81f4d66bf3439740ebddd;hb=2c4c9aba309ec40b00bc681bf75e20c9ae2f7cb0;hp=6fc57792b4b5e54674d64534b10258e97db5e5e0;hpb=4fab67a4415cbc577a8f94d4b5f7668bec6df5e1;p=mesa.git diff --git a/src/intel/compiler/brw_reg_type.h b/src/intel/compiler/brw_reg_type.h index 6fc57792b4b..086770d2e03 100644 --- a/src/intel/compiler/brw_reg_type.h +++ b/src/intel/compiler/brw_reg_type.h @@ -24,10 +24,18 @@ #ifndef BRW_REG_TYPE_H #define BRW_REG_TYPE_H +#include + #ifdef __cplusplus extern "C" { #endif +#ifdef HAVE_FUNC_ATTRIBUTE_PURE +#define ATTRIBUTE_PURE __attribute__((__pure__)) +#else +#define ATTRIBUTE_PURE +#endif + enum brw_reg_file; struct gen_device_info; @@ -37,6 +45,7 @@ struct gen_device_info; */ enum PACKED brw_reg_type { /** Floating-point types: @{ */ + BRW_REGISTER_TYPE_NF, BRW_REGISTER_TYPE_DF, BRW_REGISTER_TYPE_F, BRW_REGISTER_TYPE_HF, @@ -59,14 +68,62 @@ enum PACKED brw_reg_type { BRW_REGISTER_TYPE_LAST = BRW_REGISTER_TYPE_UV }; +static inline bool +brw_reg_type_is_floating_point(enum brw_reg_type type) +{ + switch (type) { + case BRW_REGISTER_TYPE_NF: + case BRW_REGISTER_TYPE_DF: + case BRW_REGISTER_TYPE_F: + case BRW_REGISTER_TYPE_HF: + return true; + default: + return false; + } +} + +static inline bool +brw_reg_type_is_integer(enum brw_reg_type type) +{ + switch (type) { + case BRW_REGISTER_TYPE_Q: + case BRW_REGISTER_TYPE_UQ: + case BRW_REGISTER_TYPE_D: + case BRW_REGISTER_TYPE_UD: + case BRW_REGISTER_TYPE_W: + case BRW_REGISTER_TYPE_UW: + case BRW_REGISTER_TYPE_B: + case BRW_REGISTER_TYPE_UB: + return true; + default: + return false; + } +} + unsigned brw_reg_type_to_hw_type(const struct gen_device_info *devinfo, enum brw_reg_file file, enum brw_reg_type type); -enum brw_reg_type +enum brw_reg_type ATTRIBUTE_PURE brw_hw_type_to_reg_type(const struct gen_device_info *devinfo, enum brw_reg_file file, unsigned hw_type); +unsigned +brw_reg_type_to_a16_hw_3src_type(const struct gen_device_info *devinfo, + enum brw_reg_type type); + +unsigned +brw_reg_type_to_a1_hw_3src_type(const struct gen_device_info *devinfo, + enum brw_reg_type type); + +enum brw_reg_type +brw_a16_hw_3src_type_to_reg_type(const struct gen_device_info *devinfo, + unsigned hw_type); + +enum brw_reg_type +brw_a1_hw_3src_type_to_reg_type(const struct gen_device_info *devinfo, + unsigned hw_type, unsigned exec_type); + unsigned brw_reg_type_to_size(enum brw_reg_type type);