• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -march=x86 -mattr=+sse2 | FileCheck %s
2
3; When loading the shift amount from memory, avoid generating the splat.
4
5define void @shift5a(<4 x i32> %val, <4 x i32>* %dst, i32* %pamt) nounwind {
6entry:
7; CHECK-LABEL: shift5a:
8; CHECK: movd
9; CHECK: pslld
10  %amt = load i32* %pamt
11  %tmp0 = insertelement <4 x i32> undef, i32 %amt, i32 0
12  %shamt = shufflevector <4 x i32> %tmp0, <4 x i32> undef, <4 x i32> zeroinitializer
13  %shl = shl <4 x i32> %val, %shamt
14  store <4 x i32> %shl, <4 x i32>* %dst
15  ret void
16}
17
18
19define void @shift5b(<4 x i32> %val, <4 x i32>* %dst, i32* %pamt) nounwind {
20entry:
21; CHECK-LABEL: shift5b:
22; CHECK: movd
23; CHECK: psrad
24  %amt = load i32* %pamt
25  %tmp0 = insertelement <4 x i32> undef, i32 %amt, i32 0
26  %shamt = shufflevector <4 x i32> %tmp0, <4 x i32> undef, <4 x i32> zeroinitializer
27  %shr = ashr <4 x i32> %val, %shamt
28  store <4 x i32> %shr, <4 x i32>* %dst
29  ret void
30}
31
32
33define void @shift5c(<4 x i32> %val, <4 x i32>* %dst, i32 %amt) nounwind {
34entry:
35; CHECK-LABEL: shift5c:
36; CHECK: movd
37; CHECK: pslld
38  %tmp0 = insertelement <4 x i32> undef, i32 %amt, i32 0
39  %shamt = shufflevector <4 x i32> %tmp0, <4 x i32> undef, <4 x i32> zeroinitializer
40  %shl = shl <4 x i32> %val, %shamt
41  store <4 x i32> %shl, <4 x i32>* %dst
42  ret void
43}
44
45
46define void @shift5d(<4 x i32> %val, <4 x i32>* %dst, i32 %amt) nounwind {
47entry:
48; CHECK-LABEL: shift5d:
49; CHECK: movd
50; CHECK: psrad
51  %tmp0 = insertelement <4 x i32> undef, i32 %amt, i32 0
52  %shamt = shufflevector <4 x i32> %tmp0, <4 x i32> undef, <4 x i32> zeroinitializer
53  %shr = ashr <4 x i32> %val, %shamt
54  store <4 x i32> %shr, <4 x i32>* %dst
55  ret void
56}
57