From: Elie Tournier Date: Tue, 8 Aug 2017 13:28:48 +0000 (+0100) Subject: glsl: Add utility function to extract 64-bit sign X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3e4d5ea7b8dda32ee6a8a2d23f6ab4f00f4334e7;p=mesa.git glsl: Add utility function to extract 64-bit sign Reviewed-by: Kenneth Graunke --- diff --git a/src/compiler/glsl/float64.glsl b/src/compiler/glsl/float64.glsl index 2cf85bbcafc..5f2804a8a34 100644 --- a/src/compiler/glsl/float64.glsl +++ b/src/compiler/glsl/float64.glsl @@ -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; +}