1 --- a/libc/sysdeps/linux/powerpc/Makefile.arch
2 +++ b/libc/sysdeps/linux/powerpc/Makefile.arch
4 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
7 -CSRC := __syscall_error.c pread_write.c ioctl.c
8 +CSRC := __syscall_error.c pread_write.c ioctl.c copysignl.c
11 __longjmp.S setjmp.S bsd-setjmp.S bsd-_setjmp.S brk.S \
13 +++ b/libc/sysdeps/linux/powerpc/copysignl.c
15 +/* s_copysignl.c -- long double version of s_copysign.c.
16 + * Conversion to long double by Ulrich Drepper,
17 + * Cygnus Support, drepper@cygnus.com.
21 + * ====================================================
22 + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
24 + * Developed at SunPro, a Sun Microsystems, Inc. business.
25 + * Permission to use, copy, modify, and distribute this
26 + * software is freely granted, provided that this notice
28 + * ====================================================
32 + * copysignl(long double x, long double y)
33 + * copysignl(x,y) returns a value with the magnitude of x and
34 + * with the sign bit of y.
40 +#if __FLOAT_WORD_ORDER == BIG_ENDIAN
47 + int sign_exponent:16;
48 + unsigned int empty:16;
52 +} ieee_long_double_shape_type;
56 +#if __FLOAT_WORD_ORDER == LITTLE_ENDIAN
65 + int sign_exponent:16;
66 + unsigned int empty:16;
68 +} ieee_long_double_shape_type;
72 +/* Get int from the exponent of a long double. */
74 +#define GET_LDOUBLE_EXP(exp,d) \
76 + ieee_long_double_shape_type ge_u; \
78 + (exp) = ge_u.parts.sign_exponent; \
81 +/* Set exponent of a long double from an int. */
83 +#define SET_LDOUBLE_EXP(d,exp) \
85 + ieee_long_double_shape_type se_u; \
87 + se_u.parts.sign_exponent = (exp); \
91 +long double copysignl(long double x, long double y);
92 +libc_hidden_proto(copysignl);
94 +long double copysignl(long double x, long double y)
97 + GET_LDOUBLE_EXP(es1,x);
98 + GET_LDOUBLE_EXP(es2,y);
99 + SET_LDOUBLE_EXP(x,(es1&0x7fff)|(es2&0x8000));
103 +libc_hidden_def(copysignl);