Skip to content

Commit d34fd21

Browse files
nodejs-github-botmarco-ippolito
authored andcommitted
deps: update simdutf to 5.2.4
PR-URL: #52473 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
1 parent 8464c02 commit d34fd21

File tree

2 files changed

+39
-18
lines changed

2 files changed

+39
-18
lines changed

deps/simdutf/simdutf.cpp

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on 2024-04-05 16:29:02 -0400. Do not edit! */
1+
/* auto-generated on 2024-04-11 09:56:55 -0400. Do not edit! */
22
/* begin file src/simdutf.cpp */
33
#include "simdutf.h"
44
// We include base64_tables once.
@@ -13665,7 +13665,6 @@ inline size_t convert(const char *buf, size_t len, char32_t *utf32_output) {
1366513665
/* begin file src/scalar/utf8_to_latin1/utf8_to_latin1.h */
1366613666
#ifndef SIMDUTF_UTF8_TO_LATIN1_H
1366713667
#define SIMDUTF_UTF8_TO_LATIN1_H
13668-
#include <iostream>
1366913668

1367013669
namespace simdutf {
1367113670
namespace scalar {
@@ -16715,8 +16714,17 @@ size_t encode_base64(char *dst, const char *src, size_t srclen,
1671516714
'N', 'd', 't', '9', 'O', 'e', 'u', '-', 'P', 'f', 'v', '_',
1671616715
};
1671716716
const uint8x16_t v3f = vdupq_n_u8(0x3f);
16717+
#ifdef SIMDUTF_REGULAR_VISUAL_STUDIO
16718+
// When trying to load a uint8_t array, Visual Studio might
16719+
// error with: error C2664: '__n128x4 neon_ld4m_q8(const char *)':
16720+
// cannot convert argument 1 from 'const uint8_t [64]' to 'const char *
16721+
const uint8x16x4_t table =
16722+
vld4q_u8((reinterpret_cast<const char *>(
16723+
options & base64_url) ? source_table_url : source_table));
16724+
#else
1671816725
const uint8x16x4_t table =
1671916726
vld4q_u8((options & base64_url) ? source_table_url : source_table);
16727+
#endif
1672016728
size_t i = 0;
1672116729
for (; i + 16 * 3 <= srclen; i += 16 * 3) {
1672216730
const uint8x16x3_t in = vld3q_u8((const uint8_t *)src + i);

deps/simdutf/simdutf.h

+29-16
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on 2024-04-05 16:29:02 -0400. Do not edit! */
1+
/* auto-generated on 2024-04-11 09:56:55 -0400. Do not edit! */
22
/* begin file include/simdutf.h */
33
#ifndef SIMDUTF_H
44
#define SIMDUTF_H
@@ -130,9 +130,9 @@
130130
#include <iso646.h>
131131
#endif
132132

133-
#if defined(__x86_64__) || defined(_M_AMD64)
133+
#if (defined(__x86_64__) || defined(_M_AMD64)) && !defined(_M_ARM64EC)
134134
#define SIMDUTF_IS_X86_64 1
135-
#elif defined(__aarch64__) || defined(_M_ARM64)
135+
#elif defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC)
136136
#define SIMDUTF_IS_ARM64 1
137137
#elif defined(__PPC64__) || defined(_M_PPC64)
138138
//#define SIMDUTF_IS_PPC64 1
@@ -594,7 +594,7 @@ SIMDUTF_DISABLE_UNDESIRED_WARNINGS
594594
#define SIMDUTF_SIMDUTF_VERSION_H
595595

596596
/** The version of simdutf being used (major.minor.revision) */
597-
#define SIMDUTF_VERSION "5.2.3"
597+
#define SIMDUTF_VERSION "5.2.4"
598598

599599
namespace simdutf {
600600
enum {
@@ -609,7 +609,7 @@ enum {
609609
/**
610610
* The revision (major.minor.REVISION) of simdutf being used.
611611
*/
612-
SIMDUTF_VERSION_REVISION = 3
612+
SIMDUTF_VERSION_REVISION = 4
613613
};
614614
} // namespace simdutf
615615

@@ -748,7 +748,7 @@ static inline uint32_t detect_supported_architectures() {
748748
return host_isa;
749749
}
750750

751-
#elif defined(__aarch64__) || defined(_M_ARM64)
751+
#elif defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC)
752752

753753
static inline uint32_t detect_supported_architectures() {
754754
return instruction_set::NEON;
@@ -1170,7 +1170,7 @@ simdutf_warn_unused result validate_utf32_with_errors(const char32_t *buf, size_
11701170
* @param input the UTF-8 string to convert
11711171
* @param length the length of the string in bytes
11721172
* @param latin1_output the pointer to buffer that can hold conversion result
1173-
* @return the number of written char; 0 if the input was not valid UTF-8 string
1173+
* @return the number of written char; 0 if the input was not valid UTF-8 string or if it cannot be represented as Latin1
11741174
*/
11751175
simdutf_warn_unused size_t convert_utf8_to_latin1(const char * input, size_t length, char* latin1_output) noexcept;
11761176

@@ -1227,6 +1227,8 @@ simdutf_warn_unused size_t convert_utf8_to_utf16be(const char * input, size_t le
12271227

12281228
/**
12291229
* Convert possibly broken UTF-8 string into latin1 string with errors.
1230+
* If the string cannot be represented as Latin1, an error
1231+
* code is returned.
12301232
*
12311233
* During the conversion also validation of the input string is done.
12321234
* This function is suitable to work with inputs from untrusted sources.
@@ -1446,12 +1448,14 @@ simdutf_warn_unused size_t convert_utf16_to_utf8(const char16_t * input, size_t
14461448
* @param input the UTF-16 string to convert
14471449
* @param length the length of the string in 2-byte code units (char16_t)
14481450
* @param latin1_buffer the pointer to buffer that can hold conversion result
1449-
* @return number of written code units; 0 if input is not a valid UTF-16LE string
1451+
* @return number of written code units; 0 if input is not a valid UTF-16 string or if it cannot be represented as Latin1
14501452
*/
14511453
simdutf_warn_unused size_t convert_utf16_to_latin1(const char16_t * input, size_t length, char* latin1_buffer) noexcept;
14521454

14531455
/**
14541456
* Convert possibly broken UTF-16LE string into Latin1 string.
1457+
* If the string cannot be represented as Latin1, an error
1458+
* is returned.
14551459
*
14561460
* During the conversion also validation of the input string is done.
14571461
* This function is suitable to work with inputs from untrusted sources.
@@ -1461,7 +1465,7 @@ simdutf_warn_unused size_t convert_utf16_to_latin1(const char16_t * input, size_
14611465
* @param input the UTF-16LE string to convert
14621466
* @param length the length of the string in 2-byte code units (char16_t)
14631467
* @param latin1_buffer the pointer to buffer that can hold conversion result
1464-
* @return number of written code units; 0 if input is not a valid UTF-16LE string
1468+
* @return number of written code units; 0 if input is not a valid UTF-16LE string or if it cannot be represented as Latin1
14651469
*/
14661470
simdutf_warn_unused size_t convert_utf16le_to_latin1(const char16_t * input, size_t length, char* latin1_buffer) noexcept;
14671471

@@ -1476,7 +1480,7 @@ simdutf_warn_unused size_t convert_utf16le_to_latin1(const char16_t * input, siz
14761480
* @param input the UTF-16BE string to convert
14771481
* @param length the length of the string in 2-byte code units (char16_t)
14781482
* @param latin1_buffer the pointer to buffer that can hold conversion result
1479-
* @return a result pair struct (of type simdutf::error containing the two fields error and count) with an error code and either position of the error (in the input in code units) if any, or the number of char written if successful.
1483+
* @return number of written code units; 0 if input is not a valid UTF-16BE string or if it cannot be represented as Latin1
14801484
*/
14811485
simdutf_warn_unused size_t convert_utf16be_to_latin1(const char16_t * input, size_t length, char* latin1_buffer) noexcept;
14821486

@@ -1541,6 +1545,8 @@ simdutf_warn_unused result convert_utf16le_to_latin1_with_errors(const char16_t
15411545

15421546
/**
15431547
* Convert possibly broken UTF-16BE string into Latin1 string.
1548+
* If the string cannot be represented as Latin1, an error
1549+
* is returned.
15441550
*
15451551
* During the conversion also validation of the input string is done.
15461552
* This function is suitable to work with inputs from untrusted sources.
@@ -1951,13 +1957,14 @@ simdutf_warn_unused size_t convert_utf32_to_utf16le(const char32_t * input, size
19511957
* @param input the UTF-32 string to convert
19521958
* @param length the length of the string in 4-byte code units (char32_t)
19531959
* @param latin1_buffer the pointer to buffer that can hold conversion result
1954-
* @return number of written code units; 0 if input is not a valid UTF-32 string
1960+
* @return number of written code units; 0 if input is not a valid UTF-32 string or if it cannot be represented as Latin1
19551961
*/
19561962
simdutf_warn_unused size_t convert_utf32_to_latin1(const char32_t * input, size_t length, char* latin1_buffer) noexcept;
19571963

19581964

19591965
/**
19601966
* Convert possibly broken UTF-32 string into Latin1 string and stop on error.
1967+
* If the string cannot be represented as Latin1, an error is returned.
19611968
*
19621969
* During the conversion also validation of the input string is done.
19631970
* This function is suitable to work with inputs from untrusted sources.
@@ -2681,12 +2688,14 @@ class implementation {
26812688
* @param input the UTF-8 string to convert
26822689
* @param length the length of the string in bytes
26832690
* @param latin1_output the pointer to buffer that can hold conversion result
2684-
* @return the number of written char; 0 if the input was not valid UTF-8 string
2691+
* @return the number of written char; 0 if the input was not valid UTF-8 string or if it cannot be represented as Latin1
26852692
*/
26862693
simdutf_warn_unused virtual size_t convert_utf8_to_latin1(const char * input, size_t length, char* latin1_output) const noexcept = 0;
26872694

26882695
/**
2689-
* Convert possibly broken UTF-8 string into latin1 string with errors
2696+
* Convert possibly broken UTF-8 string into latin1 string with errors.
2697+
* If the string cannot be represented as Latin1, an error
2698+
* code is returned.
26902699
*
26912700
* During the conversion also validation of the input string is done.
26922701
* This function is suitable to work with inputs from untrusted sources.
@@ -2862,7 +2871,7 @@ class implementation {
28622871
* @param input the UTF-16LE string to convert
28632872
* @param length the length of the string in 2-byte code units (char16_t)
28642873
* @param latin1_buffer the pointer to buffer that can hold conversion result
2865-
* @return number of written code units; 0 if input is not a valid UTF-16LE string
2874+
* @return number of written code units; 0 if input is not a valid UTF-16LE string or if it cannot be represented as Latin1
28662875
*/
28672876
simdutf_warn_unused virtual size_t convert_utf16le_to_latin1(const char16_t * input, size_t length, char* latin1_buffer) const noexcept = 0;
28682877

@@ -2877,12 +2886,14 @@ class implementation {
28772886
* @param input the UTF-16BE string to convert
28782887
* @param length the length of the string in 2-byte code units (char16_t)
28792888
* @param latin1_buffer the pointer to buffer that can hold conversion result
2880-
* @return a result pair struct (of type simdutf::error containing the two fields error and count) with an error code and either position of the error (in the input in code units) if any, or the number of char written if successful.
2889+
* @return number of written code units; 0 if input is not a valid UTF-16BE string or if it cannot be represented as Latin1
28812890
*/
28822891
simdutf_warn_unused virtual size_t convert_utf16be_to_latin1(const char16_t * input, size_t length, char* latin1_buffer) const noexcept = 0;
28832892

28842893
/**
28852894
* Convert possibly broken UTF-16LE string into Latin1 string.
2895+
* If the string cannot be represented as Latin1, an error
2896+
* is returned.
28862897
*
28872898
* During the conversion also validation of the input string is done.
28882899
* This function is suitable to work with inputs from untrusted sources.
@@ -2897,6 +2908,8 @@ class implementation {
28972908

28982909
/**
28992910
* Convert possibly broken UTF-16BE string into Latin1 string.
2911+
* If the string cannot be represented as Latin1, an error
2912+
* is returned.
29002913
*
29012914
* During the conversion also validation of the input string is done.
29022915
* This function is suitable to work with inputs from untrusted sources.
@@ -3157,6 +3170,7 @@ class implementation {
31573170

31583171
/**
31593172
* Convert possibly broken UTF-32 string into Latin1 string and stop on error.
3173+
* If the string cannot be represented as Latin1, an error is returned.
31603174
*
31613175
* During the conversion also validation of the input string is done.
31623176
* This function is suitable to work with inputs from untrusted sources.
@@ -3168,7 +3182,6 @@ class implementation {
31683182
* @param latin1_buffer the pointer to buffer that can hold conversion result
31693183
* @return a result pair struct (of type simdutf::error containing the two fields error and count) with an error code and either position of the error (in the input in code units) if any, or the number of char written if successful.
31703184
*/
3171-
31723185
simdutf_warn_unused virtual result convert_utf32_to_latin1_with_errors(const char32_t * input, size_t length, char* latin1_buffer) const noexcept = 0;
31733186

31743187
/**

0 commit comments

Comments
 (0)