react-native-executorch 0.10.6 → 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 (237) hide show
  1. package/lib/module/fetcher/telemetry.js +1 -1
  2. package/package.json +1 -1
  3. package/react-native-executorch.podspec +2 -0
  4. package/src/fetcher/telemetry.ts +1 -1
  5. package/third-party/common/phonemis/CMakeLists.txt +70 -14
  6. package/third-party/common/phonemis/README.md +183 -33
  7. package/third-party/common/phonemis/THIRD_PARTY_NOTICES.md +57 -0
  8. package/third-party/common/phonemis/knowledge/code_style.md +642 -0
  9. package/third-party/common/phonemis/licenses/Unicode-3.0.txt +39 -0
  10. package/third-party/common/phonemis/licenses/misaki-Apache-2.0.txt +201 -0
  11. package/third-party/common/phonemis/licenses/nlohmann-json-MIT.txt +21 -0
  12. package/third-party/common/phonemis/licenses/xsimd-BSD-3-Clause.txt +29 -0
  13. package/third-party/common/phonemis/src/phonemis/base/config.h +6 -0
  14. package/third-party/common/phonemis/src/phonemis/base/ipipeline.cpp +75 -0
  15. package/third-party/common/phonemis/src/phonemis/base/ipipeline.h +21 -0
  16. package/third-party/common/phonemis/src/phonemis/base/phonemizer/constants.h +2 -5
  17. package/third-party/common/phonemis/src/phonemis/base/phonemizer/lexicon_phonemizer.cpp +3 -4
  18. package/third-party/common/phonemis/src/phonemis/base/phonemizer/nn/neural_phonemizer.cpp +17 -8
  19. package/third-party/common/phonemis/src/phonemis/base/phonemizer/nn/neural_phonemizer.h +4 -0
  20. package/third-party/common/phonemis/src/phonemis/base/phonemizer/nn/tokenizer.cpp +21 -6
  21. package/third-party/common/phonemis/src/phonemis/base/phonemizer/nn/tokenizer.h +13 -4
  22. package/third-party/common/phonemis/src/phonemis/base/pipeline.cpp +8 -0
  23. package/third-party/common/phonemis/src/phonemis/base/pipeline.h +19 -0
  24. package/third-party/common/phonemis/src/phonemis/base/processor/common/conditions.cpp +37 -0
  25. package/third-party/common/phonemis/src/phonemis/base/processor/common/conditions.h +45 -0
  26. package/third-party/common/phonemis/src/phonemis/base/processor/common/constants.h +10 -0
  27. package/third-party/common/phonemis/src/phonemis/base/processor/common/context.cpp +105 -0
  28. package/third-party/common/phonemis/src/phonemis/base/processor/common/context.h +49 -0
  29. package/third-party/common/phonemis/src/phonemis/base/processor/common/document.cpp +173 -0
  30. package/third-party/common/phonemis/src/phonemis/base/processor/common/document.h +67 -0
  31. package/third-party/common/phonemis/src/phonemis/base/processor/common/text.cpp +75 -0
  32. package/third-party/common/phonemis/src/phonemis/base/processor/common/text.h +60 -0
  33. package/third-party/common/phonemis/src/phonemis/base/processor/common/types.h +18 -0
  34. package/third-party/common/phonemis/src/phonemis/base/processor/config.h +53 -0
  35. package/third-party/common/phonemis/src/phonemis/base/processor/layer.h +9 -7
  36. package/third-party/common/phonemis/src/phonemis/base/processor/layers/normalize/constants.h +20 -0
  37. package/third-party/common/phonemis/src/phonemis/base/processor/layers/normalize/layer.cpp +89 -0
  38. package/third-party/common/phonemis/src/phonemis/base/processor/layers/normalize/layer.h +35 -0
  39. package/third-party/common/phonemis/src/phonemis/base/processor/layers/normalize/types.h +16 -0
  40. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/kind.h +40 -0
  41. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/layer.h +382 -0
  42. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/notation.h +30 -0
  43. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/numerals.cpp +51 -0
  44. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/numerals.h +31 -0
  45. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/pattern.h +30 -0
  46. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/pattern_set.cpp +17 -0
  47. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/pattern_set.h +31 -0
  48. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/patterns.cpp +811 -0
  49. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/patterns.h +285 -0
  50. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/primitives.cpp +64 -0
  51. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/primitives.h +23 -0
  52. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/types.h +94 -0
  53. package/third-party/common/phonemis/src/phonemis/base/processor/layers/sanitizer/layer.cpp +19 -0
  54. package/third-party/common/phonemis/src/phonemis/base/processor/{sanitizer_layer.h → layers/sanitizer/layer.h} +8 -8
  55. package/third-party/common/phonemis/src/phonemis/base/processor/layers/sym2word/layer.cpp +65 -0
  56. package/third-party/common/phonemis/src/phonemis/base/processor/layers/sym2word/layer.h +29 -0
  57. package/third-party/common/phonemis/src/phonemis/base/processor/layers/term2word/layer.cpp +170 -0
  58. package/third-party/common/phonemis/src/phonemis/base/processor/layers/term2word/layer.h +40 -0
  59. package/third-party/common/phonemis/src/phonemis/base/processor/layers/term2word/types.h +25 -0
  60. package/third-party/common/phonemis/src/phonemis/base/processor/layers/trim/layer.cpp +47 -0
  61. package/third-party/common/phonemis/src/phonemis/base/processor/layers/trim/layer.h +19 -0
  62. package/third-party/common/phonemis/src/phonemis/base/processor/preprocessor.cpp +60 -0
  63. package/third-party/common/phonemis/src/phonemis/base/processor/preprocessor.h +45 -0
  64. package/third-party/common/phonemis/src/phonemis/base/processor/processor.cpp +6 -7
  65. package/third-party/common/phonemis/src/phonemis/base/processor/processor.h +14 -10
  66. package/third-party/common/phonemis/src/phonemis/base/tagger/hmm_tagger.cpp +89 -52
  67. package/third-party/common/phonemis/src/phonemis/base/tagger/hmm_tagger.h +16 -9
  68. package/third-party/common/phonemis/src/phonemis/base/tokenizer/tokenizer.cpp +13 -12
  69. package/third-party/common/phonemis/src/phonemis/lang/de/constants.h +183 -19
  70. package/third-party/common/phonemis/src/phonemis/lang/de/num2word.cpp +355 -309
  71. package/third-party/common/phonemis/src/phonemis/lang/de/num2word.h +42 -17
  72. package/third-party/common/phonemis/src/phonemis/lang/de/patterns.cpp +56 -0
  73. package/third-party/common/phonemis/src/phonemis/lang/de/patterns.h +15 -0
  74. package/third-party/common/phonemis/src/phonemis/lang/de/pipeline.h +3 -3
  75. package/third-party/common/phonemis/src/phonemis/lang/en/constants.h +181 -30
  76. package/third-party/common/phonemis/src/phonemis/lang/en/hmm_tagger.cpp +5 -7
  77. package/third-party/common/phonemis/src/phonemis/lang/en/num2word.cpp +232 -135
  78. package/third-party/common/phonemis/src/phonemis/lang/en/num2word.h +41 -16
  79. package/third-party/common/phonemis/src/phonemis/lang/en/pipeline.h +3 -10
  80. package/third-party/common/phonemis/src/phonemis/lang/es/constants.h +182 -60
  81. package/third-party/common/phonemis/src/phonemis/lang/es/num2word.cpp +247 -212
  82. package/third-party/common/phonemis/src/phonemis/lang/es/num2word.h +38 -18
  83. package/third-party/common/phonemis/src/phonemis/lang/es/patterns.cpp +50 -0
  84. package/third-party/common/phonemis/src/phonemis/lang/es/patterns.h +15 -0
  85. package/third-party/common/phonemis/src/phonemis/lang/es/pipeline.h +3 -3
  86. package/third-party/common/phonemis/src/phonemis/lang/fr/constants.h +152 -26
  87. package/third-party/common/phonemis/src/phonemis/lang/fr/num2word.cpp +252 -179
  88. package/third-party/common/phonemis/src/phonemis/lang/fr/num2word.h +38 -15
  89. package/third-party/common/phonemis/src/phonemis/lang/fr/patterns.cpp +83 -0
  90. package/third-party/common/phonemis/src/phonemis/lang/fr/patterns.h +15 -0
  91. package/third-party/common/phonemis/src/phonemis/lang/fr/pipeline.h +3 -3
  92. package/third-party/common/phonemis/src/phonemis/lang/hi/constants.h +62 -10
  93. package/third-party/common/phonemis/src/phonemis/lang/hi/num2word.cpp +74 -123
  94. package/third-party/common/phonemis/src/phonemis/lang/hi/num2word.h +27 -16
  95. package/third-party/common/phonemis/src/phonemis/lang/hi/pipeline.h +5 -3
  96. package/third-party/common/phonemis/src/phonemis/lang/it/constants.h +122 -42
  97. package/third-party/common/phonemis/src/phonemis/lang/it/num2word.cpp +200 -207
  98. package/third-party/common/phonemis/src/phonemis/lang/it/num2word.h +30 -18
  99. package/third-party/common/phonemis/src/phonemis/lang/it/patterns.cpp +25 -0
  100. package/third-party/common/phonemis/src/phonemis/lang/it/patterns.h +15 -0
  101. package/third-party/common/phonemis/src/phonemis/lang/it/pipeline.h +3 -3
  102. package/third-party/common/phonemis/src/phonemis/lang/pl/constants.h +346 -77
  103. package/third-party/common/phonemis/src/phonemis/lang/pl/num2word.cpp +631 -246
  104. package/third-party/common/phonemis/src/phonemis/lang/pl/num2word.h +47 -15
  105. package/third-party/common/phonemis/src/phonemis/lang/pl/pipeline.h +6 -6
  106. package/third-party/common/phonemis/src/phonemis/lang/pt/constants.h +201 -0
  107. package/third-party/common/phonemis/src/phonemis/lang/pt/num2word.cpp +365 -0
  108. package/third-party/common/phonemis/src/phonemis/lang/pt/num2word.h +53 -0
  109. package/third-party/common/phonemis/src/phonemis/lang/pt/pipeline.h +4 -2
  110. package/third-party/common/phonemis/src/phonemis/main.cpp +42 -11
  111. package/third-party/common/phonemis/src/phonemis/protophone/meta.h +24 -0
  112. package/third-party/common/phonemis/src/phonemis/protophone/numeric.h +26 -0
  113. package/third-party/common/phonemis/src/phonemis/protophone/protophone.cpp +525 -0
  114. package/third-party/common/phonemis/src/phonemis/protophone/protophone.h +80 -0
  115. package/third-party/common/phonemis/src/phonemis/protophone/tensor.h +76 -0
  116. package/third-party/common/phonemis/src/phonemis/protophone/tensor_utils.h +89 -0
  117. package/third-party/common/phonemis/src/phonemis/protophone/tensor_view.h +125 -0
  118. package/third-party/common/phonemis/src/phonemis/protophone/types.h +43 -0
  119. package/third-party/common/phonemis/src/phonemis/utils/strings.h +20 -14
  120. package/third-party/common/phonemis/src/phonemis/utils/unicode.h +15 -1
  121. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_arithmetic.hpp +267 -0
  122. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_bit.hpp +232 -0
  123. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_cast.hpp +43 -0
  124. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_complex.hpp +112 -0
  125. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_details.hpp +386 -0
  126. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_logical.hpp +240 -0
  127. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_math.hpp +2601 -0
  128. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_memory.hpp +1006 -0
  129. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_rounding.hpp +72 -0
  130. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_swizzle.hpp +260 -0
  131. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_trigo.hpp +996 -0
  132. package/third-party/common/phonemis/src/third-party/xsimd/arch/utils/shifts.hpp +82 -0
  133. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx.hpp +2111 -0
  134. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx2.hpp +1591 -0
  135. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx2_128.hpp +170 -0
  136. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512bw.hpp +724 -0
  137. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512cd.hpp +28 -0
  138. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512dq.hpp +270 -0
  139. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512er.hpp +17 -0
  140. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512f.hpp +2919 -0
  141. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512ifma.hpp +17 -0
  142. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512pf.hpp +17 -0
  143. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512vbmi.hpp +76 -0
  144. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512vbmi2.hpp +130 -0
  145. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512vnni_avx512bw.hpp +17 -0
  146. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512vnni_avx512vbmi2.hpp +17 -0
  147. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx_128.hpp +164 -0
  148. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avxvnni.hpp +17 -0
  149. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_common.hpp +26 -0
  150. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_common_fwd.hpp +127 -0
  151. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_constants.hpp +393 -0
  152. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_emulated.hpp +787 -0
  153. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_fma3_avx.hpp +93 -0
  154. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_fma3_avx2.hpp +46 -0
  155. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_fma3_sse.hpp +97 -0
  156. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_fma4.hpp +92 -0
  157. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_i8mm_neon64.hpp +17 -0
  158. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_isa.hpp +148 -0
  159. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_neon.hpp +3580 -0
  160. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_neon64.hpp +1614 -0
  161. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_rvv.hpp +1515 -0
  162. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_scalar.hpp +1210 -0
  163. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_sse2.hpp +2333 -0
  164. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_sse3.hpp +66 -0
  165. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_sse4_1.hpp +510 -0
  166. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_sse4_2.hpp +44 -0
  167. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_ssse3.hpp +186 -0
  168. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_sve.hpp +1186 -0
  169. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_vsx.hpp +947 -0
  170. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_vxe.hpp +787 -0
  171. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_wasm.hpp +1819 -0
  172. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_arch.hpp +242 -0
  173. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_config.hpp +633 -0
  174. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpu_features.hpp +50 -0
  175. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpu_features_arm.hpp +132 -0
  176. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpu_features_ppc.hpp +54 -0
  177. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpu_features_riscv.hpp +95 -0
  178. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpu_features_s390x.hpp +56 -0
  179. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpu_features_x86.hpp +1121 -0
  180. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpuid.hpp +144 -0
  181. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_getauxval.hpp +159 -0
  182. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_macros.hpp +78 -0
  183. package/third-party/common/phonemis/src/third-party/xsimd/math/xsimd_rem_pio2.hpp +707 -0
  184. package/third-party/common/phonemis/src/third-party/xsimd/memory/xsimd_aligned_allocator.hpp +349 -0
  185. package/third-party/common/phonemis/src/third-party/xsimd/memory/xsimd_alignment.hpp +102 -0
  186. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_all_registers.hpp +57 -0
  187. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_api.hpp +3106 -0
  188. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx2_register.hpp +57 -0
  189. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512bw_register.hpp +51 -0
  190. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512cd_register.hpp +51 -0
  191. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512dq_register.hpp +51 -0
  192. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512er_register.hpp +51 -0
  193. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512f_register.hpp +77 -0
  194. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512ifma_register.hpp +51 -0
  195. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512pf_register.hpp +51 -0
  196. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512vbmi2_register.hpp +51 -0
  197. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512vbmi_register.hpp +51 -0
  198. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512vnni_avx512bw_register.hpp +54 -0
  199. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512vnni_avx512vbmi2_register.hpp +53 -0
  200. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx_register.hpp +79 -0
  201. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avxvnni_register.hpp +44 -0
  202. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_batch.hpp +1666 -0
  203. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_batch_constant.hpp +572 -0
  204. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_batch_fwd.hpp +41 -0
  205. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_common_arch.hpp +49 -0
  206. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_emulated_register.hpp +80 -0
  207. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_fma3_avx2_register.hpp +50 -0
  208. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_fma3_avx_register.hpp +50 -0
  209. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_fma3_sse_register.hpp +50 -0
  210. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_fma4_register.hpp +50 -0
  211. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_i8mm_neon64_register.hpp +55 -0
  212. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_neon64_register.hpp +55 -0
  213. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_neon_register.hpp +130 -0
  214. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_register.hpp +96 -0
  215. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_rvv_register.hpp +491 -0
  216. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_sse2_register.hpp +59 -0
  217. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_sse3_register.hpp +49 -0
  218. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_sse4_1_register.hpp +48 -0
  219. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_sse4_2_register.hpp +48 -0
  220. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_ssse3_register.hpp +48 -0
  221. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_sve_register.hpp +216 -0
  222. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_traits.hpp +409 -0
  223. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_utils.hpp +462 -0
  224. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_vsx_register.hpp +84 -0
  225. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_vxe_register.hpp +86 -0
  226. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_wasm_register.hpp +59 -0
  227. package/third-party/common/phonemis/src/third-party/xsimd/utils/bits.hpp +122 -0
  228. package/third-party/common/phonemis/src/third-party/xsimd/utils/xsimd_type_traits.hpp +145 -0
  229. package/third-party/common/phonemis/src/third-party/xsimd/xsimd.hpp +43 -0
  230. package/third-party/common/phonemis/src/phonemis/base/processor/constants.h +0 -11
  231. package/third-party/common/phonemis/src/phonemis/base/processor/num2word/config.h +0 -16
  232. package/third-party/common/phonemis/src/phonemis/base/processor/num2word/layer.cpp +0 -271
  233. package/third-party/common/phonemis/src/phonemis/base/processor/num2word/layer.h +0 -45
  234. package/third-party/common/phonemis/src/phonemis/base/processor/num2word/types.h +0 -29
  235. package/third-party/common/phonemis/src/phonemis/base/processor/sanitizer_layer.cpp +0 -22
  236. package/third-party/common/phonemis/src/phonemis/base/processor/trim_layer.cpp +0 -40
  237. package/third-party/common/phonemis/src/phonemis/base/processor/trim_layer.h +0 -22
