This is the clang part. The llvm part is at D37560
Details
Details
- Reviewers
craig.topper igorb m_zuckerman guyblank RKSimon - Commits
- rG23e7733230c5: [X86] Lower _mm[256|512]_[mask[z]]_avg_epu[8|16] intrinsics to native llvm IR
rC313011: [X86] Lower _mm[256|512]_[mask[z]]_avg_epu[8|16] intrinsics to native llvm IR
rL313011: [X86] Lower _mm[256|512]_[mask[z]]_avg_epu[8|16] intrinsics to native llvm IR
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
With this commit some (old) code stops to compile as it seems to remove some builtins, was that intentional?
Reproducer:
typedef long long __m128i __attribute__((__vector_size__(16))); typedef short __v8hi __attribute__((__vector_size__(16))); typedef char __v16qi __attribute__((__vector_size__(16))); __m128i __attribute__((__always_inline__, __nodebug__)) _mm_avg_epu8(__m128i a, __m128i b) { return (__m128i)__builtin_ia32_pavgb128((__v16qi)a, (__v16qi)b); } __m128i __attribute__((__always_inline__, __nodebug__)) _mm_avg_epu16(__m128i a, __m128i b) { return (__m128i)__builtin_ia32_pavgw128((__v8hi)a, (__v8hi)b); }
$ clang t.c /Users/mbraun/t.c:8:19: error: use of unknown builtin '__builtin_ia32_pavgb128' [-Wimplicit-function-declaration] return (__m128i)__builtin_ia32_pavgb128((__v16qi)a, (__v16qi)b); ^ /Users/mbraun/t.c:8:10: error: invalid conversion between vector type '__m128i' (vector of 2 'long long' values) and integer type 'int' of different size return (__m128i)__builtin_ia32_pavgb128((__v16qi)a, (__v16qi)b); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/mbraun/t.c:14:19: error: use of unknown builtin '__builtin_ia32_pavgw128' [-Wimplicit-function-declaration] return (__m128i)__builtin_ia32_pavgw128((__v8hi)a, (__v8hi)b); ^ /Users/mbraun/t.c:14:10: error: invalid conversion between vector type '__m128i' (vector of 2 'long long' values) and integer type 'int' of different size return (__m128i)__builtin_ia32_pavgw128((__v8hi)a, (__v8hi)b); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 errors generated.
Comment Actions
Actually, looking at the change it seems like it is and we better try to update emmintrin.h...
Comment Actions
Was the code not using emmintrin.h and instead copied code from it that used the builtins?
Comment Actions
Turned out to be code that had been preprocessed in the past. I'll unpreprocess the xmmintrin.h/emmintrin.h parts now.