From 79af2563889098550de5d4a0955efbeb87a24565 Mon Sep 17 00:00:00 2001 From: "Juan A. Suarez Romero" Date: Mon, 18 Jul 2016 07:17:39 +0000 Subject: i965/fs: add helper to retrieve instruction execution type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The execution data size is the biggest type size of any instruction operand. We will use it to know if the instruction deals with DF, because in Ivy we need to double the execution size and regioning parameters. v2: - Fix typo in commit log (Matt) - Use static inline function instead of fs_inst's method (Curro). - Define the result as a constant (Curro). - Fix indentation (Matt). - Add braces to nested control flow (Matt). v3 (Curro): - Add get_exec_type() and other auxiliary functions and use them to calculate its size. Signed-off-by: Samuel Iglesias Gonsálvez [ Francisco Jerez: Fix bogus 'type != BAD_FILE' check. Fix deduced execution type for integer vector types. Take destination type as execution type where there is no valid source. Assert-fail if the deduced execution type is byte. Move into brw_ir_fs.h header for consistency with the VEC4 back-end. ] Reviewed-by: Francisco Jerez --- src/intel/compiler/brw_reg.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/intel/compiler/brw_reg.h') diff --git a/src/intel/compiler/brw_reg.h b/src/intel/compiler/brw_reg.h index f8c3340e452..17a51fbd655 100644 --- a/src/intel/compiler/brw_reg.h +++ b/src/intel/compiler/brw_reg.h @@ -325,6 +325,36 @@ type_sz(unsigned type) } } +static inline bool +brw_reg_type_is_floating_point(enum brw_reg_type type) +{ + switch (type) { + case BRW_REGISTER_TYPE_F: + case BRW_REGISTER_TYPE_HF: + case BRW_REGISTER_TYPE_DF: + return true; + default: + return false; + } +} + +static inline enum brw_reg_type +get_exec_type(const enum brw_reg_type type) +{ + switch (type) { + case BRW_REGISTER_TYPE_B: + case BRW_REGISTER_TYPE_V: + return BRW_REGISTER_TYPE_W; + case BRW_REGISTER_TYPE_UB: + case BRW_REGISTER_TYPE_UV: + return BRW_REGISTER_TYPE_UW; + case BRW_REGISTER_TYPE_VF: + return BRW_REGISTER_TYPE_F; + default: + return type; + } +} + /** * Return an integer type of the requested size and signedness. */ -- cgit v1.2.3