1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=thumbv6m-eabi -asm-verbose=false %s -o - | FileCheck %s
4 define void @test8(ptr %a) {
7 ; CHECK-NEXT: mvns r1, r1
8 ; CHECK-NEXT: strb r1, [r0]
16 define void @test8_2(ptr %a, ptr %b) {
17 ; CHECK-LABEL: test8_2:
18 ; CHECK: ldrb r2, [r1]
19 ; CHECK-NEXT: ldrb r3, [r0]
20 ; CHECK-NEXT: mvns r3, r3
21 ; CHECK-NEXT: strb r3, [r0]
22 ; CHECK-NEXT: mvns r0, r2
23 ; CHECK-NEXT: strb r0, [r1]
34 define void @loop8(ptr %a) {
37 ; CHECK-NEXT: .LBB2_1:
38 ; CHECK-NEXT: ldrb r2, [r0, r1]
39 ; CHECK-NEXT: mvns r2, r2
40 ; CHECK-NEXT: strb r2, [r0, r1]
41 ; CHECK-NEXT: adds r1, r1, #1
42 ; CHECK-NEXT: cmp r1, #10
43 ; CHECK-NEXT: bne .LBB2_1
49 %i = phi i32 [ 0, %entry ], [ %inc, %for.body ]
50 %arrayidx = getelementptr inbounds i8, ptr %a, i32 %i
51 %x = load i8, ptr %arrayidx
53 store i8 %xn, ptr %arrayidx
54 %inc = add nuw nsw i32 %i, 1
55 %exitcond = icmp eq i32 %inc, 10
56 br i1 %exitcond, label %for.cond.cleanup, label %for.body
62 define void @loop8_2(ptr %a, ptr %b) {
63 ; CHECK-LABEL: loop8_2:
64 ; CHECK: .save {r4, lr}
65 ; CHECK-NEXT: push {r4, lr}
66 ; CHECK-NEXT: movs r2, #0
67 ; CHECK-NEXT: .LBB3_1:
68 ; CHECK-NEXT: ldrb r3, [r1, r2]
69 ; CHECK-NEXT: ldrb r4, [r0, r2]
70 ; CHECK-NEXT: mvns r4, r4
71 ; CHECK-NEXT: strb r4, [r0, r2]
72 ; CHECK-NEXT: mvns r3, r3
73 ; CHECK-NEXT: strb r3, [r1, r2]
74 ; CHECK-NEXT: adds r2, r2, #1
75 ; CHECK-NEXT: cmp r2, #10
76 ; CHECK-NEXT: bne .LBB3_1
77 ; CHECK-NEXT: pop {r4, pc}
82 %i = phi i32 [ 0, %entry ], [ %inc, %for.body ]
83 %arrayidx = getelementptr inbounds i8, ptr %a, i32 %i
84 %arrayidx2 = getelementptr inbounds i8, ptr %b, i32 %i
85 %x = load i8, ptr %arrayidx
86 %y = load i8, ptr %arrayidx2
89 store i8 %xn, ptr %arrayidx
90 store i8 %yn, ptr %arrayidx2
91 %inc = add nuw nsw i32 %i, 1
92 %exitcond = icmp eq i32 %inc, 10
93 br i1 %exitcond, label %for.cond.cleanup, label %for.body
99 define void @test32(ptr %a) {
100 ; CHECK-LABEL: test32:
101 ; CHECK: ldr r1, [r0]
102 ; CHECK-NEXT: mvns r1, r1
103 ; CHECK-NEXT: str r1, [r0]
105 %x = load i32, ptr %a
107 store i32 %xn, ptr %a
111 define void @test32_2(ptr %a, ptr %b) {
112 ; CHECK-LABEL: test32_2:
113 ; CHECK: ldr r2, [r1]
114 ; CHECK-NEXT: ldr r3, [r0]
115 ; CHECK-NEXT: mvns r3, r3
116 ; CHECK-NEXT: str r3, [r0]
117 ; CHECK-NEXT: mvns r0, r2
118 ; CHECK-NEXT: str r0, [r1]
120 %x = load i32, ptr %a
121 %y = load i32, ptr %b
124 store i32 %xn, ptr %a
125 store i32 %yn, ptr %b
129 define void @loop32(ptr %a) {
130 ; CHECK-LABEL: loop32:
132 ; CHECK-NEXT: .LBB6_1:
133 ; CHECK-NEXT: ldr r2, [r0, r1]
134 ; CHECK-NEXT: mvns r2, r2
135 ; CHECK-NEXT: str r2, [r0, r1]
136 ; CHECK-NEXT: adds r1, r1, #4
137 ; CHECK-NEXT: cmp r1, #40
138 ; CHECK-NEXT: bne .LBB6_1
144 %i = phi i32 [ 0, %entry ], [ %inc, %for.body ]
145 %arrayidx = getelementptr inbounds i32, ptr %a, i32 %i
146 %x = load i32, ptr %arrayidx
148 store i32 %xn, ptr %arrayidx
149 %inc = add nuw nsw i32 %i, 1
150 %exitcond = icmp eq i32 %inc, 10
151 br i1 %exitcond, label %for.cond.cleanup, label %for.body
157 define void @loop32_2(ptr %a, ptr %b) {
158 ; CHECK-LABEL: loop32_2:
159 ; CHECK: .save {r4, lr}
160 ; CHECK-NEXT: push {r4, lr}
161 ; CHECK-NEXT: movs r2, #0
162 ; CHECK-NEXT: .LBB7_1:
163 ; CHECK-NEXT: ldr r3, [r1, r2]
164 ; CHECK-NEXT: ldr r4, [r0, r2]
165 ; CHECK-NEXT: mvns r4, r4
166 ; CHECK-NEXT: str r4, [r0, r2]
167 ; CHECK-NEXT: mvns r3, r3
168 ; CHECK-NEXT: str r3, [r1, r2]
169 ; CHECK-NEXT: adds r2, r2, #4
170 ; CHECK-NEXT: cmp r2, #40
171 ; CHECK-NEXT: bne .LBB7_1
172 ; CHECK-NEXT: pop {r4, pc}
177 %i = phi i32 [ 0, %entry ], [ %inc, %for.body ]
178 %arrayidx = getelementptr inbounds i32, ptr %a, i32 %i
179 %arrayidx2 = getelementptr inbounds i32, ptr %b, i32 %i
180 %x = load i32, ptr %arrayidx
181 %y = load i32, ptr %arrayidx2
184 store i32 %xn, ptr %arrayidx
185 store i32 %yn, ptr %arrayidx2
186 %inc = add nuw nsw i32 %i, 1
187 %exitcond = icmp eq i32 %inc, 10
188 br i1 %exitcond, label %for.cond.cleanup, label %for.body
195 define void @test128(ptr %a) {
196 ; CHECK-LABEL: test128:
197 ; CHECK: ldr r1, [r0, #8]
198 ; CHECK-NEXT: ldr r2, .LCPI8_0
199 ; CHECK-NEXT: eors r2, r1
200 ; CHECK-NEXT: str r2, [r0, #8]
201 ; CHECK-NEXT: ldr r1, [r0]
202 ; CHECK-NEXT: ldr r2, .LCPI8_1
203 ; CHECK-NEXT: eors r2, r1
204 ; CHECK-NEXT: str r2, [r0]
205 ; CHECK-NEXT: ldr r1, [r0, #4]
206 ; CHECK-NEXT: ldr r2, .LCPI8_2
207 ; CHECK-NEXT: eors r2, r1
208 ; CHECK-NEXT: str r2, [r0, #4]
210 ; CHECK-NEXT: .p2align 2
211 ; CHECK-NEXT: .LCPI8_0:
212 ; CHECK-NEXT: .long 6692605
213 ; CHECK-NEXT: .LCPI8_1:
214 ; CHECK-NEXT: .long 2080661269
215 ; CHECK-NEXT: .LCPI8_2:
216 ; CHECK-NEXT: .long 4075008415
217 %x = load i128, ptr %a
218 %xn = xor i128 %x, 123456789123456789123456789
219 store i128 %xn, ptr %a