xref: /netbsd-src/external/gpl3/gcc/dist/libquadmath/math/fabsq.c (revision 181254a7b1bdde6873432bffef2d2decc4b5c22f)
1*181254a7Smrg /* s_fabsl.c -- long double version of s_fabs.c.
2*181254a7Smrg  * Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz.
3*181254a7Smrg  */
4*181254a7Smrg 
5*181254a7Smrg /*
6*181254a7Smrg  * ====================================================
7*181254a7Smrg  * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
8*181254a7Smrg  *
9*181254a7Smrg  * Developed at SunPro, a Sun Microsystems, Inc. business.
10*181254a7Smrg  * Permission to use, copy, modify, and distribute this
11*181254a7Smrg  * software is freely granted, provided that this notice
12*181254a7Smrg  * is preserved.
13*181254a7Smrg  * ====================================================
14*181254a7Smrg  */
15*181254a7Smrg 
16*181254a7Smrg #if defined(LIBM_SCCS) && !defined(lint)
17*181254a7Smrg static char rcsid[] = "NetBSD: ";
18*181254a7Smrg #endif
19*181254a7Smrg 
20*181254a7Smrg /*
21*181254a7Smrg  * fabsq(x) returns the absolute value of x.
22*181254a7Smrg  */
23*181254a7Smrg 
24*181254a7Smrg #include "quadmath-imp.h"
25*181254a7Smrg 
fabsq(__float128 x)26*181254a7Smrg __float128 fabsq(__float128 x)
27*181254a7Smrg {
28*181254a7Smrg 	uint64_t hx;
29*181254a7Smrg 	GET_FLT128_MSW64(hx,x);
30*181254a7Smrg 	SET_FLT128_MSW64(x,hx&0x7fffffffffffffffLL);
31*181254a7Smrg         return x;
32*181254a7Smrg }
33