@@ -0,0 +1,386 @@
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_COMMON_DETAILS_HPP
13
+ #define XSIMD_COMMON_DETAILS_HPP
14
+
15
+ #include <complex>
16
+
17
+ #include "../../math/xsimd_rem_pio2.hpp"
18
+ #include "../../types/xsimd_common_arch.hpp"
19
+ #include "../../types/xsimd_utils.hpp"
20
+ #include "../xsimd_constants.hpp"
21
+
22
+ namespace xsimd
23
+ {
24
+ // Forward declaration. Should we put them in a separate file?
25
+ template <class T, class A>
26
+ XSIMD_INLINE batch<T, A> abs(batch<T, A> const& self) noexcept;
27
+ template <class T, class A>
28
+ XSIMD_INLINE batch<T, A> abs(batch<std::complex<T>, A> const& self) noexcept;
29
+ template <class T, class A>
30
+ XSIMD_INLINE bool any(batch_bool<T, A> const& self) noexcept;
31
+ template <class T, class A>
32
+ XSIMD_INLINE batch<T, A> atan2(batch<T, A> const& self, batch<T, A> const& other) noexcept;
33
+ template <class A, class T_out, class T_in>
34
+ XSIMD_INLINE batch<T_out, A> batch_cast(batch<T_in, A> const&, batch<T_out, A> const& out) noexcept;
35
+ template <class T, class A>
36
+ XSIMD_INLINE batch<T, A> bitofsign(batch<T, A> const& self) noexcept;
37
+ template <class T_out, class T_in, class A>
38
+ XSIMD_INLINE batch<T_out, A> bitwise_cast(batch<T_in, A> const& self) noexcept;
39
+ template <class T, class A>
40
+ XSIMD_INLINE batch<T, A> cos(batch<T, A> const& self) noexcept;
41
+ template <class T, class A>
42
+ XSIMD_INLINE batch<T, A> cosh(batch<T, A> const& self) noexcept;
43
+ template <class T, class A>
44
+ XSIMD_INLINE batch<T, A> exp(batch<T, A> const& self) noexcept;
45
+ template <class T, class A>
46
+ XSIMD_INLINE batch<T, A> fma(batch<T, A> const& x, batch<T, A> const& y, batch<T, A> const& z) noexcept;
47
+ template <class T, class A>
48
+ XSIMD_INLINE batch<T, A> fms(batch<T, A> const& x, batch<T, A> const& y, batch<T, A> const& z) noexcept;
49
+ template <class T, class A>
50
+ XSIMD_INLINE batch<T, A> fmas(batch<T, A> const& x, batch<T, A> const& y, batch<T, A> const& z) noexcept;
51
+ template <class T, class A>
52
+ XSIMD_INLINE batch<T, A> frexp(const batch<T, A>& x, const batch<as_integer_t<T>, A>& e) noexcept;
53
+ template <class T, class A, uint64_t... Coefs>
54
+ XSIMD_INLINE batch<T, A> horner(const batch<T, A>& self) noexcept;
55
+ template <class T, class A>
56
+ XSIMD_INLINE batch<T, A> hypot(const batch<T, A>& self) noexcept;
57
+ template <class T, class A>
58
+ XSIMD_INLINE batch_bool<T, A> is_even(batch<T, A> const& self) noexcept;
59
+ template <class T, class A>
60
+ XSIMD_INLINE batch_bool<T, A> is_flint(batch<T, A> const& self) noexcept;
61
+ template <class T, class A>
62
+ XSIMD_INLINE batch_bool<T, A> is_odd(batch<T, A> const& self) noexcept;
63
+ template <class T, class A>
64
+ XSIMD_INLINE typename batch<T, A>::batch_bool_type isinf(batch<T, A> const& self) noexcept;
65
+ template <class T, class A>
66
+ XSIMD_INLINE typename batch<T, A>::batch_bool_type isfinite(batch<T, A> const& self) noexcept;
67
+ template <class T, class A>
68
+ XSIMD_INLINE typename batch<T, A>::batch_bool_type isnan(batch<T, A> const& self) noexcept;
69
+ template <class T, class A>
70
+ XSIMD_INLINE batch<T, A> ldexp(const batch<T, A>& x, const batch<as_integer_t<T>, A>& e) noexcept;
71
+ template <class T, class A>
72
+ XSIMD_INLINE batch<T, A> log(batch<T, A> const& self) noexcept;
73
+ template <class T, class A>
74
+ XSIMD_INLINE batch<T, A> nearbyint(batch<T, A> const& self) noexcept;
75
+ template <class T, class A>
76
+ XSIMD_INLINE batch<as_integer_t<T>, A> nearbyint_as_int(const batch<T, A>& x) noexcept;
77
+ template <class T, class A>
78
+ XSIMD_INLINE T reduce_add(batch<T, A> const&) noexcept;
79
+ template <class T, class A>
80
+ XSIMD_INLINE T reduce_mul(batch<T, A> const&) noexcept;
81
+ template <class T, class A>
82
+ XSIMD_INLINE batch<T, A> select(batch_bool<T, A> const&, batch<T, A> const&, batch<T, A> const&) noexcept;
83
+ template <class T, class A>
84
+ XSIMD_INLINE batch<std::complex<T>, A> select(batch_bool<T, A> const&, batch<std::complex<T>, A> const&, batch<std::complex<T>, A> const&) noexcept;
85
+ template <class T, class A>
86
+ XSIMD_INLINE batch<T, A> sign(batch<T, A> const& self) noexcept;
87
+ template <class T, class A>
88
+ XSIMD_INLINE batch<T, A> signnz(batch<T, A> const& self) noexcept;
89
+ template <class T, class A>
90
+ XSIMD_INLINE batch<T, A> sin(batch<T, A> const& self) noexcept;
91
+ template <class T, class A>
92
+ XSIMD_INLINE batch<T, A> sinh(batch<T, A> const& self) noexcept;
93
+ template <class T, class A>
94
+ XSIMD_INLINE std::pair<batch<T, A>, batch<T, A>> sincos(batch<T, A> const& self) noexcept;
95
+ template <class T, class A>
96
+ XSIMD_INLINE batch<T, A> sqrt(batch<T, A> const& self) noexcept;
97
+ template <class T, class A, class Vt, Vt... Values>
98
+ XSIMD_INLINE std::enable_if_t<std::is_arithmetic<T>::value, batch<T, A>>
99
+ swizzle(batch<T, A> const& x, batch_constant<Vt, A, Values...> mask) noexcept;
100
+ template <class T, class A>
101
+ XSIMD_INLINE batch<T, A> tan(batch<T, A> const& self) noexcept;
102
+ template <class T, class A>
103
+ XSIMD_INLINE batch<as_float_t<T>, A> to_float(batch<T, A> const& self) noexcept;
104
+ template <class T, class A>
105
+ XSIMD_INLINE batch<as_integer_t<T>, A> to_int(batch<T, A> const& self) noexcept;
106
+ template <class T, class A>
107
+ XSIMD_INLINE batch<T, A> trunc(batch<T, A> const& self) noexcept;
108
+
109
+ namespace kernel
110
+ {
111
+
112
+ namespace detail
113
+ {
114
+ // Prevent -ffast-math from reassociating floating-point
115
+ // arithmetic across this point. The reason string
116
+ // documents *why* at each call site; unused at runtime.
117
+ //
118
+ // Zero-cost register constraints per target:
119
+ // x86 "+x" (XMM/YMM/ZMM, also scalar float/double)
120
+ // ARM "+w" (V-reg / SVE Z-reg, also scalar float/double)
121
+ // PPC "+wa" (VS register, also scalar float/double)
122
+ // RISC-V "+f" (F/D register, scalar float/double)
123
+ // RISC-V RVV "+vr" (V register; GCC 15+ / Clang 20+)
124
+ //
125
+ // On unknown targets the "+m" fallback spills; it is
126
+ // only emitted when the compiler can actually reassociate.
127
+ template <class T>
128
+ XSIMD_INLINE void reassociation_barrier(T& x, const char*) noexcept
129
+ {
130
+ #if XSIMD_REASSOCIATIVE_MATH && XSIMD_WITH_INLINE_ASM && !defined(__EMSCRIPTEN__)
131
+ #if XSIMD_WITH_SSE2
132
+ __asm__ volatile("" : "+x"(x));
133
+ #elif XSIMD_WITH_NEON || XSIMD_WITH_SVE
134
+ __asm__ volatile("" : "+w"(x));
135
+ #elif XSIMD_WITH_VSX
136
+ __asm__ volatile("" : "+wa"(x));
137
+ #else
138
+ __asm__ volatile("" : "+m"(x));
139
+ #endif
140
+ #else
141
+ (void)x;
142
+ #endif
143
+ }
144
+
145
+ // RISC-V scalar float/double: use F/D registers instead of
146
+ // spilling through "+m". These overloads also serve
147
+ // emulated batches on RISC-V via the std::array overload.
148
+ #if XSIMD_REASSOCIATIVE_MATH && XSIMD_WITH_INLINE_ASM && defined(__riscv)
149
+ XSIMD_INLINE void reassociation_barrier(float& x, const char*) noexcept
150
+ {
151
+ __asm__ volatile("" : "+f"(x));
152
+ }
153
+ XSIMD_INLINE void reassociation_barrier(double& x, const char*) noexcept
154
+ {
155
+ __asm__ volatile("" : "+f"(x));
156
+ }
157
+ #endif
158
+
159
+ template <class T, size_t N>
160
+ XSIMD_INLINE void reassociation_barrier(std::array<T, N>& arr, const char* reason) noexcept
161
+ {
162
+ for (auto& v : arr)
163
+ reassociation_barrier(v, reason);
164
+ }
165
+
166
+ template <class T, class A>
167
+ XSIMD_INLINE void reassociation_barrier(batch<T, A>& b, const char* reason) noexcept
168
+ {
169
+ #if XSIMD_REASSOCIATIVE_MATH && XSIMD_WITH_RVV && XSIMD_WITH_INLINE_ASM && ((__GNUC__ >= 15) || (__clang_major__ >= 20))
170
+ __asm__ volatile("" : "+vr"(b.data.value.value));
171
+ (void)reason;
172
+ #else
173
+ reassociation_barrier(b.data, reason);
174
+ #endif
175
+ }
176
+
177
+ template <class F, class A, class T, class... Batches>
178
+ XSIMD_INLINE batch<T, A> apply(F&& func, batch<T, A> const& self, batch<T, A> const& other) noexcept
179
+ {
180
+ constexpr std::size_t size = batch<T, A>::size;
181
+ alignas(A::alignment()) T self_buffer[size];
182
+ alignas(A::alignment()) T other_buffer[size];
183
+ self.store_aligned(&self_buffer[0]);
184
+ other.store_aligned(&other_buffer[0]);
185
+ for (std::size_t i = 0; i < size; ++i)
186
+ {
187
+ self_buffer[i] = func(self_buffer[i], other_buffer[i]);
188
+ }
189
+ return batch<T, A>::load_aligned(self_buffer);
190
+ }
191
+
192
+ template <class U, class F, class A, class T>
193
+ XSIMD_INLINE batch<U, A> apply_transform(F&& func, batch<T, A> const& self) noexcept
194
+ {
195
+ static_assert(batch<T, A>::size == batch<U, A>::size,
196
+ "Source and destination sizes must match");
197
+ constexpr std::size_t src_size = batch<T, A>::size;
198
+ constexpr std::size_t dest_size = batch<U, A>::size;
199
+ alignas(A::alignment()) T self_buffer[src_size];
200
+ alignas(A::alignment()) U other_buffer[dest_size];
201
+ self.store_aligned(&self_buffer[0]);
202
+ for (std::size_t i = 0; i < src_size; ++i)
203
+ {
204
+ other_buffer[i] = func(self_buffer[i]);
205
+ }
206
+ return batch<U, A>::load_aligned(other_buffer);
207
+ }
208
+ }
209
+
210
+ // some common fast_cast conversion
211
+ namespace detail
212
+ {
213
+ template <class A>
214
+ XSIMD_INLINE batch<uint8_t, A> fast_cast(batch<int8_t, A> const& self, batch<uint8_t, A> const&, requires_arch<common>) noexcept
215
+ {
216
+ return bitwise_cast<uint8_t>(self);
217
+ }
218
+ template <class A>
219
+ XSIMD_INLINE batch<uint16_t, A> fast_cast(batch<int16_t, A> const& self, batch<uint16_t, A> const&, requires_arch<common>) noexcept
220
+ {
221
+ return bitwise_cast<uint16_t>(self);
222
+ }
223
+ template <class A>
224
+ XSIMD_INLINE batch<uint32_t, A> fast_cast(batch<int32_t, A> const& self, batch<uint32_t, A> const&, requires_arch<common>) noexcept
225
+ {
226
+ return bitwise_cast<uint32_t>(self);
227
+ }
228
+ template <class A>
229
+ XSIMD_INLINE batch<uint64_t, A> fast_cast(batch<int64_t, A> const& self, batch<uint64_t, A> const&, requires_arch<common>) noexcept
230
+ {
231
+ return bitwise_cast<uint64_t>(self);
232
+ }
233
+ template <class A>
234
+ XSIMD_INLINE batch<int8_t, A> fast_cast(batch<uint8_t, A> const& self, batch<int8_t, A> const&, requires_arch<common>) noexcept
235
+ {
236
+ return bitwise_cast<int8_t>(self);
237
+ }
238
+ template <class A>
239
+ XSIMD_INLINE batch<int16_t, A> fast_cast(batch<uint16_t, A> const& self, batch<int16_t, A> const&, requires_arch<common>) noexcept
240
+ {
241
+ return bitwise_cast<int16_t>(self);
242
+ }
243
+ template <class A>
244
+ XSIMD_INLINE batch<int32_t, A> fast_cast(batch<uint32_t, A> const& self, batch<int32_t, A> const&, requires_arch<common>) noexcept
245
+ {
246
+ return bitwise_cast<int32_t>(self);
247
+ }
248
+ template <class A>
249
+ XSIMD_INLINE batch<int64_t, A> fast_cast(batch<uint64_t, A> const& self, batch<int64_t, A> const&, requires_arch<common>) noexcept
250
+ {
251
+ return bitwise_cast<int64_t>(self);
252
+ }
253
+
254
+ // Provide a common uint32_t -> float cast only if we have a
255
+ // non-common int32_t -> float fast_cast
256
+ template <class A, class = decltype(fast_cast(std::declval<batch<int32_t, A> const&>(), std::declval<batch<float, A> const&>(), A {}))>
257
+ XSIMD_INLINE batch<float, A> fast_cast(batch<uint32_t, A> const& v, batch<float, A> const&, requires_arch<common>) noexcept
258
+ {
259
+ // see https://stackoverflow.com/questions/34066228/how-to-perform-uint32-float-conversion-with-sse
260
+ batch<uint32_t, A> msk_lo(0xFFFF);
261
+ batch<float, A> cnst65536f(65536.0f);
262
+
263
+ auto v_lo = batch_cast<int32_t>(v & msk_lo); /* extract the 16 lowest significant bits of self */
264
+ auto v_hi = batch_cast<int32_t>(v >> 16); /* 16 most significant bits of v */
265
+ auto v_lo_flt = batch_cast<float>(v_lo); /* No rounding */
266
+ auto v_hi_flt = batch_cast<float>(v_hi); /* No rounding */
267
+ v_hi_flt = cnst65536f * v_hi_flt; /* No rounding */
268
+ return v_hi_flt + v_lo_flt; /* Rounding may occur here, mul and add may fuse to fma for haswell and newer */
269
+ }
270
+
271
+ // Provide a common float -> uint32_t cast only if we have a
272
+ // non-common float -> int32_t fast_cast
273
+ template <class A, class = decltype(fast_cast(std::declval<batch<float, A> const&>(), std::declval<batch<int32_t, A> const&>(), A {}))>
274
+ XSIMD_INLINE batch<uint32_t, A> fast_cast(batch<float, A> const& v, batch<uint32_t, A> const&, requires_arch<common>) noexcept
275
+ {
276
+ auto is_large = v >= batch<float, A>(1u << 31);
277
+ auto small_v = bitwise_cast<float>(batch_cast<int32_t>(v));
278
+ auto large_v = bitwise_cast<float>(
279
+ batch_cast<int32_t>(v - batch<float, A>(1u << 31))
280
+ ^ batch<int32_t, A>(1u << 31));
281
+ return bitwise_cast<uint32_t>(select(is_large, large_v, small_v));
282
+ }
283
+ }
284
+
285
+ namespace detail
286
+ {
287
+ // Generic conversion handling machinery. Each architecture must define
288
+ // conversion function when such conversions exits in the form of
289
+ // intrinsic. Then we use that information to automatically decide whether
290
+ // to use scalar or vector conversion when doing load / store / batch_cast
291
+ struct with_fast_conversion
292
+ {
293
+ };
294
+ struct with_slow_conversion
295
+ {
296
+ };
297
+
298
+ template <class A, class From, class To, class = void>
299
+ struct conversion_type_impl
300
+ {
301
+ using type = with_slow_conversion;
302
+ };
303
+
304
+ using xsimd::detail::void_t;
305
+
306
+ template <class A, class From, class To>
307
+ struct conversion_type_impl<A, From, To,
308
+ void_t<decltype(fast_cast(std::declval<const batch<From, A>&>(),
309
+ std::declval<const batch<To, A>&>(),
310
+ std::declval<const A&>()))>>
311
+ {
312
+ using type = with_fast_conversion;
313
+ };
314
+
315
+ template <class A, class From, class To>
316
+ using conversion_type = typename conversion_type_impl<A, From, To>::type;
317
+ }
318
+
319
+ namespace detail
320
+ {
321
+ /* origin: boost/simdfunction/horn.hpp*/
322
+ /*
323
+ * ====================================================
324
+ * copyright 2016 NumScale SAS
325
+ *
326
+ * Distributed under the Boost Software License, Version 1.0.
327
+ * (See copy at http://boost.org/LICENSE_1_0.txt)
328
+ * ====================================================
329
+ */
330
+ template <class B, uint64_t c>
331
+ XSIMD_INLINE B coef() noexcept
332
+ {
333
+ using value_type = typename B::value_type;
334
+ return B(bit_cast<value_type>(as_unsigned_integer_t<value_type>(c)));
335
+ }
336
+ template <class B>
337
+ XSIMD_INLINE B horner(const B&) noexcept
338
+ {
339
+ return B(typename B::value_type(0.));
340
+ }
341
+
342
+ template <class B, uint64_t c0>
343
+ XSIMD_INLINE B horner(const B&) noexcept
344
+ {
345
+ return coef<B, c0>();
346
+ }
347
+
348
+ template <class B, uint64_t c0, uint64_t c1, uint64_t... args>
349
+ XSIMD_INLINE B horner(const B& self) noexcept
350
+ {
351
+ return fma(self, horner<B, c1, args...>(self), coef<B, c0>());
352
+ }
353
+
354
+ /* origin: boost/simdfunction/horn1.hpp*/
355
+ /*
356
+ * ====================================================
357
+ * copyright 2016 NumScale SAS
358
+ *
359
+ * Distributed under the Boost Software License, Version 1.0.
360
+ * (See copy at http://boost.org/LICENSE_1_0.txt)
361
+ * ====================================================
362
+ */
363
+ template <class B>
364
+ XSIMD_INLINE B horner1(const B&) noexcept
365
+ {
366
+ return B(1.);
367
+ }
368
+
369
+ template <class B, uint64_t c0>
370
+ XSIMD_INLINE B horner1(const B& x) noexcept
371
+ {
372
+ return x + detail::coef<B, c0>();
373
+ }
374
+
375
+ template <class B, uint64_t c0, uint64_t c1, uint64_t... args>
376
+ XSIMD_INLINE B horner1(const B& x) noexcept
377
+ {
378
+ return fma(x, horner1<B, c1, args...>(x), detail::coef<B, c0>());
379
+ }
380
+ }
381
+
382
+ }
383
+
384
+ }
385
+
386
+ #endif
@@ -0,0 +1,240 @@
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_COMMON_LOGICAL_HPP
13
+ #define XSIMD_COMMON_LOGICAL_HPP
14
+
15
+ #include "./xsimd_common_bit.hpp"
16
+ #include "./xsimd_common_details.hpp"
17
+
18
+ #include <climits>
19
+
20
+ namespace xsimd
21
+ {
22
+
23
+ namespace kernel
24
+ {
25
+
26
+ using namespace types;
27
+
28
+ // count
29
+ template <class A, class T>
30
+ XSIMD_INLINE size_t count(batch_bool<T, A> const& self, requires_arch<common>) noexcept
31
+ {
32
+ return xsimd::detail::popcount(self.mask());
33
+ }
34
+
35
+ template <class A, class T>
36
+ XSIMD_INLINE size_t countl_zero(batch_bool<T, A> const& self, requires_arch<common>) noexcept
37
+ {
38
+ constexpr size_t unused_bits = 64 - batch_bool<T, A>::size;
39
+ constexpr uint64_t lower_mask = batch_bool<T, A>::size < 64 ? ((uint64_t)1 << (batch_bool<T, A>::size % 64)) - 1 : (uint64_t)-1;
40
+ return xsimd::detail::countl_zero(self.mask() & lower_mask) - unused_bits;
41
+ }
42
+
43
+ template <class A, class T>
44
+ XSIMD_INLINE size_t countl_one(batch_bool<T, A> const& self, requires_arch<common>) noexcept
45
+ {
46
+ constexpr size_t unused_bits = 64 - batch_bool<T, A>::size;
47
+ constexpr uint64_t upper_mask = batch_bool<T, A>::size < 64 ? ~(((uint64_t)1 << (batch_bool<T, A>::size % 64)) - 1) : (uint64_t)0;
48
+ return xsimd::detail::countl_one(self.mask() | upper_mask) - unused_bits;
49
+ }
50
+
51
+ template <class A, class T>
52
+ XSIMD_INLINE size_t countr_zero(batch_bool<T, A> const& self, requires_arch<common>) noexcept
53
+ {
54
+ constexpr uint64_t stop = batch_bool<T, A>::size < 64 ? (uint64_t)1 << (batch_bool<T, A>::size % 64) : 0;
55
+ return xsimd::detail::countr_zero(self.mask() | stop);
56
+ }
57
+
58
+ template <class A, class T>
59
+ XSIMD_INLINE size_t countr_one(batch_bool<T, A> const& self, requires_arch<common>) noexcept
60
+ {
61
+ constexpr uint64_t stop = batch_bool<T, A>::size < 64 ? ~((uint64_t)1 << (batch_bool<T, A>::size % 64)) : (uint64_t)-1;
62
+ return xsimd::detail::countr_one(self.mask() & stop);
63
+ }
64
+
65
+ // from mask
66
+ template <class A, class T>
67
+ XSIMD_INLINE batch_bool<T, A> from_mask(batch_bool<T, A> const&, uint64_t mask, requires_arch<common>) noexcept
68
+ {
69
+ alignas(A::alignment()) bool buffer[batch_bool<T, A>::size];
70
+ // This is inefficient and should never be called.
71
+ for (size_t i = 0; i < batch_bool<T, A>::size; ++i)
72
+ buffer[i] = mask & (1ull << i);
73
+ return batch_bool<T, A>::load_aligned(buffer);
74
+ }
75
+
76
+ // ge
77
+ template <class A, class T>
78
+ XSIMD_INLINE batch_bool<T, A> ge(batch<T, A> const& self, batch<T, A> const& other, requires_arch<common>) noexcept
79
+ {
80
+ return other <= self;
81
+ }
82
+
83
+ // gt
84
+ template <class A, class T>
85
+ XSIMD_INLINE batch_bool<T, A> gt(batch<T, A> const& self, batch<T, A> const& other, requires_arch<common>) noexcept
86
+ {
87
+ return other < self;
88
+ }
89
+
90
+ // is_even
91
+ template <class A, class T>
92
+ XSIMD_INLINE batch_bool<T, A> is_even(batch<T, A> const& self, requires_arch<common>) noexcept
93
+ {
94
+ return is_flint(self * T(0.5));
95
+ }
96
+
97
+ // is_flint
98
+ template <class A, class T>
99
+ XSIMD_INLINE batch_bool<T, A> is_flint(batch<T, A> const& self, requires_arch<common>) noexcept
100
+ {
101
+ auto frac = select(isnan(self - self), constants::nan<batch<T, A>>(), self - trunc(self));
102
+ return frac == T(0.);
103
+ }
104
+
105
+ // is_odd
106
+ template <class A, class T>
107
+ XSIMD_INLINE batch_bool<T, A> is_odd(batch<T, A> const& self, requires_arch<common>) noexcept
108
+ {
109
+ return is_even(self - T(1.));
110
+ }
111
+
112
+ // isinf
113
+ template <class A, class T, class = std::enable_if_t<std::is_integral<T>::value>>
114
+ XSIMD_INLINE batch_bool<T, A> isinf(batch<T, A> const&, requires_arch<common>) noexcept
115
+ {
116
+ return batch_bool<T, A>(false);
117
+ }
118
+ template <class A>
119
+ XSIMD_INLINE batch_bool<float, A> isinf(batch<float, A> const& self, requires_arch<common>) noexcept
120
+ {
121
+ #ifdef __FAST_MATH__
122
+ (void)self;
123
+ return { false };
124
+ #else
125
+ return abs(self) == std::numeric_limits<float>::infinity();
126
+ #endif
127
+ }
128
+ template <class A>
129
+ XSIMD_INLINE batch_bool<double, A> isinf(batch<double, A> const& self, requires_arch<common>) noexcept
130
+ {
131
+ #ifdef __FAST_MATH__
132
+ (void)self;
133
+ return { false };
134
+ #else
135
+ return abs(self) == std::numeric_limits<double>::infinity();
136
+ #endif
137
+ }
138
+
139
+ // isfinite
140
+ template <class A, class T, class = std::enable_if_t<std::is_integral<T>::value>>
141
+ XSIMD_INLINE batch_bool<T, A> isfinite(batch<T, A> const&, requires_arch<common>) noexcept
142
+ {
143
+ return batch_bool<T, A>(true);
144
+ }
145
+ template <class A>
146
+ XSIMD_INLINE batch_bool<float, A> isfinite(batch<float, A> const& self, requires_arch<common>) noexcept
147
+ {
148
+ return (self - self) == 0.f;
149
+ }
150
+ template <class A>
151
+ XSIMD_INLINE batch_bool<double, A> isfinite(batch<double, A> const& self, requires_arch<common>) noexcept
152
+ {
153
+ return (self - self) == 0.;
154
+ }
155
+
156
+ // isnan
157
+ template <class A, class T, class = std::enable_if_t<std::is_integral<T>::value>>
158
+ XSIMD_INLINE batch_bool<T, A> isnan(batch<T, A> const&, requires_arch<common>) noexcept
159
+ {
160
+ return batch_bool<T, A>(false);
161
+ }
162
+
163
+ // le
164
+ template <class A, class T, class = std::enable_if_t<std::is_integral<T>::value>>
165
+ XSIMD_INLINE batch_bool<T, A> le(batch<T, A> const& self, batch<T, A> const& other, requires_arch<common>) noexcept
166
+ {
167
+ return (self < other) || (self == other);
168
+ }
169
+
170
+ // neq
171
+ template <class A, class T>
172
+ XSIMD_INLINE batch_bool<T, A> neq(batch<T, A> const& self, batch<T, A> const& other, requires_arch<common>) noexcept
173
+ {
174
+ return !(other == self);
175
+ }
176
+
177
+ // logical_and
178
+ template <class A, class T>
179
+ XSIMD_INLINE batch<T, A> logical_and(batch<T, A> const& self, batch<T, A> const& other, requires_arch<common>) noexcept
180
+ {
181
+ return detail::apply([](T x, T y) noexcept
182
+ { return x && y; },
183
+ self, other);
184
+ }
185
+
186
+ // logical_or
187
+ template <class A, class T>
188
+ XSIMD_INLINE batch<T, A> logical_or(batch<T, A> const& self, batch<T, A> const& other, requires_arch<common>) noexcept
189
+ {
190
+ return detail::apply([](T x, T y) noexcept
191
+ { return x || y; },
192
+ self, other);
193
+ }
194
+
195
+ // mask
196
+ template <class A, class T>
197
+ XSIMD_INLINE uint64_t mask(batch_bool<T, A> const& self, requires_arch<common>) noexcept
198
+ {
199
+ alignas(A::alignment()) bool buffer[batch_bool<T, A>::size];
200
+ self.store_aligned(buffer);
201
+ // This is inefficient and should never be called.
202
+ uint64_t res = 0;
203
+ for (size_t i = 0; i < batch_bool<T, A>::size; ++i)
204
+ if (buffer[i])
205
+ res |= 1ul << i;
206
+ return res;
207
+ }
208
+
209
+ // select
210
+ namespace detail
211
+ {
212
+ template <typename T, typename A>
213
+ using is_batch_bool_register_same = std::is_same<typename batch_bool<T, A>::register_type, typename batch<T, A>::register_type>;
214
+ }
215
+
216
+ template <class A, class T, std::enable_if_t<detail::is_batch_bool_register_same<T, A>::value, int> = 3>
217
+ XSIMD_INLINE batch_bool<T, A> select(batch_bool<T, A> const& cond, batch_bool<T, A> const& true_br, batch_bool<T, A> const& false_br, requires_arch<common>)
218
+ {
219
+ using register_type = typename batch_bool<T, A>::register_type;
220
+ // Do not cast, but rather reinterpret the masks as batches.
221
+ const auto true_v = batch<T, A> { static_cast<register_type>(true_br) };
222
+ const auto false_v = batch<T, A> { static_cast<register_type>(false_br) };
223
+ return batch_bool<T, A> { select(cond, true_v, false_v) };
224
+ }
225
+
226
+ template <class A, class T, std::enable_if_t<!detail::is_batch_bool_register_same<T, A>::value, int> = 3>
227
+ XSIMD_INLINE batch_bool<T, A> select(batch_bool<T, A> const& cond, batch_bool<T, A> const& true_br, batch_bool<T, A> const& false_br, requires_arch<common>)
228
+ {
229
+ return (true_br & cond) | (bitwise_andnot(false_br, cond));
230
+ }
231
+
232
+ template <class A, class T, bool... Values>
233
+ XSIMD_INLINE batch_bool<T, A> select(batch_bool_constant<T, A, Values...> const& cond, batch_bool<T, A> const& true_br, batch_bool<T, A> const& false_br, requires_arch<common>)
234
+ {
235
+ return (true_br & cond) | (false_br & ~cond);
236
+ }
237
+ }
238
+ }
239
+
240
+ #endif