xref: /openbsd-src/lib/libc/arch/hppa/gen/fabs.c (revision b5aa3b3329f64accdef718a6489253474d9be985)
1*b5aa3b33Sguenther /*	$OpenBSD: fabs.c,v 1.11 2014/04/18 15:09:52 guenther Exp $	*/
2aeb694e3Smartynas 
3aeb694e3Smartynas /*
4aeb694e3Smartynas  * Written by Miodrag Vallat.  Public domain
5aeb694e3Smartynas  */
6aeb694e3Smartynas 
74a39ccd0Sderaadt #include <sys/types.h>
8f94f3cafSderaadt #include <math.h>
9aeb694e3Smartynas 
10aeb694e3Smartynas double
fabs(double val)11aeb694e3Smartynas fabs(double val)
12aeb694e3Smartynas {
13aeb694e3Smartynas 
14*b5aa3b33Sguenther 	__asm__ volatile("fabs,dbl %0,%0" : "+f" (val));
15aeb694e3Smartynas 	return (val);
16aeb694e3Smartynas }
17aeb694e3Smartynas 
182fbf033eSmartynas __strong_alias(fabsl, fabs);
19