@@ -188,13 +188,13 @@ CountTrailingZeroesNonzero64(uint64_t x) {
188
188
}
189
189
190
190
// These values are same to hashbrown.
191
- static const char CTRL_EMPTY = 0x80 ; // -128
192
- static const char CTRL_DUMMY = 0xFF ; // -1
191
+ #define CTRL_EMPTY ( 0x80) // -128
192
+ #define CTRL_DUMMY ( 0xFF) // -1
193
193
194
194
#if HAVE_SSE2
195
195
static inline uint64_t
196
196
match_byte (uint64_t x , uint8_t n ) {
197
- return _mm_movemask_pi8 (_mm_cmpeq_pi8 (_mm_set1_pi8 (n ), _m_from_int64 (( int64_t ) x ) ));
197
+ return _mm_movemask_pi8 (_mm_cmpeq_pi8 (_mm_set1_pi8 (n ), ( __m64 ) x ));
198
198
}
199
199
200
200
static inline uint64_t
@@ -205,7 +205,7 @@ match_empty(uint64_t x) {
205
205
static inline uint64_t
206
206
match_empty_or_dummy (uint64_t x ) {
207
207
// A byte is EMPTY or DELETED iff the high bit is set
208
- return _mm_movemask_pi8 (_m_from_int64 (( int64_t ) x ) );
208
+ return _mm_movemask_pi8 (( __m64 ) x );
209
209
}
210
210
211
211
static inline int
@@ -560,10 +560,10 @@ ctrl_get_index(const group_control *g, uint8_t log2size, int pos)
560
560
return ((uint16_t * )(g + 1 ))[pos ];
561
561
}
562
562
else if (log2size <= 32 - 3 ) {
563
- return ((uint32_t * )(g + 1 ))[pos ];
563
+ return (Py_ssize_t )( (uint32_t * )(g + 1 ))[pos ];
564
564
}
565
565
else {
566
- return ((uint64_t * )(g + 1 ))[pos ];
566
+ return (Py_ssize_t )( (uint64_t * )(g + 1 ))[pos ];
567
567
}
568
568
}
569
569
@@ -916,7 +916,7 @@ dictkeys_stringlookup(PyDictKeysObject* dk, PyObject *key, Py_hash_t hash)
916
916
int pos = bitmask_getpos(found); \
917
917
/* match_byte() has rare false positive. */ \
918
918
if (/* g->control.c[pos] == h2 */ 1 ) { \
919
- Py_ssize_t ix = g -> index [pos ]; \
919
+ Py_ssize_t ix = ( Py_ssize_t ) g -> index [pos ]; \
920
920
PyDictKeyEntry * ep = & ep0 [ix ]; \
921
921
if (ep -> me_key == key || \
922
922
(ep -> me_hash == hash \
@@ -932,21 +932,24 @@ dictkeys_stringlookup(PyDictKeysObject* dk, PyObject *key, Py_hash_t hash)
932
932
}
933
933
934
934
if (dk -> dk_log2_size <= 8 - 3 ) {
935
- PyDictKeyEntry * ep0 = DK_ENTRIES (dk );
935
+ PyDictKeyEntry * ep0 = DK_ENTRIES (dk );
936
936
LOOP (group8 );
937
937
}
938
938
else if (dk -> dk_log2_size <= 16 - 3 ) {
939
- PyDictKeyEntry * ep0 = DK_ENTRIES (dk );
939
+ PyDictKeyEntry * ep0 = DK_ENTRIES (dk );
940
940
LOOP (group16 );
941
941
}
942
- else if (dk -> dk_log2_size <= 32 - 3 ) {
943
- PyDictKeyEntry * ep0 = DK_ENTRIES (dk );
944
- LOOP (group32 );
942
+ #if SIZEOF_VOID_P > 4
943
+ else if (dk -> dk_log2_size > 32 -3 ) {
944
+ PyDictKeyEntry * ep0 = DK_ENTRIES (dk );
945
+ LOOP (group64 );
945
946
}
947
+ #endif
946
948
else {
947
- PyDictKeyEntry * ep0 = DK_ENTRIES (dk );
948
- LOOP (group64 );
949
+ PyDictKeyEntry * ep0 = DK_ENTRIES (dk );
950
+ LOOP (group32 );
949
951
}
952
+
950
953
#undef LOOP
951
954
952
955
Py_UNREACHABLE ();
0 commit comments