glsl: Add utility function to extract 64-bit sign
authorElie Tournier <tournier.elie@gmail.com>
Tue, 8 Aug 2017 13:28:48 +0000 (14:28 +0100)
committerMatt Turner <mattst88@gmail.com>
Thu, 10 Jan 2019 00:42:40 +0000 (16:42 -0800)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/compiler/glsl/float64.glsl

index 2cf85bbcafccaec6f66701b338e4ab75d535dea3..5f2804a8a34c8a4b80ff1e459a0f7d28c494eb8f 100644 (file)
@@ -159,3 +159,10 @@ __fne64(uint64_t a, uint64_t b)
 
    return !__feq64_nonnan(a, b);
 }
+
+/* Returns the sign bit of the double-precision floating-point value `a'.*/
+uint
+__extractFloat64Sign(uint64_t a)
+{
+   return unpackUint2x32(a).y >> 31;
+}