From 842338e2f0bdf2b7025f2d29851aa90dd2106777 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Mon, 30 Mar 2020 12:06:22 -0500 Subject: [PATCH] nir: Add a nir_op_is_vec helper Reviewed-by: Alyssa Rosenzweig Reviewed-by: Ian Romanick Part-of: --- src/compiler/nir/nir.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 6a1a8e175df..5d29b2f64cc 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -1054,6 +1054,22 @@ nir_op_vec(unsigned components) } } +static inline bool +nir_op_is_vec(nir_op op) +{ + switch (op) { + case nir_op_mov: + case nir_op_vec2: + case nir_op_vec3: + case nir_op_vec4: + case nir_op_vec8: + case nir_op_vec16: + return true; + default: + return false; + } +} + static inline bool nir_is_float_control_signed_zero_inf_nan_preserve(unsigned execution_mode, unsigned bit_size) { -- 2.30.2