You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

177 lines
5.7KB

  1. /* Arm Custom Datapath Extension (CDE) intrinsics include file.
  2. Copyright (C) 2020 Free Software Foundation, Inc.
  3. Contributed by Arm Ltd.
  4. This file is part of GCC.
  5. GCC is free software; you can redistribute it and/or modify it
  6. under the terms of the GNU General Public License as published
  7. by the Free Software Foundation; either version 3, or (at your
  8. option) any later version.
  9. GCC is distributed in the hope that it will be useful, but WITHOUT
  10. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  11. or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
  12. License for more details.
  13. Under Section 7 of GPL version 3, you are granted additional
  14. permissions described in the GCC Runtime Library Exception, version
  15. 3.1, as published by the Free Software Foundation.
  16. You should have received a copy of the GNU General Public License and
  17. a copy of the GCC Runtime Library Exception along with this program;
  18. see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  19. <http://www.gnu.org/licenses/>. */
  20. #ifndef _GCC_ARM_CDE_H
  21. #define _GCC_ARM_CDE_H 1
  22. #include <stdint.h>
  23. #if defined (__ARM_FEATURE_CDE)
  24. #define __arm_cx1(coproc, imm) \
  25. __builtin_arm_cx1si(coproc, imm)
  26. #define __arm_cx1a(coproc, acc, imm) \
  27. __builtin_arm_cx1asi(coproc, acc, imm)
  28. #define __arm_cx2(coproc, n, imm) \
  29. __builtin_arm_cx2si(coproc, n, imm)
  30. #define __arm_cx2a(coproc, acc, n, imm) \
  31. __builtin_arm_cx2asi(coproc, acc, n, imm)
  32. #define __arm_cx3(coproc, n, m, imm) \
  33. __builtin_arm_cx3si(coproc, n, m, imm)
  34. #define __arm_cx3a(coproc, acc, n, m, imm) \
  35. __builtin_arm_cx3asi(coproc, acc, n, m, imm)
  36. #define __arm_cx1d(coproc, imm) \
  37. __builtin_arm_cx1di(coproc, imm)
  38. #define __arm_cx1da(coproc, acc, imm) \
  39. __builtin_arm_cx1adi(coproc, acc, imm)
  40. #define __arm_cx2d(coproc, n, imm) \
  41. __builtin_arm_cx2di(coproc, n, imm)
  42. #define __arm_cx2da(coproc, acc, n, imm) \
  43. __builtin_arm_cx2adi(coproc, acc, n, imm)
  44. #define __arm_cx3d(coproc, n, m, imm) \
  45. __builtin_arm_cx3di(coproc, n, m, imm)
  46. #define __arm_cx3da(coproc, acc, n, m, imm) \
  47. __builtin_arm_cx3adi(coproc, acc, n, m, imm)
  48. #if defined (__ARM_FP) || defined (__ARM_FEATURE_MVE)
  49. /* CDE builtins using FPU/MVE registers. */
  50. /* uint32_t
  51. __arm_vcx1_u32(int coproc, uint32_t imm); */
  52. #define __arm_vcx1_u32(coproc, imm) \
  53. __builtin_arm_vcx1si(coproc, imm)
  54. /* uint32_t
  55. __arm_vcx1a_u32(int coproc, uint32_t acc, uint32_t imm); */
  56. #define __arm_vcx1a_u32(coproc, acc, imm) \
  57. __builtin_arm_vcx1asi(coproc, acc, imm)
  58. /* uint32_t
  59. __arm_vcx2_u32(int coproc, uint32_t n, uint32_t imm); */
  60. #define __arm_vcx2_u32(coproc, n, imm) \
  61. __builtin_arm_vcx2si(coproc, n, imm)
  62. /* uint32_t
  63. __arm_vcx2a_u32(int coproc, uint32_t acc, uint32_t n, uint32_t imm); */
  64. #define __arm_vcx2a_u32(coproc, acc, n, imm) \
  65. __builtin_arm_vcx2asi(coproc, acc, n, imm)
  66. /* uint32_t
  67. __arm_vcx3_u32(int coproc, uint32_t n, uint32_t m, uint32_t imm); */
  68. #define __arm_vcx3_u32(coproc, n, m, imm) \
  69. __builtin_arm_vcx3si(coproc, n, m, imm)
  70. /* uint32_t
  71. __arm_vcx3a_u32(int coproc, uint32_t acc, uint32_t n, uint32_t m,
  72. uint32_t imm); */
  73. #define __arm_vcx3a_u32(coproc, acc, n, m, imm) \
  74. __builtin_arm_vcx3asi(coproc, acc, n, m, imm)
  75. /* uint64_t
  76. __arm_vcx1d_u64(int coproc, uint32_t imm); */
  77. #define __arm_vcx1d_u64(coproc, imm) \
  78. __builtin_arm_vcx1di(coproc, imm)
  79. /* uint64_t
  80. __arm_vcx1da_u64(int coproc, uint64_t acc, uint32_t imm); */
  81. #define __arm_vcx1da_u64(coproc, acc, imm) \
  82. __builtin_arm_vcx1adi(coproc, acc, imm)
  83. /* uint64_t
  84. __arm_vcx2d_u64(int coproc, uint64_t m, uint32_t imm); */
  85. #define __arm_vcx2d_u64(coproc, m, imm) \
  86. __builtin_arm_vcx2di(coproc, m, imm)
  87. /* uint64_t
  88. __arm_vcx2da_u64(int coproc, uint64_t acc, uint64_t m, uint32_t imm); */
  89. #define __arm_vcx2da_u64(coproc, acc, m, imm) \
  90. __builtin_arm_vcx2adi(coproc, acc, m, imm)
  91. /* uint64_t
  92. __arm_vcx3d_u64(int coproc, uint64_t n, uint64_t m, uint32_t imm); */
  93. #define __arm_vcx3d_u64(coproc, n, m, imm) \
  94. __builtin_arm_vcx3di(coproc, n, m, imm)
  95. /* uint64_t
  96. __arm_vcx3da_u64(int coproc, uint64_t acc, uint64_t n, uint64_t m,
  97. uint32_t imm); */
  98. #define __arm_vcx3da_u64(coproc, acc, n, m, imm) \
  99. __builtin_arm_vcx3adi(coproc, acc, n, m, imm)
  100. #endif /* __ARM_FP || __ARM_FEATURE_MVE. */
  101. #endif /* __ARM_FEATURE_CDE. */
  102. #if __ARM_FEATURE_MVE
  103. #include "arm_mve_types.h"
  104. #define __arm_vcx1q_u8(coproc, imm) \
  105. (uint8x16_t)__builtin_arm_vcx1qv16qi(coproc, imm)
  106. #define __arm_vcx1qa(coproc, acc, imm) \
  107. __builtin_arm_vcx1qav16qi(coproc, acc, imm)
  108. #define __arm_vcx2q(coproc, n, imm) \
  109. __builtin_arm_vcx2qv16qi(coproc, n, imm)
  110. #define __arm_vcx2q_u8(coproc, n, imm) \
  111. (uint8x16_t)__builtin_arm_vcx2qv16qi(coproc, n, imm)
  112. #define __arm_vcx2qa(coproc, acc, n, imm) \
  113. __builtin_arm_vcx2qav16qi(coproc, acc, n, imm)
  114. #define __arm_vcx3q(coproc, n, m, imm) \
  115. __builtin_arm_vcx3qv16qi(coproc, n, m, imm)
  116. #define __arm_vcx3q_u8(coproc, n, m, imm) \
  117. (uint8x16_t)__builtin_arm_vcx3qv16qi(coproc, n, m, imm)
  118. #define __arm_vcx3qa(coproc, acc, n, m, imm) \
  119. __builtin_arm_vcx3qav16qi(coproc, acc, n, m, imm)
  120. #define __arm_vcx1q_m(coproc, inactive, imm, pred) \
  121. __builtin_arm_vcx1q_p_v16qi(coproc, inactive, imm, pred)
  122. #define __arm_vcx1qa_m(coproc, acc, imm, pred) \
  123. __builtin_arm_vcx1qa_p_v16qi(coproc, acc, imm, pred)
  124. #define __arm_vcx2q_m(coproc, inactive, n, imm, pred) \
  125. __builtin_arm_vcx2q_p_v16qi(coproc, inactive, n, imm, pred)
  126. #define __arm_vcx2qa_m(coproc, acc, n, imm, pred) \
  127. __builtin_arm_vcx2qa_p_v16qi(coproc, acc, n, imm, pred)
  128. #define __arm_vcx3q_m(coproc, inactive, n, m, imm, pred) \
  129. __builtin_arm_vcx3q_p_v16qi(coproc, inactive, n, m, imm, pred)
  130. #define __arm_vcx3qa_m(coproc, acc, n, m, imm, pred) \
  131. __builtin_arm_vcx3qa_p_v16qi(coproc, acc, n, m, imm, pred)
  132. #endif
  133. #endif