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,707 @@
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
+ #include <cmath>
13
+ #include <cstdint>
14
+ #include <cstring>
15
+
16
+ namespace xsimd
17
+ {
18
+ namespace detail
19
+ {
20
+
21
+ /* origin: boost/simd/arch/common/scalar/function/rem_pio2.hpp */
22
+ /*
23
+ * ====================================================
24
+ * copyright 2016 NumScale SAS
25
+ *
26
+ * Distributed under the Boost Software License, Version 1.0.
27
+ * (See copy at http://boost.org/LICENSE_1_0.txt)
28
+ * ====================================================
29
+ */
30
+ #if defined(_MSC_VER)
31
+ #define ONCE0 \
32
+ __pragma(warning(push)) \
33
+ __pragma(warning(disable : 4127)) while (0) \
34
+ __pragma(warning(pop)) /**/
35
+ #else
36
+ #define ONCE0 while (0)
37
+ #endif
38
+
39
+ /*
40
+ * ====================================================
41
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
42
+ *
43
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
44
+ * Permission to use, copy, modify, and distribute this
45
+ * software is freely granted, provided that this notice
46
+ * is preserved.
47
+ * ====================================================
48
+ */
49
+
50
+ #ifdef XSIMD_LITTLE_ENDIAN
51
+ #define LOW_WORD_IDX 0
52
+ #define HIGH_WORD_IDX sizeof(std::uint32_t)
53
+ #else
54
+ #define LOW_WORD_IDX sizeof(std::uint32_t)
55
+ #define HIGH_WORD_IDX 0
56
+ #endif
57
+
58
+ #define GET_HIGH_WORD(i, d) \
59
+ do \
60
+ { \
61
+ double f = (d); \
62
+ std::memcpy(&(i), reinterpret_cast<char*>(&f) + HIGH_WORD_IDX, \
63
+ sizeof(std::uint32_t)); \
64
+ } \
65
+ ONCE0 \
66
+ /**/
67
+
68
+ #define GET_LOW_WORD(i, d) \
69
+ do \
70
+ { \
71
+ double f = (d); \
72
+ std::memcpy(&(i), reinterpret_cast<char*>(&f) + LOW_WORD_IDX, \
73
+ sizeof(std::uint32_t)); \
74
+ } \
75
+ ONCE0 \
76
+ /**/
77
+
78
+ #define SET_HIGH_WORD(d, v) \
79
+ do \
80
+ { \
81
+ double f = (d); \
82
+ std::uint32_t value = (v); \
83
+ std::memcpy(reinterpret_cast<char*>(&f) + HIGH_WORD_IDX, \
84
+ &value, sizeof(std::uint32_t)); \
85
+ (d) = f; \
86
+ } \
87
+ ONCE0 \
88
+ /**/
89
+
90
+ #define SET_LOW_WORD(d, v) \
91
+ do \
92
+ { \
93
+ double f = (d); \
94
+ std::uint32_t value = (v); \
95
+ std::memcpy(reinterpret_cast<char*>(&f) + LOW_WORD_IDX, \
96
+ &value, sizeof(std::uint32_t)); \
97
+ (d) = f; \
98
+ } \
99
+ ONCE0 \
100
+ /**/
101
+
102
+ /*
103
+ * __kernel_rem_pio2(x,y,e0,nx,prec,ipio2)
104
+ * double x[],y[]; int e0,nx,prec; int ipio2[];
105
+ *
106
+ * __kernel_rem_pio2 return the last three digits of N with
107
+ * y = x - N*pi/2
108
+ * so that |y| < pi/2.
109
+ *
110
+ * The method is to compute the integer (mod 8) and fraction parts of
111
+ * (2/pi)*x without doing the full multiplication. In general we
112
+ * skip the part of the product that are known to be a huge integer (
113
+ * more accurately, = 0 mod 8 ). Thus the number of operations are
114
+ * independent of the exponent of the input.
115
+ *
116
+ * (2/pi) is represented by an array of 24-bit integers in ipio2[].
117
+ *
118
+ * Input parameters:
119
+ * x[] The input value (must be positive) is broken into nx
120
+ * pieces of 24-bit integers in double precision format.
121
+ * x[i] will be the i-th 24 bit of x. The scaled exponent
122
+ * of x[0] is given in input parameter e0 (i.e., x[0]*2^e0
123
+ * match x's up to 24 bits.
124
+ *
125
+ * Example of breaking a double positive z into x[0]+x[1]+x[2]:
126
+ * e0 = ilogb(z)-23
127
+ * z = scalbn(z,-e0)
128
+ * for i = 0,1,2
129
+ * x[i] = floor(z)
130
+ * z = (z-x[i])*2**24
131
+ *
132
+ *
133
+ * y[] ouput result in an array of double precision numbers.
134
+ * The dimension of y[] is:
135
+ * 24-bit precision 1
136
+ * 53-bit precision 2
137
+ * 64-bit precision 2
138
+ * 113-bit precision 3
139
+ * The actual value is the sum of them. Thus for 113-bit
140
+ * precison, one may have to do something like:
141
+ *
142
+ * long double t,w,r_head, r_tail;
143
+ * t = (long double)y[2] + (long double)y[1];
144
+ * w = (long double)y[0];
145
+ * r_head = t+w;
146
+ * r_tail = w - (r_head - t);
147
+ *
148
+ * e0 The exponent of x[0]
149
+ *
150
+ * nx dimension of x[]
151
+ *
152
+ * prec an integer indicating the precision:
153
+ * 0 24 bits (single)
154
+ * 1 53 bits (double)
155
+ * 2 64 bits (extended)
156
+ * 3 113 bits (quad)
157
+ *
158
+ * ipio2[]
159
+ * integer array, contains the (24*i)-th to (24*i+23)-th
160
+ * bit of 2/pi after binary point. The corresponding
161
+ * floating value is
162
+ *
163
+ * ipio2[i] * 2^(-24(i+1)).
164
+ *
165
+ * External function:
166
+ * double scalbn(), floor();
167
+ *
168
+ *
169
+ * Here is the description of some local variables:
170
+ *
171
+ * jk jk+1 is the initial number of terms of ipio2[] needed
172
+ * in the computation. The recommended value is 2,3,4,
173
+ * 6 for single, double, extended,and quad.
174
+ *
175
+ * jz local integer variable indicating the number of
176
+ * terms of ipio2[] used.
177
+ *
178
+ * jx nx - 1
179
+ *
180
+ * jv index for pointing to the suitable ipio2[] for the
181
+ * computation. In general, we want
182
+ * ( 2^e0*x[0] * ipio2[jv-1]*2^(-24jv) )/8
183
+ * is an integer. Thus
184
+ * e0-3-24*jv >= 0 or (e0-3)/24 >= jv
185
+ * Hence jv = max(0,(e0-3)/24).
186
+ *
187
+ * jp jp+1 is the number of terms in PIo2[] needed, jp = jk.
188
+ *
189
+ * q[] double array with integral value, representing the
190
+ * 24-bits chunk of the product of x and 2/pi.
191
+ *
192
+ * q0 the corresponding exponent of q[0]. Note that the
193
+ * exponent for q[i] would be q0-24*i.
194
+ *
195
+ * PIo2[] double precision array, obtained by cutting pi/2
196
+ * into 24 bits chunks.
197
+ *
198
+ * f[] ipio2[] in floating point
199
+ *
200
+ * iq[] integer array by breaking up q[] in 24-bits chunk.
201
+ *
202
+ * fq[] final product of x*(2/pi) in fq[0],..,fq[jk]
203
+ *
204
+ * ih integer. If >0 it indicates q[] is >= 0.5, hence
205
+ * it also indicates the *sign* of the result.
206
+ *
207
+ */
208
+
209
+ XSIMD_INLINE int32_t __kernel_rem_pio2(double* x, double* y, int32_t e0, int32_t nx, int32_t prec, const int32_t* ipio2) noexcept
210
+ {
211
+ static const int32_t init_jk[] = { 2, 3, 4, 6 }; /* initial value for jk */
212
+
213
+ static const double PIo2[] = {
214
+ 1.57079625129699707031e+00, /* 0x3FF921FB, 0x40000000 */
215
+ 7.54978941586159635335e-08, /* 0x3E74442D, 0x00000000 */
216
+ 5.39030252995776476554e-15, /* 0x3CF84698, 0x80000000 */
217
+ 3.28200341580791294123e-22, /* 0x3B78CC51, 0x60000000 */
218
+ 1.27065575308067607349e-29, /* 0x39F01B83, 0x80000000 */
219
+ 1.22933308981111328932e-36, /* 0x387A2520, 0x40000000 */
220
+ 2.73370053816464559624e-44, /* 0x36E38222, 0x80000000 */
221
+ 2.16741683877804819444e-51, /* 0x3569F31D, 0x00000000 */
222
+ };
223
+
224
+ static const double
225
+ zero
226
+ = 0.0,
227
+ one = 1.0,
228
+ two24 = 1.67772160000000000000e+07, /* 0x41700000, 0x00000000 */
229
+ twon24 = 5.96046447753906250000e-08; /* 0x3E700000, 0x00000000 */
230
+
231
+ int32_t jz, jx, jv, jp, jk, carry, n, iq[20], i, j, k, m, q0, ih;
232
+ double z, fw, f[20], fq[20], q[20];
233
+
234
+ /* initialize jk*/
235
+ jk = init_jk[prec];
236
+ jp = jk;
237
+
238
+ /* determine jx,jv,q0, note that 3>q0 */
239
+ jx = nx - 1;
240
+ jv = (e0 - 3) / 24;
241
+ if (jv < 0)
242
+ jv = 0;
243
+ q0 = e0 - 24 * (jv + 1);
244
+
245
+ /* set up f[0] to f[jx+jk] where f[jx+jk] = ipio2[jv+jk] */
246
+ j = jv - jx;
247
+ m = jx + jk;
248
+ for (i = 0; i <= m; i++, j++)
249
+ f[i] = (j < 0) ? zero : (double)ipio2[j];
250
+
251
+ /* compute q[0],q[1],...q[jk] */
252
+ for (i = 0; i <= jk; i++)
253
+ {
254
+ for (j = 0, fw = 0.0; j <= jx; j++)
255
+ fw += x[j] * f[jx + i - j];
256
+ q[i] = fw;
257
+ }
258
+
259
+ jz = jk;
260
+
261
+ recompute:
262
+ /* distill q[] into iq[] reversingly */
263
+ for (i = 0, j = jz, z = q[jz]; j > 0; i++, j--)
264
+ {
265
+ fw = (double)((int32_t)(twon24 * z));
266
+ iq[i] = (int)(z - two24 * fw);
267
+ z = q[j - 1] + fw;
268
+ }
269
+
270
+ /* compute n */
271
+ z = std::scalbn(z, q0); /* actual value of z */
272
+ z -= 8.0 * std::floor(z * 0.125); /* trim off integer >= 8 */
273
+ n = (int32_t)z;
274
+ z -= (double)n;
275
+ ih = 0;
276
+ if (q0 > 0)
277
+ { /* need iq[jz-1] to determine n */
278
+ i = (iq[jz - 1] >> (24 - q0));
279
+ n += i;
280
+ iq[jz - 1] -= i << (24 - q0);
281
+ ih = iq[jz - 1] >> (23 - q0);
282
+ }
283
+ else if (q0 == 0)
284
+ ih = iq[jz - 1] >> 23;
285
+ else if (z >= 0.5)
286
+ ih = 2;
287
+
288
+ if (ih > 0)
289
+ { /* q > 0.5 */
290
+ n += 1;
291
+ carry = 0;
292
+ for (i = 0; i < jz; i++)
293
+ { /* compute 1-q */
294
+ j = iq[i];
295
+ if (carry == 0)
296
+ {
297
+ if (j != 0)
298
+ {
299
+ carry = 1;
300
+ iq[i] = 0x1000000 - j;
301
+ }
302
+ }
303
+ else
304
+ iq[i] = 0xffffff - j;
305
+ }
306
+ if (q0 > 0)
307
+ { /* rare case: chance is 1 in 12 */
308
+ switch (q0)
309
+ {
310
+ case 1:
311
+ iq[jz - 1] &= 0x7fffff;
312
+ break;
313
+ case 2:
314
+ iq[jz - 1] &= 0x3fffff;
315
+ break;
316
+ }
317
+ }
318
+ if (ih == 2)
319
+ {
320
+ z = one - z;
321
+ if (carry != 0)
322
+ z -= std::scalbn(one, q0);
323
+ }
324
+ }
325
+
326
+ /* check if recomputation is needed */
327
+ if (z == zero)
328
+ {
329
+ j = 0;
330
+ for (i = jz - 1; i >= jk; i--)
331
+ j |= iq[i];
332
+ if (j == 0)
333
+ { /* need recomputation */
334
+ for (k = 1; iq[jk - k] == 0; k++)
335
+ ; /* k = no. of terms needed */
336
+
337
+ for (i = jz + 1; i <= jz + k; i++)
338
+ { /* add q[jz+1] to q[jz+k] */
339
+ f[jx + i] = (double)ipio2[jv + i];
340
+ for (j = 0, fw = 0.0; j <= jx; j++)
341
+ fw += x[j] * f[jx + i - j];
342
+ q[i] = fw;
343
+ }
344
+ jz += k;
345
+ goto recompute;
346
+ }
347
+ }
348
+
349
+ /* chop off zero terms */
350
+ if (z == 0.0)
351
+ {
352
+ jz -= 1;
353
+ q0 -= 24;
354
+ while (iq[jz] == 0)
355
+ {
356
+ jz--;
357
+ q0 -= 24;
358
+ }
359
+ }
360
+ else
361
+ { /* break z into 24-bit if necessary */
362
+ z = std::scalbn(z, -q0);
363
+ if (z >= two24)
364
+ {
365
+ fw = (double)((int32_t)(twon24 * z));
366
+ iq[jz] = (int32_t)(z - two24 * fw);
367
+ jz += 1;
368
+ q0 += 24;
369
+ iq[jz] = (int32_t)fw;
370
+ }
371
+ else
372
+ iq[jz] = (int32_t)z;
373
+ }
374
+
375
+ /* convert integer "bit" chunk to floating-point value */
376
+ fw = scalbn(one, q0);
377
+ for (i = jz; i >= 0; i--)
378
+ {
379
+ q[i] = fw * (double)iq[i];
380
+ fw *= twon24;
381
+ }
382
+
383
+ /* compute PIo2[0,...,jp]*q[jz,...,0] */
384
+ for (i = jz; i >= 0; i--)
385
+ {
386
+ for (fw = 0.0, k = 0; k <= jp && k <= jz - i; k++)
387
+ fw += PIo2[k] * q[i + k];
388
+ fq[jz - i] = fw;
389
+ }
390
+
391
+ /* compress fq[] into y[] */
392
+ switch (prec)
393
+ {
394
+ case 0:
395
+ fw = 0.0;
396
+ for (i = jz; i >= 0; i--)
397
+ fw += fq[i];
398
+ y[0] = (ih == 0) ? fw : -fw;
399
+ break;
400
+ case 1:
401
+ case 2:
402
+ fw = 0.0;
403
+ for (i = jz; i >= 0; i--)
404
+ fw += fq[i];
405
+ y[0] = (ih == 0) ? fw : -fw;
406
+ fw = fq[0] - fw;
407
+ for (i = 1; i <= jz; i++)
408
+ fw += fq[i];
409
+ y[1] = (ih == 0) ? fw : -fw;
410
+ break;
411
+ case 3: /* painful */
412
+ for (i = jz; i > 0; i--)
413
+ {
414
+ fw = fq[i - 1] + fq[i];
415
+ fq[i] += fq[i - 1] - fw;
416
+ fq[i - 1] = fw;
417
+ }
418
+ for (i = jz; i > 1; i--)
419
+ {
420
+ fw = fq[i - 1] + fq[i];
421
+ fq[i] += fq[i - 1] - fw;
422
+ fq[i - 1] = fw;
423
+ }
424
+ for (fw = 0.0, i = jz; i >= 2; i--)
425
+ fw += fq[i];
426
+ if (ih == 0)
427
+ {
428
+ y[0] = fq[0];
429
+ y[1] = fq[1];
430
+ y[2] = fw;
431
+ }
432
+ else
433
+ {
434
+ y[0] = -fq[0];
435
+ y[1] = -fq[1];
436
+ y[2] = -fw;
437
+ }
438
+ }
439
+ return n & 7;
440
+ }
441
+
442
+ XSIMD_INLINE std::int32_t __ieee754_rem_pio2(double x, double* y) noexcept
443
+ {
444
+ static const std::int32_t two_over_pi[] = {
445
+ 0xA2F983,
446
+ 0x6E4E44,
447
+ 0x1529FC,
448
+ 0x2757D1,
449
+ 0xF534DD,
450
+ 0xC0DB62,
451
+ 0x95993C,
452
+ 0x439041,
453
+ 0xFE5163,
454
+ 0xABDEBB,
455
+ 0xC561B7,
456
+ 0x246E3A,
457
+ 0x424DD2,
458
+ 0xE00649,
459
+ 0x2EEA09,
460
+ 0xD1921C,
461
+ 0xFE1DEB,
462
+ 0x1CB129,
463
+ 0xA73EE8,
464
+ 0x8235F5,
465
+ 0x2EBB44,
466
+ 0x84E99C,
467
+ 0x7026B4,
468
+ 0x5F7E41,
469
+ 0x3991D6,
470
+ 0x398353,
471
+ 0x39F49C,
472
+ 0x845F8B,
473
+ 0xBDF928,
474
+ 0x3B1FF8,
475
+ 0x97FFDE,
476
+ 0x05980F,
477
+ 0xEF2F11,
478
+ 0x8B5A0A,
479
+ 0x6D1F6D,
480
+ 0x367ECF,
481
+ 0x27CB09,
482
+ 0xB74F46,
483
+ 0x3F669E,
484
+ 0x5FEA2D,
485
+ 0x7527BA,
486
+ 0xC7EBE5,
487
+ 0xF17B3D,
488
+ 0x0739F7,
489
+ 0x8A5292,
490
+ 0xEA6BFB,
491
+ 0x5FB11F,
492
+ 0x8D5D08,
493
+ 0x560330,
494
+ 0x46FC7B,
495
+ 0x6BABF0,
496
+ 0xCFBC20,
497
+ 0x9AF436,
498
+ 0x1DA9E3,
499
+ 0x91615E,
500
+ 0xE61B08,
501
+ 0x659985,
502
+ 0x5F14A0,
503
+ 0x68408D,
504
+ 0xFFD880,
505
+ 0x4D7327,
506
+ 0x310606,
507
+ 0x1556CA,
508
+ 0x73A8C9,
509
+ 0x60E27B,
510
+ 0xC08C6B,
511
+ };
512
+
513
+ static const std::int32_t npio2_hw[] = {
514
+ 0x3FF921FB,
515
+ 0x400921FB,
516
+ 0x4012D97C,
517
+ 0x401921FB,
518
+ 0x401F6A7A,
519
+ 0x4022D97C,
520
+ 0x4025FDBB,
521
+ 0x402921FB,
522
+ 0x402C463A,
523
+ 0x402F6A7A,
524
+ 0x4031475C,
525
+ 0x4032D97C,
526
+ 0x40346B9C,
527
+ 0x4035FDBB,
528
+ 0x40378FDB,
529
+ 0x403921FB,
530
+ 0x403AB41B,
531
+ 0x403C463A,
532
+ 0x403DD85A,
533
+ 0x403F6A7A,
534
+ 0x40407E4C,
535
+ 0x4041475C,
536
+ 0x4042106C,
537
+ 0x4042D97C,
538
+ 0x4043A28C,
539
+ 0x40446B9C,
540
+ 0x404534AC,
541
+ 0x4045FDBB,
542
+ 0x4046C6CB,
543
+ 0x40478FDB,
544
+ 0x404858EB,
545
+ 0x404921FB,
546
+ };
547
+
548
+ /*
549
+ * invpio2: 53 bits of 2/pi
550
+ * pio2_1: first 33 bit of pi/2
551
+ * pio2_1t: pi/2 - pio2_1
552
+ * pio2_2: second 33 bit of pi/2
553
+ * pio2_2t: pi/2 - (pio2_1+pio2_2)
554
+ * pio2_3: third 33 bit of pi/2
555
+ * pio2_3t: pi/2 - (pio2_1+pio2_2+pio2_3)
556
+ */
557
+
558
+ static const double
559
+ zero
560
+ = 0.00000000000000000000e+00, /* 0x00000000, 0x00000000 */
561
+ half = 5.00000000000000000000e-01, /* 0x3FE00000, 0x00000000 */
562
+ two24 = 1.67772160000000000000e+07, /* 0x41700000, 0x00000000 */
563
+ invpio2 = 6.36619772367581382433e-01, /* 0x3FE45F30, 0x6DC9C883 */
564
+ pio2_1 = 1.57079632673412561417e+00, /* 0x3FF921FB, 0x54400000 */
565
+ pio2_1t = 6.07710050650619224932e-11, /* 0x3DD0B461, 0x1A626331 */
566
+ pio2_2 = 6.07710050630396597660e-11, /* 0x3DD0B461, 0x1A600000 */
567
+ pio2_2t = 2.02226624879595063154e-21, /* 0x3BA3198A, 0x2E037073 */
568
+ pio2_3 = 2.02226624871116645580e-21, /* 0x3BA3198A, 0x2E000000 */
569
+ pio2_3t = 8.47842766036889956997e-32; /* 0x397B839A, 0x252049C1 */
570
+
571
+ double z = 0., w, t, r, fn;
572
+ double tx[3];
573
+ std::int32_t e0, i, j, nx, n, ix, hx;
574
+ std::uint32_t low;
575
+
576
+ GET_HIGH_WORD(hx, x); /* high word of x */
577
+ ix = hx & 0x7fffffff;
578
+ if (ix <= 0x3fe921fb) /* |x| ~<= pi/4 , no need for reduction */
579
+ {
580
+ y[0] = x;
581
+ y[1] = 0;
582
+ return 0;
583
+ }
584
+ if (ix < 0x4002d97c)
585
+ { /* |x| < 3pi/4, special case with n=+-1 */
586
+ if (hx > 0)
587
+ {
588
+ z = x - pio2_1;
589
+ if (ix != 0x3ff921fb)
590
+ { /* 33+53 bit pi is good enough */
591
+ y[0] = z - pio2_1t;
592
+ y[1] = (z - y[0]) - pio2_1t;
593
+ }
594
+ else
595
+ { /* near pi/2, use 33+33+53 bit pi */
596
+ z -= pio2_2;
597
+ y[0] = z - pio2_2t;
598
+ y[1] = (z - y[0]) - pio2_2t;
599
+ }
600
+ return 1;
601
+ }
602
+ else
603
+ { /* negative x */
604
+ z = x + pio2_1;
605
+ if (ix != 0x3ff921fb)
606
+ { /* 33+53 bit pi is good enough */
607
+ y[0] = z + pio2_1t;
608
+ y[1] = (z - y[0]) + pio2_1t;
609
+ }
610
+ else
611
+ { /* near pi/2, use 33+33+53 bit pi */
612
+ z += pio2_2;
613
+ y[0] = z + pio2_2t;
614
+ y[1] = (z - y[0]) + pio2_2t;
615
+ }
616
+
617
+ return -1;
618
+ }
619
+ }
620
+ if (ix <= 0x413921fb)
621
+ { /* |x| ~<= 2^19*(pi/2), medium_ size */
622
+ t = std::fabs(x);
623
+ n = (std::int32_t)(t * invpio2 + half);
624
+ fn = (double)n;
625
+ r = t - fn * pio2_1;
626
+ w = fn * pio2_1t; /* 1st round good to 85 bit */
627
+ if ((n < 32) && (n > 0) && (ix != npio2_hw[n - 1]))
628
+ {
629
+ y[0] = r - w; /* quick check no cancellation */
630
+ }
631
+ else
632
+ {
633
+ std::uint32_t high;
634
+ j = ix >> 20;
635
+ y[0] = r - w;
636
+ GET_HIGH_WORD(high, y[0]);
637
+ i = j - static_cast<int32_t>((high >> 20) & 0x7ff);
638
+ if (i > 16)
639
+ { /* 2nd iteration needed, good to 118 */
640
+ t = r;
641
+ w = fn * pio2_2;
642
+ r = t - w;
643
+ w = fn * pio2_2t - ((t - r) - w);
644
+ y[0] = r - w;
645
+ GET_HIGH_WORD(high, y[0]);
646
+ i = j - static_cast<int32_t>((high >> 20) & 0x7ff);
647
+ if (i > 49)
648
+ { /* 3rd iteration need, 151 bits acc */
649
+ t = r; /* will cover all possible cases */
650
+ w = fn * pio2_3;
651
+ r = t - w;
652
+ w = fn * pio2_3t - ((t - r) - w);
653
+ y[0] = r - w;
654
+ }
655
+ }
656
+ }
657
+ y[1] = (r - y[0]) - w;
658
+ if (hx < 0)
659
+ {
660
+ y[0] = -y[0];
661
+ y[1] = -y[1];
662
+ return -n;
663
+ }
664
+ else
665
+ return n;
666
+ }
667
+ /*
668
+ * all other (large) arguments
669
+ */
670
+ if (ix >= 0x7ff00000)
671
+ { /* x is inf or NaN */
672
+ y[0] = y[1] = x - x;
673
+ return 0;
674
+ }
675
+ /* set z = scalbn(|x|,ilogb(x)-23) */
676
+ GET_LOW_WORD(low, x);
677
+ SET_LOW_WORD(z, low);
678
+ e0 = (ix >> 20) - 1046; /* e0 = ilogb(z)-23; */
679
+ SET_HIGH_WORD(z, static_cast<uint32_t>(ix - (e0 << 20)));
680
+ for (i = 0; i < 2; i++)
681
+ {
682
+ tx[i] = (double)((std::int32_t)(z));
683
+ z = (z - tx[i]) * two24;
684
+ }
685
+ tx[2] = z;
686
+ nx = 3;
687
+ while (tx[nx - 1] == zero)
688
+ nx--; /* skip zero term */
689
+ n = __kernel_rem_pio2(tx, y, e0, nx, 2, two_over_pi);
690
+ if (hx < 0)
691
+ {
692
+ y[0] = -y[0];
693
+ y[1] = -y[1];
694
+ return -n;
695
+ }
696
+ return n;
697
+ }
698
+ }
699
+
700
+ #undef SET_LOW_WORD
701
+ #undef SET_HIGH_WORD
702
+ #undef GET_LOW_WORD
703
+ #undef GET_HIGH_WORD
704
+ #undef HIGH_WORD_IDX
705
+ #undef LOW_WORD_IDX
706
+ #undef ONCE0
707
+ }