Most of the clang header patch by Simon Pilgrim @ SCEE.
Also fixed (or added) clang tests for these intrinsics.
LLVM tests to make sure we get the blend instruction out of these
shufflevectors are at http://reviews.llvm.org/D3600
Differential D3601
Patched clang to emit x86 blends as shufflevectors. filcab on May 2 2014, 5:55 PM. Authored by
Details Most of the clang header patch by Simon Pilgrim @ SCEE. LLVM tests to make sure we get the blend instruction out of these
Diff Detail Event TimelineComment Actions Should code that is directly using the builtins themselves (like Comment Actions Ah, I hadn't thought of that. I also don't see any other intrinsic doing the same (which doesn't mean we Filipe Comment Actions Filipe points out that we cannot use a #define for the __builtin since it has to be available even when no .h is include. Optimizing the builtin would then require custom code in clang/llvm, which is probably not worth it.
Comment Actions LGTM with a few small requests.
Comment Actions I just realized that one advantage of expanding the _builtins in clang is that it would allow us to remove the redundant ones from llvm in the future. Can you leave a FIXME about it in one of the tests? |
The masks looks wrong for the hight bits. Shouldn't this be
(((M) & 0x01) ? 16 : 0), \
(((M) & 0x02) ? 17 : 1), \
(((M) & 0x04) ? 18 : 2), \
(((M) & 0x08) ? 19 : 3), \
(((M) & 0x10) ? 20 : 4), \
(((M) & 0x20) ? 21 : 5), \
(((M) & 0x40) ? 22 : 6), \
(((M) & 0x80) ? 23 : 7), \
(((M) & 0x01) ? 24 : 8), \
(((M) & 0x02) ? 25 : 9), \
(((M) & 0x04) ? 26 : 10), \
(((M) & 0x08) ? 27 : 11), \
(((M) & 0x10) ? 28 : 12), \
(((M) & 0x20) ? 29 : 13), \
(((M) & 0x40) ? 30 : 14), \
(((M) & 0x80) ? 31 : 15), \