diff options
Diffstat (limited to 'gcc-4.8/libcpp/lex.c')
-rw-r--r-- | gcc-4.8/libcpp/lex.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc-4.8/libcpp/lex.c b/gcc-4.8/libcpp/lex.c index 570c00733..335d2b3e4 100644 --- a/gcc-4.8/libcpp/lex.c +++ b/gcc-4.8/libcpp/lex.c @@ -559,8 +559,13 @@ search_line_fast (const uchar *s, const uchar *end ATTRIBUTE_UNUSED) beginning with all ones and shifting in zeros according to the mis-alignment. The LVSR instruction pulls the exact shift we want from the address. */ +#ifdef __BIG_ENDIAN__ mask = __builtin_vec_lvsr(0, s); mask = __builtin_vec_perm(zero, ones, mask); +#else + mask = __builtin_vec_lvsl(0, s); + mask = __builtin_vec_perm(ones, zero, mask); +#endif data &= mask; /* While altivec loads mask addresses, we still need to align S so @@ -624,7 +629,11 @@ search_line_fast (const uchar *s, const uchar *end ATTRIBUTE_UNUSED) /* L now contains 0xff in bytes for which we matched one of the relevant characters. We can find the byte index by finding its bit index and dividing by 8. */ +#ifdef __BIG_ENDIAN__ l = __builtin_clzl(l) >> 3; +#else + l = __builtin_ctzl(l) >> 3; +#endif return s + l; #undef N |