diff options
| author | Craig Topper <craig.topper@intel.com> | 2018-07-10 00:37:25 +0000 |
|---|---|---|
| committer | Craig Topper <craig.topper@intel.com> | 2018-07-10 00:37:25 +0000 |
| commit | 638426fc36e08ccee78605a4d8136757ca0faf12 (patch) | |
| tree | 10d3c4a1a9bbc0ed4ecb0847c75e6f833b67b698 /clang/test/CodeGen/sse-builtins.c | |
| parent | e194f73e9f6a101dcb7dba5224c2d4b1fa1b7459 (diff) | |
| download | bcm5719-llvm-638426fc36e08ccee78605a4d8136757ca0faf12.tar.gz bcm5719-llvm-638426fc36e08ccee78605a4d8136757ca0faf12.zip | |
[X86] Add __builtin_ia32_selectss_128 and __builtin_ia32_selectsd_128 that is suitable for use in scalar mask intrinsics.
This will convert the i8 mask argument to <8 x i1> and extract an i1 and then emit a select instruction. This replaces the '(__U & 1)" and ternary operator used in some of intrinsics. The old sequence was lowered to a scalar and and compare. The new sequence uses an i1 vector that will interoperate better with other mask intrinsics.
This removes the need to handle div_ss/sd specially in CGBuiltin.cpp. A follow up patch will add the GCCBuiltin name back in llvm and remove the custom handling.
I made some adjustments to legacy move_ss/sd intrinsics which we reused here to do a simpler extract and insert instead of 2 extracts and two inserts or a shuffle.
llvm-svn: 336622
Diffstat (limited to 'clang/test/CodeGen/sse-builtins.c')
| -rw-r--r-- | clang/test/CodeGen/sse-builtins.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/test/CodeGen/sse-builtins.c b/clang/test/CodeGen/sse-builtins.c index b7c7a7fc7e4..e9801487be0 100644 --- a/clang/test/CodeGen/sse-builtins.c +++ b/clang/test/CodeGen/sse-builtins.c @@ -450,7 +450,8 @@ __m128 test_mm_min_ss(__m128 A, __m128 B) { __m128 test_mm_move_ss(__m128 A, __m128 B) { // CHECK-LABEL: test_mm_move_ss - // CHECK: shufflevector <4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x i32> <i32 4, i32 1, i32 2, i32 3> + // CHECK: extractelement <4 x float> %{{.*}}, i32 0 + // CHECK: insertelement <4 x float> %{{.*}}, float %{{.*}}, i32 0 return _mm_move_ss(A, B); } |

