copysign.S 886 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Written by J.T. Conklin <jtc@netbsd.org>.
  3. * Public domain.
  4. */
  5. #define _ERRNO_H 1
  6. #include <features.h>
  7. #include <bits/errno.h>
  8. .text
  9. .global copysign
  10. .type copysign,%function
  11. copysign:
  12. movl 16(%esp),%edx
  13. movl 8(%esp),%eax
  14. andl $0x80000000,%edx
  15. andl $0x7fffffff,%eax
  16. orl %edx,%eax
  17. movl %eax,8(%esp)
  18. fldl 4(%esp)
  19. ret
  20. .size copysign,.-copysign
  21. libc_hidden_def(copysign)
  22. .global copysignf
  23. .type copysignf,%function
  24. copysignf:
  25. movl 8(%esp),%edx
  26. movl 4(%esp),%eax
  27. andl $0x80000000,%edx
  28. andl $0x7fffffff,%eax
  29. orl %edx,%eax
  30. movl %eax,4(%esp)
  31. flds 4(%esp)
  32. ret
  33. .size copysignf,.-copysignf
  34. libc_hidden_def(copysignf)
  35. .global copysignl
  36. .type copysignl,%function
  37. copysignl:
  38. movl 24(%esp),%edx
  39. movl 12(%esp),%eax
  40. andl $0x8000,%edx
  41. andl $0x7fff,%eax
  42. orl %edx,%eax
  43. movl %eax,12(%esp)
  44. fldt 4(%esp)
  45. ret
  46. .size copysignl,.-copysignl
  47. libc_hidden_def(copysignl)