From 3e4d5ea7b8dda32ee6a8a2d23f6ab4f00f4334e7 Mon Sep 17 00:00:00 2001 From: Elie Tournier Date: Tue, 8 Aug 2017 14:28:48 +0100 Subject: [PATCH] glsl: Add utility function to extract 64-bit sign Reviewed-by: Kenneth Graunke --- src/compiler/glsl/float64.glsl | 7 +++++++ 1 file changed, 7 insertions(+) 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; +} -- 2.30.2