react-native-executorch 0.10.5 → 0.10.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/README.md +10 -1
  2. package/android/build.gradle.kts +4 -3
  3. package/ios/RnExecutorch.mm +15 -17
  4. package/lib/module/fetcher/fetcher.js +35 -122
  5. package/lib/module/fetcher/fetcher.js.map +1 -1
  6. package/lib/module/fetcher/telemetry.js +1 -1
  7. package/lib/module/index.js +12 -13
  8. package/lib/module/index.js.map +1 -1
  9. package/lib/module/models.js +4 -2
  10. package/lib/module/models.js.map +1 -1
  11. package/lib/typescript/src/fetcher/fetcher.d.ts +3 -7
  12. package/lib/typescript/src/fetcher/fetcher.d.ts.map +1 -1
  13. package/lib/typescript/src/models.d.ts.map +1 -1
  14. package/package.json +9 -7
  15. package/react-native-executorch.podspec +6 -2
  16. package/src/fetcher/fetcher.ts +38 -131
  17. package/src/fetcher/telemetry.ts +1 -1
  18. package/src/models.ts +6 -1
  19. package/third-party/common/phonemis/CMakeLists.txt +70 -14
  20. package/third-party/common/phonemis/README.md +183 -33
  21. package/third-party/common/phonemis/THIRD_PARTY_NOTICES.md +57 -0
  22. package/third-party/common/phonemis/knowledge/code_style.md +642 -0
  23. package/third-party/common/phonemis/licenses/Unicode-3.0.txt +39 -0
  24. package/third-party/common/phonemis/licenses/misaki-Apache-2.0.txt +201 -0
  25. package/third-party/common/phonemis/licenses/nlohmann-json-MIT.txt +21 -0
  26. package/third-party/common/phonemis/licenses/xsimd-BSD-3-Clause.txt +29 -0
  27. package/third-party/common/phonemis/src/phonemis/base/config.h +6 -0
  28. package/third-party/common/phonemis/src/phonemis/base/ipipeline.cpp +75 -0
  29. package/third-party/common/phonemis/src/phonemis/base/ipipeline.h +21 -0
  30. package/third-party/common/phonemis/src/phonemis/base/phonemizer/constants.h +2 -5
  31. package/third-party/common/phonemis/src/phonemis/base/phonemizer/lexicon_phonemizer.cpp +3 -4
  32. package/third-party/common/phonemis/src/phonemis/base/phonemizer/nn/neural_phonemizer.cpp +17 -8
  33. package/third-party/common/phonemis/src/phonemis/base/phonemizer/nn/neural_phonemizer.h +4 -0
  34. package/third-party/common/phonemis/src/phonemis/base/phonemizer/nn/tokenizer.cpp +21 -6
  35. package/third-party/common/phonemis/src/phonemis/base/phonemizer/nn/tokenizer.h +13 -4
  36. package/third-party/common/phonemis/src/phonemis/base/pipeline.cpp +8 -0
  37. package/third-party/common/phonemis/src/phonemis/base/pipeline.h +19 -0
  38. package/third-party/common/phonemis/src/phonemis/base/processor/common/conditions.cpp +37 -0
  39. package/third-party/common/phonemis/src/phonemis/base/processor/common/conditions.h +45 -0
  40. package/third-party/common/phonemis/src/phonemis/base/processor/common/constants.h +10 -0
  41. package/third-party/common/phonemis/src/phonemis/base/processor/common/context.cpp +105 -0
  42. package/third-party/common/phonemis/src/phonemis/base/processor/common/context.h +49 -0
  43. package/third-party/common/phonemis/src/phonemis/base/processor/common/document.cpp +173 -0
  44. package/third-party/common/phonemis/src/phonemis/base/processor/common/document.h +67 -0
  45. package/third-party/common/phonemis/src/phonemis/base/processor/common/text.cpp +75 -0
  46. package/third-party/common/phonemis/src/phonemis/base/processor/common/text.h +60 -0
  47. package/third-party/common/phonemis/src/phonemis/base/processor/common/types.h +18 -0
  48. package/third-party/common/phonemis/src/phonemis/base/processor/config.h +53 -0
  49. package/third-party/common/phonemis/src/phonemis/base/processor/layer.h +9 -7
  50. package/third-party/common/phonemis/src/phonemis/base/processor/layers/normalize/constants.h +20 -0
  51. package/third-party/common/phonemis/src/phonemis/base/processor/layers/normalize/layer.cpp +89 -0
  52. package/third-party/common/phonemis/src/phonemis/base/processor/layers/normalize/layer.h +35 -0
  53. package/third-party/common/phonemis/src/phonemis/base/processor/layers/normalize/types.h +16 -0
  54. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/kind.h +40 -0
  55. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/layer.h +382 -0
  56. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/notation.h +30 -0
  57. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/numerals.cpp +51 -0
  58. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/numerals.h +31 -0
  59. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/pattern.h +30 -0
  60. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/pattern_set.cpp +17 -0
  61. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/pattern_set.h +31 -0
  62. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/patterns.cpp +811 -0
  63. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/patterns.h +285 -0
  64. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/primitives.cpp +64 -0
  65. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/primitives.h +23 -0
  66. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/types.h +94 -0
  67. package/third-party/common/phonemis/src/phonemis/base/processor/layers/sanitizer/layer.cpp +19 -0
  68. package/third-party/common/phonemis/src/phonemis/base/processor/{sanitizer_layer.h → layers/sanitizer/layer.h} +8 -8
  69. package/third-party/common/phonemis/src/phonemis/base/processor/layers/sym2word/layer.cpp +65 -0
  70. package/third-party/common/phonemis/src/phonemis/base/processor/layers/sym2word/layer.h +29 -0
  71. package/third-party/common/phonemis/src/phonemis/base/processor/layers/term2word/layer.cpp +170 -0
  72. package/third-party/common/phonemis/src/phonemis/base/processor/layers/term2word/layer.h +40 -0
  73. package/third-party/common/phonemis/src/phonemis/base/processor/layers/term2word/types.h +25 -0
  74. package/third-party/common/phonemis/src/phonemis/base/processor/layers/trim/layer.cpp +47 -0
  75. package/third-party/common/phonemis/src/phonemis/base/processor/layers/trim/layer.h +19 -0
  76. package/third-party/common/phonemis/src/phonemis/base/processor/preprocessor.cpp +60 -0
  77. package/third-party/common/phonemis/src/phonemis/base/processor/preprocessor.h +45 -0
  78. package/third-party/common/phonemis/src/phonemis/base/processor/processor.cpp +6 -7
  79. package/third-party/common/phonemis/src/phonemis/base/processor/processor.h +14 -10
  80. package/third-party/common/phonemis/src/phonemis/base/tagger/hmm_tagger.cpp +89 -52
  81. package/third-party/common/phonemis/src/phonemis/base/tagger/hmm_tagger.h +16 -9
  82. package/third-party/common/phonemis/src/phonemis/base/tokenizer/tokenizer.cpp +13 -12
  83. package/third-party/common/phonemis/src/phonemis/lang/de/constants.h +183 -19
  84. package/third-party/common/phonemis/src/phonemis/lang/de/num2word.cpp +355 -309
  85. package/third-party/common/phonemis/src/phonemis/lang/de/num2word.h +42 -17
  86. package/third-party/common/phonemis/src/phonemis/lang/de/patterns.cpp +56 -0
  87. package/third-party/common/phonemis/src/phonemis/lang/de/patterns.h +15 -0
  88. package/third-party/common/phonemis/src/phonemis/lang/de/pipeline.h +3 -3
  89. package/third-party/common/phonemis/src/phonemis/lang/en/constants.h +181 -30
  90. package/third-party/common/phonemis/src/phonemis/lang/en/hmm_tagger.cpp +5 -7
  91. package/third-party/common/phonemis/src/phonemis/lang/en/num2word.cpp +232 -135
  92. package/third-party/common/phonemis/src/phonemis/lang/en/num2word.h +41 -16
  93. package/third-party/common/phonemis/src/phonemis/lang/en/pipeline.h +3 -10
  94. package/third-party/common/phonemis/src/phonemis/lang/es/constants.h +182 -60
  95. package/third-party/common/phonemis/src/phonemis/lang/es/num2word.cpp +247 -212
  96. package/third-party/common/phonemis/src/phonemis/lang/es/num2word.h +38 -18
  97. package/third-party/common/phonemis/src/phonemis/lang/es/patterns.cpp +50 -0
  98. package/third-party/common/phonemis/src/phonemis/lang/es/patterns.h +15 -0
  99. package/third-party/common/phonemis/src/phonemis/lang/es/pipeline.h +3 -3
  100. package/third-party/common/phonemis/src/phonemis/lang/fr/constants.h +152 -26
  101. package/third-party/common/phonemis/src/phonemis/lang/fr/num2word.cpp +252 -179
  102. package/third-party/common/phonemis/src/phonemis/lang/fr/num2word.h +38 -15
  103. package/third-party/common/phonemis/src/phonemis/lang/fr/patterns.cpp +83 -0
  104. package/third-party/common/phonemis/src/phonemis/lang/fr/patterns.h +15 -0
  105. package/third-party/common/phonemis/src/phonemis/lang/fr/pipeline.h +3 -3
  106. package/third-party/common/phonemis/src/phonemis/lang/hi/constants.h +62 -10
  107. package/third-party/common/phonemis/src/phonemis/lang/hi/num2word.cpp +74 -123
  108. package/third-party/common/phonemis/src/phonemis/lang/hi/num2word.h +27 -16
  109. package/third-party/common/phonemis/src/phonemis/lang/hi/pipeline.h +5 -3
  110. package/third-party/common/phonemis/src/phonemis/lang/it/constants.h +122 -42
  111. package/third-party/common/phonemis/src/phonemis/lang/it/num2word.cpp +200 -207
  112. package/third-party/common/phonemis/src/phonemis/lang/it/num2word.h +30 -18
  113. package/third-party/common/phonemis/src/phonemis/lang/it/patterns.cpp +25 -0
  114. package/third-party/common/phonemis/src/phonemis/lang/it/patterns.h +15 -0
  115. package/third-party/common/phonemis/src/phonemis/lang/it/pipeline.h +3 -3
  116. package/third-party/common/phonemis/src/phonemis/lang/pl/constants.h +346 -77
  117. package/third-party/common/phonemis/src/phonemis/lang/pl/num2word.cpp +631 -246
  118. package/third-party/common/phonemis/src/phonemis/lang/pl/num2word.h +47 -15
  119. package/third-party/common/phonemis/src/phonemis/lang/pl/pipeline.h +6 -6
  120. package/third-party/common/phonemis/src/phonemis/lang/pt/constants.h +201 -0
  121. package/third-party/common/phonemis/src/phonemis/lang/pt/num2word.cpp +365 -0
  122. package/third-party/common/phonemis/src/phonemis/lang/pt/num2word.h +53 -0
  123. package/third-party/common/phonemis/src/phonemis/lang/pt/pipeline.h +4 -2
  124. package/third-party/common/phonemis/src/phonemis/main.cpp +42 -11
  125. package/third-party/common/phonemis/src/phonemis/protophone/meta.h +24 -0
  126. package/third-party/common/phonemis/src/phonemis/protophone/numeric.h +26 -0
  127. package/third-party/common/phonemis/src/phonemis/protophone/protophone.cpp +525 -0
  128. package/third-party/common/phonemis/src/phonemis/protophone/protophone.h +80 -0
  129. package/third-party/common/phonemis/src/phonemis/protophone/tensor.h +76 -0
  130. package/third-party/common/phonemis/src/phonemis/protophone/tensor_utils.h +89 -0
  131. package/third-party/common/phonemis/src/phonemis/protophone/tensor_view.h +125 -0
  132. package/third-party/common/phonemis/src/phonemis/protophone/types.h +43 -0
  133. package/third-party/common/phonemis/src/phonemis/utils/strings.h +20 -14
  134. package/third-party/common/phonemis/src/phonemis/utils/unicode.h +15 -1
  135. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_arithmetic.hpp +267 -0
  136. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_bit.hpp +232 -0
  137. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_cast.hpp +43 -0
  138. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_complex.hpp +112 -0
  139. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_details.hpp +386 -0
  140. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_logical.hpp +240 -0
  141. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_math.hpp +2601 -0
  142. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_memory.hpp +1006 -0
  143. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_rounding.hpp +72 -0
  144. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_swizzle.hpp +260 -0
  145. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_trigo.hpp +996 -0
  146. package/third-party/common/phonemis/src/third-party/xsimd/arch/utils/shifts.hpp +82 -0
  147. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx.hpp +2111 -0
  148. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx2.hpp +1591 -0
  149. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx2_128.hpp +170 -0
  150. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512bw.hpp +724 -0
  151. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512cd.hpp +28 -0
  152. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512dq.hpp +270 -0
  153. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512er.hpp +17 -0
  154. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512f.hpp +2919 -0
  155. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512ifma.hpp +17 -0
  156. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512pf.hpp +17 -0
  157. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512vbmi.hpp +76 -0
  158. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512vbmi2.hpp +130 -0
  159. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512vnni_avx512bw.hpp +17 -0
  160. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512vnni_avx512vbmi2.hpp +17 -0
  161. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx_128.hpp +164 -0
  162. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avxvnni.hpp +17 -0
  163. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_common.hpp +26 -0
  164. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_common_fwd.hpp +127 -0
  165. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_constants.hpp +393 -0
  166. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_emulated.hpp +787 -0
  167. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_fma3_avx.hpp +93 -0
  168. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_fma3_avx2.hpp +46 -0
  169. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_fma3_sse.hpp +97 -0
  170. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_fma4.hpp +92 -0
  171. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_i8mm_neon64.hpp +17 -0
  172. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_isa.hpp +148 -0
  173. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_neon.hpp +3580 -0
  174. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_neon64.hpp +1614 -0
  175. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_rvv.hpp +1515 -0
  176. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_scalar.hpp +1210 -0
  177. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_sse2.hpp +2333 -0
  178. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_sse3.hpp +66 -0
  179. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_sse4_1.hpp +510 -0
  180. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_sse4_2.hpp +44 -0
  181. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_ssse3.hpp +186 -0
  182. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_sve.hpp +1186 -0
  183. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_vsx.hpp +947 -0
  184. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_vxe.hpp +787 -0
  185. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_wasm.hpp +1819 -0
  186. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_arch.hpp +242 -0
  187. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_config.hpp +633 -0
  188. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpu_features.hpp +50 -0
  189. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpu_features_arm.hpp +132 -0
  190. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpu_features_ppc.hpp +54 -0
  191. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpu_features_riscv.hpp +95 -0
  192. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpu_features_s390x.hpp +56 -0
  193. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpu_features_x86.hpp +1121 -0
  194. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpuid.hpp +144 -0
  195. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_getauxval.hpp +159 -0
  196. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_macros.hpp +78 -0
  197. package/third-party/common/phonemis/src/third-party/xsimd/math/xsimd_rem_pio2.hpp +707 -0
  198. package/third-party/common/phonemis/src/third-party/xsimd/memory/xsimd_aligned_allocator.hpp +349 -0
  199. package/third-party/common/phonemis/src/third-party/xsimd/memory/xsimd_alignment.hpp +102 -0
  200. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_all_registers.hpp +57 -0
  201. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_api.hpp +3106 -0
  202. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx2_register.hpp +57 -0
  203. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512bw_register.hpp +51 -0
  204. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512cd_register.hpp +51 -0
  205. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512dq_register.hpp +51 -0
  206. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512er_register.hpp +51 -0
  207. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512f_register.hpp +77 -0
  208. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512ifma_register.hpp +51 -0
  209. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512pf_register.hpp +51 -0
  210. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512vbmi2_register.hpp +51 -0
  211. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512vbmi_register.hpp +51 -0
  212. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512vnni_avx512bw_register.hpp +54 -0
  213. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512vnni_avx512vbmi2_register.hpp +53 -0
  214. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx_register.hpp +79 -0
  215. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avxvnni_register.hpp +44 -0
  216. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_batch.hpp +1666 -0
  217. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_batch_constant.hpp +572 -0
  218. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_batch_fwd.hpp +41 -0
  219. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_common_arch.hpp +49 -0
  220. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_emulated_register.hpp +80 -0
  221. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_fma3_avx2_register.hpp +50 -0
  222. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_fma3_avx_register.hpp +50 -0
  223. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_fma3_sse_register.hpp +50 -0
  224. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_fma4_register.hpp +50 -0
  225. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_i8mm_neon64_register.hpp +55 -0
  226. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_neon64_register.hpp +55 -0
  227. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_neon_register.hpp +130 -0
  228. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_register.hpp +96 -0
  229. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_rvv_register.hpp +491 -0
  230. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_sse2_register.hpp +59 -0
  231. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_sse3_register.hpp +49 -0
  232. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_sse4_1_register.hpp +48 -0
  233. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_sse4_2_register.hpp +48 -0
  234. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_ssse3_register.hpp +48 -0
  235. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_sve_register.hpp +216 -0
  236. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_traits.hpp +409 -0
  237. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_utils.hpp +462 -0
  238. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_vsx_register.hpp +84 -0
  239. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_vxe_register.hpp +86 -0
  240. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_wasm_register.hpp +59 -0
  241. package/third-party/common/phonemis/src/third-party/xsimd/utils/bits.hpp +122 -0
  242. package/third-party/common/phonemis/src/third-party/xsimd/utils/xsimd_type_traits.hpp +145 -0
  243. package/third-party/common/phonemis/src/third-party/xsimd/xsimd.hpp +43 -0
  244. package/third-party/common/phonemis/src/phonemis/base/processor/constants.h +0 -11
  245. package/third-party/common/phonemis/src/phonemis/base/processor/num2word/config.h +0 -16
  246. package/third-party/common/phonemis/src/phonemis/base/processor/num2word/layer.cpp +0 -271
  247. package/third-party/common/phonemis/src/phonemis/base/processor/num2word/layer.h +0 -45
  248. package/third-party/common/phonemis/src/phonemis/base/processor/num2word/types.h +0 -29
  249. package/third-party/common/phonemis/src/phonemis/base/processor/sanitizer_layer.cpp +0 -22
  250. package/third-party/common/phonemis/src/phonemis/base/processor/trim_layer.cpp +0 -40
  251. package/third-party/common/phonemis/src/phonemis/base/processor/trim_layer.h +0 -22
