blob: 365c7310559b1eaa7a9b09bbfd7fe63f6dc075bf [file] [log] [blame]
Quentin Colombet4db08df2014-02-21 23:42:41 +00001; RUN: llc < %s -o - -mcpu=generic -march=x86-64 -mattr=+sse2 | FileCheck %s
2; RUN: llc < %s -o - -mcpu=generic -march=x86-64 -mattr=+avx | FileCheck %s
3
4define <8 x i16> @foo(<8 x i16> %a, <8 x i16> %b) {
5; CHECK: .short 32
6; CHECK-NEXT: .short 32
7; CHECK-NEXT: .short 32
8; CHECK-NEXT: .short 32
9; CHECK-NEXT: .short 32
10; CHECK-NEXT: .short 32
11; CHECK-NEXT: .short 32
12; CHECK-NEXT: .short 32
NAKAMURA Takumi0607c152014-02-22 07:27:04 +000013; CHECK-LABEL: {{^_?foo:}}
Quentin Colombet4db08df2014-02-21 23:42:41 +000014; CHECK-NOT: psll
15entry:
16 %icmp = icmp eq <8 x i16> %a, %b
17 %zext = zext <8 x i1> %icmp to <8 x i16>
18 %shl = shl nuw nsw <8 x i16> %zext, <i16 5, i16 5, i16 5, i16 5, i16 5, i16 5, i16 5, i16 5>
19 ret <8 x i16> %shl
20}
21
22; Don't fail with an assert due to an undef in the buildvector
23define <8 x i16> @bar(<8 x i16> %a, <8 x i16> %b) {
24; CHECK-LABEL: bar
25entry:
26 %icmp = icmp eq <8 x i16> %a, %b
27 %zext = zext <8 x i1> %icmp to <8 x i16>
28 %shl = shl nuw nsw <8 x i16> %zext, <i16 5, i16 undef, i16 5, i16 5, i16 5, i16 5, i16 5, i16 5>
29 ret <8 x i16> %shl
30}