Skip to content

Commit

Permalink
Add vreinterpret (#344)
Browse files Browse the repository at this point in the history
* replacing vrev16_u8 by vreinterpret_u16_u8(vrev16_u8(vreinterpret_u8_u16( in two locations to account for some compilers that require it.

* version bump
  • Loading branch information
lemire committed Oct 25, 2023
1 parent fef2a49 commit 93bf2c9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.15)
project(simdutf
DESCRIPTION "Fast Unicode validation, transcoding and processing"
LANGUAGES CXX
VERSION 4.0.2
VERSION 4.0.3
)

include (TestBigEndian)
Expand Down
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = simdutf
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = "4.0.2"
PROJECT_NUMBER = "4.0.3"

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
4 changes: 2 additions & 2 deletions include/simdutf/simdutf_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#define SIMDUTF_SIMDUTF_VERSION_H

/** The version of simdutf being used (major.minor.revision) */
#define SIMDUTF_VERSION "4.0.2"
#define SIMDUTF_VERSION "4.0.3"

namespace simdutf {
enum {
Expand All @@ -19,7 +19,7 @@ enum {
/**
* The revision (major.minor.REVISION) of simdutf being used.
*/
SIMDUTF_VERSION_REVISION = 2
SIMDUTF_VERSION_REVISION = 3
};
} // namespace simdutf

Expand Down
4 changes: 2 additions & 2 deletions src/arm64/arm_convert_utf32_to_utf16.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ std::pair<const char32_t*, char16_t*> arm_convert_utf32_to_utf16(const char32_t*
const uint16x4_t v_dfff = vmov_n_u16((uint16_t)0xdfff);
forbidden_bytemask = vorr_u16(vand_u16(vcle_u16(utf16_packed, v_dfff), vcge_u16(utf16_packed, v_d800)), forbidden_bytemask);

if (!match_system(big_endian)) { utf16_packed = vrev16_u8(utf16_packed); }
if (!match_system(big_endian)) { utf16_packed = vreinterpret_u16_u8(vrev16_u8(vreinterpret_u8_u16(utf16_packed))); }
vst1_u16(utf16_output, utf16_packed);
utf16_output += 4;
buf += 4;
Expand Down Expand Up @@ -77,7 +77,7 @@ std::pair<result, char16_t*> arm_convert_utf32_to_utf16_with_errors(const char32
return std::make_pair(result(error_code::SURROGATE, buf - start), reinterpret_cast<char16_t*>(utf16_output));
}

if (!match_system(big_endian)) { utf16_packed = vrev16_u8(utf16_packed); }
if (!match_system(big_endian)) { utf16_packed = vreinterpret_u16_u8(vrev16_u8(vreinterpret_u8_u16(utf16_packed))); }
vst1_u16(utf16_output, utf16_packed);
utf16_output += 4;
buf += 4;
Expand Down

0 comments on commit 93bf2c9

Please sign in to comment.