|
18 | 18 | ; The basic positive tests
|
19 | 19 |
|
20 | 20 | define i32 @t0_32(i32 %ptr, i32 %mask) nounwind {
|
21 |
| -; X86-LABEL: t0_32: |
22 |
| -; X86: # %bb.0: |
23 |
| -; X86-NEXT: movl {{[0-9]+}}(%esp), %eax |
24 |
| -; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx |
25 |
| -; X86-NEXT: andl %eax, %ecx |
26 |
| -; X86-NEXT: subl %ecx, %eax |
27 |
| -; X86-NEXT: retl |
| 21 | +; NOBMI-X86-LABEL: t0_32: |
| 22 | +; NOBMI-X86: # %bb.0: |
| 23 | +; NOBMI-X86-NEXT: movl {{[0-9]+}}(%esp), %eax |
| 24 | +; NOBMI-X86-NEXT: notl %eax |
| 25 | +; NOBMI-X86-NEXT: andl {{[0-9]+}}(%esp), %eax |
| 26 | +; NOBMI-X86-NEXT: retl |
28 | 27 | ;
|
29 |
| -; X64-LABEL: t0_32: |
30 |
| -; X64: # %bb.0: |
31 |
| -; X64-NEXT: movl %edi, %eax |
32 |
| -; X64-NEXT: andl %edi, %esi |
33 |
| -; X64-NEXT: subl %esi, %eax |
34 |
| -; X64-NEXT: retq |
| 28 | +; BMI-X86-LABEL: t0_32: |
| 29 | +; BMI-X86: # %bb.0: |
| 30 | +; BMI-X86-NEXT: movl {{[0-9]+}}(%esp), %eax |
| 31 | +; BMI-X86-NEXT: andnl {{[0-9]+}}(%esp), %eax, %eax |
| 32 | +; BMI-X86-NEXT: retl |
| 33 | +; |
| 34 | +; NOBMI-X64-LABEL: t0_32: |
| 35 | +; NOBMI-X64: # %bb.0: |
| 36 | +; NOBMI-X64-NEXT: movl %esi, %eax |
| 37 | +; NOBMI-X64-NEXT: notl %eax |
| 38 | +; NOBMI-X64-NEXT: andl %edi, %eax |
| 39 | +; NOBMI-X64-NEXT: retq |
| 40 | +; |
| 41 | +; BMI-X64-LABEL: t0_32: |
| 42 | +; BMI-X64: # %bb.0: |
| 43 | +; BMI-X64-NEXT: andnl %edi, %esi, %eax |
| 44 | +; BMI-X64-NEXT: retq |
35 | 45 | %bias = and i32 %ptr, %mask
|
36 | 46 | %r = sub i32 %ptr, %bias
|
37 | 47 | ret i32 %r
|
38 | 48 | }
|
39 | 49 | define i64 @t1_64(i64 %ptr, i64 %mask) nounwind {
|
40 |
| -; X86-LABEL: t1_64: |
41 |
| -; X86: # %bb.0: |
42 |
| -; X86-NEXT: pushl %esi |
43 |
| -; X86-NEXT: movl {{[0-9]+}}(%esp), %eax |
44 |
| -; X86-NEXT: movl {{[0-9]+}}(%esp), %edx |
45 |
| -; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx |
46 |
| -; X86-NEXT: andl %edx, %ecx |
47 |
| -; X86-NEXT: movl {{[0-9]+}}(%esp), %esi |
48 |
| -; X86-NEXT: andl %eax, %esi |
49 |
| -; X86-NEXT: subl %esi, %eax |
50 |
| -; X86-NEXT: sbbl %ecx, %edx |
51 |
| -; X86-NEXT: popl %esi |
52 |
| -; X86-NEXT: retl |
| 50 | +; NOBMI-X86-LABEL: t1_64: |
| 51 | +; NOBMI-X86: # %bb.0: |
| 52 | +; NOBMI-X86-NEXT: movl {{[0-9]+}}(%esp), %eax |
| 53 | +; NOBMI-X86-NEXT: movl {{[0-9]+}}(%esp), %edx |
| 54 | +; NOBMI-X86-NEXT: notl %eax |
| 55 | +; NOBMI-X86-NEXT: andl {{[0-9]+}}(%esp), %eax |
| 56 | +; NOBMI-X86-NEXT: notl %edx |
| 57 | +; NOBMI-X86-NEXT: andl {{[0-9]+}}(%esp), %edx |
| 58 | +; NOBMI-X86-NEXT: retl |
53 | 59 | ;
|
54 |
| -; X64-LABEL: t1_64: |
55 |
| -; X64: # %bb.0: |
56 |
| -; X64-NEXT: movq %rdi, %rax |
57 |
| -; X64-NEXT: andq %rdi, %rsi |
58 |
| -; X64-NEXT: subq %rsi, %rax |
59 |
| -; X64-NEXT: retq |
| 60 | +; BMI-X86-LABEL: t1_64: |
| 61 | +; BMI-X86: # %bb.0: |
| 62 | +; BMI-X86-NEXT: movl {{[0-9]+}}(%esp), %eax |
| 63 | +; BMI-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx |
| 64 | +; BMI-X86-NEXT: andnl {{[0-9]+}}(%esp), %eax, %eax |
| 65 | +; BMI-X86-NEXT: andnl {{[0-9]+}}(%esp), %ecx, %edx |
| 66 | +; BMI-X86-NEXT: retl |
| 67 | +; |
| 68 | +; NOBMI-X64-LABEL: t1_64: |
| 69 | +; NOBMI-X64: # %bb.0: |
| 70 | +; NOBMI-X64-NEXT: movq %rsi, %rax |
| 71 | +; NOBMI-X64-NEXT: notq %rax |
| 72 | +; NOBMI-X64-NEXT: andq %rdi, %rax |
| 73 | +; NOBMI-X64-NEXT: retq |
| 74 | +; |
| 75 | +; BMI-X64-LABEL: t1_64: |
| 76 | +; BMI-X64: # %bb.0: |
| 77 | +; BMI-X64-NEXT: andnq %rdi, %rsi, %rax |
| 78 | +; BMI-X64-NEXT: retq |
60 | 79 | %bias = and i64 %ptr, %mask
|
61 | 80 | %r = sub i64 %ptr, %bias
|
62 | 81 | ret i64 %r
|
63 | 82 | }
|
64 | 83 |
|
65 | 84 | define i32 @t2_commutative(i32 %ptr, i32 %mask) nounwind {
|
66 |
| -; X86-LABEL: t2_commutative: |
67 |
| -; X86: # %bb.0: |
68 |
| -; X86-NEXT: movl {{[0-9]+}}(%esp), %eax |
69 |
| -; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx |
70 |
| -; X86-NEXT: andl %eax, %ecx |
71 |
| -; X86-NEXT: subl %ecx, %eax |
72 |
| -; X86-NEXT: retl |
| 85 | +; NOBMI-X86-LABEL: t2_commutative: |
| 86 | +; NOBMI-X86: # %bb.0: |
| 87 | +; NOBMI-X86-NEXT: movl {{[0-9]+}}(%esp), %eax |
| 88 | +; NOBMI-X86-NEXT: notl %eax |
| 89 | +; NOBMI-X86-NEXT: andl {{[0-9]+}}(%esp), %eax |
| 90 | +; NOBMI-X86-NEXT: retl |
73 | 91 | ;
|
74 |
| -; X64-LABEL: t2_commutative: |
75 |
| -; X64: # %bb.0: |
76 |
| -; X64-NEXT: movl %edi, %eax |
77 |
| -; X64-NEXT: andl %edi, %esi |
78 |
| -; X64-NEXT: subl %esi, %eax |
79 |
| -; X64-NEXT: retq |
| 92 | +; BMI-X86-LABEL: t2_commutative: |
| 93 | +; BMI-X86: # %bb.0: |
| 94 | +; BMI-X86-NEXT: movl {{[0-9]+}}(%esp), %eax |
| 95 | +; BMI-X86-NEXT: andnl {{[0-9]+}}(%esp), %eax, %eax |
| 96 | +; BMI-X86-NEXT: retl |
| 97 | +; |
| 98 | +; NOBMI-X64-LABEL: t2_commutative: |
| 99 | +; NOBMI-X64: # %bb.0: |
| 100 | +; NOBMI-X64-NEXT: movl %esi, %eax |
| 101 | +; NOBMI-X64-NEXT: notl %eax |
| 102 | +; NOBMI-X64-NEXT: andl %edi, %eax |
| 103 | +; NOBMI-X64-NEXT: retq |
| 104 | +; |
| 105 | +; BMI-X64-LABEL: t2_commutative: |
| 106 | +; BMI-X64: # %bb.0: |
| 107 | +; BMI-X64-NEXT: andnl %edi, %esi, %eax |
| 108 | +; BMI-X64-NEXT: retq |
80 | 109 | %bias = and i32 %mask, %ptr ; swapped
|
81 | 110 | %r = sub i32 %ptr, %bias
|
82 | 111 | ret i32 %r
|
@@ -150,20 +179,30 @@ define i32 @n5_different_ptrs_commutative(i32 %ptr0, i32 %ptr1, i32 %mask) nounw
|
150 | 179 | }
|
151 | 180 |
|
152 | 181 | define i32 @n6_not_lowbit_mask(i32 %ptr, i32 %mask) nounwind {
|
153 |
| -; X86-LABEL: n6_not_lowbit_mask: |
154 |
| -; X86: # %bb.0: |
155 |
| -; X86-NEXT: movl {{[0-9]+}}(%esp), %eax |
156 |
| -; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx |
157 |
| -; X86-NEXT: andl %eax, %ecx |
158 |
| -; X86-NEXT: subl %ecx, %eax |
159 |
| -; X86-NEXT: retl |
| 182 | +; NOBMI-X86-LABEL: n6_not_lowbit_mask: |
| 183 | +; NOBMI-X86: # %bb.0: |
| 184 | +; NOBMI-X86-NEXT: movl {{[0-9]+}}(%esp), %eax |
| 185 | +; NOBMI-X86-NEXT: notl %eax |
| 186 | +; NOBMI-X86-NEXT: andl {{[0-9]+}}(%esp), %eax |
| 187 | +; NOBMI-X86-NEXT: retl |
160 | 188 | ;
|
161 |
| -; X64-LABEL: n6_not_lowbit_mask: |
162 |
| -; X64: # %bb.0: |
163 |
| -; X64-NEXT: movl %edi, %eax |
164 |
| -; X64-NEXT: andl %edi, %esi |
165 |
| -; X64-NEXT: subl %esi, %eax |
166 |
| -; X64-NEXT: retq |
| 189 | +; BMI-X86-LABEL: n6_not_lowbit_mask: |
| 190 | +; BMI-X86: # %bb.0: |
| 191 | +; BMI-X86-NEXT: movl {{[0-9]+}}(%esp), %eax |
| 192 | +; BMI-X86-NEXT: andnl {{[0-9]+}}(%esp), %eax, %eax |
| 193 | +; BMI-X86-NEXT: retl |
| 194 | +; |
| 195 | +; NOBMI-X64-LABEL: n6_not_lowbit_mask: |
| 196 | +; NOBMI-X64: # %bb.0: |
| 197 | +; NOBMI-X64-NEXT: movl %esi, %eax |
| 198 | +; NOBMI-X64-NEXT: notl %eax |
| 199 | +; NOBMI-X64-NEXT: andl %edi, %eax |
| 200 | +; NOBMI-X64-NEXT: retq |
| 201 | +; |
| 202 | +; BMI-X64-LABEL: n6_not_lowbit_mask: |
| 203 | +; BMI-X64: # %bb.0: |
| 204 | +; BMI-X64-NEXT: andnl %edi, %esi, %eax |
| 205 | +; BMI-X64-NEXT: retq |
167 | 206 | %bias = and i32 %ptr, %mask
|
168 | 207 | %r = sub i32 %ptr, %bias
|
169 | 208 | ret i32 %r
|
|
0 commit comments