1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=x86_64-- < %s | FileCheck %s
4 ; OR of two rotates of %a0(edi).
5 define i32 @f0(i32 %a0) #0 {
7 ; CHECK: # %bb.0: # %b0
8 ; CHECK-NEXT: movl %edi, %eax
9 ; CHECK-NEXT: movl %edi, %ecx
10 ; CHECK-NEXT: roll $7, %ecx
11 ; CHECK-NEXT: roll $9, %eax
12 ; CHECK-NEXT: orl %ecx, %eax
16 %v1 = lshr i32 %a0, 25
19 %v4 = lshr i32 %a0, 23
25 ; OR of two rotates of %a0(edi) with an extra input %a1(esi).
26 define i32 @f1(i32 %a0, i32 %a1) #0 {
28 ; CHECK: # %bb.0: # %b0
29 ; CHECK-NEXT: movl %edi, %eax
30 ; CHECK-NEXT: movl %edi, %ecx
31 ; CHECK-NEXT: shll $7, %ecx
32 ; CHECK-NEXT: roll $9, %eax
33 ; CHECK-NEXT: orl %esi, %eax
34 ; CHECK-NEXT: orl %ecx, %eax
38 %v1 = lshr i32 %a0, 25
41 %v4 = lshr i32 %a0, 23
48 ; OR of two rotates of two different inputs: %a0(edi) and %a1(esi).
49 define i32 @f2(i32 %a0, i32 %a1) #0 {
52 ; CHECK-NEXT: movl %esi, %eax
53 ; CHECK-NEXT: movl %edi, %ecx
54 ; CHECK-NEXT: shll $11, %ecx
55 ; CHECK-NEXT: shrl $21, %edi
56 ; CHECK-NEXT: movl %esi, %edx
57 ; CHECK-NEXT: shll $19, %edx
58 ; CHECK-NEXT: shrl $13, %eax
59 ; CHECK-NEXT: orl %edi, %eax
60 ; CHECK-NEXT: orl %edx, %eax
61 ; CHECK-NEXT: orl %ecx, %eax
64 %v1 = lshr i32 %a0, 21
66 %v3 = lshr i32 %a1, 13
73 ; ORs of multiple shifts of the same value with only one pair actually
75 define i32 @f3(i32 %a0) #0 {
77 ; CHECK: # %bb.0: # %b0
78 ; CHECK-NEXT: # kill: def $edi killed $edi def $rdi
79 ; CHECK-NEXT: leal (,%rdi,8), %eax
80 ; CHECK-NEXT: movl %edi, %ecx
81 ; CHECK-NEXT: shll $5, %ecx
82 ; CHECK-NEXT: movl %edi, %edx
83 ; CHECK-NEXT: shll $7, %edx
84 ; CHECK-NEXT: orl %ecx, %edx
85 ; CHECK-NEXT: movl %edi, %ecx
86 ; CHECK-NEXT: shll $13, %ecx
87 ; CHECK-NEXT: orl %edx, %ecx
88 ; CHECK-NEXT: movl %edi, %edx
89 ; CHECK-NEXT: shll $19, %edx
90 ; CHECK-NEXT: orl %ecx, %edx
91 ; CHECK-NEXT: movl %edi, %ecx
92 ; CHECK-NEXT: shrl $2, %ecx
93 ; CHECK-NEXT: orl %edx, %ecx
94 ; CHECK-NEXT: movl %edi, %edx
95 ; CHECK-NEXT: shrl $15, %edx
96 ; CHECK-NEXT: orl %ecx, %edx
97 ; CHECK-NEXT: movl %edi, %ecx
98 ; CHECK-NEXT: shrl $23, %ecx
99 ; CHECK-NEXT: orl %edx, %ecx
100 ; CHECK-NEXT: movl %edi, %edx
101 ; CHECK-NEXT: shrl $25, %edx
102 ; CHECK-NEXT: orl %ecx, %edx
103 ; CHECK-NEXT: shrl $30, %edi
104 ; CHECK-NEXT: orl %edx, %edi
105 ; CHECK-NEXT: orl %edi, %eax
110 %v2 = shl i32 %a0, 7 ; rotate
111 %v3 = shl i32 %a0, 13
112 %v4 = shl i32 %a0, 19
113 %v5 = lshr i32 %a0, 2
114 %v6 = lshr i32 %a0, 15
115 %v7 = lshr i32 %a0, 23
116 %v8 = lshr i32 %a0, 25 ; rotate
117 %v9 = lshr i32 %a0, 30
118 %v10 = or i32 %v0, %v1
119 %v11 = or i32 %v10, %v2
120 %v12 = or i32 %v11, %v3
121 %v13 = or i32 %v12, %v4
122 %v14 = or i32 %v13, %v5
123 %v15 = or i32 %v14, %v6
124 %v16 = or i32 %v15, %v7
125 %v17 = or i32 %v16, %v8
126 %v18 = or i32 %v17, %v9
130 attributes #0 = { readnone nounwind }