diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2016-06-15 17:17:27 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2016-06-15 17:17:27 +0000 |
| commit | a6c6f09967a009498bde2849f69814672606dd00 (patch) | |
| tree | c031ebd43716298149dfc67c3263ec7d9a5bb2c3 /llvm/test/CodeGen/X86/sse2-intrinsics-fast-isel.ll | |
| parent | 30e0456562bf1f410a7bcf5ed4a4f23f7e027595 (diff) | |
| download | bcm5719-llvm-a6c6f09967a009498bde2849f69814672606dd00.tar.gz bcm5719-llvm-a6c6f09967a009498bde2849f69814672606dd00.zip | |
[x86, SSE] remove the GCCBuiltins from the integer min/max intrinsics
This allows us to emit native IR in Clang (next commit).
Also, update the intrinsic tests to show that codegen already knows how to handle
the IR that Clang will soon produce.
llvm-svn: 272806
Diffstat (limited to 'llvm/test/CodeGen/X86/sse2-intrinsics-fast-isel.ll')
| -rw-r--r-- | llvm/test/CodeGen/X86/sse2-intrinsics-fast-isel.ll | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/llvm/test/CodeGen/X86/sse2-intrinsics-fast-isel.ll b/llvm/test/CodeGen/X86/sse2-intrinsics-fast-isel.ll index c8927f8200d..0a961e83d5a 100644 --- a/llvm/test/CodeGen/X86/sse2-intrinsics-fast-isel.ll +++ b/llvm/test/CodeGen/X86/sse2-intrinsics-fast-isel.ll @@ -1598,8 +1598,9 @@ define <2 x i64> @test_mm_max_epi16(<2 x i64> %a0, <2 x i64> %a1) nounwind { ; X64-NEXT: retq %arg0 = bitcast <2 x i64> %a0 to <8 x i16> %arg1 = bitcast <2 x i64> %a1 to <8 x i16> - %res = call <8 x i16> @llvm.x86.sse2.pmaxs.w(<8 x i16> %arg0, <8 x i16> %arg1) - %bc = bitcast <8 x i16> %res to <2 x i64> + %cmp = icmp sgt <8 x i16> %arg0, %arg1 + %sel = select <8 x i1> %cmp, <8 x i16> %arg0, <8 x i16> %arg1 + %bc = bitcast <8 x i16> %sel to <2 x i64> ret <2 x i64> %bc } declare <8 x i16> @llvm.x86.sse2.pmaxs.w(<8 x i16>, <8 x i16>) nounwind readnone @@ -1616,8 +1617,9 @@ define <2 x i64> @test_mm_max_epu8(<2 x i64> %a0, <2 x i64> %a1) nounwind { ; X64-NEXT: retq %arg0 = bitcast <2 x i64> %a0 to <16 x i8> %arg1 = bitcast <2 x i64> %a1 to <16 x i8> - %res = call <16 x i8> @llvm.x86.sse2.pmaxu.b(<16 x i8> %arg0, <16 x i8> %arg1) - %bc = bitcast <16 x i8> %res to <2 x i64> + %cmp = icmp ugt <16 x i8> %arg0, %arg1 + %sel = select <16 x i1> %cmp, <16 x i8> %arg0, <16 x i8> %arg1 + %bc = bitcast <16 x i8> %sel to <2 x i64> ret <2 x i64> %bc } declare <16 x i8> @llvm.x86.sse2.pmaxu.b(<16 x i8>, <16 x i8>) nounwind readnone @@ -1679,8 +1681,9 @@ define <2 x i64> @test_mm_min_epi16(<2 x i64> %a0, <2 x i64> %a1) nounwind { ; X64-NEXT: retq %arg0 = bitcast <2 x i64> %a0 to <8 x i16> %arg1 = bitcast <2 x i64> %a1 to <8 x i16> - %res = call <8 x i16> @llvm.x86.sse2.pmins.w(<8 x i16> %arg0, <8 x i16> %arg1) - %bc = bitcast <8 x i16> %res to <2 x i64> + %cmp = icmp slt <8 x i16> %arg0, %arg1 + %sel = select <8 x i1> %cmp, <8 x i16> %arg0, <8 x i16> %arg1 + %bc = bitcast <8 x i16> %sel to <2 x i64> ret <2 x i64> %bc } declare <8 x i16> @llvm.x86.sse2.pmins.w(<8 x i16>, <8 x i16>) nounwind readnone @@ -1697,8 +1700,9 @@ define <2 x i64> @test_mm_min_epu8(<2 x i64> %a0, <2 x i64> %a1) nounwind { ; X64-NEXT: retq %arg0 = bitcast <2 x i64> %a0 to <16 x i8> %arg1 = bitcast <2 x i64> %a1 to <16 x i8> - %res = call <16 x i8> @llvm.x86.sse2.pminu.b(<16 x i8> %arg0, <16 x i8> %arg1) - %bc = bitcast <16 x i8> %res to <2 x i64> + %cmp = icmp ult <16 x i8> %arg0, %arg1 + %sel = select <16 x i1> %cmp, <16 x i8> %arg0, <16 x i8> %arg1 + %bc = bitcast <16 x i8> %sel to <2 x i64> ret <2 x i64> %bc } declare <16 x i8> @llvm.x86.sse2.pminu.b(<16 x i8>, <16 x i8>) nounwind readnone |

