nir/algebraic: Simplify fsat of fsign
[mesa.git] / src / compiler / glsl_types.h
index efc6324865620a6a9bbfb89033754b5abdce67bc..d32b580acc1e5c7035885860b363b4ff8527381c 100644 (file)
@@ -87,6 +87,13 @@ enum glsl_base_type {
    GLSL_TYPE_ERROR
 };
 
+static inline bool glsl_base_type_is_16bit(enum glsl_base_type type)
+{
+   return type == GLSL_TYPE_FLOAT16 ||
+          type == GLSL_TYPE_UINT16 ||
+          type == GLSL_TYPE_INT16;
+}
+
 static inline bool glsl_base_type_is_64bit(enum glsl_base_type type)
 {
    return type == GLSL_TYPE_DOUBLE ||
@@ -551,6 +558,14 @@ public:
       return glsl_base_type_is_64bit(base_type);
    }
 
+   /**
+    * Query whether or not a type is 16-bit
+    */
+   bool is_16bit() const
+   {
+      return glsl_base_type_is_16bit(base_type);
+   }
+
    /**
     * Query whether or not a type is a non-array boolean type
     */