From a35cc50903d2a3e41b3ecac0559aadc950825ff1 Mon Sep 17 00:00:00 2001 From: ashbob999 Date: Sat, 21 Sep 2024 09:22:39 +0100 Subject: [PATCH] Fixed MSVC not supporting subscript operator on vector types --- include/stringzilla/drafts.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/include/stringzilla/drafts.h b/include/stringzilla/drafts.h index 17147f7e..785e8a45 100644 --- a/include/stringzilla/drafts.h +++ b/include/stringzilla/drafts.h @@ -867,10 +867,10 @@ SZ_PUBLIC void sz_hashes_neon_readahead(sz_cptr_t start, sz_size_t length, sz_si chars_readahead_vec[3].u8x16 = vld1q_u8(text + window_length * 3 + i); for (; i != window_length; ++i) { - chars_incoming_low_vec.u32s[0] = chars_readahead_vec[0].u8x16[i]; - chars_incoming_low_vec.u32s[1] = chars_readahead_vec[1].u8x16[i]; - chars_incoming_low_vec.u32s[2] = chars_readahead_vec[2].u8x16[i]; - chars_incoming_low_vec.u32s[3] = chars_readahead_vec[3].u8x16[i]; + chars_incoming_low_vec.u32s[0] = chars_readahead_vec[0].u16s[i]; + chars_incoming_low_vec.u32s[1] = chars_readahead_vec[1].u16s[i]; + chars_incoming_low_vec.u32s[2] = chars_readahead_vec[2].u16s[i]; + chars_incoming_low_vec.u32s[3] = chars_readahead_vec[3].u16s[i]; chars_incoming_high_vec.u8x16 = vaddq_u8(chars_incoming_low_vec.u8x16, vld1q_dup_u8(&high_shift)); // Append new data. @@ -906,11 +906,11 @@ SZ_PUBLIC void sz_hashes_neon_readahead(sz_cptr_t start, sz_size_t length, sz_si for (; i + 1 < window_length; ++i) { // Transpose - chars_outgoing_low_vec.u32s[0] = chars_readahead_vec[0].u8x16[i]; - chars_outgoing_low_vec.u32s[1] = chars_incoming_low_vec.u32s[0] = chars_readahead_vec[1].u8x16[i]; - chars_outgoing_low_vec.u32s[2] = chars_incoming_low_vec.u32s[1] = chars_readahead_vec[2].u8x16[i]; - chars_outgoing_low_vec.u32s[3] = chars_incoming_low_vec.u32s[2] = chars_readahead_vec[3].u8x16[i]; - chars_incoming_low_vec.u32s[3] = chars_readahead_vec[4].u8x16[i]; + chars_outgoing_low_vec.u32s[0] = chars_readahead_vec[0].u16s[i]; + chars_outgoing_low_vec.u32s[1] = chars_incoming_low_vec.u32s[0] = chars_readahead_vec[1].u16s[i]; + chars_outgoing_low_vec.u32s[2] = chars_incoming_low_vec.u32s[1] = chars_readahead_vec[2].u16s[i]; + chars_outgoing_low_vec.u32s[3] = chars_incoming_low_vec.u32s[2] = chars_readahead_vec[3].u16s[i]; + chars_incoming_low_vec.u32s[3] = chars_readahead_vec[4].u16s[i]; chars_outgoing_high_vec.u8x16 = vaddq_u8(chars_outgoing_low_vec.u8x16, vld1q_dup_u8(&high_shift)); chars_incoming_high_vec.u8x16 = vaddq_u8(chars_incoming_low_vec.u8x16, vld1q_dup_u8(&high_shift));