diff options
| author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-01-26 16:27:48 +0000 |
|---|---|---|
| committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-01-26 16:27:48 +0000 |
| commit | 7d6c58e843ed38719ee4f5f8facdaedb1edcf329 (patch) | |
| tree | af11fdf932eeef9987c454f9bb1b9990cf412f7b /llvm/test/CodeGen | |
| parent | a03c63b77fb7da32c9df77ca442f239ebe40f4b4 (diff) | |
| download | bcm5719-llvm-7d6c58e843ed38719ee4f5f8facdaedb1edcf329.tar.gz bcm5719-llvm-7d6c58e843ed38719ee4f5f8facdaedb1edcf329.zip | |
[X86] Add nonsplat increment/decrement constant vector with min/max test (PR39859)
llvm-svn: 352281
Diffstat (limited to 'llvm/test/CodeGen')
| -rw-r--r-- | llvm/test/CodeGen/X86/sat-add.ll | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/sat-add.ll b/llvm/test/CodeGen/X86/sat-add.ll index e09c2416d48..e652f2ca0ec 100644 --- a/llvm/test/CodeGen/X86/sat-add.ll +++ b/llvm/test/CodeGen/X86/sat-add.ll @@ -537,6 +537,33 @@ define <4 x i32> @unsigned_sat_constant_v4i32_using_cmp_notval(<4 x i32> %x) { ret <4 x i32> %r } +define <4 x i32> @unsigned_sat_constant_v4i32_using_cmp_notval_nonsplat(<4 x i32> %x) { +; SSE2-LABEL: unsigned_sat_constant_v4i32_using_cmp_notval_nonsplat: +; SSE2: # %bb.0: +; SSE2-NEXT: movdqa {{.*#+}} xmm1 = [43,44,45,46] +; SSE2-NEXT: paddd %xmm0, %xmm1 +; SSE2-NEXT: pxor {{.*}}(%rip), %xmm0 +; SSE2-NEXT: pcmpgtd {{.*}}(%rip), %xmm0 +; SSE2-NEXT: por %xmm1, %xmm0 +; SSE2-NEXT: retq +; +; SSE41-LABEL: unsigned_sat_constant_v4i32_using_cmp_notval_nonsplat: +; SSE41: # %bb.0: +; SSE41-NEXT: movdqa {{.*#+}} xmm1 = [43,44,45,46] +; SSE41-NEXT: paddd %xmm0, %xmm1 +; SSE41-NEXT: movdqa {{.*#+}} xmm2 = [4294967252,4294967251,4294967250,4294967249] +; SSE41-NEXT: pminud %xmm0, %xmm2 +; SSE41-NEXT: pcmpeqd %xmm2, %xmm0 +; SSE41-NEXT: pcmpeqd %xmm2, %xmm2 +; SSE41-NEXT: pxor %xmm2, %xmm0 +; SSE41-NEXT: por %xmm1, %xmm0 +; SSE41-NEXT: retq + %a = add <4 x i32> %x, <i32 43, i32 44, i32 45, i32 46> + %c = icmp ugt <4 x i32> %x, <i32 -44, i32 -45, i32 -46, i32 -47> + %r = select <4 x i1> %c, <4 x i32> <i32 -1, i32 -1, i32 -1, i32 -1>, <4 x i32> %a + ret <4 x i32> %r +} + define <2 x i64> @unsigned_sat_constant_v2i64_using_min(<2 x i64> %x) { ; SSE2-LABEL: unsigned_sat_constant_v2i64_using_min: ; SSE2: # %bb.0: |

