macros_generated.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. /* Copyright (C) 2013 Povilas Kanapickas <[email protected]>
  2. Distributed under the Boost Software License, Version 1.0.
  3. (See accompanying file LICENSE_1_0.txt or copy at
  4. http://www.boost.org/LICENSE_1_0.txt)
  5. */
  6. // This file is generated automatically. See tools/gen_dispatcher_macros.py
  7. #ifndef LIBSIMDPP_DISPATCH_MACROS_GENERATED_H
  8. #define LIBSIMDPP_DISPATCH_MACROS_GENERATED_H
  9. #include <simdpp/dispatch/collect_macros_generated.h>
  10. #include <simdpp/dispatch/make_dispatcher.h>
  11. /** Note: the following macros are deprecated and provided only for backwards
  12. compatibility. See SIMDPP_MAKE_DISPATCHER for a more versatile replacement.
  13. Builds a dispatcher for a specific non-member function. Different macros
  14. are provided for functions with or without return value and for each
  15. parameter count.
  16. Macros in the form @a SIMDPP_MAKE_DISPATCHER_VOID# are to be used for
  17. functions with no return value. It accepts the following macro parameters:
  18. * NAME: the unqualified name of the function to dispatch.
  19. * T1, T2, ..., T#: the types of the parameters of the function that is
  20. dispatched.
  21. Macros in the form @a SIMDPP_MAKE_DISPATCHER_RET# are to be used for
  22. functions that return a value. It accepts the following macro parameters:
  23. * NAME: the unqualified name of the function to dispatch.
  24. * R: the type of the return value
  25. * T1, T2, ..., T#: the types of the parameters of the function that is
  26. dispatcher.
  27. @c SIMDPP_ARCH_NAMESPACE::NAME must refer to the function to be disptached
  28. relative to the namespace in which the @a MAKE_DISPATCHER* macro is used in.
  29. That is, the macro must be used in a namespace one level up than the
  30. dispatched function, and that namespace must be @c SIMDPP_ARCH_NAMESPACE
  31. @a R, T1, T2, ..., T# must be exactly the same as those of the function
  32. to be dispatched. The dispatched function may be overloaded.
  33. The macro defines a function with the same signature as the dispatched
  34. function in the namespace the macro is used. The body of that function
  35. implements the dispatch mechanism.
  36. The dispatch functions check the enabled instruction set and select the
  37. best function on first call. The initialization does not introduce race
  38. conditions when done concurrently.
  39. */
  40. #define SIMDPP_MAKE_DISPATCHER_VOID0(NAME) \
  41. SIMDPP_MAKE_DISPATCHER((void)(NAME)())
  42. #define SIMDPP_MAKE_DISPATCHER_VOID1(NAME,T1) \
  43. SIMDPP_MAKE_DISPATCHER((void)(NAME)((T1) a1))
  44. #define SIMDPP_MAKE_DISPATCHER_VOID2(NAME,T1,T2) \
  45. SIMDPP_MAKE_DISPATCHER((void)(NAME)((T1) a1,(T2) a2))
  46. #define SIMDPP_MAKE_DISPATCHER_VOID3(NAME,T1,T2,T3) \
  47. SIMDPP_MAKE_DISPATCHER((void)(NAME)((T1) a1,(T2) a2,(T3) a3))
  48. #define SIMDPP_MAKE_DISPATCHER_VOID4(NAME,T1,T2,T3,T4) \
  49. SIMDPP_MAKE_DISPATCHER((void)(NAME)((T1) a1,(T2) a2,(T3) a3,(T4) a4))
  50. #define SIMDPP_MAKE_DISPATCHER_VOID5(NAME,T1,T2,T3,T4,T5) \
  51. SIMDPP_MAKE_DISPATCHER((void)(NAME)((T1) a1,(T2) a2,(T3) a3,(T4) a4,(T5) a5))
  52. #define SIMDPP_MAKE_DISPATCHER_VOID6(NAME,T1,T2,T3,T4,T5,T6) \
  53. SIMDPP_MAKE_DISPATCHER((void)(NAME)((T1) a1,(T2) a2,(T3) a3,(T4) a4,(T5) a5,(T6) a6))
  54. #define SIMDPP_MAKE_DISPATCHER_VOID7(NAME,T1,T2,T3,T4,T5,T6,T7) \
  55. SIMDPP_MAKE_DISPATCHER((void)(NAME)((T1) a1,(T2) a2,(T3) a3,(T4) a4,(T5) a5,(T6) a6,(T7) a7))
  56. #define SIMDPP_MAKE_DISPATCHER_VOID8(NAME,T1,T2,T3,T4,T5,T6,T7,T8) \
  57. SIMDPP_MAKE_DISPATCHER((void)(NAME)((T1) a1,(T2) a2,(T3) a3,(T4) a4,(T5) a5,(T6) a6,(T7) a7,(T8) a8))
  58. #define SIMDPP_MAKE_DISPATCHER_VOID9(NAME,T1,T2,T3,T4,T5,T6,T7,T8,T9) \
  59. SIMDPP_MAKE_DISPATCHER((void)(NAME)((T1) a1,(T2) a2,(T3) a3,(T4) a4,(T5) a5,(T6) a6,(T7) a7,(T8) a8,(T9) a9))
  60. #define SIMDPP_MAKE_DISPATCHER_RET0(NAME,R) \
  61. SIMDPP_MAKE_DISPATCHER((R)(NAME)())
  62. #define SIMDPP_MAKE_DISPATCHER_RET1(NAME,R,T1) \
  63. SIMDPP_MAKE_DISPATCHER((R)(NAME)((T1) a1))
  64. #define SIMDPP_MAKE_DISPATCHER_RET2(NAME,R,T1,T2) \
  65. SIMDPP_MAKE_DISPATCHER((R)(NAME)((T1) a1,(T2) a2))
  66. #define SIMDPP_MAKE_DISPATCHER_RET3(NAME,R,T1,T2,T3) \
  67. SIMDPP_MAKE_DISPATCHER((R)(NAME)((T1) a1,(T2) a2,(T3) a3))
  68. #define SIMDPP_MAKE_DISPATCHER_RET4(NAME,R,T1,T2,T3,T4) \
  69. SIMDPP_MAKE_DISPATCHER((R)(NAME)((T1) a1,(T2) a2,(T3) a3,(T4) a4))
  70. #define SIMDPP_MAKE_DISPATCHER_RET5(NAME,R,T1,T2,T3,T4,T5) \
  71. SIMDPP_MAKE_DISPATCHER((R)(NAME)((T1) a1,(T2) a2,(T3) a3,(T4) a4,(T5) a5))
  72. #define SIMDPP_MAKE_DISPATCHER_RET6(NAME,R,T1,T2,T3,T4,T5,T6) \
  73. SIMDPP_MAKE_DISPATCHER((R)(NAME)((T1) a1,(T2) a2,(T3) a3,(T4) a4,(T5) a5,(T6) a6))
  74. #define SIMDPP_MAKE_DISPATCHER_RET7(NAME,R,T1,T2,T3,T4,T5,T6,T7) \
  75. SIMDPP_MAKE_DISPATCHER((R)(NAME)((T1) a1,(T2) a2,(T3) a3,(T4) a4,(T5) a5,(T6) a6,(T7) a7))
  76. #define SIMDPP_MAKE_DISPATCHER_RET8(NAME,R,T1,T2,T3,T4,T5,T6,T7,T8) \
  77. SIMDPP_MAKE_DISPATCHER((R)(NAME)((T1) a1,(T2) a2,(T3) a3,(T4) a4,(T5) a5,(T6) a6,(T7) a7,(T8) a8))
  78. #define SIMDPP_MAKE_DISPATCHER_RET9(NAME,R,T1,T2,T3,T4,T5,T6,T7,T8,T9) \
  79. SIMDPP_MAKE_DISPATCHER((R)(NAME)((T1) a1,(T2) a2,(T3) a3,(T4) a4,(T5) a5,(T6) a6,(T7) a7,(T8) a8,(T9) a9))
  80. #endif