nir: Add a nir_op_is_vec helper
authorJason Ekstrand <jason@jlekstrand.net>
Mon, 30 Mar 2020 17:06:22 +0000 (12:06 -0500)
committerMarge Bot <eric+marge@anholt.net>
Tue, 31 Mar 2020 00:18:05 +0000 (00:18 +0000)
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4365>

src/compiler/nir/nir.h

index 6a1a8e175df410b97e83fc1cba58ba53c3da93d1..5d29b2f64cc815bf3bc5dd521c8955c1b034c700 100644 (file)
@@ -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)
 {