Skip to content

Commit

Permalink
deps: update simdutf to 2.0.9
Browse files Browse the repository at this point in the history
PR-URL: #45975
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
nodejs-github-bot authored and juanarbol committed Jan 31, 2023
1 parent 86b2c8c commit d148f35
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
26 changes: 17 additions & 9 deletions deps/simdutf/simdutf.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* auto-generated on 2022-12-13 18:33:40 -0500. Do not edit! */
/* auto-generated on 2022-12-15 12:13:17 -0500. Do not edit! */
// dofile: invoked with prepath=/Users/dlemire/CVS/github/simdutf/src, filename=simdutf.cpp
/* begin file src/simdutf.cpp */
#include "simdutf.h"
Expand Down Expand Up @@ -3895,7 +3895,9 @@ SIMDUTF_POP_DISABLE_WARNINGS

#if __GNUC__ == 8
#define SIMDUTF_GCC8 1
#endif // __GNUC__ == 8
#elif __GNUC__ == 9
#define SIMDUTF_GCC9 1
#endif // __GNUC__ == 8 || __GNUC__ == 9

#endif // defined(__GNUC__) && !defined(__clang__)

Expand Down Expand Up @@ -15730,8 +15732,13 @@ simdutf_really_inline bool process_block_utf8_to_utf16(const char *&in, char16_t
__mmask64 bxorleading = _kxor_mask64(b, leading);
if (_kshiftli_mask64(m234, 1) != bxorleading) { return false; }
}
in += 64 - _lzcnt_u64(_pdep_u64(0xFFFFFFFF, continuation_or_ascii));

//
if (tail == SIMDUTF_FULL) {
in += 32;
if(int8_t(*in) <= int8_t(0xc0)) in++;
} else {
in += 64 - _lzcnt_u64(_pdep_u64(0xFFFFFFFF, continuation_or_ascii));
}
__m512i lead = _mm512_maskz_compress_epi8(leading, leading2byte); // will contain zero for ascii, and the data
lead = _mm512_cvtepu8_epi16(_mm512_castsi512_si256(lead)); // ... zero extended into words
__m512i follow = _mm512_maskz_compress_epi8(continuation_or_ascii, input); // the last bytes of each sequence
Expand All @@ -15742,8 +15749,9 @@ simdutf_really_inline bool process_block_utf8_to_utf16(const char *&in, char16_t
if(big_endian) { final = _mm512_shuffle_epi8(final, byteflip); }
if (tail == SIMDUTF_FULL) {
// Next part is UTF-16 specific and can be generalized to UTF-32.
_mm512_storeu_si512(out, final);
out += 32; // UTF-8 to UTF-16 is only expansionary in this case.
int nout = _mm_popcnt_u32(uint32_t(leading));
_mm512_mask_storeu_epi16(out, __mmask32((uint64_t(1) << nout) - 1), final);
out += nout; // UTF-8 to UTF-16 is only expansionary in this case.
} else {
int nout = int(_mm_popcnt_u64(_pdep_u64(0xFFFFFFFF, leading)));
_mm512_mask_storeu_epi16(out, __mmask32((uint64_t(1) << nout) - 1), final);
Expand Down Expand Up @@ -15909,12 +15917,12 @@ __m512i prev(__m512i input, __m512i previous) {
static_assert(N<=32, "N must be no larger than 32");
const __m512i movemask = _mm512_setr_epi32(28,29,30,31,0,1,2,3,4,5,6,7,8,9,10,11);
const __m512i rotated = _mm512_permutex2var_epi32(input, movemask, previous);
#if SIMDUTF_GCC8
constexpr int shift = 16-N; // workaround for GCC8
#if SIMDUTF_GCC8 || SIMDUTF_GCC9
constexpr int shift = 16-N; // workaround for GCC8,9
return _mm512_alignr_epi8(input, rotated, shift);
#else
return _mm512_alignr_epi8(input, rotated, 16-N);
#endif // SIMDUTF_GCC8
#endif // SIMDUTF_GCC8 || SIMDUTF_GCC9
}

template <unsigned idx0, unsigned idx1, unsigned idx2, unsigned idx3>
Expand Down
6 changes: 3 additions & 3 deletions deps/simdutf/simdutf.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* auto-generated on 2022-12-13 18:33:40 -0500. Do not edit! */
/* auto-generated on 2022-12-15 12:13:17 -0500. Do not edit! */
// dofile: invoked with prepath=/Users/dlemire/CVS/github/simdutf/include, filename=simdutf.h
/* begin file include/simdutf.h */
#ifndef SIMDUTF_H
Expand Down Expand Up @@ -526,7 +526,7 @@ SIMDUTF_DISABLE_UNDESIRED_WARNINGS
#define SIMDUTF_SIMDUTF_VERSION_H
/** The version of simdutf being used (major.minor.revision) */
#define SIMDUTF_VERSION 2.0.7
#define SIMDUTF_VERSION 2.0.9
namespace simdutf {
enum {
Expand All @@ -541,7 +541,7 @@ enum {
/**
* The revision (major.minor.REVISION) of simdutf being used.
*/
SIMDUTF_VERSION_REVISION = 7
SIMDUTF_VERSION_REVISION = 9
};
} // namespace simdutf
Expand Down

0 comments on commit d148f35

Please sign in to comment.