--- /dev/null
+#include <math.h>
+
+#ifdef _ARCH_PWR5X
+
+double ceil(double x)
+{
+ __asm__ ("frip %0, %1" : "=d"(x) : "d"(x));
+ return x;
+}
+
+#else
+
+#include "../ceil.c"
+
+#endif
--- /dev/null
+#include <math.h>
+
+#ifdef _ARCH_PWR5X
+
+float ceilf(float x)
+{
+ __asm__ ("frip %0, %1" : "=f"(x) : "f"(x));
+ return x;
+}
+
+#else
+
+#include "../ceilf.c"
+
+#endif
--- /dev/null
+#include <math.h>
+
+double fabs(double x)
+{
+ __asm__ ("fabs %0, %1" : "=d"(x) : "d"(x));
+ return x;
+}
--- /dev/null
+#include <math.h>
+
+float fabsf(float x)
+{
+ __asm__ ("fabs %0, %1" : "=f"(x) : "f"(x));
+ return x;
+}
--- /dev/null
+#include <math.h>
+
+#ifdef _ARCH_PWR5X
+
+double floor(double x)
+{
+ __asm__ ("frim %0, %1" : "=d"(x) : "d"(x));
+ return x;
+}
+
+#else
+
+#include "../floor.c"
+
+#endif
--- /dev/null
+#include <math.h>
+
+#ifdef _ARCH_PWR5X
+
+float floorf(float x)
+{
+ __asm__ ("frim %0, %1" : "=f"(x) : "f"(x));
+ return x;
+}
+
+#else
+
+#include "../floorf.c"
+
+#endif
--- /dev/null
+#include <math.h>
+
+double fma(double x, double y, double z)
+{
+ __asm__ ("fmadd %0, %1, %2, %3" : "=d"(x) : "d"(x), "d"(y), "d"(z));
+ return x;
+}
--- /dev/null
+#include <math.h>
+
+float fmaf(float x, float y, float z)
+{
+ __asm__ ("fmadds %0, %1, %2, %3" : "=f"(x) : "f"(x), "f"(y), "f"(z));
+ return x;
+}
--- /dev/null
+#include <math.h>
+
+#ifdef __VSX__
+
+double fmax(double x, double y)
+{
+ __asm__ ("xsmaxdp %x0, %x1, %x2" : "=ws"(x) : "ws"(x), "ws"(y));
+ return x;
+}
+
+#else
+
+#include "../fmax.c"
+
+#endif
--- /dev/null
+#include <math.h>
+
+#ifdef __VSX__
+
+float fmaxf(float x, float y)
+{
+ __asm__ ("xsmaxdp %x0, %x1, %x2" : "=ww"(x) : "ww"(x), "ww"(y));
+ return x;
+}
+
+#else
+
+#include "../fmaxf.c"
+
+#endif
--- /dev/null
+#include <math.h>
+
+#ifdef __VSX__
+
+double fmin(double x, double y)
+{
+ __asm__ ("xsmindp %x0, %x1, %x2" : "=ws"(x) : "ws"(x), "ws"(y));
+ return x;
+}
+
+#else
+
+#include "../fmin.c"
+
+#endif
--- /dev/null
+#include <math.h>
+
+#ifdef __VSX__
+
+float fminf(float x, float y)
+{
+ __asm__ ("xsmindp %x0, %x1, %x2" : "=ww"(x) : "ww"(x), "ww"(y));
+ return x;
+}
+
+#else
+
+#include "../fminf.c"
+
+#endif
--- /dev/null
+#include <math.h>
+
+#ifdef _ARCH_PWR5X
+
+long lrint(double x)
+{
+ long n;
+ __asm__ ("fctid %0, %1" : "=d"(n) : "d"(x));
+ return n;
+}
+
+#else
+
+#include "../lrint.c"
+
+#endif
--- /dev/null
+#include <math.h>
+
+#ifdef _ARCH_PWR5X
+
+long lrintf(float x)
+{
+ long n;
+ __asm__ ("fctid %0, %1" : "=d"(n) : "f"(x));
+ return n;
+}
+
+#else
+
+#include "../lrintf.c"
+
+#endif
--- /dev/null
+#include <math.h>
+
+#ifdef __VSX__
+
+long lround(double x)
+{
+ long n;
+ __asm__ (
+ "xsrdpi %1, %1\n"
+ "fctid %0, %1\n" : "=d"(n), "+d"(x));
+ return n;
+}
+
+#else
+
+#include "../lround.c"
+
+#endif
--- /dev/null
+#include <math.h>
+
+#ifdef __VSX__
+
+long lroundf(float x)
+{
+ long n;
+ __asm__ (
+ "xsrdpi %1, %1\n"
+ "fctid %0, %1\n" : "=d"(n), "+f"(x));
+ return n;
+}
+
+#else
+
+#include "../lroundf.c"
+
+#endif
--- /dev/null
+#include <math.h>
+
+#ifdef _ARCH_PWR5X
+
+double round(double x)
+{
+ __asm__ ("frin %0, %1" : "=d"(x) : "d"(x));
+ return x;
+}
+
+#else
+
+#include "../round.c"
+
+#endif
--- /dev/null
+#include <math.h>
+
+#ifdef _ARCH_PWR5X
+
+float roundf(float x)
+{
+ __asm__ ("frin %0, %1" : "=f"(x) : "f"(x));
+ return x;
+}
+
+#else
+
+#include "../roundf.c"
+
+#endif
--- /dev/null
+#include <math.h>
+
+double sqrt(double x)
+{
+ __asm__ ("fsqrt %0, %1" : "=d"(x) : "d"(x));
+ return x;
+}
--- /dev/null
+#include <math.h>
+
+float sqrtf(float x)
+{
+ __asm__ ("fsqrts %0, %1" : "=f"(x) : "f"(x));
+ return x;
+}
--- /dev/null
+#include <math.h>
+
+#ifdef _ARCH_PWR5X
+
+double trunc(double x)
+{
+ __asm__ ("friz %0, %1" : "=d"(x) : "d"(x));
+ return x;
+}
+
+#else
+
+#include "../trunc.c"
+
+#endif
--- /dev/null
+#include <math.h>
+
+#ifdef _ARCH_PWR5X
+
+float truncf(float x)
+{
+ __asm__ ("friz %0, %1" : "=f"(x) : "f"(x));
+ return x;
+}
+
+#else
+
+#include "../truncf.c"
+
+#endif