summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/sse41-builtins.c
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2018-06-06 00:24:55 +0000
committerCraig Topper <craig.topper@intel.com>2018-06-06 00:24:55 +0000
commitf3914b74c1825f4deece3317542743109dabbf56 (patch)
treec6f2e80811bbed0f4fb57c2fd9f38ff3058ff11c /clang/test/CodeGen/sse41-builtins.c
parentc797bb23b857e4521562073d408be2de8d15a270 (diff)
downloadbcm5719-llvm-f3914b74c1825f4deece3317542743109dabbf56.tar.gz
bcm5719-llvm-f3914b74c1825f4deece3317542743109dabbf56.zip
[X86] Add builtins for vector element insert and extract for different 128 and 256 bit vector types. Use them to implement the extract and insert intrinsics.
Previously we were just using extended vector operations in the header file. This unfortunately allowed non-constant indices to be used with the intrinsics. This is incompatible with gcc, icc, and MSVC. It also introduces a different performance characteristic because non-constant index gets lowered to a vector store and an element sized load. By adding the builtins we can check for the index to be a constant and ensure its in range of the vector element count. User code still has the option to use extended vector operations themselves if they need non-constant indexing. llvm-svn: 334057
Diffstat (limited to 'clang/test/CodeGen/sse41-builtins.c')
-rw-r--r--clang/test/CodeGen/sse41-builtins.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/test/CodeGen/sse41-builtins.c b/clang/test/CodeGen/sse41-builtins.c
index a99ecdabe44..6d6e11e9622 100644
--- a/clang/test/CodeGen/sse41-builtins.c
+++ b/clang/test/CodeGen/sse41-builtins.c
@@ -220,20 +220,20 @@ __m128 test_mm_floor_ss(__m128 x, __m128 y) {
__m128i test_mm_insert_epi8(__m128i x, char b) {
// CHECK-LABEL: test_mm_insert_epi8
- // CHECK: insertelement <16 x i8> %{{.*}}, i8 %{{.*}}, i32 0
- return _mm_insert_epi8(x, b, 16);
+ // CHECK: insertelement <16 x i8> %{{.*}}, i8 %{{.*}}, i32 1
+ return _mm_insert_epi8(x, b, 1);
}
__m128i test_mm_insert_epi32(__m128i x, int b) {
// CHECK-LABEL: test_mm_insert_epi32
- // CHECK: insertelement <4 x i32> %{{.*}}, i32 %{{.*}}, i32 0
- return _mm_insert_epi32(x, b, 4);
+ // CHECK: insertelement <4 x i32> %{{.*}}, i32 %{{.*}}, i32 1
+ return _mm_insert_epi32(x, b, 1);
}
__m128i test_mm_insert_epi64(__m128i x, long long b) {
// CHECK-LABEL: test_mm_insert_epi64
- // CHECK: insertelement <2 x i64> %{{.*}}, i64 %{{.*}}, i32 0
- return _mm_insert_epi64(x, b, 2);
+ // CHECK: insertelement <2 x i64> %{{.*}}, i64 %{{.*}}, i32 1
+ return _mm_insert_epi64(x, b, 1);
}
__m128 test_mm_insert_ps(__m128 x, __m128 y) {
OpenPOWER on IntegriCloud