Skip to content

Commit c8c6c7c

Browse files
committed
Fix: Missing _mm_cvtsi128_si64x in Clang
1 parent c2b997c commit c8c6c7c

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

include/stringzilla/stringzilla.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4022,7 +4022,7 @@ SZ_PUBLIC sz_u64_t sz_checksum_avx2(sz_cptr_t text, sz_size_t length) {
40224022
__m128i low_xmm = _mm256_castsi256_si128(sums_vec.ymm);
40234023
__m128i high_xmm = _mm256_extracti128_si256(sums_vec.ymm, 1);
40244024
__m128i sums_xmm = _mm_add_epi64(low_xmm, high_xmm);
4025-
sz_u64_t low = (sz_u64_t)_mm_cvtsi128_si64x(sums_xmm);
4025+
sz_u64_t low = (sz_u64_t)_mm_cvtsi128_si64(sums_xmm);
40264026
sz_u64_t high = (sz_u64_t)_mm_extract_epi64(sums_xmm, 1);
40274027
sz_u64_t result = low + high;
40284028
if (length) result += sz_checksum_serial(text, length);
@@ -4073,7 +4073,7 @@ SZ_PUBLIC sz_u64_t sz_checksum_avx2(sz_cptr_t text, sz_size_t length) {
40734073
__m128i low_xmm = _mm256_castsi256_si128(sums_vec.ymm);
40744074
__m128i high_xmm = _mm256_extracti128_si256(sums_vec.ymm, 1);
40754075
__m128i sums_xmm = _mm_add_epi64(low_xmm, high_xmm);
4076-
sz_u64_t low = (sz_u64_t)_mm_cvtsi128_si64x(sums_xmm);
4076+
sz_u64_t low = (sz_u64_t)_mm_cvtsi128_si64(sums_xmm);
40774077
sz_u64_t high = (sz_u64_t)_mm_extract_epi64(sums_xmm, 1);
40784078
result += low + high;
40794079
return result;
@@ -5306,7 +5306,7 @@ SZ_PUBLIC sz_u64_t sz_checksum_avx512(sz_cptr_t text, sz_size_t length) {
53065306
__mmask16 mask = _sz_u16_mask_until(length);
53075307
text_vec.xmms[0] = _mm_maskz_loadu_epi8(mask, text);
53085308
sums_vec.xmms[0] = _mm_sad_epu8(text_vec.xmms[0], _mm_setzero_si128());
5309-
sz_u64_t low = (sz_u64_t)_mm_cvtsi128_si64x(sums_vec.xmms[0]);
5309+
sz_u64_t low = (sz_u64_t)_mm_cvtsi128_si64(sums_vec.xmms[0]);
53105310
sz_u64_t high = (sz_u64_t)_mm_extract_epi64(sums_vec.xmms[0], 1);
53115311
return low + high;
53125312
}
@@ -5318,7 +5318,7 @@ SZ_PUBLIC sz_u64_t sz_checksum_avx512(sz_cptr_t text, sz_size_t length) {
53185318
__m128i low_xmm = _mm256_castsi256_si128(sums_vec.ymms[0]);
53195319
__m128i high_xmm = _mm256_extracti128_si256(sums_vec.ymms[0], 1);
53205320
__m128i sums_xmm = _mm_add_epi64(low_xmm, high_xmm);
5321-
sz_u64_t low = (sz_u64_t)_mm_cvtsi128_si64x(sums_xmm);
5321+
sz_u64_t low = (sz_u64_t)_mm_cvtsi128_si64(sums_xmm);
53225322
sz_u64_t high = (sz_u64_t)_mm_extract_epi64(sums_xmm, 1);
53235323
return low + high;
53245324
}
@@ -6092,7 +6092,7 @@ SZ_PUBLIC sz_bool_t sz_equal_neon(sz_cptr_t a, sz_cptr_t b, sz_size_t length) {
60926092
return sz_true_k;
60936093
}
60946094

6095-
SZ_PUBLIC sz_u64_t sz_checksum_neon(sz_cptr_t const *text, size_t length) {
6095+
SZ_PUBLIC sz_u64_t sz_checksum_neon(sz_cptr_t text, sz_size_t length) {
60966096
uint64x2_t sum_vec = vdupq_n_u64(0);
60976097

60986098
// Process 16 bytes (128 bits) at a time

scripts/bench_token.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
*
55
* This file is the sibling of `bench_sort.cpp`, `bench_search.cpp` and `bench_similarity.cpp`.
66
*/
7+
#include <numeric> // `std::accumulate`
8+
79
#include <bench.hpp>
810
#include <test.hpp> // `random_string`
911

@@ -189,7 +191,7 @@ void bench(strings_type &&strings) {
189191

190192
void bench_on_input_data(int argc, char const **argv) {
191193
dataset_t dataset = prepare_benchmark_environment(argc, argv);
192-
194+
#if 0
193195
std::printf("Benchmarking on the entire dataset:\n");
194196
bench_unary_functions(dataset.tokens, random_generation_functions(100));
195197
bench_unary_functions(dataset.tokens, random_generation_functions(20));
@@ -211,14 +213,14 @@ void bench_on_input_data(int argc, char const **argv) {
211213
bench_unary_functions<std::vector<std::string_view>>({dataset.text}, fingerprinting_functions(128, 4 * 1024));
212214
bench_unary_functions<std::vector<std::string_view>>({dataset.text}, fingerprinting_functions(128, 64 * 1024));
213215
bench_unary_functions<std::vector<std::string_view>>({dataset.text}, fingerprinting_functions(128, 1024 * 1024));
214-
216+
#endif
215217
// Baseline benchmarks for real words, coming in all lengths
216-
std::printf("Benchmarking on entire dataset:\n");
217-
bench<std::vector<std::string_view>>({dataset.text});
218-
std::printf("Benchmarking on real lines:\n");
219-
bench(dataset.lines);
220218
std::printf("Benchmarking on real words:\n");
221219
bench(dataset.tokens);
220+
std::printf("Benchmarking on real lines:\n");
221+
bench(dataset.lines);
222+
std::printf("Benchmarking on entire dataset:\n");
223+
bench<std::vector<std::string_view>>({dataset.text});
222224

223225
// Run benchmarks on tokens of different length
224226
for (std::size_t token_length : {1, 2, 3, 4, 5, 6, 7, 8, 16, 32}) {

scripts/test.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1546,12 +1546,10 @@ int main(int argc, char const **argv) {
15461546
std::printf("- Uses NEON: %s \n", SZ_USE_ARM_NEON ? "yes" : "no");
15471547
std::printf("- Uses SVE: %s \n", SZ_USE_ARM_SVE ? "yes" : "no");
15481548

1549-
#if 0
15501549
// Basic utilities
15511550
test_arithmetical_utilities();
15521551
test_memory_utilities();
15531552
test_replacements();
1554-
#endif
15551553

15561554
// Compatibility with STL
15571555
#if SZ_DETECT_CPP_17 && __cpp_lib_string_view

0 commit comments

Comments
 (0)