Blame sysdeps/ieee754/ldbl-128/s_copysignl.c

Packit 6c4009
/* s_copysignl.c -- long double version of s_copysign.c.
Packit 6c4009
 * Conversion to long double by Jakub Jelinek, jj@ultra.linux.cz.
Packit 6c4009
 */
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 * ====================================================
Packit 6c4009
 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
Packit 6c4009
 *
Packit 6c4009
 * Developed at SunPro, a Sun Microsystems, Inc. business.
Packit 6c4009
 * Permission to use, copy, modify, and distribute this
Packit 6c4009
 * software is freely granted, provided that this notice
Packit 6c4009
 * is preserved.
Packit 6c4009
 * ====================================================
Packit 6c4009
 */
Packit 6c4009
Packit Service 3b0880
#if defined(LIBM_SCCS) && !defined(lint)
Packit 6c4009
static char rcsid[] = "$NetBSD: $";
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 * copysignl(long double x, long double y)
Packit 6c4009
 * copysignl(x,y) returns a value with the magnitude of x and
Packit 6c4009
 * with the sign bit of y.
Packit 6c4009
 */
Packit 6c4009
Packit 6c4009
#include <math.h>
Packit 6c4009
#include <math_private.h>
Packit 6c4009
#include <libm-alias-ldouble.h>
Packit Service 8cba35
#include <math-use-builtins.h>
Packit 6c4009
Packit Service 3b0880
_Float128 __copysignl(_Float128 x, _Float128 y)
Packit 6c4009
{
Packit Service 8cba35
#if USE_COPYSIGNL_BUILTIN
Packit Service 8cba35
  return __builtin_copysignl (x, y);
Packit Service 8cba35
#else
Packit Service 8cba35
  /* Use generic implementation.  */
Packit Service 3b0880
	uint64_t hx,hy;
Packit Service 3b0880
	GET_LDOUBLE_MSW64(hx,x);
Packit Service 3b0880
	GET_LDOUBLE_MSW64(hy,y);
Packit Service 3b0880
	SET_LDOUBLE_MSW64(x,(hx&0x7fffffffffffffffULL)
Packit Service 3b0880
			    |(hy&0x8000000000000000ULL));
Packit Service 3b0880
        return x;
Packit Service 8cba35
#endif /* ! USE_COPYSIGNL_BUILTIN  */
Packit 6c4009
}
Packit 6c4009
libm_alias_ldouble (__copysign, copysign)