Add altivec version of block comment skipping code.
llvm-svn: 39093
This commit is contained in:
parent
c07ba1fe2f
commit
9f6604fa60
|
|
@ -772,6 +772,9 @@ static bool isEndOfBlockCommentWithEscapedNewLine(const char *CurPtr,
|
||||||
|
|
||||||
#ifdef __SSE2__
|
#ifdef __SSE2__
|
||||||
#include <emmintrin.h>
|
#include <emmintrin.h>
|
||||||
|
#elif __ALTIVEC__
|
||||||
|
#include <altivec.h>
|
||||||
|
#undef bool
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// SkipBlockComment - We have just read the /* characters from input. Read
|
/// SkipBlockComment - We have just read the /* characters from input. Read
|
||||||
|
|
@ -808,6 +811,14 @@ bool Lexer::SkipBlockComment(LexerToken &Result, const char *CurPtr) {
|
||||||
while (CurPtr+16 <= BufferEnd &&
|
while (CurPtr+16 <= BufferEnd &&
|
||||||
_mm_movemask_epi8(_mm_cmpeq_epi8(*(__m128i*)CurPtr, Slashes)) == 0)
|
_mm_movemask_epi8(_mm_cmpeq_epi8(*(__m128i*)CurPtr, Slashes)) == 0)
|
||||||
CurPtr += 16;
|
CurPtr += 16;
|
||||||
|
#elif __ALTIVEC__
|
||||||
|
__vector unsigned char Slashes = {
|
||||||
|
'/', '/', '/', '/', '/', '/', '/', '/',
|
||||||
|
'/', '/', '/', '/', '/', '/', '/', '/'
|
||||||
|
};
|
||||||
|
while (CurPtr+16 <= BufferEnd &&
|
||||||
|
!vec_any_eq(*(vector unsigned char*)CurPtr, Slashes))
|
||||||
|
CurPtr += 16;
|
||||||
#else
|
#else
|
||||||
// Scan for '/' quickly. Many block comments are very large.
|
// Scan for '/' quickly. Many block comments are very large.
|
||||||
while (CurPtr[0] != '/' &&
|
while (CurPtr[0] != '/' &&
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,16 @@
|
||||||
##===----------------------------------------------------------------------===##
|
##===----------------------------------------------------------------------===##
|
||||||
|
|
||||||
LEVEL = ../../..
|
LEVEL = ../../..
|
||||||
|
include $(LEVEL)/Makefile.config
|
||||||
|
|
||||||
LIBRARYNAME := clangLex
|
LIBRARYNAME := clangLex
|
||||||
BUILD_ARCHIVE = 1
|
BUILD_ARCHIVE = 1
|
||||||
CXXFLAGS = -fno-rtti
|
CXXFLAGS = -fno-rtti
|
||||||
|
|
||||||
|
ifeq ($(ARCH),PowerPC)
|
||||||
|
CXXFLAGS += -maltivec
|
||||||
|
endif
|
||||||
|
|
||||||
CPPFLAGS += -I$(PROJ_SRC_DIR)/../include
|
CPPFLAGS += -I$(PROJ_SRC_DIR)/../include
|
||||||
|
|
||||||
include $(LEVEL)/Makefile.common
|
include $(LEVEL)/Makefile.common
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue