s390x: add single instruction fma and fmaf

These are available in the s390x baseline isa -march=z900.
This commit is contained in:
Szabolcs Nagy authored and Rich Felker committed 2018-10-15 14:41:43 -04:00
1 parent 481006fd88
commit 1da534ada8
2 files changed
+14

No files matched your search

+7
View File
@@ -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
View File
@@ -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;
}