libm-alias-double.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /* Define aliases for libm double functions.
  2. Copyright (C) 2017-2019 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, see
  14. <http://www.gnu.org/licenses/>. */
  15. #ifndef _LIBM_ALIAS_DOUBLE_H
  16. #define _LIBM_ALIAS_DOUBLE_H
  17. #include <bits/floatn.h>
  18. #if __HAVE_FLOAT64 && !__HAVE_DISTINCT_FLOAT64
  19. # define libm_alias_double_other_r_f64(from, to, r) \
  20. weak_alias (from ## r, to ## f64 ## r)
  21. #else
  22. # define libm_alias_double_other_r_f64(from, to, r)
  23. #endif
  24. #if __HAVE_FLOAT32X && !__HAVE_DISTINCT_FLOAT32X
  25. # define libm_alias_double_other_r_f32x(from, to, r) \
  26. weak_alias (from ## r, to ## f32x ## r)
  27. #else
  28. # define libm_alias_double_other_r_f32x(from, to, r)
  29. #endif
  30. /* Define _FloatN / _FloatNx aliases for a double libm function that
  31. has internal name FROM ## R and public names TO ## suffix ## R for
  32. each suffix of a supported _FloatN / _FloatNx floating-point type
  33. with the same format as double. */
  34. #define libm_alias_double_other_r(from, to, r) \
  35. libm_alias_double_other_r_f64 (from, to, r); \
  36. libm_alias_double_other_r_f32x (from, to, r)
  37. /* Likewise, but without the R suffix. */
  38. #define libm_alias_double_other(from, to) \
  39. libm_alias_double_other_r (from, to, )
  40. /* Define aliases for a double libm function that has internal name
  41. FROM ## R and public names TO ## suffix ## R for each suffix of a
  42. supported floating-point type with the same format as double. This
  43. should only be used for functions where such public names exist for
  44. _FloatN types, not for implementation-namespace exported names
  45. (where there is one name per format, not per type) or for
  46. obsolescent functions not provided for _FloatN types. */
  47. #ifdef NO_LONG_DOUBLE
  48. # define libm_alias_double_r(from, to, r) \
  49. weak_alias (from ## r, to ## r) \
  50. strong_alias (from ## r, from ## l ## r) \
  51. weak_alias (from ## r, to ## l ## r); \
  52. libm_alias_double_other_r (from, to, r)
  53. #else
  54. # define libm_alias_double_r(from, to, r) \
  55. weak_alias (from ## r, to ## r); \
  56. libm_alias_double_other_r (from, to, r)
  57. #endif
  58. /* Likewise, but without the R suffix. */
  59. #define libm_alias_double(from, to) libm_alias_double_r (from, to, )
  60. #endif