Skip to content

Commit

Permalink
Merge branch 'master' of github.com:simdutf/simdutf
Browse files Browse the repository at this point in the history
  • Loading branch information
lemire committed Oct 24, 2023
2 parents ee29bbd + af4858e commit b82a978
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/vs16-ci.yml
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Run Debug tests
run: |
cd build
ctest -C Debug --output-on-failure
ctest -C Debug --output-on-failure -E basic_fuzzer
- name: Install
run: |
cmake --install build --config Release
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/vs17-ci-cxx20.yml
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Run Debug tests
run: |
cd build
ctest -C Debug --output-on-failure
ctest -C Debug --output-on-failure -E basic_fuzzer
- name: Install
run: |
cmake --install build --config Release
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/vs17-ci.yml
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Run Debug tests
run: |
cd build
ctest -C Debug --output-on-failure
ctest -C Debug --output-on-failure -E basic_fuzzer
- name: Install
run: |
cmake --install build --config Release
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/vs17-clang-ci.yml
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Run Debug tests
run: |
cd build
ctest -C Debug --output-on-failure
ctest -C Debug --output-on-failure -E basic_fuzzer
- name: Install
run: |
cmake --install build --config Release
Expand Down
4 changes: 1 addition & 3 deletions src/simdutf/haswell/simd.h
Expand Up @@ -348,9 +348,7 @@ namespace simd {

return simd8x64<bool>(
(this->chunks[0] <= mask_high) & (this->chunks[0] >= mask_low),
(this->chunks[1] <= mask_high) & (this->chunks[1] >= mask_low),
(this->chunks[2] <= mask_high) & (this->chunks[2] >= mask_low),
(this->chunks[3] <= mask_high) & (this->chunks[3] >= mask_low)
(this->chunks[1] <= mask_high) & (this->chunks[1] >= mask_low)
).to_bitmask();
}
simdutf_really_inline uint64_t not_in_range(const T low, const T high) const {
Expand Down
4 changes: 1 addition & 3 deletions src/simdutf/haswell/simd16-inl.h
Expand Up @@ -243,9 +243,7 @@ struct simd16<uint16_t>: base16_numeric<uint16_t> {

return simd16x32<bool>(
(this->chunks[0] <= mask_high) & (this->chunks[0] >= mask_low),
(this->chunks[1] <= mask_high) & (this->chunks[1] >= mask_low),
(this->chunks[2] <= mask_high) & (this->chunks[2] >= mask_low),
(this->chunks[3] <= mask_high) & (this->chunks[3] >= mask_low)
(this->chunks[1] <= mask_high) & (this->chunks[1] >= mask_low)
).to_bitmask();
}
simdutf_really_inline uint64_t not_in_range(const T low, const T high) const {
Expand Down
15 changes: 6 additions & 9 deletions tests/bele_tests.cpp
Expand Up @@ -5,19 +5,16 @@
#include <tests/helpers/test.h>

// We use explicit arrays so that no funny business is possible.

//
// s = "@\u00A7\u2208\U0001D4AA"
const unsigned char utf8_string[] = {0x40,0xc2,0xa7,0xe2,0x88,0x88,0xf0,0x9d,0x92,0xaa};
const char *utf8 = reinterpret_cast<const char*>(utf8_string);
const size_t utf8_size = sizeof(utf8_string)/sizeof(uint8_t);

const unsigned char utf16le_string[] = {0x40,0x00,0xa7,0x00,0x08,0x22,0x35,0xd8,0xaa,0xdc};
alignas(char16_t) const unsigned char utf16le_string[] = {0x40,0x00,0xa7,0x00,0x08,0x22,0x35,0xd8,0xaa,0xdc};
const char16_t *utf16le = reinterpret_cast<const char16_t*>(utf16le_string);
const size_t utf16_size = sizeof(utf16le_string)/sizeof(uint16_t);


const unsigned char utf16be_string[] = {0x00,0x40,0x00,0xa7,0x22,0x08,0xd8,0x35,0xdc,0xaa};
alignas(char16_t) const unsigned char utf16be_string[] = {0x00,0x40,0x00,0xa7,0x22,0x08,0xd8,0x35,0xdc,0xaa};
const char16_t *utf16be = reinterpret_cast<const char16_t*>(utf16be_string);
#if SIMDUTF_IS_BIG_ENDIAN
const char16_t *utf16 = utf16be;
Expand All @@ -27,11 +24,11 @@ const char16_t *utf16 = utf16le;

// Native order
#if SIMDUTF_IS_BIG_ENDIAN
const unsigned char utf32_string[] = {0x00,0x00,0x00,0x40,0x00,0x00,0x00,0xa7,0x00,0x00,0x22,0x08,0x00,0x01,0xd4,0xaa};
const char32_t *utf32 = reinterpret_cast<const char32_t*>(utf32_string); // Technically undefined behavior.
alignas(char32_t) const unsigned char utf32_string[] = {0x00,0x00,0x00,0x40,0x00,0x00,0x00,0xa7,0x00,0x00,0x22,0x08,0x00,0x01,0xd4,0xaa};
const char32_t *utf32 = reinterpret_cast<const char32_t*>(utf32_string);
#else
const unsigned char utf32_string[] = {0x40,0x00,0x00,0x00,0xa7,0x00,0x00,0x00,0x08,0x22,0x00,0x00,0xaa,0xd4,0x01,0x00};
const char32_t *utf32 = reinterpret_cast<const char32_t*>(utf32_string); // Technically undefined behavior.
alignas(char32_t) const unsigned char utf32_string[] = {0x40,0x00,0x00,0x00,0xa7,0x00,0x00,0x00,0x08,0x22,0x00,0x00,0xaa,0xd4,0x01,0x00};
const char32_t *utf32 = reinterpret_cast<const char32_t*>(utf32_string);
#endif
const size_t utf32_size = sizeof(utf32_string)/sizeof(char32_t);
const size_t number_of_code_points = utf32_size;
Expand Down

0 comments on commit b82a978

Please sign in to comment.