minix/lib/nbsd_libc/arch/powerpc/gen/fabs.c
Gianluca Guida b6cbf7203b Import unmodified NetBSD libc in trunk
This patch imports the unmodified current version of NetBSD libc.
The NetBSD includes are in /nbsd_include, while the libc code itself is 
split between lib/nbsd_libc and common/lib/libc.
2011-02-14 19:36:03 +00:00

15 lines
223 B
C

/* $NetBSD: fabs.c,v 1.4 2005/12/24 23:10:08 perry Exp $ */
#include <math.h>
double
fabs(double x)
{
#ifdef _SOFT_FLOAT
if (x < 0)
x = -x;
#else
__asm volatile("fabs %0,%1" : "=f"(x) : "f"(x));
#endif
return (x);
}