diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WTF/wtf/text/ASCIIFastPath.h | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/WTF/wtf/text/ASCIIFastPath.h')
-rw-r--r-- | Source/WTF/wtf/text/ASCIIFastPath.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/Source/WTF/wtf/text/ASCIIFastPath.h b/Source/WTF/wtf/text/ASCIIFastPath.h index d057a6fa1..eb54828a2 100644 --- a/Source/WTF/wtf/text/ASCIIFastPath.h +++ b/Source/WTF/wtf/text/ASCIIFastPath.h @@ -22,12 +22,14 @@ #ifndef ASCIIFastPath_h #define ASCIIFastPath_h -#if OS(DARWIN) && (CPU(X86) || CPU(X86_64)) -#include <emmintrin.h> -#endif #include <stdint.h> +#include <unicode/utypes.h> #include <wtf/StdLibExtras.h> -#include <wtf/unicode/Unicode.h> +#include <wtf/text/LChar.h> + +#if CPU(X86_SSE2) +#include <emmintrin.h> +#endif namespace WTF { @@ -107,7 +109,7 @@ inline bool charactersAreAllASCII(const CharacterType* characters, size_t length inline void copyLCharsFromUCharSource(LChar* destination, const UChar* source, size_t length) { -#if OS(DARWIN) && (CPU(X86) || CPU(X86_64)) +#if CPU(X86_SSE2) const uintptr_t memoryAccessSize = 16; // Memory accesses on 16 byte (128 bit) alignment const uintptr_t memoryAccessMask = memoryAccessSize - 1; @@ -137,7 +139,7 @@ inline void copyLCharsFromUCharSource(LChar* destination, const UChar* source, s ASSERT(!(source[i] & 0xff00)); destination[i] = static_cast<LChar>(source[i]); } -#elif COMPILER(GCC) && CPU(ARM64) && defined(NDEBUG) +#elif COMPILER(GCC_OR_CLANG) && CPU(ARM64) && defined(NDEBUG) const LChar* const end = destination + length; const uintptr_t memoryAccessSize = 16; @@ -158,7 +160,7 @@ inline void copyLCharsFromUCharSource(LChar* destination, const UChar* source, s while (destination != end) *destination++ = static_cast<LChar>(*source++); -#elif COMPILER(GCC) && CPU(ARM_NEON) && !(PLATFORM(BIG_ENDIAN) || PLATFORM(MIDDLE_ENDIAN)) && defined(NDEBUG) +#elif COMPILER(GCC_OR_CLANG) && CPU(ARM_NEON) && !(CPU(BIG_ENDIAN) || CPU(MIDDLE_ENDIAN)) && defined(NDEBUG) const LChar* const end = destination + length; const uintptr_t memoryAccessSize = 8; |