@@ -0,0 +1,491 @@
1
+ /***************************************************************************
2
+ * Copyright (c) Johan Mabille, Sylvain Corlay, Wolf Vollprecht and *
3
+ * Martin Renou *
4
+ * Copyright (c) QuantStack *
5
+ * Copyright (c) Serge Guelton *
6
+ * Copyright (c) Yibo Cai *
7
+ * *
8
+ * Distributed under the terms of the BSD 3-Clause License. *
9
+ * *
10
+ * The full license is in the file LICENSE, distributed with this software. *
11
+ ****************************************************************************/
12
+
13
+ #ifndef XSIMD_RVV_REGISTER_HPP
14
+ #define XSIMD_RVV_REGISTER_HPP
15
+
16
+ #include "../utils/xsimd_type_traits.hpp"
17
+ #include "./xsimd_common_arch.hpp"
18
+ #include "./xsimd_register.hpp"
19
+
20
+ #if XSIMD_WITH_RVV
21
+ #include <riscv_vector.h>
22
+ #endif
23
+
24
+ namespace xsimd
25
+ {
26
+ namespace detail
27
+ {
28
+ /**
29
+ * @ingroup architectures
30
+ *
31
+ * RVV instructions (fixed vector size) for riscv
32
+ */
33
+ template <size_t Width>
34
+ struct rvv : xsimd::common
35
+ {
36
+ static constexpr size_t width = Width;
37
+ static constexpr bool supported() noexcept { return Width == XSIMD_RVV_BITS; }
38
+ static constexpr bool available() noexcept { return true; }
39
+ static constexpr bool requires_alignment() noexcept { return true; }
40
+ static constexpr std::size_t alignment() noexcept { return 16; }
41
+ static constexpr char const* name() noexcept { return "riscv+rvv"; }
42
+ };
43
+ }
44
+
45
+ #if XSIMD_WITH_RVV
46
+
47
+ using rvv = detail::rvv<__riscv_v_fixed_vlen>;
48
+
49
+ #define XSIMD_RVV_JOINT_(a, b, c) a##b##c
50
+ #define XSIMD_RVV_JOINT(a, b, c) XSIMD_RVV_JOINT_(a, b, c)
51
+ #define XSIMD_RVV_JOINT5(a, b, c, d, e) XSIMD_RVV_JOINT(XSIMD_RVV_JOINT(a, b, c), d, e)
52
+
53
+ #define XSIMD_RVV_TYPE_i(S, V) XSIMD_RVV_JOINT5(vint, S, m, V, _t)
54
+ #define XSIMD_RVV_TYPE_u(S, V) XSIMD_RVV_JOINT5(vuint, S, m, V, _t)
55
+ #define XSIMD_RVV_TYPE_f(S, V) XSIMD_RVV_JOINT5(vfloat, S, m, V, _t)
56
+ #define XSIMD_RVV_TYPE(T, S, V) XSIMD_RVV_JOINT(XSIMD_RVV_TYPE, _, T)(S, V)
57
+
58
+ namespace types
59
+ {
60
+ namespace detail
61
+ {
62
+ static constexpr size_t rvv_width_mf8 = XSIMD_RVV_BITS / 8;
63
+ static constexpr size_t rvv_width_mf4 = XSIMD_RVV_BITS / 4;
64
+ static constexpr size_t rvv_width_mf2 = XSIMD_RVV_BITS / 2;
65
+ static constexpr size_t rvv_width_m1 = XSIMD_RVV_BITS;
66
+
67
+ // Cope with gcc limitation, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116484
68
+ #define XSIMD_RVV_WIDTH_MF8 (XSIMD_RVV_BITS / 8)
69
+ #define XSIMD_RVV_WIDTH_MF4 (XSIMD_RVV_BITS / 4)
70
+ #define XSIMD_RVV_WIDTH_MF2 (XSIMD_RVV_BITS / 2)
71
+ #define XSIMD_RVV_WIDTH_M1 XSIMD_RVV_BITS
72
+
73
+ // rvv_type_info is a utility class to convert scalar type and
74
+ // bitwidth into rvv register types.
75
+ //
76
+ // * `type` is the unadorned vector type.
77
+ // * `fixed_type` is the same type, but with the storage attribute
78
+ // applied.
79
+ // * `byte_type` is the type which is the same size in unsigned
80
+ // bytes, used as an intermediate step for bit-cast operations,
81
+ // because only a subset of __riscv_vreinterpret() intrinsics
82
+ // exist -- but always enough to get us to bytes and back.
83
+ //
84
+ template <class T, size_t Width>
85
+ struct rvv_type_info;
86
+ #define XSIMD_RVV_MAKE_TYPE(scalar, t, s, vmul) \
87
+ template <> \
88
+ struct rvv_type_info<scalar, rvv_width_m1 * vmul> \
89
+ { \
90
+ static constexpr size_t width = rvv_width_m1 * vmul; \
91
+ using type = XSIMD_RVV_TYPE(t, s, vmul); \
92
+ using byte_type = XSIMD_RVV_TYPE(u, 8, vmul); \
93
+ using fixed_type = type __attribute__((riscv_rvv_vector_bits(/*width=*/XSIMD_RVV_WIDTH_M1 * vmul))); \
94
+ template <class U> \
95
+ static XSIMD_INLINE type bitcast(U x) noexcept \
96
+ { \
97
+ const auto words = XSIMD_RVV_JOINT5(__riscv_vreinterpret_, u, s, m, vmul)(x); \
98
+ return XSIMD_RVV_JOINT5(__riscv_vreinterpret_, t, s, m, vmul)(words); \
99
+ } \
100
+ template <class U> \
101
+ static XSIMD_INLINE byte_type as_bytes(U x) noexcept \
102
+ { \
103
+ static_assert(std::is_same<U, type>::value, "inconsistent conversion types"); \
104
+ const auto words = XSIMD_RVV_JOINT5(__riscv_vreinterpret_, u, s, m, vmul)(x); \
105
+ return XSIMD_RVV_JOINT5(__riscv_vreinterpret_, u, 8, m, vmul)(words); \
106
+ } \
107
+ }; \
108
+ template <> \
109
+ XSIMD_INLINE XSIMD_RVV_TYPE(t, s, vmul) rvv_type_info<scalar, rvv_width_m1 * vmul>::bitcast<XSIMD_RVV_TYPE(t, s, vmul)>(XSIMD_RVV_TYPE(t, s, vmul) x) noexcept { return x; }
110
+
111
+ #define XSIMD_RVV_MAKE_TYPES(vmul) \
112
+ XSIMD_RVV_MAKE_TYPE(int8_t, i, 8, vmul) \
113
+ XSIMD_RVV_MAKE_TYPE(uint8_t, u, 8, vmul) \
114
+ XSIMD_RVV_MAKE_TYPE(int16_t, i, 16, vmul) \
115
+ XSIMD_RVV_MAKE_TYPE(uint16_t, u, 16, vmul) \
116
+ XSIMD_RVV_MAKE_TYPE(int32_t, i, 32, vmul) \
117
+ XSIMD_RVV_MAKE_TYPE(uint32_t, u, 32, vmul) \
118
+ XSIMD_RVV_MAKE_TYPE(int64_t, i, 64, vmul) \
119
+ XSIMD_RVV_MAKE_TYPE(uint64_t, u, 64, vmul) \
120
+ XSIMD_RVV_MAKE_TYPE(float, f, 32, vmul) \
121
+ XSIMD_RVV_MAKE_TYPE(double, f, 64, vmul)
122
+
123
+ XSIMD_RVV_MAKE_TYPES(8)
124
+ XSIMD_RVV_MAKE_TYPES(4)
125
+ XSIMD_RVV_MAKE_TYPES(2)
126
+ XSIMD_RVV_MAKE_TYPES(1)
127
+ #undef XSIMD_RVV_TYPE
128
+ #undef XSIMD_RVV_TYPE_f
129
+ #undef XSIMD_RVV_TYPE_u
130
+ #undef XSIMD_RVV_TYPE_i
131
+ #undef XSIMD_RVV_MAKE_TYPES
132
+ #undef XSIMD_RVV_MAKE_TYPE
133
+
134
+ // Specialization needed for #1058
135
+ template <>
136
+ XSIMD_INLINE rvv_type_info<int8_t, rvv_width_m1 * 8>::type
137
+ rvv_type_info<int8_t, rvv_width_m1 * 8>::bitcast<__rvv_uint8m8_t>(
138
+ __rvv_uint8m8_t x) noexcept
139
+ {
140
+ return __riscv_vreinterpret_i8m8(x);
141
+ }
142
+ template <>
143
+ XSIMD_INLINE rvv_type_info<int8_t, rvv_width_m1 * 1>::type
144
+ rvv_type_info<int8_t, rvv_width_m1 * 1>::bitcast<__rvv_uint8m1_t>(
145
+ __rvv_uint8m1_t x) noexcept
146
+ {
147
+ return __riscv_vreinterpret_i8m1(x);
148
+ }
149
+ template <>
150
+ XSIMD_INLINE rvv_type_info<uint16_t, rvv_width_m1 * 1>::type
151
+ rvv_type_info<uint16_t, rvv_width_m1 * 1>::bitcast<__rvv_uint8m1_t>(
152
+ __rvv_uint8m1_t x) noexcept
153
+ {
154
+ return __riscv_vreinterpret_u16m1(x);
155
+ }
156
+ template <>
157
+ XSIMD_INLINE rvv_type_info<uint32_t, rvv_width_m1 * 1>::type
158
+ rvv_type_info<uint32_t, rvv_width_m1 * 1>::bitcast<__rvv_uint8m1_t>(
159
+ __rvv_uint8m1_t x) noexcept
160
+ {
161
+ return __riscv_vreinterpret_u32m1(x);
162
+ }
163
+ template <>
164
+ XSIMD_INLINE rvv_type_info<uint64_t, rvv_width_m1 * 1>::type
165
+ rvv_type_info<uint64_t, rvv_width_m1 * 1>::bitcast<__rvv_uint8m1_t>(
166
+ __rvv_uint8m1_t x) noexcept
167
+ {
168
+ return __riscv_vreinterpret_u64m1(x);
169
+ }
170
+
171
+ //
172
+
173
+ template <>
174
+ XSIMD_INLINE rvv_type_info<int8_t, rvv_width_m1 * 8>::byte_type
175
+ rvv_type_info<int8_t, rvv_width_m1 * 8>::as_bytes<__rvv_int8m8_t>(__rvv_int8m8_t x) noexcept
176
+ {
177
+ return __riscv_vreinterpret_u8m8(x);
178
+ }
179
+ template <>
180
+ XSIMD_INLINE rvv_type_info<int8_t, rvv_width_m1 * 1>::byte_type
181
+ rvv_type_info<int8_t, rvv_width_m1 * 1>::as_bytes<__rvv_int8m1_t>(__rvv_int8m1_t x) noexcept
182
+ {
183
+ return __riscv_vreinterpret_u8m1(x);
184
+ }
185
+
186
+ template <>
187
+ XSIMD_INLINE rvv_type_info<uint8_t, rvv_width_m1 * 1>::byte_type
188
+ rvv_type_info<uint8_t, rvv_width_m1 * 1>::as_bytes<__rvv_uint8m1_t>(__rvv_uint8m1_t x) noexcept
189
+ {
190
+ return x;
191
+ }
192
+ template <>
193
+ XSIMD_INLINE rvv_type_info<uint16_t, rvv_width_m1 * 1>::byte_type
194
+ rvv_type_info<uint16_t, rvv_width_m1 * 1>::as_bytes<__rvv_uint16m1_t>(__rvv_uint16m1_t x) noexcept
195
+ {
196
+ return __riscv_vreinterpret_u8m1(x);
197
+ }
198
+ template <>
199
+ XSIMD_INLINE rvv_type_info<uint32_t, rvv_width_m1 * 1>::byte_type
200
+ rvv_type_info<uint32_t, rvv_width_m1 * 1>::as_bytes<__rvv_uint32m1_t>(__rvv_uint32m1_t x) noexcept
201
+ {
202
+ return __riscv_vreinterpret_u8m1(x);
203
+ }
204
+ template <>
205
+ XSIMD_INLINE rvv_type_info<uint64_t, rvv_width_m1 * 1>::byte_type
206
+ rvv_type_info<uint64_t, rvv_width_m1 * 1>::as_bytes<__rvv_uint64m1_t>(__rvv_uint64m1_t x) noexcept
207
+ {
208
+ return __riscv_vreinterpret_u8m1(x);
209
+ }
210
+
211
+ // rvv_blob is storage-type abstraction for a vector register.
212
+ template <class T, size_t Width>
213
+ struct rvv_blob : public rvv_type_info<T, Width>
214
+ {
215
+ using super = rvv_type_info<T, Width>;
216
+ using typename super::fixed_type;
217
+ using typename super::type;
218
+
219
+ fixed_type value;
220
+ type get() const { return value; }
221
+ void set(type v) { value = v; }
222
+ };
223
+
224
+ template <size_t div>
225
+ struct semitype;
226
+ template <>
227
+ struct semitype<2>
228
+ {
229
+ using type = vuint8mf2_t __attribute__((riscv_rvv_vector_bits(XSIMD_RVV_WIDTH_MF2)));
230
+ };
231
+ template <>
232
+ struct semitype<4>
233
+ {
234
+ using type = vuint8mf4_t __attribute__((riscv_rvv_vector_bits(XSIMD_RVV_WIDTH_MF4)));
235
+ };
236
+ template <>
237
+ struct semitype<8>
238
+ {
239
+ using type = vuint8mf8_t __attribute__((riscv_rvv_vector_bits(XSIMD_RVV_WIDTH_MF8)));
240
+ };
241
+
242
+ //
243
+ // But sometimes we want our storage type to be less than a whole
244
+ // register, while presenting as a whole register to the outside
245
+ // world. This is because some partial-register types are not
246
+ // defined, but they can (mostly) be emulated using shorter vl on a
247
+ // full-width register for arithmetic, and cast back to a partial
248
+ // byte register for storage.
249
+ //
250
+ template <class T, size_t divisor>
251
+ struct rvv_semiblob : public rvv_type_info<T, rvv_width_m1>
252
+ {
253
+ using super = rvv_type_info<T, rvv_width_m1>;
254
+ static constexpr size_t width = rvv_width_m1 / divisor;
255
+ using typename super::type;
256
+ using fixed_type = typename semitype<divisor>::type;
257
+ using super::as_bytes;
258
+ using super::bitcast;
259
+
260
+ fixed_type value;
261
+ vuint8m1_t get_bytes(std::integral_constant<size_t, 2>) const { return __riscv_vlmul_ext_v_u8mf2_u8m1(value); }
262
+ vuint8m1_t get_bytes(std::integral_constant<size_t, 4>) const { return __riscv_vlmul_ext_v_u8mf4_u8m1(value); }
263
+ vuint8m1_t get_bytes(std::integral_constant<size_t, 8>) const { return __riscv_vlmul_ext_v_u8mf8_u8m1(value); }
264
+ type get() const noexcept
265
+ {
266
+ vuint8m1_t bytes = get_bytes(std::integral_constant<size_t, divisor>());
267
+ return bitcast(bytes);
268
+ }
269
+ void set_bytes(vuint8m1_t v, std::integral_constant<size_t, 2>) { value = __riscv_vlmul_trunc_v_u8m1_u8mf2(v); }
270
+ void set_bytes(vuint8m1_t v, std::integral_constant<size_t, 4>) { value = __riscv_vlmul_trunc_v_u8m1_u8mf4(v); }
271
+ void set_bytes(vuint8m1_t v, std::integral_constant<size_t, 8>) { value = __riscv_vlmul_trunc_v_u8m1_u8mf8(v); }
272
+ void set(type v)
273
+ {
274
+ vuint8m1_t bytes = as_bytes(v);
275
+ set_bytes(bytes, std::integral_constant<size_t, divisor>());
276
+ }
277
+ };
278
+ template <class T>
279
+ struct rvv_blob<T, rvv_width_mf2> : rvv_semiblob<T, 2>
280
+ {
281
+ };
282
+ template <class T>
283
+ struct rvv_blob<T, rvv_width_mf4> : rvv_semiblob<T, 4>
284
+ {
285
+ };
286
+ template <class T>
287
+ struct rvv_blob<T, rvv_width_mf8> : rvv_semiblob<T, 8>
288
+ {
289
+ };
290
+
291
+ // An explicit constructor isn't really explicit enough to allow
292
+ // implicit bit-casting operations between incompatible types, so
293
+ // we add this vacuous flag argument when we're serious:
294
+ //
295
+ enum rvv_bitcast_flag
296
+ {
297
+ XSIMD_RVV_BITCAST
298
+ };
299
+
300
+ // the general-purpose vector register type, usable within
301
+ // templates, and supporting arithmetic on partial registers for
302
+ // which there is no intrinsic type (by casting via a full register
303
+ // type).
304
+ //
305
+ template <class T, size_t Width>
306
+ struct rvv_reg
307
+ {
308
+ static constexpr size_t width = Width;
309
+ static constexpr size_t vl = Width / (sizeof(T) * 8);
310
+ using blob_type = rvv_blob<T, Width>;
311
+ using register_type = typename blob_type::type;
312
+ using byte_type = typename blob_type::byte_type;
313
+ blob_type value;
314
+ rvv_reg() noexcept = default;
315
+ rvv_reg(register_type x) noexcept { value.set(x); }
316
+ explicit rvv_reg(byte_type v, rvv_bitcast_flag) { value.set(value.bitcast(v)); }
317
+ template <class U>
318
+ explicit rvv_reg(rvv_reg<U, Width> v, rvv_bitcast_flag)
319
+ : rvv_reg(v.get_bytes(), XSIMD_RVV_BITCAST)
320
+ {
321
+ }
322
+ byte_type get_bytes() const noexcept
323
+ {
324
+ return blob_type::as_bytes(value.get());
325
+ }
326
+ operator register_type() const noexcept { return value.get(); }
327
+ };
328
+ template <class T, size_t Width = XSIMD_RVV_BITS>
329
+ using rvv_reg_t = std::conditional_t<!std::is_void<T>::value, rvv_reg<map_to_sized_type_t<T>, Width>, void>;
330
+
331
+ // And some more of the same stuff for bool types, which have
332
+ // similar problems and similar workarounds.
333
+ //
334
+ template <size_t>
335
+ struct rvv_bool_info;
336
+ #define XSIMD_RVV_MAKE_BOOL_TYPE(i) \
337
+ template <> \
338
+ struct rvv_bool_info<i> \
339
+ { \
340
+ using type = XSIMD_RVV_JOINT(vbool, i, _t); \
341
+ template <class T> \
342
+ static XSIMD_INLINE type bitcast(T value) noexcept \
343
+ { \
344
+ return XSIMD_RVV_JOINT(__riscv_vreinterpret_b, i, )(value); \
345
+ } \
346
+ /*template <> static XSIMD_INLINE type bitcast(type value) noexcept { return value; }*/ \
347
+ };
348
+ XSIMD_RVV_MAKE_BOOL_TYPE(1);
349
+ XSIMD_RVV_MAKE_BOOL_TYPE(2);
350
+ XSIMD_RVV_MAKE_BOOL_TYPE(4);
351
+ XSIMD_RVV_MAKE_BOOL_TYPE(8);
352
+ XSIMD_RVV_MAKE_BOOL_TYPE(16);
353
+ XSIMD_RVV_MAKE_BOOL_TYPE(32);
354
+ XSIMD_RVV_MAKE_BOOL_TYPE(64);
355
+ #undef XSIMD_RVV_MAKE_BOOL_TYPE
356
+ #undef XSIMD_RVV_JOINT5
357
+ #undef XSIMD_RVV_JOINT
358
+ #undef XSIMD_RVV_JOINT_
359
+
360
+ template <class T, size_t Width>
361
+ struct rvv_bool
362
+ {
363
+ using bool_info = rvv_bool_info<rvv_width_m1 * sizeof(T) * 8 / Width>;
364
+ using storage_type = vuint8m1_t __attribute__((riscv_rvv_vector_bits(XSIMD_RVV_WIDTH_M1)));
365
+ using type = typename bool_info::type;
366
+ storage_type value;
367
+ rvv_bool() = default;
368
+ rvv_bool(type v) noexcept
369
+ : value(__riscv_vreinterpret_u8m1(v))
370
+ {
371
+ }
372
+ template <class U, std::enable_if_t<sizeof(T) == sizeof(U), int> = 0>
373
+ rvv_bool(rvv_bool<U, Width> v)
374
+ : value(v.value)
375
+ {
376
+ }
377
+ explicit rvv_bool(uint8_t mask) noexcept
378
+ : value(__riscv_vmv_v_x_u8m1(mask, rvv_width_m1 / 8))
379
+ {
380
+ }
381
+ explicit rvv_bool(uint64_t mask) noexcept
382
+ : value(__riscv_vreinterpret_v_u64m1_u8m1(__riscv_vmv_v_x_u64m1(mask, rvv_width_m1 / 64)))
383
+ {
384
+ }
385
+ operator type() const noexcept { return bool_info::bitcast(value); }
386
+ type as_mask() const noexcept { return (type) * this; }
387
+ };
388
+
389
+ template <class T, size_t Width = XSIMD_RVV_BITS>
390
+ using rvv_bool_t = std::enable_if_t < !std::is_void<T>::value,
391
+ rvv_bool<map_to_sized_type_t<T>, Width<rvv_width_m1 ? rvv_width_m1 : Width>>;
392
+
393
+ template <size_t S>
394
+ struct rvv_vector_type_impl;
395
+
396
+ template <>
397
+ struct rvv_vector_type_impl<8>
398
+ {
399
+ using signed_type = rvv_reg_t<int8_t>;
400
+ using unsigned_type = rvv_reg_t<uint8_t>;
401
+ using floating_point_type = void;
402
+ };
403
+
404
+ template <>
405
+ struct rvv_vector_type_impl<16>
406
+ {
407
+ using signed_type = rvv_reg_t<int16_t>;
408
+ using unsigned_type = rvv_reg_t<uint16_t>;
409
+ using floating_point_type = rvv_reg_t<_Float16>;
410
+ };
411
+
412
+ template <>
413
+ struct rvv_vector_type_impl<32>
414
+ {
415
+ using signed_type = rvv_reg_t<int32_t>;
416
+ using unsigned_type = rvv_reg_t<uint32_t>;
417
+ using floating_point_type = rvv_reg_t<float>;
418
+ };
419
+
420
+ template <>
421
+ struct rvv_vector_type_impl<64>
422
+ {
423
+ using signed_type = rvv_reg_t<int64_t>;
424
+ using unsigned_type = rvv_reg_t<uint64_t>;
425
+ using floating_point_type = rvv_reg_t<double>;
426
+ };
427
+
428
+ template <class T>
429
+ using signed_int_rvv_vector_type = typename rvv_vector_type_impl<8 * sizeof(T)>::signed_type;
430
+
431
+ template <class T>
432
+ using unsigned_int_rvv_vector_type = typename rvv_vector_type_impl<8 * sizeof(T)>::unsigned_type;
433
+
434
+ template <class T>
435
+ using floating_point_rvv_vector_type = typename rvv_vector_type_impl<8 * sizeof(T)>::floating_point_type;
436
+
437
+ template <class T>
438
+ using signed_int_or_floating_point_rvv_vector_type = std::conditional_t<std::is_floating_point<T>::value,
439
+ floating_point_rvv_vector_type<T>,
440
+ signed_int_rvv_vector_type<T>>;
441
+
442
+ template <class T>
443
+ using rvv_vector_type = std::conditional_t<std::is_signed<T>::value,
444
+ signed_int_or_floating_point_rvv_vector_type<T>,
445
+ unsigned_int_rvv_vector_type<T>>;
446
+ } // namespace detail
447
+
448
+ XSIMD_DECLARE_SIMD_REGISTER(bool, rvv, detail::rvv_vector_type<unsigned char>);
449
+ XSIMD_DECLARE_SIMD_REGISTER(signed char, rvv, detail::rvv_vector_type<signed char>);
450
+ XSIMD_DECLARE_SIMD_REGISTER(unsigned char, rvv, detail::rvv_vector_type<unsigned char>);
451
+ XSIMD_DECLARE_SIMD_REGISTER(char, rvv, detail::rvv_vector_type<char>);
452
+ XSIMD_DECLARE_SIMD_REGISTER(short, rvv, detail::rvv_vector_type<short>);
453
+ XSIMD_DECLARE_SIMD_REGISTER(unsigned short, rvv, detail::rvv_vector_type<unsigned short>);
454
+ XSIMD_DECLARE_SIMD_REGISTER(int, rvv, detail::rvv_vector_type<int>);
455
+ XSIMD_DECLARE_SIMD_REGISTER(unsigned int, rvv, detail::rvv_vector_type<unsigned int>);
456
+ XSIMD_DECLARE_SIMD_REGISTER(long int, rvv, detail::rvv_vector_type<long int>);
457
+ XSIMD_DECLARE_SIMD_REGISTER(unsigned long int, rvv, detail::rvv_vector_type<unsigned long int>);
458
+ XSIMD_DECLARE_SIMD_REGISTER(long long int, rvv, detail::rvv_vector_type<long long int>);
459
+ XSIMD_DECLARE_SIMD_REGISTER(unsigned long long int, rvv, detail::rvv_vector_type<unsigned long long int>);
460
+ XSIMD_DECLARE_SIMD_REGISTER(float, rvv, detail::rvv_vector_type<float>);
461
+ XSIMD_DECLARE_SIMD_REGISTER(double, rvv, detail::rvv_vector_type<double>);
462
+
463
+ namespace detail
464
+ {
465
+ template <class T>
466
+ struct rvv_bool_simd_register
467
+ {
468
+ using register_type = rvv_bool_t<T>;
469
+ register_type data;
470
+ operator register_type() const noexcept { return data; }
471
+ };
472
+ } // namespace detail
473
+
474
+ template <class T>
475
+ struct get_bool_simd_register<T, rvv>
476
+ {
477
+ using type = detail::rvv_bool_simd_register<T>;
478
+ };
479
+ } // namespace types
480
+
481
+ #undef XSIMD_RVV_WIDTH_MF8
482
+ #undef XSIMD_RVV_WIDTH_MF4
483
+ #undef XSIMD_RVV_WIDTH_MF2
484
+ #undef XSIMD_RVV_WIDTH_M1
485
+
486
+ #else
487
+ using rvv = detail::rvv<0xFFFFFFFF>;
488
+ #endif
489
+ } // namespace xsimd
490
+
491
+ #endif
@@ -0,0 +1,59 @@
1
+ /***************************************************************************
2
+ * Copyright (c) Johan Mabille, Sylvain Corlay, Wolf Vollprecht and *
3
+ * Martin Renou *
4
+ * Copyright (c) QuantStack *
5
+ * Copyright (c) Serge Guelton *
6
+ * *
7
+ * Distributed under the terms of the BSD 3-Clause License. *
8
+ * *
9
+ * The full license is in the file LICENSE, distributed with this software. *
10
+ ****************************************************************************/
11
+
12
+ #ifndef XSIMD_SSE2_REGISTER_HPP
13
+ #define XSIMD_SSE2_REGISTER_HPP
14
+
15
+ #include "./xsimd_common_arch.hpp"
16
+ #include "./xsimd_register.hpp"
17
+
18
+ #if XSIMD_WITH_SSE2
19
+ #include <emmintrin.h>
20
+ #include <xmmintrin.h>
21
+ #endif
22
+
23
+ namespace xsimd
24
+ {
25
+ /**
26
+ * @ingroup architectures
27
+ *
28
+ * SSE2 instructions
29
+ */
30
+ struct sse2 : common
31
+ {
32
+ static constexpr bool supported() noexcept { return XSIMD_WITH_SSE2; }
33
+ static constexpr bool available() noexcept { return true; }
34
+ static constexpr bool requires_alignment() noexcept { return true; }
35
+ static constexpr std::size_t alignment() noexcept { return 16; }
36
+ static constexpr char const* name() noexcept { return "sse2"; }
37
+ };
38
+
39
+ #if XSIMD_WITH_SSE2
40
+ namespace types
41
+ {
42
+ XSIMD_DECLARE_SIMD_REGISTER(signed char, sse2, __m128i);
43
+ XSIMD_DECLARE_SIMD_REGISTER(unsigned char, sse2, __m128i);
44
+ XSIMD_DECLARE_SIMD_REGISTER(char, sse2, __m128i);
45
+ XSIMD_DECLARE_SIMD_REGISTER(unsigned short, sse2, __m128i);
46
+ XSIMD_DECLARE_SIMD_REGISTER(short, sse2, __m128i);
47
+ XSIMD_DECLARE_SIMD_REGISTER(unsigned int, sse2, __m128i);
48
+ XSIMD_DECLARE_SIMD_REGISTER(int, sse2, __m128i);
49
+ XSIMD_DECLARE_SIMD_REGISTER(unsigned long int, sse2, __m128i);
50
+ XSIMD_DECLARE_SIMD_REGISTER(long int, sse2, __m128i);
51
+ XSIMD_DECLARE_SIMD_REGISTER(unsigned long long int, sse2, __m128i);
52
+ XSIMD_DECLARE_SIMD_REGISTER(long long int, sse2, __m128i);
53
+ XSIMD_DECLARE_SIMD_REGISTER(float, sse2, __m128);
54
+ XSIMD_DECLARE_SIMD_REGISTER(double, sse2, __m128d);
55
+ }
56
+ #endif
57
+ }
58
+
59
+ #endif
@@ -0,0 +1,49 @@
1
+ /***************************************************************************
2
+ * Copyright (c) Johan Mabille, Sylvain Corlay, Wolf Vollprecht and *
3
+ * Martin Renou *
4
+ * Copyright (c) QuantStack *
5
+ * Copyright (c) Serge Guelton *
6
+ * *
7
+ * Distributed under the terms of the BSD 3-Clause License. *
8
+ * *
9
+ * The full license is in the file LICENSE, distributed with this software. *
10
+ ****************************************************************************/
11
+
12
+ #ifndef XSIMD_SSE3_REGISTER_HPP
13
+ #define XSIMD_SSE3_REGISTER_HPP
14
+
15
+ #include "./xsimd_sse2_register.hpp"
16
+
17
+ #if XSIMD_WITH_SSE3
18
+ #include <pmmintrin.h>
19
+ #endif
20
+
21
+ namespace xsimd
22
+ {
23
+ /**
24
+ * @ingroup architectures
25
+ *
26
+ * SSE3 instructions
27
+ */
28
+ struct sse3 : sse2
29
+ {
30
+ static constexpr bool supported() noexcept { return XSIMD_WITH_SSE3; }
31
+ static constexpr bool available() noexcept { return true; }
32
+ static constexpr char const* name() noexcept { return "sse3"; }
33
+ };
34
+
35
+ #if XSIMD_WITH_SSE3
36
+
37
+ #if !XSIMD_WITH_SSE2
38
+ #error "architecture inconsistency: sse3 requires sse2"
39
+ #endif
40
+
41
+ namespace types
42
+ {
43
+
44
+ XSIMD_DECLARE_SIMD_REGISTER_ALIAS(sse3, sse2);
45
+ }
46
+ #endif
47
+ }
48
+
49
+ #endif
@@ -0,0 +1,48 @@
1
+ /***************************************************************************
2
+ * Copyright (c) Johan Mabille, Sylvain Corlay, Wolf Vollprecht and *
3
+ * Martin Renou *
4
+ * Copyright (c) QuantStack *
5
+ * Copyright (c) Serge Guelton *
6
+ * *
7
+ * Distributed under the terms of the BSD 3-Clause License. *
8
+ * *
9
+ * The full license is in the file LICENSE, distributed with this software. *
10
+ ****************************************************************************/
11
+
12
+ #ifndef XSIMD_SSE4_1_REGISTER_HPP
13
+ #define XSIMD_SSE4_1_REGISTER_HPP
14
+
15
+ #include "./xsimd_ssse3_register.hpp"
16
+
17
+ #if XSIMD_WITH_SSE4_1
18
+ #include <smmintrin.h>
19
+ #endif
20
+
21
+ namespace xsimd
22
+ {
23
+ /**
24
+ * @ingroup architectures
25
+ *
26
+ * SSE4.1 instructions
27
+ */
28
+ struct sse4_1 : ssse3
29
+ {
30
+ static constexpr bool supported() noexcept { return XSIMD_WITH_SSE4_1; }
31
+ static constexpr bool available() noexcept { return true; }
32
+ static constexpr char const* name() noexcept { return "sse4.1"; }
33
+ };
34
+
35
+ #if XSIMD_WITH_SSE4_1
36
+
37
+ #if !XSIMD_WITH_SSSE3
38
+ #error "architecture inconsistency: sse4.1 requires ssse3"
39
+ #endif
40
+
41
+ namespace types
42
+ {
43
+ XSIMD_DECLARE_SIMD_REGISTER_ALIAS(sse4_1, ssse3);
44
+ }
45
+ #endif
46
+ }
47
+
48
+ #endif