ycpp 0.1.0__cp315-cp315t-win_amd64.whl

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 (142) hide show
  1. ycpp/__init__.py +110 -0
  2. ycpp/_array.py +318 -0
  3. ycpp/_awareness.py +268 -0
  4. ycpp/_doc.py +718 -0
  5. ycpp/_event.py +188 -0
  6. ycpp/_id_map.py +620 -0
  7. ycpp/_map.py +267 -0
  8. ycpp/_provider.py +180 -0
  9. ycpp/_snapshot.py +28 -0
  10. ycpp/_sticky_index.py +59 -0
  11. ycpp/_stream.py +91 -0
  12. ycpp/_sync.py +192 -0
  13. ycpp/_text.py +239 -0
  14. ycpp/_transaction.py +287 -0
  15. ycpp/_typed.py +122 -0
  16. ycpp/_undo.py +201 -0
  17. ycpp/_update.py +18 -0
  18. ycpp/_xml.py +452 -0
  19. ycpp/_ycpp.cp315t-win_amd64.lib +0 -0
  20. ycpp/_ycpp.cp315t-win_amd64.pyd +0 -0
  21. ycpp-0.1.0.data/headers/fast_float/ascii_number.h +766 -0
  22. ycpp-0.1.0.data/headers/fast_float/bigint.h +638 -0
  23. ycpp-0.1.0.data/headers/fast_float/constexpr_feature_detect.h +53 -0
  24. ycpp-0.1.0.data/headers/fast_float/decimal_to_binary.h +212 -0
  25. ycpp-0.1.0.data/headers/fast_float/digit_comparison.h +455 -0
  26. ycpp-0.1.0.data/headers/fast_float/fast_float.h +91 -0
  27. ycpp-0.1.0.data/headers/fast_float/fast_table.h +708 -0
  28. ycpp-0.1.0.data/headers/fast_float/float_common.h +1432 -0
  29. ycpp-0.1.0.data/headers/fast_float/parse_number.h +488 -0
  30. ycpp-0.1.0.data/headers/xsimd/arch/common/xsimd_common_arithmetic.hpp +267 -0
  31. ycpp-0.1.0.data/headers/xsimd/arch/common/xsimd_common_bit.hpp +230 -0
  32. ycpp-0.1.0.data/headers/xsimd/arch/common/xsimd_common_cast.hpp +43 -0
  33. ycpp-0.1.0.data/headers/xsimd/arch/common/xsimd_common_complex.hpp +112 -0
  34. ycpp-0.1.0.data/headers/xsimd/arch/common/xsimd_common_details.hpp +386 -0
  35. ycpp-0.1.0.data/headers/xsimd/arch/common/xsimd_common_logical.hpp +240 -0
  36. ycpp-0.1.0.data/headers/xsimd/arch/common/xsimd_common_math.hpp +2601 -0
  37. ycpp-0.1.0.data/headers/xsimd/arch/common/xsimd_common_memory.hpp +1006 -0
  38. ycpp-0.1.0.data/headers/xsimd/arch/common/xsimd_common_rounding.hpp +72 -0
  39. ycpp-0.1.0.data/headers/xsimd/arch/common/xsimd_common_swizzle.hpp +260 -0
  40. ycpp-0.1.0.data/headers/xsimd/arch/common/xsimd_common_trigo.hpp +996 -0
  41. ycpp-0.1.0.data/headers/xsimd/arch/utils/shifts.hpp +82 -0
  42. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_avx.hpp +2111 -0
  43. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_avx2.hpp +1591 -0
  44. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_avx512bw.hpp +724 -0
  45. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_avx512cd.hpp +28 -0
  46. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_avx512dq.hpp +270 -0
  47. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_avx512er.hpp +17 -0
  48. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_avx512f.hpp +2919 -0
  49. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_avx512ifma.hpp +17 -0
  50. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_avx512pf.hpp +17 -0
  51. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_avx512vbmi.hpp +76 -0
  52. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_avx512vbmi2.hpp +130 -0
  53. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_avx512vnni_avx512bw.hpp +17 -0
  54. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_avx512vnni_avx512vbmi2.hpp +17 -0
  55. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_avxvnni.hpp +17 -0
  56. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_common.hpp +26 -0
  57. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_common_fwd.hpp +127 -0
  58. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_constants.hpp +393 -0
  59. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_emulated.hpp +787 -0
  60. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_fma3_avx.hpp +93 -0
  61. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_fma3_avx2.hpp +46 -0
  62. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_fma3_sse.hpp +97 -0
  63. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_fma4.hpp +92 -0
  64. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_i8mm_neon64.hpp +17 -0
  65. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_isa.hpp +146 -0
  66. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_neon.hpp +3580 -0
  67. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_neon64.hpp +1614 -0
  68. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_rvv.hpp +1515 -0
  69. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_scalar.hpp +1210 -0
  70. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_sse2.hpp +2333 -0
  71. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_sse3.hpp +66 -0
  72. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_sse4_1.hpp +510 -0
  73. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_sse4_2.hpp +44 -0
  74. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_ssse3.hpp +186 -0
  75. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_sve.hpp +1186 -0
  76. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_vsx.hpp +916 -0
  77. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_vxe.hpp +787 -0
  78. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_wasm.hpp +1819 -0
  79. ycpp-0.1.0.data/headers/xsimd/config/xsimd_arch.hpp +242 -0
  80. ycpp-0.1.0.data/headers/xsimd/config/xsimd_config.hpp +620 -0
  81. ycpp-0.1.0.data/headers/xsimd/config/xsimd_cpu_features.hpp +50 -0
  82. ycpp-0.1.0.data/headers/xsimd/config/xsimd_cpu_features_arm.hpp +132 -0
  83. ycpp-0.1.0.data/headers/xsimd/config/xsimd_cpu_features_ppc.hpp +54 -0
  84. ycpp-0.1.0.data/headers/xsimd/config/xsimd_cpu_features_riscv.hpp +95 -0
  85. ycpp-0.1.0.data/headers/xsimd/config/xsimd_cpu_features_s390x.hpp +56 -0
  86. ycpp-0.1.0.data/headers/xsimd/config/xsimd_cpu_features_x86.hpp +1044 -0
  87. ycpp-0.1.0.data/headers/xsimd/config/xsimd_cpuid.hpp +144 -0
  88. ycpp-0.1.0.data/headers/xsimd/config/xsimd_getauxval.hpp +159 -0
  89. ycpp-0.1.0.data/headers/xsimd/config/xsimd_macros.hpp +76 -0
  90. ycpp-0.1.0.data/headers/xsimd/math/xsimd_rem_pio2.hpp +707 -0
  91. ycpp-0.1.0.data/headers/xsimd/memory/xsimd_aligned_allocator.hpp +349 -0
  92. ycpp-0.1.0.data/headers/xsimd/memory/xsimd_alignment.hpp +102 -0
  93. ycpp-0.1.0.data/headers/xsimd/types/xsimd_all_registers.hpp +57 -0
  94. ycpp-0.1.0.data/headers/xsimd/types/xsimd_api.hpp +3106 -0
  95. ycpp-0.1.0.data/headers/xsimd/types/xsimd_avx2_register.hpp +44 -0
  96. ycpp-0.1.0.data/headers/xsimd/types/xsimd_avx512bw_register.hpp +51 -0
  97. ycpp-0.1.0.data/headers/xsimd/types/xsimd_avx512cd_register.hpp +51 -0
  98. ycpp-0.1.0.data/headers/xsimd/types/xsimd_avx512dq_register.hpp +51 -0
  99. ycpp-0.1.0.data/headers/xsimd/types/xsimd_avx512er_register.hpp +51 -0
  100. ycpp-0.1.0.data/headers/xsimd/types/xsimd_avx512f_register.hpp +77 -0
  101. ycpp-0.1.0.data/headers/xsimd/types/xsimd_avx512ifma_register.hpp +51 -0
  102. ycpp-0.1.0.data/headers/xsimd/types/xsimd_avx512pf_register.hpp +51 -0
  103. ycpp-0.1.0.data/headers/xsimd/types/xsimd_avx512vbmi2_register.hpp +51 -0
  104. ycpp-0.1.0.data/headers/xsimd/types/xsimd_avx512vbmi_register.hpp +51 -0
  105. ycpp-0.1.0.data/headers/xsimd/types/xsimd_avx512vnni_avx512bw_register.hpp +54 -0
  106. ycpp-0.1.0.data/headers/xsimd/types/xsimd_avx512vnni_avx512vbmi2_register.hpp +53 -0
  107. ycpp-0.1.0.data/headers/xsimd/types/xsimd_avx_register.hpp +64 -0
  108. ycpp-0.1.0.data/headers/xsimd/types/xsimd_avxvnni_register.hpp +44 -0
  109. ycpp-0.1.0.data/headers/xsimd/types/xsimd_batch.hpp +1665 -0
  110. ycpp-0.1.0.data/headers/xsimd/types/xsimd_batch_constant.hpp +571 -0
  111. ycpp-0.1.0.data/headers/xsimd/types/xsimd_batch_fwd.hpp +41 -0
  112. ycpp-0.1.0.data/headers/xsimd/types/xsimd_common_arch.hpp +49 -0
  113. ycpp-0.1.0.data/headers/xsimd/types/xsimd_emulated_register.hpp +80 -0
  114. ycpp-0.1.0.data/headers/xsimd/types/xsimd_fma3_avx2_register.hpp +50 -0
  115. ycpp-0.1.0.data/headers/xsimd/types/xsimd_fma3_avx_register.hpp +50 -0
  116. ycpp-0.1.0.data/headers/xsimd/types/xsimd_fma3_sse_register.hpp +50 -0
  117. ycpp-0.1.0.data/headers/xsimd/types/xsimd_fma4_register.hpp +50 -0
  118. ycpp-0.1.0.data/headers/xsimd/types/xsimd_i8mm_neon64_register.hpp +55 -0
  119. ycpp-0.1.0.data/headers/xsimd/types/xsimd_neon64_register.hpp +55 -0
  120. ycpp-0.1.0.data/headers/xsimd/types/xsimd_neon_register.hpp +130 -0
  121. ycpp-0.1.0.data/headers/xsimd/types/xsimd_register.hpp +96 -0
  122. ycpp-0.1.0.data/headers/xsimd/types/xsimd_rvv_register.hpp +491 -0
  123. ycpp-0.1.0.data/headers/xsimd/types/xsimd_sse2_register.hpp +59 -0
  124. ycpp-0.1.0.data/headers/xsimd/types/xsimd_sse3_register.hpp +49 -0
  125. ycpp-0.1.0.data/headers/xsimd/types/xsimd_sse4_1_register.hpp +48 -0
  126. ycpp-0.1.0.data/headers/xsimd/types/xsimd_sse4_2_register.hpp +48 -0
  127. ycpp-0.1.0.data/headers/xsimd/types/xsimd_ssse3_register.hpp +48 -0
  128. ycpp-0.1.0.data/headers/xsimd/types/xsimd_sve_register.hpp +216 -0
  129. ycpp-0.1.0.data/headers/xsimd/types/xsimd_traits.hpp +408 -0
  130. ycpp-0.1.0.data/headers/xsimd/types/xsimd_utils.hpp +462 -0
  131. ycpp-0.1.0.data/headers/xsimd/types/xsimd_vsx_register.hpp +77 -0
  132. ycpp-0.1.0.data/headers/xsimd/types/xsimd_vxe_register.hpp +86 -0
  133. ycpp-0.1.0.data/headers/xsimd/types/xsimd_wasm_register.hpp +59 -0
  134. ycpp-0.1.0.data/headers/xsimd/utils/bits.hpp +122 -0
  135. ycpp-0.1.0.data/headers/xsimd/utils/xsimd_type_traits.hpp +145 -0
  136. ycpp-0.1.0.data/headers/xsimd/xsimd.hpp +43 -0
  137. ycpp-0.1.0.dist-info/DELVEWHEEL +2 -0
  138. ycpp-0.1.0.dist-info/METADATA +15 -0
  139. ycpp-0.1.0.dist-info/RECORD +142 -0
  140. ycpp-0.1.0.dist-info/WHEEL +4 -0
  141. ycpp.libs/msvcp140-a4c2229bdc2a2a630acdc095b4d86008.dll +0 -0
  142. ycpp.libs/msvcp140_1-226498d4bfcb4f07974757b596ebec45.dll +0 -0
