glsl: Add "built-in" functions to do ffract(fp64)
authorMatt Turner <mattst88@gmail.com>
Fri, 9 Nov 2018 06:05:56 +0000 (22:05 -0800)
committerMatt Turner <mattst88@gmail.com>
Thu, 10 Jan 2019 00:42:40 +0000 (16:42 -0800)
Reviewed-by: Elie Tournier <tournier.elie@gmail.com>
src/compiler/glsl/float64.glsl

index c54835fbf78e4b7d8b1df50c050887ac672886a1..7d12da50ac0162ab13e7c2a541c04d8f5d4848c8 100644 (file)
@@ -1458,3 +1458,9 @@ __fmax64(uint64_t a, uint64_t b)
    if (__flt64_nonnan(a, b)) return b;
    return a;
 }
+
+uint64_t
+__ffract64(uint64_t a)
+{
+   return __fadd64(a, __fneg64(__ffloor64(a)));
+}