blob: 011a4e50e5d8efd4016f367866e951b1fe76070a [file] [log] [blame]
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001; RUN: llc -march=hexagon -mcpu=hexagonv5 < %s | FileCheck %s
2; Generate MemOps for V4 and above.
3
4define void @memop_unsigned_char_add5(i8* nocapture %p) nounwind {
5entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00006; CHECK-LABEL: memop_unsigned_char_add5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00007; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}+={{ *}}#5
David Blaikiea79ac142015-02-27 21:17:42 +00008 %0 = load i8, i8* %p, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00009 %conv = zext i8 %0 to i32
10 %add = add nsw i32 %conv, 5
11 %conv1 = trunc i32 %add to i8
Manman Rena2e9a982013-08-21 22:20:53 +000012 store i8 %conv1, i8* %p, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +000013 ret void
14}
15
16define void @memop_unsigned_char_add(i8* nocapture %p, i8 zeroext %x) nounwind {
17entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +000018; CHECK-LABEL: memop_unsigned_char_add:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +000019; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}+={{ *}}r{{[0-9]+}}
20 %conv = zext i8 %x to i32
David Blaikiea79ac142015-02-27 21:17:42 +000021 %0 = load i8, i8* %p, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +000022 %conv1 = zext i8 %0 to i32
23 %add = add nsw i32 %conv1, %conv
24 %conv2 = trunc i32 %add to i8
Manman Rena2e9a982013-08-21 22:20:53 +000025 store i8 %conv2, i8* %p, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +000026 ret void
27}
28
29define void @memop_unsigned_char_sub(i8* nocapture %p, i8 zeroext %x) nounwind {
30entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +000031; CHECK-LABEL: memop_unsigned_char_sub:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +000032; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}-={{ *}}r{{[0-9]+}}
33 %conv = zext i8 %x to i32
David Blaikiea79ac142015-02-27 21:17:42 +000034 %0 = load i8, i8* %p, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +000035 %conv1 = zext i8 %0 to i32
36 %sub = sub nsw i32 %conv1, %conv
37 %conv2 = trunc i32 %sub to i8
Manman Rena2e9a982013-08-21 22:20:53 +000038 store i8 %conv2, i8* %p, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +000039 ret void
40}
41
42define void @memop_unsigned_char_or(i8* nocapture %p, i8 zeroext %x) nounwind {
43entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +000044; CHECK-LABEL: memop_unsigned_char_or:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +000045; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}|={{ *}}r{{[0-9]+}}
David Blaikiea79ac142015-02-27 21:17:42 +000046 %0 = load i8, i8* %p, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +000047 %or3 = or i8 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +000048 store i8 %or3, i8* %p, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +000049 ret void
50}
51
52define void @memop_unsigned_char_and(i8* nocapture %p, i8 zeroext %x) nounwind {
53entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +000054; CHECK-LABEL: memop_unsigned_char_and:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +000055; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}&={{ *}}r{{[0-9]+}}
David Blaikiea79ac142015-02-27 21:17:42 +000056 %0 = load i8, i8* %p, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +000057 %and3 = and i8 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +000058 store i8 %and3, i8* %p, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +000059 ret void
60}
61
62define void @memop_unsigned_char_clrbit(i8* nocapture %p) nounwind {
63entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +000064; CHECK-LABEL: memop_unsigned_char_clrbit:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +000065; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}={{ *}}clrbit({{ *}}#5{{ *}})
David Blaikiea79ac142015-02-27 21:17:42 +000066 %0 = load i8, i8* %p, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +000067 %conv = zext i8 %0 to i32
68 %and = and i32 %conv, 223
69 %conv1 = trunc i32 %and to i8
Manman Rena2e9a982013-08-21 22:20:53 +000070 store i8 %conv1, i8* %p, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +000071 ret void
72}
73
74define void @memop_unsigned_char_setbit(i8* nocapture %p) nounwind {
75entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +000076; CHECK-LABEL: memop_unsigned_char_setbit:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +000077; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}={{ *}}setbit({{ *}}#7{{ *}})
David Blaikiea79ac142015-02-27 21:17:42 +000078 %0 = load i8, i8* %p, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +000079 %conv = zext i8 %0 to i32
80 %or = or i32 %conv, 128
81 %conv1 = trunc i32 %or to i8
Manman Rena2e9a982013-08-21 22:20:53 +000082 store i8 %conv1, i8* %p, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +000083 ret void
84}
85
86define void @memop_unsigned_char_add5_index(i8* nocapture %p, i32 %i) nounwind {
87entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +000088; CHECK-LABEL: memop_unsigned_char_add5_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +000089; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}+={{ *}}#5
David Blaikie79e6c742015-02-27 19:29:02 +000090 %add.ptr = getelementptr inbounds i8, i8* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +000091 %0 = load i8, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +000092 %conv = zext i8 %0 to i32
93 %add = add nsw i32 %conv, 5
94 %conv1 = trunc i32 %add to i8
Manman Rena2e9a982013-08-21 22:20:53 +000095 store i8 %conv1, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +000096 ret void
97}
98
99define void @memop_unsigned_char_add_index(i8* nocapture %p, i32 %i, i8 zeroext %x) nounwind {
100entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000101; CHECK-LABEL: memop_unsigned_char_add_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000102; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}+={{ *}}r{{[0-9]+}}
103 %conv = zext i8 %x to i32
David Blaikie79e6c742015-02-27 19:29:02 +0000104 %add.ptr = getelementptr inbounds i8, i8* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +0000105 %0 = load i8, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000106 %conv1 = zext i8 %0 to i32
107 %add = add nsw i32 %conv1, %conv
108 %conv2 = trunc i32 %add to i8
Manman Rena2e9a982013-08-21 22:20:53 +0000109 store i8 %conv2, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000110 ret void
111}
112
113define void @memop_unsigned_char_sub_index(i8* nocapture %p, i32 %i, i8 zeroext %x) nounwind {
114entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000115; CHECK-LABEL: memop_unsigned_char_sub_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000116; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}-={{ *}}r{{[0-9]+}}
117 %conv = zext i8 %x to i32
David Blaikie79e6c742015-02-27 19:29:02 +0000118 %add.ptr = getelementptr inbounds i8, i8* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +0000119 %0 = load i8, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000120 %conv1 = zext i8 %0 to i32
121 %sub = sub nsw i32 %conv1, %conv
122 %conv2 = trunc i32 %sub to i8
Manman Rena2e9a982013-08-21 22:20:53 +0000123 store i8 %conv2, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000124 ret void
125}
126
127define void @memop_unsigned_char_or_index(i8* nocapture %p, i32 %i, i8 zeroext %x) nounwind {
128entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000129; CHECK-LABEL: memop_unsigned_char_or_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000130; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}|={{ *}}r{{[0-9]+}}
David Blaikie79e6c742015-02-27 19:29:02 +0000131 %add.ptr = getelementptr inbounds i8, i8* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +0000132 %0 = load i8, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000133 %or3 = or i8 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +0000134 store i8 %or3, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000135 ret void
136}
137
138define void @memop_unsigned_char_and_index(i8* nocapture %p, i32 %i, i8 zeroext %x) nounwind {
139entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000140; CHECK-LABEL: memop_unsigned_char_and_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000141; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}&={{ *}}r{{[0-9]+}}
David Blaikie79e6c742015-02-27 19:29:02 +0000142 %add.ptr = getelementptr inbounds i8, i8* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +0000143 %0 = load i8, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000144 %and3 = and i8 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +0000145 store i8 %and3, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000146 ret void
147}
148
149define void @memop_unsigned_char_clrbit_index(i8* nocapture %p, i32 %i) nounwind {
150entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000151; CHECK-LABEL: memop_unsigned_char_clrbit_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000152; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}={{ *}}clrbit({{ *}}#5{{ *}})
David Blaikie79e6c742015-02-27 19:29:02 +0000153 %add.ptr = getelementptr inbounds i8, i8* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +0000154 %0 = load i8, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000155 %conv = zext i8 %0 to i32
156 %and = and i32 %conv, 223
157 %conv1 = trunc i32 %and to i8
Manman Rena2e9a982013-08-21 22:20:53 +0000158 store i8 %conv1, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000159 ret void
160}
161
162define void @memop_unsigned_char_setbit_index(i8* nocapture %p, i32 %i) nounwind {
163entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000164; CHECK-LABEL: memop_unsigned_char_setbit_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000165; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}={{ *}}setbit({{ *}}#7{{ *}})
David Blaikie79e6c742015-02-27 19:29:02 +0000166 %add.ptr = getelementptr inbounds i8, i8* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +0000167 %0 = load i8, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000168 %conv = zext i8 %0 to i32
169 %or = or i32 %conv, 128
170 %conv1 = trunc i32 %or to i8
Manman Rena2e9a982013-08-21 22:20:53 +0000171 store i8 %conv1, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000172 ret void
173}
174
175define void @memop_unsigned_char_add5_index5(i8* nocapture %p) nounwind {
176entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000177; CHECK-LABEL: memop_unsigned_char_add5_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000178; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#5){{ *}}+={{ *}}#5
David Blaikie79e6c742015-02-27 19:29:02 +0000179 %add.ptr = getelementptr inbounds i8, i8* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +0000180 %0 = load i8, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000181 %conv = zext i8 %0 to i32
182 %add = add nsw i32 %conv, 5
183 %conv1 = trunc i32 %add to i8
Manman Rena2e9a982013-08-21 22:20:53 +0000184 store i8 %conv1, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000185 ret void
186}
187
188define void @memop_unsigned_char_add_index5(i8* nocapture %p, i8 zeroext %x) nounwind {
189entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000190; CHECK-LABEL: memop_unsigned_char_add_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000191; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#5){{ *}}+={{ *}}r{{[0-9]+}}
192 %conv = zext i8 %x to i32
David Blaikie79e6c742015-02-27 19:29:02 +0000193 %add.ptr = getelementptr inbounds i8, i8* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +0000194 %0 = load i8, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000195 %conv1 = zext i8 %0 to i32
196 %add = add nsw i32 %conv1, %conv
197 %conv2 = trunc i32 %add to i8
Manman Rena2e9a982013-08-21 22:20:53 +0000198 store i8 %conv2, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000199 ret void
200}
201
202define void @memop_unsigned_char_sub_index5(i8* nocapture %p, i8 zeroext %x) nounwind {
203entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000204; CHECK-LABEL: memop_unsigned_char_sub_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000205; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#5){{ *}}-={{ *}}r{{[0-9]+}}
206 %conv = zext i8 %x to i32
David Blaikie79e6c742015-02-27 19:29:02 +0000207 %add.ptr = getelementptr inbounds i8, i8* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +0000208 %0 = load i8, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000209 %conv1 = zext i8 %0 to i32
210 %sub = sub nsw i32 %conv1, %conv
211 %conv2 = trunc i32 %sub to i8
Manman Rena2e9a982013-08-21 22:20:53 +0000212 store i8 %conv2, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000213 ret void
214}
215
216define void @memop_unsigned_char_or_index5(i8* nocapture %p, i8 zeroext %x) nounwind {
217entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000218; CHECK-LABEL: memop_unsigned_char_or_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000219; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#5){{ *}}|={{ *}}r{{[0-9]+}}
David Blaikie79e6c742015-02-27 19:29:02 +0000220 %add.ptr = getelementptr inbounds i8, i8* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +0000221 %0 = load i8, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000222 %or3 = or i8 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +0000223 store i8 %or3, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000224 ret void
225}
226
227define void @memop_unsigned_char_and_index5(i8* nocapture %p, i8 zeroext %x) nounwind {
228entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000229; CHECK-LABEL: memop_unsigned_char_and_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000230; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#5){{ *}}&={{ *}}r{{[0-9]+}}
David Blaikie79e6c742015-02-27 19:29:02 +0000231 %add.ptr = getelementptr inbounds i8, i8* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +0000232 %0 = load i8, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000233 %and3 = and i8 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +0000234 store i8 %and3, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000235 ret void
236}
237
238define void @memop_unsigned_char_clrbit_index5(i8* nocapture %p) nounwind {
239entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000240; CHECK-LABEL: memop_unsigned_char_clrbit_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000241; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#5){{ *}}={{ *}}clrbit({{ *}}#5{{ *}})
David Blaikie79e6c742015-02-27 19:29:02 +0000242 %add.ptr = getelementptr inbounds i8, i8* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +0000243 %0 = load i8, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000244 %conv = zext i8 %0 to i32
245 %and = and i32 %conv, 223
246 %conv1 = trunc i32 %and to i8
Manman Rena2e9a982013-08-21 22:20:53 +0000247 store i8 %conv1, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000248 ret void
249}
250
251define void @memop_unsigned_char_setbit_index5(i8* nocapture %p) nounwind {
252entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000253; CHECK-LABEL: memop_unsigned_char_setbit_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000254; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#5){{ *}}={{ *}}setbit({{ *}}#7{{ *}})
David Blaikie79e6c742015-02-27 19:29:02 +0000255 %add.ptr = getelementptr inbounds i8, i8* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +0000256 %0 = load i8, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000257 %conv = zext i8 %0 to i32
258 %or = or i32 %conv, 128
259 %conv1 = trunc i32 %or to i8
Manman Rena2e9a982013-08-21 22:20:53 +0000260 store i8 %conv1, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000261 ret void
262}
263
264define void @memop_signed_char_add5(i8* nocapture %p) nounwind {
265entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000266; CHECK-LABEL: memop_signed_char_add5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000267; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}+={{ *}}#5
David Blaikiea79ac142015-02-27 21:17:42 +0000268 %0 = load i8, i8* %p, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000269 %conv2 = zext i8 %0 to i32
270 %add = add nsw i32 %conv2, 5
271 %conv1 = trunc i32 %add to i8
Manman Rena2e9a982013-08-21 22:20:53 +0000272 store i8 %conv1, i8* %p, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000273 ret void
274}
275
276define void @memop_signed_char_add(i8* nocapture %p, i8 signext %x) nounwind {
277entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000278; CHECK-LABEL: memop_signed_char_add:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000279; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}+={{ *}}r{{[0-9]+}}
280 %conv4 = zext i8 %x to i32
David Blaikiea79ac142015-02-27 21:17:42 +0000281 %0 = load i8, i8* %p, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000282 %conv13 = zext i8 %0 to i32
283 %add = add nsw i32 %conv13, %conv4
284 %conv2 = trunc i32 %add to i8
Manman Rena2e9a982013-08-21 22:20:53 +0000285 store i8 %conv2, i8* %p, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000286 ret void
287}
288
289define void @memop_signed_char_sub(i8* nocapture %p, i8 signext %x) nounwind {
290entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000291; CHECK-LABEL: memop_signed_char_sub:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000292; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}-={{ *}}r{{[0-9]+}}
293 %conv4 = zext i8 %x to i32
David Blaikiea79ac142015-02-27 21:17:42 +0000294 %0 = load i8, i8* %p, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000295 %conv13 = zext i8 %0 to i32
296 %sub = sub nsw i32 %conv13, %conv4
297 %conv2 = trunc i32 %sub to i8
Manman Rena2e9a982013-08-21 22:20:53 +0000298 store i8 %conv2, i8* %p, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000299 ret void
300}
301
302define void @memop_signed_char_or(i8* nocapture %p, i8 signext %x) nounwind {
303entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000304; CHECK-LABEL: memop_signed_char_or:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000305; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}|={{ *}}r{{[0-9]+}}
David Blaikiea79ac142015-02-27 21:17:42 +0000306 %0 = load i8, i8* %p, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000307 %or3 = or i8 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +0000308 store i8 %or3, i8* %p, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000309 ret void
310}
311
312define void @memop_signed_char_and(i8* nocapture %p, i8 signext %x) nounwind {
313entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000314; CHECK-LABEL: memop_signed_char_and:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000315; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}&={{ *}}r{{[0-9]+}}
David Blaikiea79ac142015-02-27 21:17:42 +0000316 %0 = load i8, i8* %p, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000317 %and3 = and i8 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +0000318 store i8 %and3, i8* %p, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000319 ret void
320}
321
322define void @memop_signed_char_clrbit(i8* nocapture %p) nounwind {
323entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000324; CHECK-LABEL: memop_signed_char_clrbit:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000325; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}={{ *}}clrbit({{ *}}#5{{ *}})
David Blaikiea79ac142015-02-27 21:17:42 +0000326 %0 = load i8, i8* %p, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000327 %conv2 = zext i8 %0 to i32
328 %and = and i32 %conv2, 223
329 %conv1 = trunc i32 %and to i8
Manman Rena2e9a982013-08-21 22:20:53 +0000330 store i8 %conv1, i8* %p, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000331 ret void
332}
333
334define void @memop_signed_char_setbit(i8* nocapture %p) nounwind {
335entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000336; CHECK-LABEL: memop_signed_char_setbit:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000337; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}={{ *}}setbit({{ *}}#7{{ *}})
David Blaikiea79ac142015-02-27 21:17:42 +0000338 %0 = load i8, i8* %p, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000339 %conv2 = zext i8 %0 to i32
340 %or = or i32 %conv2, 128
341 %conv1 = trunc i32 %or to i8
Manman Rena2e9a982013-08-21 22:20:53 +0000342 store i8 %conv1, i8* %p, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000343 ret void
344}
345
346define void @memop_signed_char_add5_index(i8* nocapture %p, i32 %i) nounwind {
347entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000348; CHECK-LABEL: memop_signed_char_add5_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000349; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}+={{ *}}#5
David Blaikie79e6c742015-02-27 19:29:02 +0000350 %add.ptr = getelementptr inbounds i8, i8* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +0000351 %0 = load i8, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000352 %conv2 = zext i8 %0 to i32
353 %add = add nsw i32 %conv2, 5
354 %conv1 = trunc i32 %add to i8
Manman Rena2e9a982013-08-21 22:20:53 +0000355 store i8 %conv1, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000356 ret void
357}
358
359define void @memop_signed_char_add_index(i8* nocapture %p, i32 %i, i8 signext %x) nounwind {
360entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000361; CHECK-LABEL: memop_signed_char_add_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000362; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}+={{ *}}r{{[0-9]+}}
363 %conv4 = zext i8 %x to i32
David Blaikie79e6c742015-02-27 19:29:02 +0000364 %add.ptr = getelementptr inbounds i8, i8* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +0000365 %0 = load i8, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000366 %conv13 = zext i8 %0 to i32
367 %add = add nsw i32 %conv13, %conv4
368 %conv2 = trunc i32 %add to i8
Manman Rena2e9a982013-08-21 22:20:53 +0000369 store i8 %conv2, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000370 ret void
371}
372
373define void @memop_signed_char_sub_index(i8* nocapture %p, i32 %i, i8 signext %x) nounwind {
374entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000375; CHECK-LABEL: memop_signed_char_sub_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000376; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}-={{ *}}r{{[0-9]+}}
377 %conv4 = zext i8 %x to i32
David Blaikie79e6c742015-02-27 19:29:02 +0000378 %add.ptr = getelementptr inbounds i8, i8* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +0000379 %0 = load i8, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000380 %conv13 = zext i8 %0 to i32
381 %sub = sub nsw i32 %conv13, %conv4
382 %conv2 = trunc i32 %sub to i8
Manman Rena2e9a982013-08-21 22:20:53 +0000383 store i8 %conv2, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000384 ret void
385}
386
387define void @memop_signed_char_or_index(i8* nocapture %p, i32 %i, i8 signext %x) nounwind {
388entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000389; CHECK-LABEL: memop_signed_char_or_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000390; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}|={{ *}}r{{[0-9]+}}
David Blaikie79e6c742015-02-27 19:29:02 +0000391 %add.ptr = getelementptr inbounds i8, i8* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +0000392 %0 = load i8, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000393 %or3 = or i8 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +0000394 store i8 %or3, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000395 ret void
396}
397
398define void @memop_signed_char_and_index(i8* nocapture %p, i32 %i, i8 signext %x) nounwind {
399entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000400; CHECK-LABEL: memop_signed_char_and_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000401; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}&={{ *}}r{{[0-9]+}}
David Blaikie79e6c742015-02-27 19:29:02 +0000402 %add.ptr = getelementptr inbounds i8, i8* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +0000403 %0 = load i8, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000404 %and3 = and i8 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +0000405 store i8 %and3, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000406 ret void
407}
408
409define void @memop_signed_char_clrbit_index(i8* nocapture %p, i32 %i) nounwind {
410entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000411; CHECK-LABEL: memop_signed_char_clrbit_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000412; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}={{ *}}clrbit({{ *}}#5{{ *}})
David Blaikie79e6c742015-02-27 19:29:02 +0000413 %add.ptr = getelementptr inbounds i8, i8* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +0000414 %0 = load i8, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000415 %conv2 = zext i8 %0 to i32
416 %and = and i32 %conv2, 223
417 %conv1 = trunc i32 %and to i8
Manman Rena2e9a982013-08-21 22:20:53 +0000418 store i8 %conv1, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000419 ret void
420}
421
422define void @memop_signed_char_setbit_index(i8* nocapture %p, i32 %i) nounwind {
423entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000424; CHECK-LABEL: memop_signed_char_setbit_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000425; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}={{ *}}setbit({{ *}}#7{{ *}})
David Blaikie79e6c742015-02-27 19:29:02 +0000426 %add.ptr = getelementptr inbounds i8, i8* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +0000427 %0 = load i8, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000428 %conv2 = zext i8 %0 to i32
429 %or = or i32 %conv2, 128
430 %conv1 = trunc i32 %or to i8
Manman Rena2e9a982013-08-21 22:20:53 +0000431 store i8 %conv1, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000432 ret void
433}
434
435define void @memop_signed_char_add5_index5(i8* nocapture %p) nounwind {
436entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000437; CHECK-LABEL: memop_signed_char_add5_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000438; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#5){{ *}}+={{ *}}#5
David Blaikie79e6c742015-02-27 19:29:02 +0000439 %add.ptr = getelementptr inbounds i8, i8* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +0000440 %0 = load i8, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000441 %conv2 = zext i8 %0 to i32
442 %add = add nsw i32 %conv2, 5
443 %conv1 = trunc i32 %add to i8
Manman Rena2e9a982013-08-21 22:20:53 +0000444 store i8 %conv1, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000445 ret void
446}
447
448define void @memop_signed_char_add_index5(i8* nocapture %p, i8 signext %x) nounwind {
449entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000450; CHECK-LABEL: memop_signed_char_add_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000451; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#5){{ *}}+={{ *}}r{{[0-9]+}}
452 %conv4 = zext i8 %x to i32
David Blaikie79e6c742015-02-27 19:29:02 +0000453 %add.ptr = getelementptr inbounds i8, i8* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +0000454 %0 = load i8, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000455 %conv13 = zext i8 %0 to i32
456 %add = add nsw i32 %conv13, %conv4
457 %conv2 = trunc i32 %add to i8
Manman Rena2e9a982013-08-21 22:20:53 +0000458 store i8 %conv2, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000459 ret void
460}
461
462define void @memop_signed_char_sub_index5(i8* nocapture %p, i8 signext %x) nounwind {
463entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000464; CHECK-LABEL: memop_signed_char_sub_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000465; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#5){{ *}}-={{ *}}r{{[0-9]+}}
466 %conv4 = zext i8 %x to i32
David Blaikie79e6c742015-02-27 19:29:02 +0000467 %add.ptr = getelementptr inbounds i8, i8* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +0000468 %0 = load i8, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000469 %conv13 = zext i8 %0 to i32
470 %sub = sub nsw i32 %conv13, %conv4
471 %conv2 = trunc i32 %sub to i8
Manman Rena2e9a982013-08-21 22:20:53 +0000472 store i8 %conv2, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000473 ret void
474}
475
476define void @memop_signed_char_or_index5(i8* nocapture %p, i8 signext %x) nounwind {
477entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000478; CHECK-LABEL: memop_signed_char_or_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000479; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#5){{ *}}|={{ *}}r{{[0-9]+}}
David Blaikie79e6c742015-02-27 19:29:02 +0000480 %add.ptr = getelementptr inbounds i8, i8* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +0000481 %0 = load i8, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000482 %or3 = or i8 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +0000483 store i8 %or3, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000484 ret void
485}
486
487define void @memop_signed_char_and_index5(i8* nocapture %p, i8 signext %x) nounwind {
488entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000489; CHECK-LABEL: memop_signed_char_and_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000490; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#5){{ *}}&={{ *}}r{{[0-9]+}}
David Blaikie79e6c742015-02-27 19:29:02 +0000491 %add.ptr = getelementptr inbounds i8, i8* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +0000492 %0 = load i8, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000493 %and3 = and i8 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +0000494 store i8 %and3, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000495 ret void
496}
497
498define void @memop_signed_char_clrbit_index5(i8* nocapture %p) nounwind {
499entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000500; CHECK-LABEL: memop_signed_char_clrbit_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000501; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#5){{ *}}={{ *}}clrbit({{ *}}#5{{ *}})
David Blaikie79e6c742015-02-27 19:29:02 +0000502 %add.ptr = getelementptr inbounds i8, i8* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +0000503 %0 = load i8, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000504 %conv2 = zext i8 %0 to i32
505 %and = and i32 %conv2, 223
506 %conv1 = trunc i32 %and to i8
Manman Rena2e9a982013-08-21 22:20:53 +0000507 store i8 %conv1, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000508 ret void
509}
510
511define void @memop_signed_char_setbit_index5(i8* nocapture %p) nounwind {
512entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000513; CHECK-LABEL: memop_signed_char_setbit_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000514; CHECK: memb(r{{[0-9]+}}{{ *}}+{{ *}}#5){{ *}}={{ *}}setbit({{ *}}#7{{ *}})
David Blaikie79e6c742015-02-27 19:29:02 +0000515 %add.ptr = getelementptr inbounds i8, i8* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +0000516 %0 = load i8, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000517 %conv2 = zext i8 %0 to i32
518 %or = or i32 %conv2, 128
519 %conv1 = trunc i32 %or to i8
Manman Rena2e9a982013-08-21 22:20:53 +0000520 store i8 %conv1, i8* %add.ptr, align 1
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000521 ret void
522}
523
524define void @memop_unsigned_short_add5(i16* nocapture %p) nounwind {
525entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000526; CHECK-LABEL: memop_unsigned_short_add5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000527; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}+={{ *}}#5
David Blaikiea79ac142015-02-27 21:17:42 +0000528 %0 = load i16, i16* %p, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000529 %conv = zext i16 %0 to i32
530 %add = add nsw i32 %conv, 5
531 %conv1 = trunc i32 %add to i16
Manman Rena2e9a982013-08-21 22:20:53 +0000532 store i16 %conv1, i16* %p, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000533 ret void
534}
535
536define void @memop_unsigned_short_add(i16* nocapture %p, i16 zeroext %x) nounwind {
537entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000538; CHECK-LABEL: memop_unsigned_short_add:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000539; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}+={{ *}}r{{[0-9]+}}
540 %conv = zext i16 %x to i32
David Blaikiea79ac142015-02-27 21:17:42 +0000541 %0 = load i16, i16* %p, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000542 %conv1 = zext i16 %0 to i32
543 %add = add nsw i32 %conv1, %conv
544 %conv2 = trunc i32 %add to i16
Manman Rena2e9a982013-08-21 22:20:53 +0000545 store i16 %conv2, i16* %p, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000546 ret void
547}
548
549define void @memop_unsigned_short_sub(i16* nocapture %p, i16 zeroext %x) nounwind {
550entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000551; CHECK-LABEL: memop_unsigned_short_sub:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000552; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}-={{ *}}r{{[0-9]+}}
553 %conv = zext i16 %x to i32
David Blaikiea79ac142015-02-27 21:17:42 +0000554 %0 = load i16, i16* %p, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000555 %conv1 = zext i16 %0 to i32
556 %sub = sub nsw i32 %conv1, %conv
557 %conv2 = trunc i32 %sub to i16
Manman Rena2e9a982013-08-21 22:20:53 +0000558 store i16 %conv2, i16* %p, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000559 ret void
560}
561
562define void @memop_unsigned_short_or(i16* nocapture %p, i16 zeroext %x) nounwind {
563entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000564; CHECK-LABEL: memop_unsigned_short_or:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000565; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}|={{ *}}r{{[0-9]+}}
David Blaikiea79ac142015-02-27 21:17:42 +0000566 %0 = load i16, i16* %p, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000567 %or3 = or i16 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +0000568 store i16 %or3, i16* %p, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000569 ret void
570}
571
572define void @memop_unsigned_short_and(i16* nocapture %p, i16 zeroext %x) nounwind {
573entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000574; CHECK-LABEL: memop_unsigned_short_and:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000575; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}&={{ *}}r{{[0-9]+}}
David Blaikiea79ac142015-02-27 21:17:42 +0000576 %0 = load i16, i16* %p, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000577 %and3 = and i16 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +0000578 store i16 %and3, i16* %p, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000579 ret void
580}
581
582define void @memop_unsigned_short_clrbit(i16* nocapture %p) nounwind {
583entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000584; CHECK-LABEL: memop_unsigned_short_clrbit:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000585; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}={{ *}}clrbit({{ *}}#5{{ *}})
David Blaikiea79ac142015-02-27 21:17:42 +0000586 %0 = load i16, i16* %p, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000587 %conv = zext i16 %0 to i32
588 %and = and i32 %conv, 65503
589 %conv1 = trunc i32 %and to i16
Manman Rena2e9a982013-08-21 22:20:53 +0000590 store i16 %conv1, i16* %p, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000591 ret void
592}
593
594define void @memop_unsigned_short_setbit(i16* nocapture %p) nounwind {
595entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000596; CHECK-LABEL: memop_unsigned_short_setbit:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000597; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}={{ *}}setbit({{ *}}#7{{ *}})
David Blaikiea79ac142015-02-27 21:17:42 +0000598 %0 = load i16, i16* %p, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000599 %conv = zext i16 %0 to i32
600 %or = or i32 %conv, 128
601 %conv1 = trunc i32 %or to i16
Manman Rena2e9a982013-08-21 22:20:53 +0000602 store i16 %conv1, i16* %p, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000603 ret void
604}
605
606define void @memop_unsigned_short_add5_index(i16* nocapture %p, i32 %i) nounwind {
607entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000608; CHECK-LABEL: memop_unsigned_short_add5_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000609; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}+={{ *}}#5
David Blaikie79e6c742015-02-27 19:29:02 +0000610 %add.ptr = getelementptr inbounds i16, i16* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +0000611 %0 = load i16, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000612 %conv = zext i16 %0 to i32
613 %add = add nsw i32 %conv, 5
614 %conv1 = trunc i32 %add to i16
Manman Rena2e9a982013-08-21 22:20:53 +0000615 store i16 %conv1, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000616 ret void
617}
618
619define void @memop_unsigned_short_add_index(i16* nocapture %p, i32 %i, i16 zeroext %x) nounwind {
620entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000621; CHECK-LABEL: memop_unsigned_short_add_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000622; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}+={{ *}}r{{[0-9]+}}
623 %conv = zext i16 %x to i32
David Blaikie79e6c742015-02-27 19:29:02 +0000624 %add.ptr = getelementptr inbounds i16, i16* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +0000625 %0 = load i16, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000626 %conv1 = zext i16 %0 to i32
627 %add = add nsw i32 %conv1, %conv
628 %conv2 = trunc i32 %add to i16
Manman Rena2e9a982013-08-21 22:20:53 +0000629 store i16 %conv2, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000630 ret void
631}
632
633define void @memop_unsigned_short_sub_index(i16* nocapture %p, i32 %i, i16 zeroext %x) nounwind {
634entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000635; CHECK-LABEL: memop_unsigned_short_sub_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000636; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}-={{ *}}r{{[0-9]+}}
637 %conv = zext i16 %x to i32
David Blaikie79e6c742015-02-27 19:29:02 +0000638 %add.ptr = getelementptr inbounds i16, i16* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +0000639 %0 = load i16, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000640 %conv1 = zext i16 %0 to i32
641 %sub = sub nsw i32 %conv1, %conv
642 %conv2 = trunc i32 %sub to i16
Manman Rena2e9a982013-08-21 22:20:53 +0000643 store i16 %conv2, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000644 ret void
645}
646
647define void @memop_unsigned_short_or_index(i16* nocapture %p, i32 %i, i16 zeroext %x) nounwind {
648entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000649; CHECK-LABEL: memop_unsigned_short_or_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000650; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}|={{ *}}r{{[0-9]+}}
David Blaikie79e6c742015-02-27 19:29:02 +0000651 %add.ptr = getelementptr inbounds i16, i16* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +0000652 %0 = load i16, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000653 %or3 = or i16 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +0000654 store i16 %or3, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000655 ret void
656}
657
658define void @memop_unsigned_short_and_index(i16* nocapture %p, i32 %i, i16 zeroext %x) nounwind {
659entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000660; CHECK-LABEL: memop_unsigned_short_and_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000661; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}&={{ *}}r{{[0-9]+}}
David Blaikie79e6c742015-02-27 19:29:02 +0000662 %add.ptr = getelementptr inbounds i16, i16* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +0000663 %0 = load i16, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000664 %and3 = and i16 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +0000665 store i16 %and3, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000666 ret void
667}
668
669define void @memop_unsigned_short_clrbit_index(i16* nocapture %p, i32 %i) nounwind {
670entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000671; CHECK-LABEL: memop_unsigned_short_clrbit_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000672; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}={{ *}}clrbit({{ *}}#5{{ *}})
David Blaikie79e6c742015-02-27 19:29:02 +0000673 %add.ptr = getelementptr inbounds i16, i16* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +0000674 %0 = load i16, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000675 %conv = zext i16 %0 to i32
676 %and = and i32 %conv, 65503
677 %conv1 = trunc i32 %and to i16
Manman Rena2e9a982013-08-21 22:20:53 +0000678 store i16 %conv1, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000679 ret void
680}
681
682define void @memop_unsigned_short_setbit_index(i16* nocapture %p, i32 %i) nounwind {
683entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000684; CHECK-LABEL: memop_unsigned_short_setbit_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000685; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}={{ *}}setbit({{ *}}#7{{ *}})
David Blaikie79e6c742015-02-27 19:29:02 +0000686 %add.ptr = getelementptr inbounds i16, i16* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +0000687 %0 = load i16, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000688 %conv = zext i16 %0 to i32
689 %or = or i32 %conv, 128
690 %conv1 = trunc i32 %or to i16
Manman Rena2e9a982013-08-21 22:20:53 +0000691 store i16 %conv1, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000692 ret void
693}
694
695define void @memop_unsigned_short_add5_index5(i16* nocapture %p) nounwind {
696entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000697; CHECK-LABEL: memop_unsigned_short_add5_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000698; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#10){{ *}}+={{ *}}#5
David Blaikie79e6c742015-02-27 19:29:02 +0000699 %add.ptr = getelementptr inbounds i16, i16* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +0000700 %0 = load i16, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000701 %conv = zext i16 %0 to i32
702 %add = add nsw i32 %conv, 5
703 %conv1 = trunc i32 %add to i16
Manman Rena2e9a982013-08-21 22:20:53 +0000704 store i16 %conv1, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000705 ret void
706}
707
708define void @memop_unsigned_short_add_index5(i16* nocapture %p, i16 zeroext %x) nounwind {
709entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000710; CHECK-LABEL: memop_unsigned_short_add_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000711; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#10){{ *}}+={{ *}}r{{[0-9]+}}
712 %conv = zext i16 %x to i32
David Blaikie79e6c742015-02-27 19:29:02 +0000713 %add.ptr = getelementptr inbounds i16, i16* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +0000714 %0 = load i16, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000715 %conv1 = zext i16 %0 to i32
716 %add = add nsw i32 %conv1, %conv
717 %conv2 = trunc i32 %add to i16
Manman Rena2e9a982013-08-21 22:20:53 +0000718 store i16 %conv2, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000719 ret void
720}
721
722define void @memop_unsigned_short_sub_index5(i16* nocapture %p, i16 zeroext %x) nounwind {
723entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000724; CHECK-LABEL: memop_unsigned_short_sub_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000725; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#10){{ *}}-={{ *}}r{{[0-9]+}}
726 %conv = zext i16 %x to i32
David Blaikie79e6c742015-02-27 19:29:02 +0000727 %add.ptr = getelementptr inbounds i16, i16* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +0000728 %0 = load i16, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000729 %conv1 = zext i16 %0 to i32
730 %sub = sub nsw i32 %conv1, %conv
731 %conv2 = trunc i32 %sub to i16
Manman Rena2e9a982013-08-21 22:20:53 +0000732 store i16 %conv2, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000733 ret void
734}
735
736define void @memop_unsigned_short_or_index5(i16* nocapture %p, i16 zeroext %x) nounwind {
737entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000738; CHECK-LABEL: memop_unsigned_short_or_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000739; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#10){{ *}}|={{ *}}r{{[0-9]+}}
David Blaikie79e6c742015-02-27 19:29:02 +0000740 %add.ptr = getelementptr inbounds i16, i16* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +0000741 %0 = load i16, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000742 %or3 = or i16 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +0000743 store i16 %or3, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000744 ret void
745}
746
747define void @memop_unsigned_short_and_index5(i16* nocapture %p, i16 zeroext %x) nounwind {
748entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000749; CHECK-LABEL: memop_unsigned_short_and_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000750; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#10){{ *}}&={{ *}}r{{[0-9]+}}
David Blaikie79e6c742015-02-27 19:29:02 +0000751 %add.ptr = getelementptr inbounds i16, i16* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +0000752 %0 = load i16, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000753 %and3 = and i16 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +0000754 store i16 %and3, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000755 ret void
756}
757
758define void @memop_unsigned_short_clrbit_index5(i16* nocapture %p) nounwind {
759entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000760; CHECK-LABEL: memop_unsigned_short_clrbit_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000761; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#10){{ *}}={{ *}}clrbit({{ *}}#5{{ *}})
David Blaikie79e6c742015-02-27 19:29:02 +0000762 %add.ptr = getelementptr inbounds i16, i16* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +0000763 %0 = load i16, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000764 %conv = zext i16 %0 to i32
765 %and = and i32 %conv, 65503
766 %conv1 = trunc i32 %and to i16
Manman Rena2e9a982013-08-21 22:20:53 +0000767 store i16 %conv1, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000768 ret void
769}
770
771define void @memop_unsigned_short_setbit_index5(i16* nocapture %p) nounwind {
772entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000773; CHECK-LABEL: memop_unsigned_short_setbit_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000774; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#10){{ *}}={{ *}}setbit({{ *}}#7{{ *}})
David Blaikie79e6c742015-02-27 19:29:02 +0000775 %add.ptr = getelementptr inbounds i16, i16* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +0000776 %0 = load i16, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000777 %conv = zext i16 %0 to i32
778 %or = or i32 %conv, 128
779 %conv1 = trunc i32 %or to i16
Manman Rena2e9a982013-08-21 22:20:53 +0000780 store i16 %conv1, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000781 ret void
782}
783
784define void @memop_signed_short_add5(i16* nocapture %p) nounwind {
785entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000786; CHECK-LABEL: memop_signed_short_add5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000787; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}+={{ *}}#5
David Blaikiea79ac142015-02-27 21:17:42 +0000788 %0 = load i16, i16* %p, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000789 %conv2 = zext i16 %0 to i32
790 %add = add nsw i32 %conv2, 5
791 %conv1 = trunc i32 %add to i16
Manman Rena2e9a982013-08-21 22:20:53 +0000792 store i16 %conv1, i16* %p, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000793 ret void
794}
795
796define void @memop_signed_short_add(i16* nocapture %p, i16 signext %x) nounwind {
797entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000798; CHECK-LABEL: memop_signed_short_add:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000799; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}+={{ *}}r{{[0-9]+}}
800 %conv4 = zext i16 %x to i32
David Blaikiea79ac142015-02-27 21:17:42 +0000801 %0 = load i16, i16* %p, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000802 %conv13 = zext i16 %0 to i32
803 %add = add nsw i32 %conv13, %conv4
804 %conv2 = trunc i32 %add to i16
Manman Rena2e9a982013-08-21 22:20:53 +0000805 store i16 %conv2, i16* %p, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000806 ret void
807}
808
809define void @memop_signed_short_sub(i16* nocapture %p, i16 signext %x) nounwind {
810entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000811; CHECK-LABEL: memop_signed_short_sub:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000812; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}-={{ *}}r{{[0-9]+}}
813 %conv4 = zext i16 %x to i32
David Blaikiea79ac142015-02-27 21:17:42 +0000814 %0 = load i16, i16* %p, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000815 %conv13 = zext i16 %0 to i32
816 %sub = sub nsw i32 %conv13, %conv4
817 %conv2 = trunc i32 %sub to i16
Manman Rena2e9a982013-08-21 22:20:53 +0000818 store i16 %conv2, i16* %p, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000819 ret void
820}
821
822define void @memop_signed_short_or(i16* nocapture %p, i16 signext %x) nounwind {
823entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000824; CHECK-LABEL: memop_signed_short_or:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000825; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}|={{ *}}r{{[0-9]+}}
David Blaikiea79ac142015-02-27 21:17:42 +0000826 %0 = load i16, i16* %p, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000827 %or3 = or i16 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +0000828 store i16 %or3, i16* %p, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000829 ret void
830}
831
832define void @memop_signed_short_and(i16* nocapture %p, i16 signext %x) nounwind {
833entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000834; CHECK-LABEL: memop_signed_short_and:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000835; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}&={{ *}}r{{[0-9]+}}
David Blaikiea79ac142015-02-27 21:17:42 +0000836 %0 = load i16, i16* %p, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000837 %and3 = and i16 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +0000838 store i16 %and3, i16* %p, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000839 ret void
840}
841
842define void @memop_signed_short_clrbit(i16* nocapture %p) nounwind {
843entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000844; CHECK-LABEL: memop_signed_short_clrbit:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000845; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}={{ *}}clrbit({{ *}}#5{{ *}})
David Blaikiea79ac142015-02-27 21:17:42 +0000846 %0 = load i16, i16* %p, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000847 %conv2 = zext i16 %0 to i32
848 %and = and i32 %conv2, 65503
849 %conv1 = trunc i32 %and to i16
Manman Rena2e9a982013-08-21 22:20:53 +0000850 store i16 %conv1, i16* %p, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000851 ret void
852}
853
854define void @memop_signed_short_setbit(i16* nocapture %p) nounwind {
855entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000856; CHECK-LABEL: memop_signed_short_setbit:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000857; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}={{ *}}setbit({{ *}}#7{{ *}})
David Blaikiea79ac142015-02-27 21:17:42 +0000858 %0 = load i16, i16* %p, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000859 %conv2 = zext i16 %0 to i32
860 %or = or i32 %conv2, 128
861 %conv1 = trunc i32 %or to i16
Manman Rena2e9a982013-08-21 22:20:53 +0000862 store i16 %conv1, i16* %p, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000863 ret void
864}
865
866define void @memop_signed_short_add5_index(i16* nocapture %p, i32 %i) nounwind {
867entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000868; CHECK-LABEL: memop_signed_short_add5_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000869; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}+={{ *}}#5
David Blaikie79e6c742015-02-27 19:29:02 +0000870 %add.ptr = getelementptr inbounds i16, i16* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +0000871 %0 = load i16, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000872 %conv2 = zext i16 %0 to i32
873 %add = add nsw i32 %conv2, 5
874 %conv1 = trunc i32 %add to i16
Manman Rena2e9a982013-08-21 22:20:53 +0000875 store i16 %conv1, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000876 ret void
877}
878
879define void @memop_signed_short_add_index(i16* nocapture %p, i32 %i, i16 signext %x) nounwind {
880entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000881; CHECK-LABEL: memop_signed_short_add_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000882; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}+={{ *}}r{{[0-9]+}}
883 %conv4 = zext i16 %x to i32
David Blaikie79e6c742015-02-27 19:29:02 +0000884 %add.ptr = getelementptr inbounds i16, i16* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +0000885 %0 = load i16, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000886 %conv13 = zext i16 %0 to i32
887 %add = add nsw i32 %conv13, %conv4
888 %conv2 = trunc i32 %add to i16
Manman Rena2e9a982013-08-21 22:20:53 +0000889 store i16 %conv2, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000890 ret void
891}
892
893define void @memop_signed_short_sub_index(i16* nocapture %p, i32 %i, i16 signext %x) nounwind {
894entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000895; CHECK-LABEL: memop_signed_short_sub_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000896; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}-={{ *}}r{{[0-9]+}}
897 %conv4 = zext i16 %x to i32
David Blaikie79e6c742015-02-27 19:29:02 +0000898 %add.ptr = getelementptr inbounds i16, i16* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +0000899 %0 = load i16, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000900 %conv13 = zext i16 %0 to i32
901 %sub = sub nsw i32 %conv13, %conv4
902 %conv2 = trunc i32 %sub to i16
Manman Rena2e9a982013-08-21 22:20:53 +0000903 store i16 %conv2, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000904 ret void
905}
906
907define void @memop_signed_short_or_index(i16* nocapture %p, i32 %i, i16 signext %x) nounwind {
908entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000909; CHECK-LABEL: memop_signed_short_or_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000910; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}|={{ *}}r{{[0-9]+}}
David Blaikie79e6c742015-02-27 19:29:02 +0000911 %add.ptr = getelementptr inbounds i16, i16* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +0000912 %0 = load i16, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000913 %or3 = or i16 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +0000914 store i16 %or3, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000915 ret void
916}
917
918define void @memop_signed_short_and_index(i16* nocapture %p, i32 %i, i16 signext %x) nounwind {
919entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000920; CHECK-LABEL: memop_signed_short_and_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000921; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}&={{ *}}r{{[0-9]+}}
David Blaikie79e6c742015-02-27 19:29:02 +0000922 %add.ptr = getelementptr inbounds i16, i16* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +0000923 %0 = load i16, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000924 %and3 = and i16 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +0000925 store i16 %and3, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000926 ret void
927}
928
929define void @memop_signed_short_clrbit_index(i16* nocapture %p, i32 %i) nounwind {
930entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000931; CHECK-LABEL: memop_signed_short_clrbit_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000932; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}={{ *}}clrbit({{ *}}#5{{ *}})
David Blaikie79e6c742015-02-27 19:29:02 +0000933 %add.ptr = getelementptr inbounds i16, i16* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +0000934 %0 = load i16, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000935 %conv2 = zext i16 %0 to i32
936 %and = and i32 %conv2, 65503
937 %conv1 = trunc i32 %and to i16
Manman Rena2e9a982013-08-21 22:20:53 +0000938 store i16 %conv1, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000939 ret void
940}
941
942define void @memop_signed_short_setbit_index(i16* nocapture %p, i32 %i) nounwind {
943entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000944; CHECK-LABEL: memop_signed_short_setbit_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000945; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}={{ *}}setbit({{ *}}#7{{ *}})
David Blaikie79e6c742015-02-27 19:29:02 +0000946 %add.ptr = getelementptr inbounds i16, i16* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +0000947 %0 = load i16, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000948 %conv2 = zext i16 %0 to i32
949 %or = or i32 %conv2, 128
950 %conv1 = trunc i32 %or to i16
Manman Rena2e9a982013-08-21 22:20:53 +0000951 store i16 %conv1, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000952 ret void
953}
954
955define void @memop_signed_short_add5_index5(i16* nocapture %p) nounwind {
956entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000957; CHECK-LABEL: memop_signed_short_add5_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000958; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#10){{ *}}+={{ *}}#5
David Blaikie79e6c742015-02-27 19:29:02 +0000959 %add.ptr = getelementptr inbounds i16, i16* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +0000960 %0 = load i16, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000961 %conv2 = zext i16 %0 to i32
962 %add = add nsw i32 %conv2, 5
963 %conv1 = trunc i32 %add to i16
Manman Rena2e9a982013-08-21 22:20:53 +0000964 store i16 %conv1, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000965 ret void
966}
967
968define void @memop_signed_short_add_index5(i16* nocapture %p, i16 signext %x) nounwind {
969entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000970; CHECK-LABEL: memop_signed_short_add_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000971; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#10){{ *}}+={{ *}}r{{[0-9]+}}
972 %conv4 = zext i16 %x to i32
David Blaikie79e6c742015-02-27 19:29:02 +0000973 %add.ptr = getelementptr inbounds i16, i16* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +0000974 %0 = load i16, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000975 %conv13 = zext i16 %0 to i32
976 %add = add nsw i32 %conv13, %conv4
977 %conv2 = trunc i32 %add to i16
Manman Rena2e9a982013-08-21 22:20:53 +0000978 store i16 %conv2, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000979 ret void
980}
981
982define void @memop_signed_short_sub_index5(i16* nocapture %p, i16 signext %x) nounwind {
983entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000984; CHECK-LABEL: memop_signed_short_sub_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000985; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#10){{ *}}-={{ *}}r{{[0-9]+}}
986 %conv4 = zext i16 %x to i32
David Blaikie79e6c742015-02-27 19:29:02 +0000987 %add.ptr = getelementptr inbounds i16, i16* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +0000988 %0 = load i16, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000989 %conv13 = zext i16 %0 to i32
990 %sub = sub nsw i32 %conv13, %conv4
991 %conv2 = trunc i32 %sub to i16
Manman Rena2e9a982013-08-21 22:20:53 +0000992 store i16 %conv2, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000993 ret void
994}
995
996define void @memop_signed_short_or_index5(i16* nocapture %p, i16 signext %x) nounwind {
997entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +0000998; CHECK-LABEL: memop_signed_short_or_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +0000999; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#10){{ *}}|={{ *}}r{{[0-9]+}}
David Blaikie79e6c742015-02-27 19:29:02 +00001000 %add.ptr = getelementptr inbounds i16, i16* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +00001001 %0 = load i16, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001002 %or3 = or i16 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +00001003 store i16 %or3, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001004 ret void
1005}
1006
1007define void @memop_signed_short_and_index5(i16* nocapture %p, i16 signext %x) nounwind {
1008entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001009; CHECK-LABEL: memop_signed_short_and_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001010; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#10){{ *}}&={{ *}}r{{[0-9]+}}
David Blaikie79e6c742015-02-27 19:29:02 +00001011 %add.ptr = getelementptr inbounds i16, i16* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +00001012 %0 = load i16, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001013 %and3 = and i16 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +00001014 store i16 %and3, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001015 ret void
1016}
1017
1018define void @memop_signed_short_clrbit_index5(i16* nocapture %p) nounwind {
1019entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001020; CHECK-LABEL: memop_signed_short_clrbit_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001021; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#10){{ *}}={{ *}}clrbit({{ *}}#5{{ *}})
David Blaikie79e6c742015-02-27 19:29:02 +00001022 %add.ptr = getelementptr inbounds i16, i16* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +00001023 %0 = load i16, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001024 %conv2 = zext i16 %0 to i32
1025 %and = and i32 %conv2, 65503
1026 %conv1 = trunc i32 %and to i16
Manman Rena2e9a982013-08-21 22:20:53 +00001027 store i16 %conv1, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001028 ret void
1029}
1030
1031define void @memop_signed_short_setbit_index5(i16* nocapture %p) nounwind {
1032entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001033; CHECK-LABEL: memop_signed_short_setbit_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001034; CHECK: memh(r{{[0-9]+}}{{ *}}+{{ *}}#10){{ *}}={{ *}}setbit({{ *}}#7{{ *}})
David Blaikie79e6c742015-02-27 19:29:02 +00001035 %add.ptr = getelementptr inbounds i16, i16* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +00001036 %0 = load i16, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001037 %conv2 = zext i16 %0 to i32
1038 %or = or i32 %conv2, 128
1039 %conv1 = trunc i32 %or to i16
Manman Rena2e9a982013-08-21 22:20:53 +00001040 store i16 %conv1, i16* %add.ptr, align 2
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001041 ret void
1042}
1043
1044define void @memop_signed_int_add5(i32* nocapture %p) nounwind {
1045entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001046; CHECK-LABEL: memop_signed_int_add5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001047; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}+={{ *}}#5
David Blaikiea79ac142015-02-27 21:17:42 +00001048 %0 = load i32, i32* %p, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001049 %add = add i32 %0, 5
Manman Rena2e9a982013-08-21 22:20:53 +00001050 store i32 %add, i32* %p, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001051 ret void
1052}
1053
1054define void @memop_signed_int_add(i32* nocapture %p, i32 %x) nounwind {
1055entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001056; CHECK-LABEL: memop_signed_int_add:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001057; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}+={{ *}}r{{[0-9]+}}
David Blaikiea79ac142015-02-27 21:17:42 +00001058 %0 = load i32, i32* %p, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001059 %add = add i32 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +00001060 store i32 %add, i32* %p, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001061 ret void
1062}
1063
1064define void @memop_signed_int_sub(i32* nocapture %p, i32 %x) nounwind {
1065entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001066; CHECK-LABEL: memop_signed_int_sub:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001067; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}-={{ *}}r{{[0-9]+}}
David Blaikiea79ac142015-02-27 21:17:42 +00001068 %0 = load i32, i32* %p, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001069 %sub = sub i32 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +00001070 store i32 %sub, i32* %p, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001071 ret void
1072}
1073
1074define void @memop_signed_int_or(i32* nocapture %p, i32 %x) nounwind {
1075entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001076; CHECK-LABEL: memop_signed_int_or:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001077; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}|={{ *}}r{{[0-9]+}}
David Blaikiea79ac142015-02-27 21:17:42 +00001078 %0 = load i32, i32* %p, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001079 %or = or i32 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +00001080 store i32 %or, i32* %p, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001081 ret void
1082}
1083
1084define void @memop_signed_int_and(i32* nocapture %p, i32 %x) nounwind {
1085entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001086; CHECK-LABEL: memop_signed_int_and:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001087; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}&={{ *}}r{{[0-9]+}}
David Blaikiea79ac142015-02-27 21:17:42 +00001088 %0 = load i32, i32* %p, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001089 %and = and i32 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +00001090 store i32 %and, i32* %p, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001091 ret void
1092}
1093
1094define void @memop_signed_int_clrbit(i32* nocapture %p) nounwind {
1095entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001096; CHECK-LABEL: memop_signed_int_clrbit:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001097; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}={{ *}}clrbit({{ *}}#5{{ *}})
David Blaikiea79ac142015-02-27 21:17:42 +00001098 %0 = load i32, i32* %p, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001099 %and = and i32 %0, -33
Manman Rena2e9a982013-08-21 22:20:53 +00001100 store i32 %and, i32* %p, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001101 ret void
1102}
1103
1104define void @memop_signed_int_setbit(i32* nocapture %p) nounwind {
1105entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001106; CHECK-LABEL: memop_signed_int_setbit:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001107; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}={{ *}}setbit({{ *}}#7{{ *}})
David Blaikiea79ac142015-02-27 21:17:42 +00001108 %0 = load i32, i32* %p, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001109 %or = or i32 %0, 128
Manman Rena2e9a982013-08-21 22:20:53 +00001110 store i32 %or, i32* %p, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001111 ret void
1112}
1113
1114define void @memop_signed_int_add5_index(i32* nocapture %p, i32 %i) nounwind {
1115entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001116; CHECK-LABEL: memop_signed_int_add5_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001117; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}+={{ *}}#5
David Blaikie79e6c742015-02-27 19:29:02 +00001118 %add.ptr = getelementptr inbounds i32, i32* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +00001119 %0 = load i32, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001120 %add = add i32 %0, 5
Manman Rena2e9a982013-08-21 22:20:53 +00001121 store i32 %add, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001122 ret void
1123}
1124
1125define void @memop_signed_int_add_index(i32* nocapture %p, i32 %i, i32 %x) nounwind {
1126entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001127; CHECK-LABEL: memop_signed_int_add_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001128; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}+={{ *}}r{{[0-9]+}}
David Blaikie79e6c742015-02-27 19:29:02 +00001129 %add.ptr = getelementptr inbounds i32, i32* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +00001130 %0 = load i32, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001131 %add = add i32 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +00001132 store i32 %add, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001133 ret void
1134}
1135
1136define void @memop_signed_int_sub_index(i32* nocapture %p, i32 %i, i32 %x) nounwind {
1137entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001138; CHECK-LABEL: memop_signed_int_sub_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001139; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}-={{ *}}r{{[0-9]+}}
David Blaikie79e6c742015-02-27 19:29:02 +00001140 %add.ptr = getelementptr inbounds i32, i32* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +00001141 %0 = load i32, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001142 %sub = sub i32 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +00001143 store i32 %sub, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001144 ret void
1145}
1146
1147define void @memop_signed_int_or_index(i32* nocapture %p, i32 %i, i32 %x) nounwind {
1148entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001149; CHECK-LABEL: memop_signed_int_or_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001150; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}|={{ *}}r{{[0-9]+}}
David Blaikie79e6c742015-02-27 19:29:02 +00001151 %add.ptr = getelementptr inbounds i32, i32* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +00001152 %0 = load i32, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001153 %or = or i32 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +00001154 store i32 %or, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001155 ret void
1156}
1157
1158define void @memop_signed_int_and_index(i32* nocapture %p, i32 %i, i32 %x) nounwind {
1159entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001160; CHECK-LABEL: memop_signed_int_and_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001161; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}&={{ *}}r{{[0-9]+}}
David Blaikie79e6c742015-02-27 19:29:02 +00001162 %add.ptr = getelementptr inbounds i32, i32* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +00001163 %0 = load i32, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001164 %and = and i32 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +00001165 store i32 %and, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001166 ret void
1167}
1168
1169define void @memop_signed_int_clrbit_index(i32* nocapture %p, i32 %i) nounwind {
1170entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001171; CHECK-LABEL: memop_signed_int_clrbit_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001172; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}={{ *}}clrbit({{ *}}#5{{ *}})
David Blaikie79e6c742015-02-27 19:29:02 +00001173 %add.ptr = getelementptr inbounds i32, i32* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +00001174 %0 = load i32, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001175 %and = and i32 %0, -33
Manman Rena2e9a982013-08-21 22:20:53 +00001176 store i32 %and, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001177 ret void
1178}
1179
1180define void @memop_signed_int_setbit_index(i32* nocapture %p, i32 %i) nounwind {
1181entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001182; CHECK-LABEL: memop_signed_int_setbit_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001183; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}={{ *}}setbit({{ *}}#7{{ *}})
David Blaikie79e6c742015-02-27 19:29:02 +00001184 %add.ptr = getelementptr inbounds i32, i32* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +00001185 %0 = load i32, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001186 %or = or i32 %0, 128
Manman Rena2e9a982013-08-21 22:20:53 +00001187 store i32 %or, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001188 ret void
1189}
1190
1191define void @memop_signed_int_add5_index5(i32* nocapture %p) nounwind {
1192entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001193; CHECK-LABEL: memop_signed_int_add5_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001194; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#20){{ *}}+={{ *}}#5
David Blaikie79e6c742015-02-27 19:29:02 +00001195 %add.ptr = getelementptr inbounds i32, i32* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +00001196 %0 = load i32, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001197 %add = add i32 %0, 5
Manman Rena2e9a982013-08-21 22:20:53 +00001198 store i32 %add, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001199 ret void
1200}
1201
1202define void @memop_signed_int_add_index5(i32* nocapture %p, i32 %x) nounwind {
1203entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001204; CHECK-LABEL: memop_signed_int_add_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001205; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#20){{ *}}+={{ *}}r{{[0-9]+}}
David Blaikie79e6c742015-02-27 19:29:02 +00001206 %add.ptr = getelementptr inbounds i32, i32* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +00001207 %0 = load i32, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001208 %add = add i32 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +00001209 store i32 %add, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001210 ret void
1211}
1212
1213define void @memop_signed_int_sub_index5(i32* nocapture %p, i32 %x) nounwind {
1214entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001215; CHECK-LABEL: memop_signed_int_sub_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001216; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#20){{ *}}-={{ *}}r{{[0-9]+}}
David Blaikie79e6c742015-02-27 19:29:02 +00001217 %add.ptr = getelementptr inbounds i32, i32* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +00001218 %0 = load i32, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001219 %sub = sub i32 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +00001220 store i32 %sub, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001221 ret void
1222}
1223
1224define void @memop_signed_int_or_index5(i32* nocapture %p, i32 %x) nounwind {
1225entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001226; CHECK-LABEL: memop_signed_int_or_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001227; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#20){{ *}}|={{ *}}r{{[0-9]+}}
David Blaikie79e6c742015-02-27 19:29:02 +00001228 %add.ptr = getelementptr inbounds i32, i32* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +00001229 %0 = load i32, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001230 %or = or i32 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +00001231 store i32 %or, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001232 ret void
1233}
1234
1235define void @memop_signed_int_and_index5(i32* nocapture %p, i32 %x) nounwind {
1236entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001237; CHECK-LABEL: memop_signed_int_and_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001238; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#20){{ *}}&={{ *}}r{{[0-9]+}}
David Blaikie79e6c742015-02-27 19:29:02 +00001239 %add.ptr = getelementptr inbounds i32, i32* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +00001240 %0 = load i32, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001241 %and = and i32 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +00001242 store i32 %and, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001243 ret void
1244}
1245
1246define void @memop_signed_int_clrbit_index5(i32* nocapture %p) nounwind {
1247entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001248; CHECK-LABEL: memop_signed_int_clrbit_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001249; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#20){{ *}}={{ *}}clrbit({{ *}}#5{{ *}})
David Blaikie79e6c742015-02-27 19:29:02 +00001250 %add.ptr = getelementptr inbounds i32, i32* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +00001251 %0 = load i32, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001252 %and = and i32 %0, -33
Manman Rena2e9a982013-08-21 22:20:53 +00001253 store i32 %and, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001254 ret void
1255}
1256
1257define void @memop_signed_int_setbit_index5(i32* nocapture %p) nounwind {
1258entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001259; CHECK-LABEL: memop_signed_int_setbit_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001260; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#20){{ *}}={{ *}}setbit({{ *}}#7{{ *}})
David Blaikie79e6c742015-02-27 19:29:02 +00001261 %add.ptr = getelementptr inbounds i32, i32* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +00001262 %0 = load i32, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001263 %or = or i32 %0, 128
Manman Rena2e9a982013-08-21 22:20:53 +00001264 store i32 %or, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001265 ret void
1266}
1267
1268define void @memop_unsigned_int_add5(i32* nocapture %p) nounwind {
1269entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001270; CHECK-LABEL: memop_unsigned_int_add5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001271; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}+={{ *}}#5
David Blaikiea79ac142015-02-27 21:17:42 +00001272 %0 = load i32, i32* %p, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001273 %add = add nsw i32 %0, 5
Manman Rena2e9a982013-08-21 22:20:53 +00001274 store i32 %add, i32* %p, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001275 ret void
1276}
1277
1278define void @memop_unsigned_int_add(i32* nocapture %p, i32 %x) nounwind {
1279entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001280; CHECK-LABEL: memop_unsigned_int_add:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001281; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}+={{ *}}r{{[0-9]+}}
David Blaikiea79ac142015-02-27 21:17:42 +00001282 %0 = load i32, i32* %p, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001283 %add = add nsw i32 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +00001284 store i32 %add, i32* %p, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001285 ret void
1286}
1287
1288define void @memop_unsigned_int_sub(i32* nocapture %p, i32 %x) nounwind {
1289entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001290; CHECK-LABEL: memop_unsigned_int_sub:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001291; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}-={{ *}}r{{[0-9]+}}
David Blaikiea79ac142015-02-27 21:17:42 +00001292 %0 = load i32, i32* %p, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001293 %sub = sub nsw i32 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +00001294 store i32 %sub, i32* %p, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001295 ret void
1296}
1297
1298define void @memop_unsigned_int_or(i32* nocapture %p, i32 %x) nounwind {
1299entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001300; CHECK-LABEL: memop_unsigned_int_or:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001301; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}|={{ *}}r{{[0-9]+}}
David Blaikiea79ac142015-02-27 21:17:42 +00001302 %0 = load i32, i32* %p, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001303 %or = or i32 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +00001304 store i32 %or, i32* %p, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001305 ret void
1306}
1307
1308define void @memop_unsigned_int_and(i32* nocapture %p, i32 %x) nounwind {
1309entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001310; CHECK-LABEL: memop_unsigned_int_and:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001311; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}&={{ *}}r{{[0-9]+}}
David Blaikiea79ac142015-02-27 21:17:42 +00001312 %0 = load i32, i32* %p, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001313 %and = and i32 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +00001314 store i32 %and, i32* %p, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001315 ret void
1316}
1317
1318define void @memop_unsigned_int_clrbit(i32* nocapture %p) nounwind {
1319entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001320; CHECK-LABEL: memop_unsigned_int_clrbit:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001321; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}={{ *}}clrbit({{ *}}#5{{ *}})
David Blaikiea79ac142015-02-27 21:17:42 +00001322 %0 = load i32, i32* %p, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001323 %and = and i32 %0, -33
Manman Rena2e9a982013-08-21 22:20:53 +00001324 store i32 %and, i32* %p, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001325 ret void
1326}
1327
1328define void @memop_unsigned_int_setbit(i32* nocapture %p) nounwind {
1329entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001330; CHECK-LABEL: memop_unsigned_int_setbit:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001331; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}={{ *}}setbit({{ *}}#7{{ *}})
David Blaikiea79ac142015-02-27 21:17:42 +00001332 %0 = load i32, i32* %p, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001333 %or = or i32 %0, 128
Manman Rena2e9a982013-08-21 22:20:53 +00001334 store i32 %or, i32* %p, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001335 ret void
1336}
1337
1338define void @memop_unsigned_int_add5_index(i32* nocapture %p, i32 %i) nounwind {
1339entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001340; CHECK-LABEL: memop_unsigned_int_add5_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001341; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}+={{ *}}#5
David Blaikie79e6c742015-02-27 19:29:02 +00001342 %add.ptr = getelementptr inbounds i32, i32* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +00001343 %0 = load i32, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001344 %add = add nsw i32 %0, 5
Manman Rena2e9a982013-08-21 22:20:53 +00001345 store i32 %add, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001346 ret void
1347}
1348
1349define void @memop_unsigned_int_add_index(i32* nocapture %p, i32 %i, i32 %x) nounwind {
1350entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001351; CHECK-LABEL: memop_unsigned_int_add_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001352; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}+={{ *}}r{{[0-9]+}}
David Blaikie79e6c742015-02-27 19:29:02 +00001353 %add.ptr = getelementptr inbounds i32, i32* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +00001354 %0 = load i32, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001355 %add = add nsw i32 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +00001356 store i32 %add, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001357 ret void
1358}
1359
1360define void @memop_unsigned_int_sub_index(i32* nocapture %p, i32 %i, i32 %x) nounwind {
1361entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001362; CHECK-LABEL: memop_unsigned_int_sub_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001363; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}-={{ *}}r{{[0-9]+}}
David Blaikie79e6c742015-02-27 19:29:02 +00001364 %add.ptr = getelementptr inbounds i32, i32* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +00001365 %0 = load i32, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001366 %sub = sub nsw i32 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +00001367 store i32 %sub, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001368 ret void
1369}
1370
1371define void @memop_unsigned_int_or_index(i32* nocapture %p, i32 %i, i32 %x) nounwind {
1372entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001373; CHECK-LABEL: memop_unsigned_int_or_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001374; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}|={{ *}}r{{[0-9]+}}
David Blaikie79e6c742015-02-27 19:29:02 +00001375 %add.ptr = getelementptr inbounds i32, i32* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +00001376 %0 = load i32, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001377 %or = or i32 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +00001378 store i32 %or, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001379 ret void
1380}
1381
1382define void @memop_unsigned_int_and_index(i32* nocapture %p, i32 %i, i32 %x) nounwind {
1383entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001384; CHECK-LABEL: memop_unsigned_int_and_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001385; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}&={{ *}}r{{[0-9]+}}
David Blaikie79e6c742015-02-27 19:29:02 +00001386 %add.ptr = getelementptr inbounds i32, i32* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +00001387 %0 = load i32, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001388 %and = and i32 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +00001389 store i32 %and, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001390 ret void
1391}
1392
1393define void @memop_unsigned_int_clrbit_index(i32* nocapture %p, i32 %i) nounwind {
1394entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001395; CHECK-LABEL: memop_unsigned_int_clrbit_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001396; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}={{ *}}clrbit({{ *}}#5{{ *}})
David Blaikie79e6c742015-02-27 19:29:02 +00001397 %add.ptr = getelementptr inbounds i32, i32* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +00001398 %0 = load i32, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001399 %and = and i32 %0, -33
Manman Rena2e9a982013-08-21 22:20:53 +00001400 store i32 %and, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001401 ret void
1402}
1403
1404define void @memop_unsigned_int_setbit_index(i32* nocapture %p, i32 %i) nounwind {
1405entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001406; CHECK-LABEL: memop_unsigned_int_setbit_index:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001407; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#0){{ *}}={{ *}}setbit({{ *}}#7{{ *}})
David Blaikie79e6c742015-02-27 19:29:02 +00001408 %add.ptr = getelementptr inbounds i32, i32* %p, i32 %i
David Blaikiea79ac142015-02-27 21:17:42 +00001409 %0 = load i32, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001410 %or = or i32 %0, 128
Manman Rena2e9a982013-08-21 22:20:53 +00001411 store i32 %or, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001412 ret void
1413}
1414
1415define void @memop_unsigned_int_add5_index5(i32* nocapture %p) nounwind {
1416entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001417; CHECK-LABEL: memop_unsigned_int_add5_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001418; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#20){{ *}}+={{ *}}#5
David Blaikie79e6c742015-02-27 19:29:02 +00001419 %add.ptr = getelementptr inbounds i32, i32* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +00001420 %0 = load i32, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001421 %add = add nsw i32 %0, 5
Manman Rena2e9a982013-08-21 22:20:53 +00001422 store i32 %add, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001423 ret void
1424}
1425
1426define void @memop_unsigned_int_add_index5(i32* nocapture %p, i32 %x) nounwind {
1427entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001428; CHECK-LABEL: memop_unsigned_int_add_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001429; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#20){{ *}}+={{ *}}r{{[0-9]+}}
David Blaikie79e6c742015-02-27 19:29:02 +00001430 %add.ptr = getelementptr inbounds i32, i32* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +00001431 %0 = load i32, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001432 %add = add nsw i32 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +00001433 store i32 %add, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001434 ret void
1435}
1436
1437define void @memop_unsigned_int_sub_index5(i32* nocapture %p, i32 %x) nounwind {
1438entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001439; CHECK-LABEL: memop_unsigned_int_sub_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001440; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#20){{ *}}-={{ *}}r{{[0-9]+}}
David Blaikie79e6c742015-02-27 19:29:02 +00001441 %add.ptr = getelementptr inbounds i32, i32* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +00001442 %0 = load i32, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001443 %sub = sub nsw i32 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +00001444 store i32 %sub, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001445 ret void
1446}
1447
1448define void @memop_unsigned_int_or_index5(i32* nocapture %p, i32 %x) nounwind {
1449entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001450; CHECK-LABEL: memop_unsigned_int_or_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001451; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#20){{ *}}|={{ *}}r{{[0-9]+}}
David Blaikie79e6c742015-02-27 19:29:02 +00001452 %add.ptr = getelementptr inbounds i32, i32* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +00001453 %0 = load i32, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001454 %or = or i32 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +00001455 store i32 %or, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001456 ret void
1457}
1458
1459define void @memop_unsigned_int_and_index5(i32* nocapture %p, i32 %x) nounwind {
1460entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001461; CHECK-LABEL: memop_unsigned_int_and_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001462; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#20){{ *}}&={{ *}}r{{[0-9]+}}
David Blaikie79e6c742015-02-27 19:29:02 +00001463 %add.ptr = getelementptr inbounds i32, i32* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +00001464 %0 = load i32, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001465 %and = and i32 %0, %x
Manman Rena2e9a982013-08-21 22:20:53 +00001466 store i32 %and, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001467 ret void
1468}
1469
1470define void @memop_unsigned_int_clrbit_index5(i32* nocapture %p) nounwind {
1471entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001472; CHECK-LABEL: memop_unsigned_int_clrbit_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001473; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#20){{ *}}={{ *}}clrbit({{ *}}#5{{ *}})
David Blaikie79e6c742015-02-27 19:29:02 +00001474 %add.ptr = getelementptr inbounds i32, i32* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +00001475 %0 = load i32, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001476 %and = and i32 %0, -33
Manman Rena2e9a982013-08-21 22:20:53 +00001477 store i32 %and, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001478 ret void
1479}
1480
1481define void @memop_unsigned_int_setbit_index5(i32* nocapture %p) nounwind {
1482entry:
Krzysztof Parzyszekbba0bf72016-07-15 15:35:52 +00001483; CHECK-LABEL: memop_unsigned_int_setbit_index5:
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001484; CHECK: memw(r{{[0-9]+}}{{ *}}+{{ *}}#20){{ *}}={{ *}}setbit({{ *}}#7{{ *}})
David Blaikie79e6c742015-02-27 19:29:02 +00001485 %add.ptr = getelementptr inbounds i32, i32* %p, i32 5
David Blaikiea79ac142015-02-27 21:17:42 +00001486 %0 = load i32, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001487 %or = or i32 %0, 128
Manman Rena2e9a982013-08-21 22:20:53 +00001488 store i32 %or, i32* %add.ptr, align 4
Jyotsna Vermafdc660b2013-03-22 18:41:34 +00001489 ret void
1490}