diff options
author | Craig Topper <craig.topper@intel.com> | 2018-06-06 00:24:55 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2018-06-06 00:24:55 +0000 |
commit | f3914b74c1825f4deece3317542743109dabbf56 (patch) | |
tree | c6f2e80811bbed0f4fb57c2fd9f38ff3058ff11c /clang/test/CodeGen/vector.c | |
parent | c797bb23b857e4521562073d408be2de8d15a270 (diff) | |
download | bcm5719-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/vector.c')
-rw-r--r-- | clang/test/CodeGen/vector.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/CodeGen/vector.c b/clang/test/CodeGen/vector.c index ebaea841aa8..98dd82a28a0 100644 --- a/clang/test/CodeGen/vector.c +++ b/clang/test/CodeGen/vector.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -ffreestanding -triple i386-apple-darwin9 -O1 -target-cpu core2 -debug-info-kind=limited -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -ffreestanding -triple i386-apple-darwin9 -O1 -target-cpu corei7 -debug-info-kind=limited -emit-llvm %s -o - | FileCheck %s typedef short __v4hi __attribute__ ((__vector_size__ (8))); void test1() { |