math: Update alpha ulps
[glibc.git] / sysdeps / ieee754 / ldbl-128 / s_copysignl.c
blobd512d9a1e23dd407a362d7671184e69e723a3bfb
1 /* s_copysignl.c -- long double version of s_copysign.c.
2 */
4 /*
5 * ====================================================
6 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
8 * Developed at SunPro, a Sun Microsystems, Inc. business.
9 * Permission to use, copy, modify, and distribute this
10 * software is freely granted, provided that this notice
11 * is preserved.
12 * ====================================================
15 #if defined (LIBM_SCCS) && ! defined (lint)
16 static char rcsid[] = "$NetBSD: $";
17 #endif
20 * copysignl(long double x, long double y)
21 * copysignl(x,y) returns a value with the magnitude of x and
22 * with the sign bit of y.
25 #define NO_MATH_REDIRECT
26 #include <math.h>
27 #include <math_private.h>
28 #include <libm-alias-ldouble.h>
29 #include <math-use-builtins.h>
31 _Float128
32 __copysignl (_Float128 x, _Float128 y)
34 #if USE_COPYSIGNL_BUILTIN
35 return __builtin_copysignl (x, y);
36 #else
37 /* Use generic implementation. */
38 uint64_t hx, hy;
39 GET_LDOUBLE_MSW64 (hx, x);
40 GET_LDOUBLE_MSW64 (hy, y);
41 SET_LDOUBLE_MSW64 (x, (hx & 0x7fffffffffffffffULL)
42 | (hy & 0x8000000000000000ULL));
43 return x;
44 #endif /* ! USE_COPYSIGNL_BUILTIN */
46 libm_alias_ldouble (__copysign, copysign)