1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s -mtriple=i686-unknown -mattr=+sse4.1 | FileCheck %s --check-prefix=X32
3; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+sse4.1 | FileCheck %s --check-prefix=X64
4
5define <2 x i64> @shl1(<4 x i32> %r, <4 x i32> %a) nounwind readnone ssp {
6; X32-LABEL: shl1:
7; X32:       # BB#0: # %entry
8; X32-NEXT:    pslld $23, %xmm1
9; X32-NEXT:    paddd {{\.LCPI.*}}, %xmm1
10; X32-NEXT:    cvttps2dq %xmm1, %xmm1
11; X32-NEXT:    pmulld %xmm1, %xmm0
12; X32-NEXT:    retl
13;
14; X64-LABEL: shl1:
15; X64:       # BB#0: # %entry
16; X64-NEXT:    pslld $23, %xmm1
17; X64-NEXT:    paddd {{.*}}(%rip), %xmm1
18; X64-NEXT:    cvttps2dq %xmm1, %xmm1
19; X64-NEXT:    pmulld %xmm1, %xmm0
20; X64-NEXT:    retq
21entry:
22; CHECK-NOT: shll
23; CHECK: pslld
24; CHECK: paddd
25; CHECK: cvttps2dq
26; CHECK: pmulld
27
28  %shl = shl <4 x i32> %r, %a                     ; <<4 x i32>> [#uses=1]
29  %tmp2 = bitcast <4 x i32> %shl to <2 x i64>     ; <<2 x i64>> [#uses=1]
30  ret <2 x i64> %tmp2
31}
32
33define <2 x i64> @shl2(<16 x i8> %r, <16 x i8> %a) nounwind readnone ssp {
34; X32-LABEL: shl2:
35; X32:       # BB#0: # %entry
36; X32-NEXT:    movdqa %xmm0, %xmm2
37; X32-NEXT:    psllw $5, %xmm1
38; X32-NEXT:    movdqa %xmm2, %xmm3
39; X32-NEXT:    psllw $4, %xmm3
40; X32-NEXT:    pand {{\.LCPI.*}}, %xmm3
41; X32-NEXT:    movdqa %xmm1, %xmm0
42; X32-NEXT:    pblendvb %xmm3, %xmm2
43; X32-NEXT:    movdqa %xmm2, %xmm3
44; X32-NEXT:    psllw $2, %xmm3
45; X32-NEXT:    pand {{\.LCPI.*}}, %xmm3
46; X32-NEXT:    paddb %xmm1, %xmm1
47; X32-NEXT:    movdqa %xmm1, %xmm0
48; X32-NEXT:    pblendvb %xmm3, %xmm2
49; X32-NEXT:    movdqa %xmm2, %xmm3
50; X32-NEXT:    paddb %xmm3, %xmm3
51; X32-NEXT:    paddb %xmm1, %xmm1
52; X32-NEXT:    movdqa %xmm1, %xmm0
53; X32-NEXT:    pblendvb %xmm3, %xmm2
54; X32-NEXT:    movdqa %xmm2, %xmm0
55; X32-NEXT:    retl
56;
57; X64-LABEL: shl2:
58; X64:       # BB#0: # %entry
59; X64-NEXT:    movdqa %xmm0, %xmm2
60; X64-NEXT:    psllw $5, %xmm1
61; X64-NEXT:    movdqa %xmm2, %xmm3
62; X64-NEXT:    psllw $4, %xmm3
63; X64-NEXT:    pand {{.*}}(%rip), %xmm3
64; X64-NEXT:    movdqa %xmm1, %xmm0
65; X64-NEXT:    pblendvb %xmm3, %xmm2
66; X64-NEXT:    movdqa %xmm2, %xmm3
67; X64-NEXT:    psllw $2, %xmm3
68; X64-NEXT:    pand {{.*}}(%rip), %xmm3
69; X64-NEXT:    paddb %xmm1, %xmm1
70; X64-NEXT:    movdqa %xmm1, %xmm0
71; X64-NEXT:    pblendvb %xmm3, %xmm2
72; X64-NEXT:    movdqa %xmm2, %xmm3
73; X64-NEXT:    paddb %xmm3, %xmm3
74; X64-NEXT:    paddb %xmm1, %xmm1
75; X64-NEXT:    movdqa %xmm1, %xmm0
76; X64-NEXT:    pblendvb %xmm3, %xmm2
77; X64-NEXT:    movdqa %xmm2, %xmm0
78; X64-NEXT:    retq
79entry:
80; CHECK-NOT: shlb
81; CHECK: pblendvb
82; CHECK: pblendvb
83; CHECK: pblendvb
84  %shl = shl <16 x i8> %r, %a                     ; <<16 x i8>> [#uses=1]
85  %tmp2 = bitcast <16 x i8> %shl to <2 x i64>     ; <<2 x i64>> [#uses=1]
86  ret <2 x i64> %tmp2
87}
88