glsl: Add "built-in" functions to do ffma(fp64)
authorMatt Turner <mattst88@gmail.com>
Wed, 31 Oct 2018 04:48:01 +0000 (21:48 -0700)
committerMatt Turner <mattst88@gmail.com>
Thu, 10 Jan 2019 00:42:40 +0000 (16:42 -0800)
Definitely not actually a fused-multiply add.

Reviewed-by: Elie Tournier <tournier.elie@gmail.com>
src/compiler/glsl/float64.glsl

index e09655e50557924d57ae0a520769f1352beba03c..1a434b1fd596262d8bf19ef7476246b149ee2ba1 100644 (file)
@@ -798,6 +798,12 @@ __fmul64(uint64_t a, uint64_t b)
    return __roundAndPackFloat64(zSign, zExp, zFrac0, zFrac1, zFrac2);
 }
 
+uint64_t
+__ffma64(uint64_t a, uint64_t b, uint64_t c)
+{
+   return __fadd64(__fmul64(a, b), c);
+}
+
 /* Shifts the 64-bit value formed by concatenating `a0' and `a1' right by the
  * number of bits given in `count'.  Any bits shifted off are lost.  The value
  * of `count' can be arbitrarily large; in particular, if `count' is greater