mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-10 08:10:14 +01:00
glsl: Add "built-in" function to do abs(fp64)
Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
This commit is contained in:
parent
b63a1f8e40
commit
0428951b9d
1 changed files with 11 additions and 0 deletions
|
|
@ -56,3 +56,14 @@
|
|||
#define FLOAT_ROUND_DOWN 2
|
||||
#define FLOAT_ROUND_UP 3
|
||||
#define FLOAT_ROUNDING_MODE FLOAT_ROUND_NEAREST_EVEN
|
||||
|
||||
/* Absolute value of a Float64 :
|
||||
* Clear the sign bit
|
||||
*/
|
||||
uint64_t
|
||||
__fabs64(uint64_t __a)
|
||||
{
|
||||
uvec2 a = unpackUint2x32(__a);
|
||||
a.y &= 0x7FFFFFFFu;
|
||||
return packUint2x32(a);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue