فهرست منبع

s390x: add single instruction fma and fmaf

These are available in the s390x baseline isa -march=z900.
Szabolcs Nagy 6 سال پیش
والد
کامیت
1da534ada8
2فایلهای تغییر یافته به همراه14 افزوده شده و 0 حذف شده
  1. 7 0
      src/math/s390x/fma.c
  2. 7 0
      src/math/s390x/fmaf.c

+ 7 - 0
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 - 0
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;
+}