1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse2 | FileCheck %s --check-prefixes=CHECK,SSE2
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse4.1 | FileCheck %s --check-prefixes=CHECK,SSE41
4 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse4.2 | FileCheck %s --check-prefixes=CHECK,SSE42
5 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s --check-prefixes=CHECK,AVX
6 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx2 | FileCheck %s --check-prefixes=CHECK,AVX
7 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f | FileCheck %s --check-prefixes=CHECK,AVX
8 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512bw | FileCheck %s --check-prefixes=CHECK,AVX
10 define i8 @test_demandedbits_umin_ult(i8 %a0, i8 %a1) {
11 ; CHECK-LABEL: test_demandedbits_umin_ult:
13 ; CHECK-NEXT: movl %esi, %eax
14 ; CHECK-NEXT: orb $4, %al
15 ; CHECK-NEXT: andb $12, %al
16 ; CHECK-NEXT: # kill: def $al killed $al killed $eax
18 %lhs0 = and i8 %a0, 13 ; b1101
19 %rhs0 = and i8 %a1, 12 ; b1100
20 %lhs1 = or i8 %lhs0, 12 ; b1100
21 %rhs1 = or i8 %rhs0, 4 ; b0100
22 %umin = tail call i8 @llvm.umin.i8(i8 %lhs1, i8 %rhs1)
25 declare i8 @llvm.umin.i8(i8, i8)
27 define <8 x i16> @test_v8i16_nosignbit(<8 x i16> %a, <8 x i16> %b) {
28 ; SSE2-LABEL: test_v8i16_nosignbit:
30 ; SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
31 ; SSE2-NEXT: psrlw $1, %xmm1
32 ; SSE2-NEXT: pmaxsw %xmm1, %xmm0
35 ; SSE41-LABEL: test_v8i16_nosignbit:
37 ; SSE41-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
38 ; SSE41-NEXT: psrlw $1, %xmm1
39 ; SSE41-NEXT: pmaxuw %xmm1, %xmm0
42 ; SSE42-LABEL: test_v8i16_nosignbit:
44 ; SSE42-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
45 ; SSE42-NEXT: psrlw $1, %xmm1
46 ; SSE42-NEXT: pmaxuw %xmm1, %xmm0
49 ; AVX-LABEL: test_v8i16_nosignbit:
51 ; AVX-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
52 ; AVX-NEXT: vpsrlw $1, %xmm1, %xmm1
53 ; AVX-NEXT: vpmaxuw %xmm1, %xmm0, %xmm0
55 %1 = and <8 x i16> %a, <i16 255, i16 255, i16 255, i16 255, i16 255, i16 255, i16 255, i16 255>
56 %2 = lshr <8 x i16> %b, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>
57 %3 = icmp ugt <8 x i16> %1, %2
58 %4 = select <8 x i1> %3, <8 x i16> %1, <8 x i16> %2