copysignq.c 746 B

123456789101112131415161718192021222324252627
  1. /* copysignq.c -- __float128 version of s_copysign.c.
  2. * Conversion to long double by Jakub Jelinek, jj@ultra.linux.cz.
  3. */
  4. /*
  5. * ====================================================
  6. * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
  7. *
  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. * ====================================================
  13. */
  14. #include "quadmath-imp.h"
  15. __float128
  16. copysignq (__float128 x, __float128 y)
  17. {
  18. uint64_t hx,hy;
  19. GET_FLT128_MSW64(hx,x);
  20. GET_FLT128_MSW64(hy,y);
  21. SET_FLT128_MSW64(x,(hx&0x7fffffffffffffffULL)|(hy&0x8000000000000000ULL));
  22. return x;
  23. }