================
@@ -1919,10 +1921,21 @@ bool Lexer::LexUnicodeIdentifierStart(Token &Result,
uint32_t C,
return true;
}
-static const char *
-fastParseASCIIIdentifier(const char *CurPtr,
- [[maybe_unused]] const char *BufferEnd) {
-#ifdef __SSE4_2__
+static const char *fastParseASCIIIdentifierScalar(const char *CurPtr) {
+ unsigned char C = *CurPtr;
+ while (isAsciiIdentifierContinue(C))
+ C = *++CurPtr;
+ return CurPtr;
+}
+
+// Fast path for lexing ASCII identifiers using SSE4.2 instructions.
+// Only enabled on x86/x86_64 when building with a compiler that supports
+// the 'target' attribute, which is used for runtime dispatch. Otherwise, we
+// fall back to the scalar implementation.
+#if (defined(__i386__) || defined(__x86_64__)) && defined(__has_attribute) &&
\
+ __has_attribute(target) && !defined(_WIN32)
----------------
Andarwinux wrote:
This is definitely a regression on Windows, since you've completely disabled
fast paths on Windows, even though SSE4.2 was enabled at compile time.
https://github.com/llvm/llvm-project/pull/175452
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits