mathcalls-macros.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* Macros for math function declarations.
  2. Copyright (C) 2024-2026 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. <https://www.gnu.org/licenses/>. */
  15. #define __SIMD_DECL(function) __CONCAT (__DECL_SIMD_, function)
  16. #define __MATHCALL_VEC(function, suffix, args) \
  17. __SIMD_DECL (__MATH_PRECNAME (function, suffix)) \
  18. __MATHCALL (function, suffix, args)
  19. #define __MATHDECL_VEC(type, function,suffix, args) \
  20. __SIMD_DECL (__MATH_PRECNAME (function, suffix)) \
  21. __MATHDECL(type, function,suffix, args)
  22. #define __MATHCALL(function,suffix, args) \
  23. __MATHDECL (_Mdouble_,function,suffix, args)
  24. #define __MATHDECL(type, function,suffix, args) \
  25. __MATHDECL_1(type, function,suffix, args); \
  26. __MATHDECL_1(type, __CONCAT(__,function),suffix, args)
  27. #define __MATHCALLX(function,suffix, args, attrib) \
  28. __MATHDECLX (_Mdouble_,function,suffix, args, attrib)
  29. #define __MATHDECLX(type, function,suffix, args, attrib) \
  30. __MATHDECL_1(type, function,suffix, args) __attribute__ (attrib)
  31. #define __MATHDECL_1_IMPL(type, function, suffix, args) \
  32. extern type __MATH_PRECNAME(function,suffix) args __THROW
  33. #define __MATHDECL_1(type, function, suffix, args) \
  34. __MATHDECL_1_IMPL(type, function, suffix, args)
  35. /* Ignore the alias by default. The alias is only useful with
  36. redirections. */
  37. #define __MATHDECL_ALIAS(type, function, suffix, args, alias) \
  38. __MATHDECL_1(type, function, suffix, args)
  39. #define __MATHREDIR(type, function, suffix, args, to) \
  40. extern type __REDIRECT_NTH (__MATH_PRECNAME (function, suffix), args, to)