glsl: Add "built-in" function for 64-bit integer sign()
[mesa.git] / src / compiler / glsl / int64.glsl
index f5fb01013c76512c426e47bd4f31b547239df0f1..a2bec011e3e0771fd08afe11dc4a7999cf964342 100644 (file)
@@ -17,3 +17,14 @@ umul64(uvec2 a, uvec2 b)
 
    return result;
 }
+
+ivec2
+sign64(ivec2 a)
+{
+   ivec2 result;
+
+   result.y = a.y >> 31;
+   result.x = result.y | int((a.x | a.y) != 0);
+
+   return result;
+}