Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/Vc/common/fix_clang_emmintrin.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*{{{
0002     Copyright (C) 2013-2015 Matthias Kretz <kretz@kde.org>
0003 
0004     Permission to use, copy, modify, and distribute this software
0005     and its documentation for any purpose and without fee is hereby
0006     granted, provided that the above copyright notice appear in all
0007     copies and that both that the copyright notice and this
0008     permission notice and warranty disclaimer appear in supporting
0009     documentation, and that the name of the author not be used in
0010     advertising or publicity pertaining to distribution of the
0011     software without specific, written prior permission.
0012 
0013     The author disclaim all warranties with regard to this
0014     software, including all implied warranties of merchantability
0015     and fitness.  In no event shall the author be liable for any
0016     special, indirect or consequential damages or any damages
0017     whatsoever resulting from loss of use, data or profits, whether
0018     in an action of contract, negligence or other tortious action,
0019     arising out of or in connection with the use or performance of
0020     this software.
0021 
0022 }}}*/
0023 
0024 #ifndef VC_COMMON_FIX_CLANG_EMMINTRIN_H_
0025 #define VC_COMMON_FIX_CLANG_EMMINTRIN_H_
0026 
0027 #include "../global.h"
0028 
0029 #if (defined Vc_CLANG && Vc_CLANG < 0x30700) || (defined Vc_APPLECLANG && Vc_APPLECLANG < 0x70000)
0030 
0031 #ifdef _mm_slli_si128
0032 #undef _mm_slli_si128
0033 #define _mm_slli_si128(a, count) __extension__ ({ \
0034   (__m128i)__builtin_ia32_pslldqi128((__m128i)(a), (count)*8); })
0035 #endif
0036 
0037 #ifdef _mm_srli_si128
0038 #undef _mm_srli_si128
0039 #define _mm_srli_si128(a, count) __extension__ ({ \
0040   (__m128i)__builtin_ia32_psrldqi128((__m128i)(a), (count)*8); })
0041 #endif
0042 
0043 #ifdef _mm_shuffle_epi32
0044 #undef _mm_shuffle_epi32
0045 #define _mm_shuffle_epi32(a, imm) __extension__ ({ \
0046   (__m128i)__builtin_shufflevector((__v4si)(__m128i)(a), (__v4si) _mm_set1_epi32(0), \
0047                                    (imm) & 0x3, ((imm) & 0xc) >> 2, \
0048                                    ((imm) & 0x30) >> 4, ((imm) & 0xc0) >> 6); })
0049 #endif
0050 
0051 #ifdef _mm_shufflelo_epi16
0052 #undef _mm_shufflelo_epi16
0053 #define _mm_shufflelo_epi16(a, imm) __extension__ ({ \
0054   (__m128i)__builtin_shufflevector((__v8hi)(__m128i)(a), (__v8hi) _mm_set1_epi16(0), \
0055                                    (imm) & 0x3, ((imm) & 0xc) >> 2, \
0056                                    ((imm) & 0x30) >> 4, ((imm) & 0xc0) >> 6, \
0057                                    4, 5, 6, 7); })
0058 #endif
0059 
0060 #ifdef _mm_shufflehi_epi16
0061 #undef _mm_shufflehi_epi16
0062 #define _mm_shufflehi_epi16(a, imm) __extension__ ({ \
0063   (__m128i)__builtin_shufflevector((__v8hi)(__m128i)(a), (__v8hi) _mm_set1_epi16(0), \
0064                                    0, 1, 2, 3, \
0065                                    4 + (((imm) & 0x03) >> 0), \
0066                                    4 + (((imm) & 0x0c) >> 2), \
0067                                    4 + (((imm) & 0x30) >> 4), \
0068                                    4 + (((imm) & 0xc0) >> 6)); })
0069 #endif
0070 
0071 #ifdef _mm_shuffle_pd
0072 #undef _mm_shuffle_pd
0073 #define _mm_shuffle_pd(a, b, i) __extension__ ({ \
0074   __builtin_shufflevector((__m128d)(a), (__m128d)(b), (i) & 1, (((i) & 2) >> 1) + 2); })
0075 #endif
0076 
0077 #endif // Vc_CLANG || Vc_APPLECLANG
0078 
0079 #endif // VC_COMMON_FIX_CLANG_EMMINTRIN_H_