nir/lower_amul: Add a variable mode check
[mesa.git] / src / compiler / glsl_types.h
index aa1a4cec324b842213b57532827075aa5cf49650..df5ca4629e5b1c266f97430c9f19036bc90e330e 100644 (file)
@@ -721,6 +721,14 @@ public:
       return glsl_base_type_is_integer(base_type);
    }
 
+   /**
+    * Query whether or not a type is a 16-bit integer.
+    */
+   bool is_integer_16() const
+   {
+      return base_type == GLSL_TYPE_UINT16 || base_type == GLSL_TYPE_INT16;
+   }
+
    /**
     * Query whether or not a type is an 32-bit integer.
     */
@@ -745,6 +753,22 @@ public:
       return is_integer_32() || is_integer_64();
    }
 
+   /**
+    * Query whether or not a type is a 16-bit or 32-bit integer
+    */
+   bool is_integer_16_32() const
+   {
+      return is_integer_16() || is_integer_32() || is_integer_64();
+   }
+
+   /**
+    * Query whether or not a type is a 16-bit, 32-bit or 64-bit integer
+    */
+   bool is_integer_16_32_64() const
+   {
+      return is_integer_16() || is_integer_32() || is_integer_64();
+   }
+
    /**
     * Query whether or not type is an integral type, or for struct and array
     * types, contains an integral type.
@@ -787,6 +811,40 @@ public:
       return base_type == GLSL_TYPE_FLOAT16 || is_float() || is_double();
    }
 
+   /**
+    * Query whether or not a type is a float or double
+    */
+   bool is_float_32_64() const
+   {
+      return is_float() || is_double();
+   }
+
+   bool is_int_16_32_64() const
+   {
+      return base_type == GLSL_TYPE_INT16 ||
+             base_type == GLSL_TYPE_INT ||
+             base_type == GLSL_TYPE_INT64;
+   }
+
+   bool is_uint_16_32_64() const
+   {
+      return base_type == GLSL_TYPE_UINT16 ||
+             base_type == GLSL_TYPE_UINT ||
+             base_type == GLSL_TYPE_UINT64;
+   }
+
+   bool is_int_16_32() const
+   {
+      return base_type == GLSL_TYPE_INT ||
+             base_type == GLSL_TYPE_INT16;
+   }
+
+   bool is_uint_16_32() const
+   {
+      return base_type == GLSL_TYPE_UINT ||
+             base_type == GLSL_TYPE_UINT16;
+   }
+
    /**
     * Query whether or not a type is a double type
     */