@@ -0,0 +1,393 @@
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_NUMERICAL_CONSTANT_HPP
13
+ #define XSIMD_NUMERICAL_CONSTANT_HPP
14
+
15
+ #include <limits>
16
+
17
+ #include "../types/xsimd_utils.hpp"
18
+
19
+ namespace xsimd
20
+ {
21
+
22
+ namespace constants
23
+ {
24
+
25
+ #define XSIMD_DEFINE_CONSTANT(NAME, SINGLE, DOUBLE) \
26
+ template <class T> \
27
+ XSIMD_INLINE T NAME() noexcept \
28
+ { \
29
+ return T(NAME<typename T::value_type>()); \
30
+ } \
31
+ template <> \
32
+ XSIMD_INLINE float NAME<float>() noexcept \
33
+ { \
34
+ return SINGLE; \
35
+ } \
36
+ template <> \
37
+ XSIMD_INLINE double NAME<double>() noexcept \
38
+ { \
39
+ return DOUBLE; \
40
+ }
41
+
42
+ #define XSIMD_DEFINE_CONSTANT_HEX(NAME, SINGLE, DOUBLE) \
43
+ template <class T> \
44
+ XSIMD_INLINE T NAME() noexcept \
45
+ { \
46
+ return T(NAME<typename T::value_type>()); \
47
+ } \
48
+ template <> \
49
+ XSIMD_INLINE float NAME<float>() noexcept \
50
+ { \
51
+ return bit_cast<float>((uint32_t)SINGLE); \
52
+ } \
53
+ template <> \
54
+ XSIMD_INLINE double NAME<double>() noexcept \
55
+ { \
56
+ return bit_cast<double>((uint64_t)DOUBLE); \
57
+ }
58
+
59
+ // Under fast-math, GCC might replace signmask (minus zero) by zero
60
+ #if defined(__FAST_MATH__) && defined(__GNUC__) && !defined(__clang__)
61
+ #pragma GCC push_options
62
+ #pragma GCC optimize("signed-zeros")
63
+ #endif
64
+ #ifndef __FAST_MATH__
65
+ XSIMD_DEFINE_CONSTANT(infinity, (std::numeric_limits<float>::infinity()), (std::numeric_limits<double>::infinity()))
66
+ XSIMD_DEFINE_CONSTANT(minusinfinity, (-infinity<float>()), (-infinity<double>()))
67
+ #endif
68
+ XSIMD_DEFINE_CONSTANT(invlog_2, 1.442695040888963407359924681001892137426645954152986f, 1.442695040888963407359924681001892137426645954152986)
69
+ XSIMD_DEFINE_CONSTANT_HEX(invlog_2hi, 0x3fb8b000, 0x3ff7154765200000)
70
+ XSIMD_DEFINE_CONSTANT_HEX(invlog_2lo, 0xb9389ad4, 0x3de705fc2eefa200)
71
+ XSIMD_DEFINE_CONSTANT(invlog10_2, 3.32192809488736234787031942949f, 3.32192809488736234787031942949)
72
+ XSIMD_DEFINE_CONSTANT_HEX(invpi, 0x3ea2f983, 0x3fd45f306dc9c883)
73
+ XSIMD_DEFINE_CONSTANT(log_2, 0.6931471805599453094172321214581765680755001343602553f, 0.6931471805599453094172321214581765680755001343602553)
74
+ XSIMD_DEFINE_CONSTANT_HEX(log_2hi, 0x3f318000, 0x3fe62e42fee00000)
75
+ XSIMD_DEFINE_CONSTANT_HEX(log_2lo, 0xb95e8083, 0x3dea39ef35793c76)
76
+ XSIMD_DEFINE_CONSTANT_HEX(log10_2hi, 0x3e9a0000, 0x3fd3440000000000)
77
+ XSIMD_DEFINE_CONSTANT_HEX(log10_2lo, 0x39826a14, 0x3ed3509f79fef312)
78
+ XSIMD_DEFINE_CONSTANT_HEX(logeps, 0xc17f1402, 0xc04205966f2b4f12)
79
+ XSIMD_DEFINE_CONSTANT_HEX(logpi, 0x3f928682, 0x3ff250d048e7a1bd)
80
+ XSIMD_DEFINE_CONSTANT_HEX(logsqrt2pi, 0x3f6b3f8e, 0x3fed67f1c864beb5)
81
+ XSIMD_DEFINE_CONSTANT(maxflint, 16777216.0f, 9007199254740992.0)
82
+ XSIMD_DEFINE_CONSTANT(maxlog, 88.3762626647949f, 709.78271289338400)
83
+ XSIMD_DEFINE_CONSTANT(maxlog2, 127.0f, 1023.)
84
+ XSIMD_DEFINE_CONSTANT(maxlog10, 38.23080825805664f, 308.2547155599167)
85
+ XSIMD_DEFINE_CONSTANT_HEX(mediumpi, 0x43490fdb, 0x412921fb54442d18)
86
+ XSIMD_DEFINE_CONSTANT(minlog, -88.3762626647949f, -708.3964185322641)
87
+ XSIMD_DEFINE_CONSTANT(minlog2, -127.0f, -1023.)
88
+ XSIMD_DEFINE_CONSTANT(minlog10, -37.89999771118164f, -308.2547155599167)
89
+ XSIMD_DEFINE_CONSTANT_HEX(nan, 0xffffffff, 0xffffffffffffffff)
90
+ XSIMD_DEFINE_CONSTANT_HEX(oneosqrteps, 0x453504f3, 0x4190000000000000)
91
+ XSIMD_DEFINE_CONSTANT_HEX(oneotwoeps, 0x4a800000, 0x4320000000000000)
92
+ XSIMD_DEFINE_CONSTANT_HEX(pi, 0x40490fdb, 0x400921fb54442d18)
93
+ XSIMD_DEFINE_CONSTANT_HEX(pio_2lo, 0xb33bbd2e, 0x3c91a62633145c07)
94
+ XSIMD_DEFINE_CONSTANT_HEX(pio_4lo, 0xb2bbbd2e, 0x3c81a62633145c07)
95
+ XSIMD_DEFINE_CONSTANT_HEX(pio2, 0x3fc90fdb, 0x3ff921fb54442d18)
96
+ XSIMD_DEFINE_CONSTANT_HEX(pio2_1, 0x3fc90f80, 0x3ff921fb54400000)
97
+ XSIMD_DEFINE_CONSTANT_HEX(pio2_1t, 0x37354443, 0x3dd0b4611a626331)
98
+ XSIMD_DEFINE_CONSTANT_HEX(pio2_2, 0x37354400, 0x3dd0b4611a600000)
99
+ XSIMD_DEFINE_CONSTANT_HEX(pio2_2t, 0x2e85a308, 0x3ba3198a2e037073)
100
+ XSIMD_DEFINE_CONSTANT_HEX(pio2_3, 0x2e85a300, 0x3ba3198a2e000000)
101
+ XSIMD_DEFINE_CONSTANT_HEX(pio2_3t, 0x248d3132, 0x397b839a252049c1)
102
+ XSIMD_DEFINE_CONSTANT_HEX(pio4, 0x3f490fdb, 0x3fe921fb54442d18)
103
+ XSIMD_DEFINE_CONSTANT_HEX(signmask, 0x80000000, 0x8000000000000000)
104
+ XSIMD_DEFINE_CONSTANT(smallestposval, std::numeric_limits<float>::min(), std::numeric_limits<double>::min())
105
+ XSIMD_DEFINE_CONSTANT_HEX(sqrt_2pi, 0x40206c99, 0x40040d931ff62704)
106
+ XSIMD_DEFINE_CONSTANT_HEX(sqrteps, 0x39b504f3, 0x3e50000000000000)
107
+ XSIMD_DEFINE_CONSTANT_HEX(tanpio8, 0x3ed413cd, 0x3fda827999fcef31)
108
+ XSIMD_DEFINE_CONSTANT_HEX(tan3pio8, 0x401a827a, 0x4003504f333f9de6)
109
+ XSIMD_DEFINE_CONSTANT_HEX(twentypi, 0x427b53d1, 0x404f6a7a2955385e)
110
+ XSIMD_DEFINE_CONSTANT_HEX(twoopi, 0x3f22f983, 0x3fe45f306dc9c883)
111
+ XSIMD_DEFINE_CONSTANT(twotonmb, 8388608.0f, 4503599627370496.0)
112
+ XSIMD_DEFINE_CONSTANT_HEX(twotonmbo3, 0x3ba14518, 0x3ed428a2f98d7286)
113
+ #if defined(__FAST_MATH__) && defined(__GNUC__) && !defined(__clang__)
114
+ #pragma GCC pop_options
115
+ #endif
116
+
117
+ #undef XSIMD_DEFINE_CONSTANT
118
+ #undef XSIMD_DEFINE_CONSTANT_HEX
119
+
120
+ template <class T>
121
+ constexpr T allbits() noexcept;
122
+
123
+ template <class T>
124
+ constexpr as_integer_t<T> mask1frexp() noexcept;
125
+
126
+ template <class T>
127
+ constexpr as_integer_t<T> mask2frexp() noexcept;
128
+
129
+ template <class T>
130
+ constexpr as_integer_t<T> maxexponent() noexcept;
131
+
132
+ template <class T>
133
+ constexpr as_integer_t<T> maxexponentm1() noexcept;
134
+
135
+ template <class T>
136
+ constexpr int32_t nmb() noexcept;
137
+
138
+ template <class T>
139
+ constexpr T zero() noexcept;
140
+
141
+ template <class T>
142
+ constexpr T minvalue() noexcept;
143
+
144
+ template <class T>
145
+ constexpr T maxvalue() noexcept;
146
+
147
+ /**************************
148
+ * allbits implementation *
149
+ **************************/
150
+
151
+ namespace detail
152
+ {
153
+ template <class T, bool = std::is_integral<T>::value>
154
+ struct allbits_impl
155
+ {
156
+ static constexpr T get_value() noexcept
157
+ {
158
+ return T(~0);
159
+ }
160
+ };
161
+
162
+ template <class T>
163
+ struct allbits_impl<T, false>
164
+ {
165
+ static constexpr T get_value() noexcept
166
+ {
167
+ return nan<T>();
168
+ }
169
+ };
170
+ }
171
+
172
+ template <class T>
173
+ XSIMD_INLINE constexpr T allbits() noexcept
174
+ {
175
+ return T(detail::allbits_impl<typename T::value_type>::get_value());
176
+ }
177
+
178
+ /*****************************
179
+ * mask1frexp implementation *
180
+ *****************************/
181
+
182
+ template <class T>
183
+ XSIMD_INLINE constexpr as_integer_t<T> mask1frexp() noexcept
184
+ {
185
+ return as_integer_t<T>(mask1frexp<typename T::value_type>());
186
+ }
187
+
188
+ template <>
189
+ XSIMD_INLINE constexpr int32_t mask1frexp<float>() noexcept
190
+ {
191
+ return 0x7f800000;
192
+ }
193
+
194
+ template <>
195
+ XSIMD_INLINE constexpr int64_t mask1frexp<double>() noexcept
196
+ {
197
+ return 0x7ff0000000000000;
198
+ }
199
+
200
+ /*****************************
201
+ * mask2frexp implementation *
202
+ *****************************/
203
+
204
+ template <class T>
205
+ XSIMD_INLINE constexpr as_integer_t<T> mask2frexp() noexcept
206
+ {
207
+ return as_integer_t<T>(mask2frexp<typename T::value_type>());
208
+ }
209
+
210
+ template <>
211
+ XSIMD_INLINE constexpr int32_t mask2frexp<float>() noexcept
212
+ {
213
+ return 0x3f000000;
214
+ }
215
+
216
+ template <>
217
+ XSIMD_INLINE constexpr int64_t mask2frexp<double>() noexcept
218
+ {
219
+ return 0x3fe0000000000000;
220
+ }
221
+
222
+ /******************************
223
+ * maxexponent implementation *
224
+ ******************************/
225
+
226
+ template <class T>
227
+ XSIMD_INLINE constexpr as_integer_t<T> maxexponent() noexcept
228
+ {
229
+ return as_integer_t<T>(maxexponent<typename T::value_type>());
230
+ }
231
+
232
+ template <>
233
+ XSIMD_INLINE constexpr int32_t maxexponent<float>() noexcept
234
+ {
235
+ return 127;
236
+ }
237
+
238
+ template <>
239
+ XSIMD_INLINE constexpr int64_t maxexponent<double>() noexcept
240
+ {
241
+ return 1023;
242
+ }
243
+
244
+ /******************************
245
+ * maxexponent implementation *
246
+ ******************************/
247
+
248
+ template <class T>
249
+ XSIMD_INLINE constexpr as_integer_t<T> maxexponentm1() noexcept
250
+ {
251
+ return as_integer_t<T>(maxexponentm1<typename T::value_type>());
252
+ }
253
+
254
+ template <>
255
+ XSIMD_INLINE constexpr int32_t maxexponentm1<float>() noexcept
256
+ {
257
+ return 126;
258
+ }
259
+
260
+ template <>
261
+ XSIMD_INLINE constexpr int64_t maxexponentm1<double>() noexcept
262
+ {
263
+ return 1022;
264
+ }
265
+
266
+ /**********************
267
+ * nmb implementation *
268
+ **********************/
269
+
270
+ template <class T>
271
+ XSIMD_INLINE constexpr int32_t nmb() noexcept
272
+ {
273
+ return nmb<typename T::value_type>();
274
+ }
275
+
276
+ template <>
277
+ XSIMD_INLINE constexpr int32_t nmb<float>() noexcept
278
+ {
279
+ return 23;
280
+ }
281
+
282
+ template <>
283
+ XSIMD_INLINE constexpr int32_t nmb<double>() noexcept
284
+ {
285
+ return 52;
286
+ }
287
+
288
+ /***********************
289
+ * zero implementation *
290
+ ***********************/
291
+
292
+ template <class T>
293
+ XSIMD_INLINE constexpr T zero() noexcept
294
+ {
295
+ return T(typename T::value_type(0));
296
+ }
297
+
298
+ /***************************
299
+ * minvalue implementation *
300
+ ***************************/
301
+
302
+ namespace detail
303
+ {
304
+ template <class T>
305
+ struct minvalue_impl
306
+ {
307
+ static constexpr T get_value() noexcept
308
+ {
309
+ return std::numeric_limits<typename T::value_type>::min();
310
+ }
311
+ };
312
+
313
+ template <class T>
314
+ struct minvalue_common
315
+ {
316
+ static constexpr T get_value() noexcept
317
+ {
318
+ return std::numeric_limits<T>::min();
319
+ }
320
+ };
321
+
322
+ template <>
323
+ struct minvalue_impl<int8_t> : minvalue_common<int8_t>
324
+ {
325
+ };
326
+ template <>
327
+ struct minvalue_impl<uint8_t> : minvalue_common<uint8_t>
328
+ {
329
+ };
330
+ template <>
331
+ struct minvalue_impl<int16_t> : minvalue_common<int16_t>
332
+ {
333
+ };
334
+ template <>
335
+ struct minvalue_impl<uint16_t> : minvalue_common<uint16_t>
336
+ {
337
+ };
338
+ template <>
339
+ struct minvalue_impl<int32_t> : minvalue_common<int32_t>
340
+ {
341
+ };
342
+ template <>
343
+ struct minvalue_impl<uint32_t> : minvalue_common<uint32_t>
344
+ {
345
+ };
346
+ template <>
347
+ struct minvalue_impl<int64_t> : minvalue_common<int64_t>
348
+ {
349
+ };
350
+ template <>
351
+ struct minvalue_impl<uint64_t> : minvalue_common<uint64_t>
352
+ {
353
+ };
354
+
355
+ template <>
356
+ struct minvalue_impl<float>
357
+ {
358
+ XSIMD_INLINE static float get_value() noexcept
359
+ {
360
+ return bit_cast<float>((uint32_t)0xff7fffff);
361
+ }
362
+ };
363
+
364
+ template <>
365
+ struct minvalue_impl<double>
366
+ {
367
+ XSIMD_INLINE static double get_value() noexcept
368
+ {
369
+ return bit_cast<double>((uint64_t)0xffefffffffffffff);
370
+ }
371
+ };
372
+ }
373
+
374
+ template <class T>
375
+ constexpr T minvalue() noexcept
376
+ {
377
+ return T(detail::minvalue_impl<typename T::value_type>::get_value());
378
+ }
379
+
380
+ /***************************
381
+ * maxvalue implementation *
382
+ ***************************/
383
+
384
+ template <class T>
385
+ constexpr T maxvalue() noexcept
386
+ {
387
+ return T(std::numeric_limits<typename T::value_type>::max());
388
+ }
389
+ }
390
+
391
+ }
392
+
393
+ #endif