[cfe-commits] r39093 - in /cfe/cfe/trunk/Lex: Lexer.cpp Makefile
sabre at cs.uiuc.edu
sabre at cs.uiuc.edu
Wed Jul 11 09:27:28 PDT 2007
Author: sabre
Date: Wed Jul 11 11:27:28 2007
New Revision: 39093
URL: http://llvm.org/viewvc/llvm-project?rev=39093&view=rev
Log:
Add altivec version of block comment skipping code.
Modified:
cfe/cfe/trunk/Lex/Lexer.cpp
cfe/cfe/trunk/Lex/Makefile
Modified: cfe/cfe/trunk/Lex/Lexer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Lex/Lexer.cpp?rev=39093&r1=39092&r2=39093&view=diff
==============================================================================
--- cfe/cfe/trunk/Lex/Lexer.cpp (original)
+++ cfe/cfe/trunk/Lex/Lexer.cpp Wed Jul 11 11:27:28 2007
@@ -772,6 +772,9 @@
#ifdef __SSE2__
#include <emmintrin.h>
+#elif __ALTIVEC__
+#include <altivec.h>
+#undef bool
#endif
/// SkipBlockComment - We have just read the /* characters from input. Read
@@ -808,7 +811,15 @@
while (CurPtr+16 <= BufferEnd &&
_mm_movemask_epi8(_mm_cmpeq_epi8(*(__m128i*)CurPtr, Slashes)) == 0)
CurPtr += 16;
-#else
+#elif __ALTIVEC__
+ __vector unsigned char Slashes = {
+ '/', '/', '/', '/', '/', '/', '/', '/',
+ '/', '/', '/', '/', '/', '/', '/', '/'
+ };
+ while (CurPtr+16 <= BufferEnd &&
+ !vec_any_eq(*(vector unsigned char*)CurPtr, Slashes))
+ CurPtr += 16;
+#else
// Scan for '/' quickly. Many block comments are very large.
while (CurPtr[0] != '/' &&
CurPtr[1] != '/' &&
Modified: cfe/cfe/trunk/Lex/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Lex/Makefile?rev=39093&r1=39092&r2=39093&view=diff
==============================================================================
--- cfe/cfe/trunk/Lex/Makefile (original)
+++ cfe/cfe/trunk/Lex/Makefile Wed Jul 11 11:27:28 2007
@@ -12,10 +12,16 @@
##===----------------------------------------------------------------------===##
LEVEL = ../../..
+include $(LEVEL)/Makefile.config
+
LIBRARYNAME := clangLex
BUILD_ARCHIVE = 1
CXXFLAGS = -fno-rtti
+ifeq ($(ARCH),PowerPC)
+CXXFLAGS += -maltivec
+endif
+
CPPFLAGS += -I$(PROJ_SRC_DIR)/../include
include $(LEVEL)/Makefile.common
More information about the cfe-commits
mailing list