1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -o - -mtriple=x86_64-unknown-unknown -mattr=+sse2 | FileCheck %s --check-prefix=SSE
3 ; RUN: llc < %s -o - -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s --check-prefix=AVX
5 define <8 x i16> @foo(<8 x i16> %a, <8 x i16> %b) {
8 ; SSE-NEXT: pcmpeqw %xmm1, %xmm0
9 ; SSE-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
14 ; AVX-NEXT: vpcmpeqw %xmm1, %xmm0, %xmm0
15 ; AVX-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
17 %icmp = icmp eq <8 x i16> %a, %b
18 %zext = zext <8 x i1> %icmp to <8 x i16>
19 %shl = shl nuw nsw <8 x i16> %zext, <i16 5, i16 5, i16 5, i16 5, i16 5, i16 5, i16 5, i16 5>
23 ; Don't fail with an assert due to an undef in the buildvector
24 define <8 x i16> @bar(<8 x i16> %a, <8 x i16> %b) {
27 ; SSE-NEXT: pcmpeqw %xmm1, %xmm0
28 ; SSE-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
33 ; AVX-NEXT: vpcmpeqw %xmm1, %xmm0, %xmm0
34 ; AVX-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
36 %icmp = icmp eq <8 x i16> %a, %b
37 %zext = zext <8 x i1> %icmp to <8 x i16>
38 %shl = shl nuw nsw <8 x i16> %zext, <i16 5, i16 undef, i16 5, i16 5, i16 5, i16 5, i16 5, i16 5>