Browse Source

s390x: add single instruction fma and fmaf

These are available in the s390x baseline isa -march=z900.
master
Szabolcs Nagy 8 years ago
committed by Rich Felker
parent
commit
1da534ada8
  1. 7
      src/math/s390x/fma.c
  2. 7
      src/math/s390x/fmaf.c

7
src/math/s390x/fma.c

@ -0,0 +1,7 @@
#include <math.h>
double fma(double x, double y, double z)
{
__asm__ ("madbr %0, %1, %2" : "+f"(z) : "f"(x), "f"(y));
return z;
}

7
src/math/s390x/fmaf.c

@ -0,0 +1,7 @@
#include <math.h>
float fmaf(float x, float y, float z)
{
__asm__ ("maebr %0, %1, %2" : "+f"(z) : "f"(x), "f"(y));
return z;
}
Loading…
Cancel
Save