glsl: Add utility function to extract 64-bit sign

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Elie Tournier
2017-08-08 14:28:48 +01:00
committed by Matt Turner
parent ec6e823a99
commit 3e4d5ea7b8

View 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;
}