================
@@ -1943,12 +1954,31 @@ fastParseASCIIIdentifier(const char *CurPtr,
       continue;
     return CurPtr;
   }
+
+  return fastParseASCIIIdentifierScalar(CurPtr, BufferEnd);
+}
+
+static bool supportsSSE42() {
+  static bool SupportsSSE42 = __builtin_cpu_supports("sse4.2");
+  return SupportsSSE42;
+}
+
 #endif
 
-  unsigned char C = *CurPtr;
-  while (isAsciiIdentifierContinue(C))
-    C = *++CurPtr;
-  return CurPtr;
+static const char *fastParseASCIIIdentifier(const char *CurPtr,
+                                            const char *BufferEnd) {
+#if !defined(__i386__) && !defined(__x86_64__) || defined(_WIN32)
+  return fastParseASCIIIdentifierScalar(CurPtr, BufferEnd);
+#else
+
+#ifndef __SSE4_2__
+  if (LLVM_UNLIKELY(!supportsSSE42()))
+    return fastParseASCIIIdentifierScalar(CurPtr, BufferEnd);
+#endif
+
+  return fastParseASCIIIdentifierSSE42(CurPtr, BufferEnd);
----------------
Thibault-Monnier wrote:

I'm afraid this will require a lot of preprocessor logic because 
`__attribute__((target("sse4.2")))` isn't supported by MSVC. Should I still go 
for that?

https://github.com/llvm/llvm-project/pull/171914
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to