svf-lib 1.0.2062 → 1.0.2064

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.
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -20,9 +20,13 @@
20
20
  #ifdef __has_builtin
21
21
  # define HAS_CLZ __has_builtin(__builtin_clz)
22
22
  # define HAS_CLZLL __has_builtin(__builtin_clzll)
23
+ # define HAS_CTZ __has_builtin(__builtin_ctz)
24
+ # define HAS_CTZLL __has_builtin(__builtin_ctzll)
23
25
  #else
24
26
  # define HAS_CLZ 0
25
27
  # define HAS_CLZLL 0
28
+ # define HAS_CLZ 0
29
+ # define HAS_CLZLL 0
26
30
  #endif
27
31
 
28
32
  namespace SVF
@@ -66,6 +70,44 @@ template <typename T, std::size_t SizeOfT> struct TrailingZerosCounter
66
70
  }
67
71
  };
68
72
 
73
+ #if defined(__GNUC__) || defined(_MSC_VER)
74
+ template <typename T> struct TrailingZerosCounter<T, 4>
75
+ {
76
+ static unsigned count(T Val, ZeroBehavior)
77
+ {
78
+ if (Val == 0)
79
+ return 32;
80
+
81
+ #if HAS_CTZ || defined(__GNUC__)
82
+ return __builtin_ctz(Val);
83
+ #elif defined(_MSC_VER)
84
+ unsigned long Index;
85
+ _BitScanForward(&Index, Val);
86
+ return Index;
87
+ #endif
88
+ }
89
+ };
90
+
91
+ #if !defined(_MSC_VER) || defined(_M_X64)
92
+ template <typename T> struct TrailingZerosCounter<T, 8>
93
+ {
94
+ static unsigned count(T Val, ZeroBehavior)
95
+ {
96
+ if (Val == 0)
97
+ return 64;
98
+
99
+ #if HAS_CTZLL || defined(__GNUC__)
100
+ return __builtin_ctzll(Val);
101
+ #elif defined(_MSC_VER)
102
+ unsigned long Index;
103
+ _BitScanForward64(&Index, Val);
104
+ return Index;
105
+ #endif
106
+ }
107
+ };
108
+ #endif
109
+ #endif
110
+
69
111
  /// Count number of 0's from the least significant bit to the most
70
112
  /// stopping at the first 1.
71
113
  ///
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-lib",
3
- "version": "1.0.2062",
3
+ "version": "1.0.2064",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {