1 // Copyright 2016, VIXL authors
2 // All rights reserved.
3 //
4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are met:
6 //
7 // * Redistributions of source code must retain the above copyright notice,
8 // this list of conditions and the following disclaimer.
9 // * Redistributions in binary form must reproduce the above copyright notice,
10 // this list of conditions and the following disclaimer in the documentation
11 // and/or other materials provided with the distribution.
12 // * Neither the name of ARM Limited nor the names of its contributors may be
13 // used to endorse or promote products derived from this software without
14 // specific prior written permission.
15 //
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS CONTRIBUTORS "AS IS" AND
17 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
20 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
27
28 // -----------------------------------------------------------------------------
29 // This file is auto generated from the
30 // test/aarch32/config/template-simulator-aarch32.cc.in template file using
31 // tools/generate_tests.py.
32 //
33 // PLEASE DO NOT EDIT.
34 // -----------------------------------------------------------------------------
35
36
37 #include "test-runner.h"
38
39 #include "test-utils.h"
40 #include "test-utils-aarch32.h"
41
42 #include "aarch32/assembler-aarch32.h"
43 #include "aarch32/disasm-aarch32.h"
44 #include "aarch32/macro-assembler-aarch32.h"
45
46 #define __ masm.
47 #define BUF_SIZE (4096)
48
49 #ifdef VIXL_INCLUDE_SIMULATOR_AARCH32
50 // Run tests with the simulator.
51
52 #define SETUP() MacroAssembler masm(BUF_SIZE)
53
54 #define START() masm.GetBuffer()->Reset()
55
56 #define END() \
57 __ Hlt(0); \
58 __ FinalizeCode();
59
60 // TODO: Run the tests in the simulator.
61 #define RUN()
62
63 #else // ifdef VIXL_INCLUDE_SIMULATOR_AARCH32.
64
65 #define SETUP() \
66 MacroAssembler masm(BUF_SIZE); \
67 UseScratchRegisterScope harness_scratch;
68
69 #define START() \
70 harness_scratch.Open(&masm); \
71 harness_scratch.ExcludeAll(); \
72 masm.GetBuffer()->Reset(); \
73 __ Push(r4); \
74 __ Push(r5); \
75 __ Push(r6); \
76 __ Push(r7); \
77 __ Push(r8); \
78 __ Push(r9); \
79 __ Push(r10); \
80 __ Push(r11); \
81 __ Push(lr); \
82 harness_scratch.Include(ip);
83
84 #define END() \
85 harness_scratch.Exclude(ip); \
86 __ Pop(lr); \
87 __ Pop(r11); \
88 __ Pop(r10); \
89 __ Pop(r9); \
90 __ Pop(r8); \
91 __ Pop(r7); \
92 __ Pop(r6); \
93 __ Pop(r5); \
94 __ Pop(r4); \
95 __ Bx(lr); \
96 __ FinalizeCode(); \
97 harness_scratch.Close();
98
99 #define RUN() \
100 { \
101 int pcs_offset = masm.IsUsingT32() ? 1 : 0; \
102 masm.GetBuffer()->SetExecutable(); \
103 ExecuteMemory(masm.GetBuffer()->GetStartAddress<byte*>(), \
104 masm.GetSizeOfCodeGenerated(), \
105 pcs_offset); \
106 masm.GetBuffer()->SetWritable(); \
107 }
108
109 #endif // ifdef VIXL_INCLUDE_SIMULATOR_AARCH32
110
111 namespace vixl {
112 namespace aarch32 {
113
114 // List of instruction encodings:
115 #define FOREACH_INSTRUCTION(M) \
116 M(Adc) \
117 M(Adcs) \
118 M(Add) \
119 M(Adds) \
120 M(And) \
121 M(Ands) \
122 M(Bic) \
123 M(Bics) \
124 M(Eor) \
125 M(Eors) \
126 M(Orn) \
127 M(Orns) \
128 M(Orr) \
129 M(Orrs) \
130 M(Rsb) \
131 M(Rsbs) \
132 M(Sbc) \
133 M(Sbcs) \
134 M(Sub) \
135 M(Subs)
136
137
138 // The following definitions are defined again in each generated test, therefore
139 // we need to place them in an anomymous namespace. It expresses that they are
140 // local to this file only, and the compiler is not allowed to share these types
141 // across test files during template instantiation. Specifically, `Operands` and
142 // `Inputs` have various layouts across generated tests so they absolutely
143 // cannot be shared.
144
145 #ifdef VIXL_INCLUDE_TARGET_T32
146 namespace {
147
148 // Values to be passed to the assembler to produce the instruction under test.
149 struct Operands {
150 Condition cond;
151 Register rd;
152 Register rn;
153 Register rm;
154 ShiftType shift;
155 uint32_t amount;
156 };
157
158 // Input data to feed to the instruction.
159 struct Inputs {
160 uint32_t apsr;
161 uint32_t rd;
162 uint32_t rn;
163 uint32_t rm;
164 };
165
166 // This structure contains all input data needed to test one specific encoding.
167 // It used to generate a loop over an instruction.
168 struct TestLoopData {
169 // The `operands` fields represents the values to pass to the assembler to
170 // produce the instruction.
171 Operands operands;
172 // Description of the operands, used for error reporting.
173 const char* operands_description;
174 // Unique identifier, used for generating traces.
175 const char* identifier;
176 // Array of values to be fed to the instruction.
177 size_t input_size;
178 const Inputs* inputs;
179 };
180
181 static const Inputs kCondition[] =
182 {{NFlag, 0xabababab, 0xabababab, 0xabababab},
183 {ZFlag, 0xabababab, 0xabababab, 0xabababab},
184 {CFlag, 0xabababab, 0xabababab, 0xabababab},
185 {VFlag, 0xabababab, 0xabababab, 0xabababab},
186 {NZFlag, 0xabababab, 0xabababab, 0xabababab},
187 {NCFlag, 0xabababab, 0xabababab, 0xabababab},
188 {NVFlag, 0xabababab, 0xabababab, 0xabababab},
189 {ZCFlag, 0xabababab, 0xabababab, 0xabababab},
190 {ZVFlag, 0xabababab, 0xabababab, 0xabababab},
191 {CVFlag, 0xabababab, 0xabababab, 0xabababab},
192 {NZCFlag, 0xabababab, 0xabababab, 0xabababab},
193 {NZVFlag, 0xabababab, 0xabababab, 0xabababab},
194 {NCVFlag, 0xabababab, 0xabababab, 0xabababab},
195 {ZCVFlag, 0xabababab, 0xabababab, 0xabababab},
196 {NZCVFlag, 0xabababab, 0xabababab, 0xabababab}};
197
198 static const Inputs kRdIsRn[] = {{NoFlag, 0xffffff83, 0xffffff83, 0xffff8002},
199 {NoFlag, 0x0000007e, 0x0000007e, 0x7fffffff},
200 {NoFlag, 0x0000007d, 0x0000007d, 0xffffffe0},
201 {NoFlag, 0x7fffffff, 0x7fffffff, 0x00000002},
202 {NoFlag, 0xffff8002, 0xffff8002, 0xfffffffd},
203 {NoFlag, 0xffffffe0, 0xffffffe0, 0x00007fff},
204 {NoFlag, 0xffff8000, 0xffff8000, 0xffffff83},
205 {NoFlag, 0xffff8002, 0xffff8002, 0x80000001},
206 {NoFlag, 0x00007ffd, 0x00007ffd, 0xffff8003},
207 {NoFlag, 0x00007fff, 0x00007fff, 0xffffffff},
208 {NoFlag, 0x00000000, 0x00000000, 0xffffff80},
209 {NoFlag, 0xffff8001, 0xffff8001, 0x33333333},
210 {NoFlag, 0xffffff80, 0xffffff80, 0x0000007e},
211 {NoFlag, 0x0000007e, 0x0000007e, 0x7ffffffd},
212 {NoFlag, 0xffffff80, 0xffffff80, 0xfffffffd},
213 {NoFlag, 0x00000020, 0x00000020, 0xffff8002},
214 {NoFlag, 0xffffff80, 0xffffff80, 0xfffffffe},
215 {NoFlag, 0x00000002, 0x00000002, 0x00000000},
216 {NoFlag, 0x0000007e, 0x0000007e, 0x00000001},
217 {NoFlag, 0x00000002, 0x00000002, 0x0000007f},
218 {NoFlag, 0x80000000, 0x80000000, 0x80000000},
219 {NoFlag, 0x7fffffff, 0x7fffffff, 0xffffff80},
220 {NoFlag, 0x00000001, 0x00000001, 0xfffffffe},
221 {NoFlag, 0x33333333, 0x33333333, 0x0000007d},
222 {NoFlag, 0x00000001, 0x00000001, 0x7ffffffe},
223 {NoFlag, 0x00007ffe, 0x00007ffe, 0x7fffffff},
224 {NoFlag, 0x80000000, 0x80000000, 0xffffff83},
225 {NoFlag, 0x00000000, 0x00000000, 0x7ffffffe},
226 {NoFlag, 0x00000000, 0x00000000, 0x0000007f},
227 {NoFlag, 0x7fffffff, 0x7fffffff, 0xcccccccc},
228 {NoFlag, 0xffffff82, 0xffffff82, 0x00000002},
229 {NoFlag, 0x7ffffffd, 0x7ffffffd, 0xaaaaaaaa},
230 {NoFlag, 0xcccccccc, 0xcccccccc, 0xffff8001},
231 {NoFlag, 0xfffffffe, 0xfffffffe, 0xffff8001},
232 {NoFlag, 0x7fffffff, 0x7fffffff, 0x00000020},
233 {NoFlag, 0xffffffe0, 0xffffffe0, 0x00007ffe},
234 {NoFlag, 0x80000001, 0x80000001, 0xffff8000},
235 {NoFlag, 0xffffff82, 0xffffff82, 0x0000007d},
236 {NoFlag, 0x0000007e, 0x0000007e, 0x7ffffffe},
237 {NoFlag, 0x00007ffd, 0x00007ffd, 0xffffff80},
238 {NoFlag, 0x0000007d, 0x0000007d, 0x0000007e},
239 {NoFlag, 0xffff8002, 0xffff8002, 0x7fffffff},
240 {NoFlag, 0xffffffe0, 0xffffffe0, 0x0000007f},
241 {NoFlag, 0x00007ffe, 0x00007ffe, 0xffffff81},
242 {NoFlag, 0x80000000, 0x80000000, 0x0000007e},
243 {NoFlag, 0xffffffff, 0xffffffff, 0xaaaaaaaa},
244 {NoFlag, 0xfffffffe, 0xfffffffe, 0x00000020},
245 {NoFlag, 0xffffff82, 0xffffff82, 0xffff8003},
246 {NoFlag, 0x7ffffffd, 0x7ffffffd, 0xffff8002},
247 {NoFlag, 0x7ffffffe, 0x7ffffffe, 0x00000000},
248 {NoFlag, 0xfffffffd, 0xfffffffd, 0xffffffe0},
249 {NoFlag, 0xffff8000, 0xffff8000, 0xffff8002},
250 {NoFlag, 0xffffff82, 0xffffff82, 0x7ffffffd},
251 {NoFlag, 0xcccccccc, 0xcccccccc, 0x80000000},
252 {NoFlag, 0x80000001, 0x80000001, 0x33333333},
253 {NoFlag, 0x00000001, 0x00000001, 0x00000002},
254 {NoFlag, 0x55555555, 0x55555555, 0x0000007f},
255 {NoFlag, 0xffffffff, 0xffffffff, 0xfffffffd},
256 {NoFlag, 0xffffff80, 0xffffff80, 0x80000000},
257 {NoFlag, 0x00000000, 0x00000000, 0x00000020},
258 {NoFlag, 0xfffffffe, 0xfffffffe, 0xffff8003},
259 {NoFlag, 0xffff8001, 0xffff8001, 0xffff8000},
260 {NoFlag, 0x55555555, 0x55555555, 0x55555555},
261 {NoFlag, 0x00007fff, 0x00007fff, 0xffff8000},
262 {NoFlag, 0x7fffffff, 0x7fffffff, 0xffffffe0},
263 {NoFlag, 0x00000001, 0x00000001, 0x55555555},
264 {NoFlag, 0x33333333, 0x33333333, 0x7ffffffe},
265 {NoFlag, 0x80000000, 0x80000000, 0xffffffe0},
266 {NoFlag, 0xffffff83, 0xffffff83, 0x0000007d},
267 {NoFlag, 0xffff8003, 0xffff8003, 0x00000002},
268 {NoFlag, 0x7ffffffe, 0x7ffffffe, 0xffffff81},
269 {NoFlag, 0xfffffffe, 0xfffffffe, 0xffffff80},
270 {NoFlag, 0x00007ffe, 0x00007ffe, 0xffff8002},
271 {NoFlag, 0x80000001, 0x80000001, 0xfffffffe},
272 {NoFlag, 0x7ffffffd, 0x7ffffffd, 0xfffffffd},
273 {NoFlag, 0x7ffffffd, 0x7ffffffd, 0xfffffffe},
274 {NoFlag, 0x7ffffffe, 0x7ffffffe, 0xffffff83},
275 {NoFlag, 0xfffffffd, 0xfffffffd, 0x00007ffe},
276 {NoFlag, 0x7fffffff, 0x7fffffff, 0x80000000},
277 {NoFlag, 0xffffff82, 0xffffff82, 0x7fffffff},
278 {NoFlag, 0xffffffe0, 0xffffffe0, 0xffffff83},
279 {NoFlag, 0xffff8000, 0xffff8000, 0xffff8000},
280 {NoFlag, 0x00000001, 0x00000001, 0x7fffffff},
281 {NoFlag, 0xfffffffe, 0xfffffffe, 0xffffffff},
282 {NoFlag, 0xffffff82, 0xffffff82, 0xffffffff},
283 {NoFlag, 0xffffffff, 0xffffffff, 0xfffffffe},
284 {NoFlag, 0xaaaaaaaa, 0xaaaaaaaa, 0x0000007d},
285 {NoFlag, 0xffff8001, 0xffff8001, 0xfffffffe},
286 {NoFlag, 0x00007ffe, 0x00007ffe, 0x0000007d},
287 {NoFlag, 0xffffff82, 0xffffff82, 0xfffffffe},
288 {NoFlag, 0x00000000, 0x00000000, 0x00007ffd},
289 {NoFlag, 0xaaaaaaaa, 0xaaaaaaaa, 0xffff8002},
290 {NoFlag, 0x0000007f, 0x0000007f, 0xffffff82},
291 {NoFlag, 0x00007fff, 0x00007fff, 0x33333333},
292 {NoFlag, 0xfffffffd, 0xfffffffd, 0x80000000},
293 {NoFlag, 0x00000000, 0x00000000, 0xfffffffd},
294 {NoFlag, 0x0000007d, 0x0000007d, 0x0000007f},
295 {NoFlag, 0xfffffffd, 0xfffffffd, 0x0000007e},
296 {NoFlag, 0xffffffe0, 0xffffffe0, 0x55555555},
297 {NoFlag, 0xffffffff, 0xffffffff, 0x80000000},
298 {NoFlag, 0xffffffe0, 0xffffffe0, 0x0000007e},
299 {NoFlag, 0xffffff81, 0xffffff81, 0x00007ffd},
300 {NoFlag, 0x00000020, 0x00000020, 0xffff8001},
301 {NoFlag, 0x00007fff, 0x00007fff, 0xffffff83},
302 {NoFlag, 0x33333333, 0x33333333, 0x00000000},
303 {NoFlag, 0xffff8000, 0xffff8000, 0xffffff82},
304 {NoFlag, 0xffff8001, 0xffff8001, 0x0000007e},
305 {NoFlag, 0xffffff80, 0xffffff80, 0x00000001},
306 {NoFlag, 0x80000000, 0x80000000, 0xcccccccc},
307 {NoFlag, 0x00000002, 0x00000002, 0x00007ffd},
308 {NoFlag, 0x7ffffffe, 0x7ffffffe, 0x80000001},
309 {NoFlag, 0x00000020, 0x00000020, 0x00007ffe},
310 {NoFlag, 0xffff8000, 0xffff8000, 0xfffffffd},
311 {NoFlag, 0x7fffffff, 0x7fffffff, 0xffff8001},
312 {NoFlag, 0x00000000, 0x00000000, 0xffffff83},
313 {NoFlag, 0x0000007f, 0x0000007f, 0x00000020},
314 {NoFlag, 0x80000001, 0x80000001, 0xffff8003},
315 {NoFlag, 0xffff8001, 0xffff8001, 0x0000007f},
316 {NoFlag, 0x0000007f, 0x0000007f, 0x80000001},
317 {NoFlag, 0x00000002, 0x00000002, 0x7ffffffe},
318 {NoFlag, 0xffffff82, 0xffffff82, 0xffffff83},
319 {NoFlag, 0x00007ffd, 0x00007ffd, 0x7fffffff},
320 {NoFlag, 0x7ffffffe, 0x7ffffffe, 0xfffffffe},
321 {NoFlag, 0xffffff82, 0xffffff82, 0xffff8000},
322 {NoFlag, 0xfffffffe, 0xfffffffe, 0xffff8000},
323 {NoFlag, 0xffff8002, 0xffff8002, 0xffffff81},
324 {NoFlag, 0x33333333, 0x33333333, 0x7fffffff},
325 {NoFlag, 0x80000001, 0x80000001, 0x00007fff},
326 {NoFlag, 0xffff8002, 0xffff8002, 0xcccccccc},
327 {NoFlag, 0xffffffff, 0xffffffff, 0x00000002},
328 {NoFlag, 0x33333333, 0x33333333, 0xffffff81},
329 {NoFlag, 0xfffffffd, 0xfffffffd, 0xffffff80},
330 {NoFlag, 0x55555555, 0x55555555, 0xaaaaaaaa},
331 {NoFlag, 0x33333333, 0x33333333, 0xffffff82},
332 {NoFlag, 0xffffff80, 0xffffff80, 0xaaaaaaaa},
333 {NoFlag, 0x0000007e, 0x0000007e, 0x00000020},
334 {NoFlag, 0xffffff83, 0xffffff83, 0x00007ffd},
335 {NoFlag, 0xffffff82, 0xffffff82, 0xaaaaaaaa},
336 {NoFlag, 0xffff8003, 0xffff8003, 0xffffffff},
337 {NoFlag, 0xaaaaaaaa, 0xaaaaaaaa, 0xfffffffe},
338 {NoFlag, 0xaaaaaaaa, 0xaaaaaaaa, 0x00000000},
339 {NoFlag, 0xaaaaaaaa, 0xaaaaaaaa, 0x0000007f},
340 {NoFlag, 0x0000007f, 0x0000007f, 0x0000007d},
341 {NoFlag, 0xfffffffd, 0xfffffffd, 0x55555555},
342 {NoFlag, 0xffffffff, 0xffffffff, 0x00000020},
343 {NoFlag, 0x00007ffe, 0x00007ffe, 0xffffff83},
344 {NoFlag, 0x7fffffff, 0x7fffffff, 0x55555555},
345 {NoFlag, 0x55555555, 0x55555555, 0xcccccccc},
346 {NoFlag, 0xffffffe0, 0xffffffe0, 0xffff8003},
347 {NoFlag, 0x7ffffffe, 0x7ffffffe, 0x00007ffe},
348 {NoFlag, 0x00007ffd, 0x00007ffd, 0xffff8002},
349 {NoFlag, 0x00007ffd, 0x00007ffd, 0x00000001},
350 {NoFlag, 0x00000000, 0x00000000, 0x00007ffe},
351 {NoFlag, 0xffffff80, 0xffffff80, 0x00000020},
352 {NoFlag, 0xffff8000, 0xffff8000, 0x0000007d},
353 {NoFlag, 0xffff8003, 0xffff8003, 0x00000000},
354 {NoFlag, 0x0000007e, 0x0000007e, 0x80000000},
355 {NoFlag, 0xfffffffd, 0xfffffffd, 0x00000000},
356 {NoFlag, 0xffffff80, 0xffffff80, 0xffffffff},
357 {NoFlag, 0xcccccccc, 0xcccccccc, 0x0000007f},
358 {NoFlag, 0x7ffffffd, 0x7ffffffd, 0x00000000},
359 {NoFlag, 0x00007fff, 0x00007fff, 0x00000000},
360 {NoFlag, 0x0000007f, 0x0000007f, 0x00000001},
361 {NoFlag, 0xffffffff, 0xffffffff, 0xffffff82},
362 {NoFlag, 0x00007ffe, 0x00007ffe, 0x00007ffd},
363 {NoFlag, 0xaaaaaaaa, 0xaaaaaaaa, 0x33333333},
364 {NoFlag, 0xffffff82, 0xffffff82, 0x55555555},
365 {NoFlag, 0xffff8003, 0xffff8003, 0x0000007e},
366 {NoFlag, 0xffffff83, 0xffffff83, 0x00000002},
367 {NoFlag, 0xffffff82, 0xffffff82, 0x33333333},
368 {NoFlag, 0x55555555, 0x55555555, 0xffffffff},
369 {NoFlag, 0xaaaaaaaa, 0xaaaaaaaa, 0x80000001},
370 {NoFlag, 0xffffff83, 0xffffff83, 0xffffffe0},
371 {NoFlag, 0x00000001, 0x00000001, 0xffffffe0},
372 {NoFlag, 0x33333333, 0x33333333, 0x33333333},
373 {NoFlag, 0x55555555, 0x55555555, 0x00000001},
374 {NoFlag, 0xffffff83, 0xffffff83, 0x00007fff},
375 {NoFlag, 0x00000002, 0x00000002, 0xfffffffd},
376 {NoFlag, 0xffffffe0, 0xffffffe0, 0xffff8002},
377 {NoFlag, 0x80000000, 0x80000000, 0x00007ffd},
378 {NoFlag, 0xffffff83, 0xffffff83, 0xfffffffe},
379 {NoFlag, 0x80000001, 0x80000001, 0xffffffff},
380 {NoFlag, 0xffff8003, 0xffff8003, 0x00000020},
381 {NoFlag, 0xffffff82, 0xffffff82, 0xcccccccc},
382 {NoFlag, 0x00000020, 0x00000020, 0x7fffffff},
383 {NoFlag, 0xffffff80, 0xffffff80, 0x55555555},
384 {NoFlag, 0x00000001, 0x00000001, 0x00000020},
385 {NoFlag, 0xffff8001, 0xffff8001, 0x00007fff},
386 {NoFlag, 0x00000020, 0x00000020, 0xaaaaaaaa},
387 {NoFlag, 0x55555555, 0x55555555, 0x7fffffff},
388 {NoFlag, 0xfffffffe, 0xfffffffe, 0x7fffffff},
389 {NoFlag, 0x00007fff, 0x00007fff, 0x55555555},
390 {NoFlag, 0x55555555, 0x55555555, 0x0000007d},
391 {NoFlag, 0xcccccccc, 0xcccccccc, 0x7ffffffe},
392 {NoFlag, 0xffff8002, 0xffff8002, 0x00007ffe},
393 {NoFlag, 0xfffffffe, 0xfffffffe, 0xffffff81},
394 {NoFlag, 0xffffff81, 0xffffff81, 0x0000007d},
395 {NoFlag, 0x00000020, 0x00000020, 0x0000007e},
396 {NoFlag, 0xffffffff, 0xffffffff, 0x00007ffe},
397 {NoFlag, 0xffff8002, 0xffff8002, 0x0000007e}};
398
399 static const Inputs kRdIsRm[] = {{NoFlag, 0x55555555, 0x7ffffffe, 0x55555555},
400 {NoFlag, 0xfffffffe, 0x00000001, 0xfffffffe},
401 {NoFlag, 0xffffff82, 0xffffff82, 0xffffff82},
402 {NoFlag, 0xffff8000, 0xffff8003, 0xffff8000},
403 {NoFlag, 0x00000001, 0x00000000, 0x00000001},
404 {NoFlag, 0xffffff81, 0x00007fff, 0xffffff81},
405 {NoFlag, 0x0000007d, 0xffff8002, 0x0000007d},
406 {NoFlag, 0x80000000, 0xffff8000, 0x80000000},
407 {NoFlag, 0xffffff80, 0x00000020, 0xffffff80},
408 {NoFlag, 0x55555555, 0xffffff81, 0x55555555},
409 {NoFlag, 0x00007ffd, 0xffffff82, 0x00007ffd},
410 {NoFlag, 0x55555555, 0x00007fff, 0x55555555},
411 {NoFlag, 0x7ffffffd, 0xffff8000, 0x7ffffffd},
412 {NoFlag, 0xffffffff, 0xffffff83, 0xffffffff},
413 {NoFlag, 0x00000000, 0xffffffff, 0x00000000},
414 {NoFlag, 0xffff8002, 0x33333333, 0xffff8002},
415 {NoFlag, 0x00007ffd, 0xaaaaaaaa, 0x00007ffd},
416 {NoFlag, 0x55555555, 0xffff8000, 0x55555555},
417 {NoFlag, 0x80000001, 0xffffffff, 0x80000001},
418 {NoFlag, 0x0000007d, 0xffffff83, 0x0000007d},
419 {NoFlag, 0x0000007e, 0xffffff82, 0x0000007e},
420 {NoFlag, 0xcccccccc, 0x0000007d, 0xcccccccc},
421 {NoFlag, 0xffff8002, 0xffffffff, 0xffff8002},
422 {NoFlag, 0xffffff81, 0x0000007f, 0xffffff81},
423 {NoFlag, 0xffff8000, 0xffffff83, 0xffff8000},
424 {NoFlag, 0xffffffff, 0xffffffe0, 0xffffffff},
425 {NoFlag, 0xfffffffd, 0x80000001, 0xfffffffd},
426 {NoFlag, 0x55555555, 0x80000000, 0x55555555},
427 {NoFlag, 0xffff8000, 0x0000007d, 0xffff8000},
428 {NoFlag, 0xaaaaaaaa, 0xffff8003, 0xaaaaaaaa},
429 {NoFlag, 0x00000001, 0x00007ffd, 0x00000001},
430 {NoFlag, 0x0000007e, 0x7ffffffe, 0x0000007e},
431 {NoFlag, 0x00000020, 0x00007ffd, 0x00000020},
432 {NoFlag, 0xffffff81, 0x7ffffffd, 0xffffff81},
433 {NoFlag, 0xffffff83, 0x0000007f, 0xffffff83},
434 {NoFlag, 0x00000001, 0x0000007e, 0x00000001},
435 {NoFlag, 0xffffff82, 0xfffffffd, 0xffffff82},
436 {NoFlag, 0xffff8003, 0x7ffffffe, 0xffff8003},
437 {NoFlag, 0x00000002, 0x00000002, 0x00000002},
438 {NoFlag, 0xffffff83, 0xffff8001, 0xffffff83},
439 {NoFlag, 0xffff8002, 0xfffffffe, 0xffff8002},
440 {NoFlag, 0xffffff80, 0xffffff81, 0xffffff80},
441 {NoFlag, 0x7fffffff, 0xffffff81, 0x7fffffff},
442 {NoFlag, 0x00000020, 0xffffff81, 0x00000020},
443 {NoFlag, 0x0000007f, 0xffffffff, 0x0000007f},
444 {NoFlag, 0x0000007d, 0xcccccccc, 0x0000007d},
445 {NoFlag, 0x00007fff, 0x55555555, 0x00007fff},
446 {NoFlag, 0xffff8003, 0x00007ffd, 0xffff8003},
447 {NoFlag, 0x80000001, 0x80000001, 0x80000001},
448 {NoFlag, 0xffffffff, 0xfffffffd, 0xffffffff},
449 {NoFlag, 0xffff8000, 0xfffffffe, 0xffff8000},
450 {NoFlag, 0xcccccccc, 0x0000007f, 0xcccccccc},
451 {NoFlag, 0x00000001, 0x00000002, 0x00000001},
452 {NoFlag, 0xffffff82, 0xffffff81, 0xffffff82},
453 {NoFlag, 0xfffffffd, 0x00007ffd, 0xfffffffd},
454 {NoFlag, 0x80000001, 0x33333333, 0x80000001},
455 {NoFlag, 0xffffff82, 0xffff8002, 0xffffff82},
456 {NoFlag, 0xffff8003, 0xfffffffd, 0xffff8003},
457 {NoFlag, 0xffffff81, 0x00000020, 0xffffff81},
458 {NoFlag, 0xffff8001, 0xffff8003, 0xffff8001},
459 {NoFlag, 0x00000001, 0x80000001, 0x00000001},
460 {NoFlag, 0xfffffffd, 0x00000002, 0xfffffffd},
461 {NoFlag, 0xffff8003, 0x7ffffffd, 0xffff8003},
462 {NoFlag, 0x0000007e, 0xaaaaaaaa, 0x0000007e},
463 {NoFlag, 0x7ffffffe, 0x7fffffff, 0x7ffffffe},
464 {NoFlag, 0x00007ffd, 0x00007ffe, 0x00007ffd},
465 {NoFlag, 0x00007fff, 0x80000001, 0x00007fff},
466 {NoFlag, 0x00007fff, 0xfffffffe, 0x00007fff},
467 {NoFlag, 0x00000001, 0xffffff80, 0x00000001},
468 {NoFlag, 0x55555555, 0xcccccccc, 0x55555555},
469 {NoFlag, 0x7ffffffd, 0xffffffe0, 0x7ffffffd},
470 {NoFlag, 0xffffff81, 0xfffffffe, 0xffffff81},
471 {NoFlag, 0xffffff82, 0x00007ffe, 0xffffff82},
472 {NoFlag, 0xffffff82, 0x80000001, 0xffffff82},
473 {NoFlag, 0x0000007f, 0xffff8001, 0x0000007f},
474 {NoFlag, 0x7ffffffd, 0xffffff83, 0x7ffffffd},
475 {NoFlag, 0xffffff82, 0xcccccccc, 0xffffff82},
476 {NoFlag, 0x00000020, 0xffffff83, 0x00000020},
477 {NoFlag, 0x00007ffe, 0x80000000, 0x00007ffe},
478 {NoFlag, 0x0000007f, 0xffff8000, 0x0000007f},
479 {NoFlag, 0xffffff82, 0x33333333, 0xffffff82},
480 {NoFlag, 0x7ffffffd, 0x7ffffffd, 0x7ffffffd},
481 {NoFlag, 0xffffff80, 0xffff8001, 0xffffff80},
482 {NoFlag, 0x00000002, 0xaaaaaaaa, 0x00000002},
483 {NoFlag, 0xffffffff, 0x7fffffff, 0xffffffff},
484 {NoFlag, 0xfffffffd, 0xfffffffe, 0xfffffffd},
485 {NoFlag, 0x00000020, 0x00000001, 0x00000020},
486 {NoFlag, 0x55555555, 0x00000001, 0x55555555},
487 {NoFlag, 0x55555555, 0xffffff80, 0x55555555},
488 {NoFlag, 0xffffffff, 0x00007fff, 0xffffffff},
489 {NoFlag, 0x00000020, 0xaaaaaaaa, 0x00000020},
490 {NoFlag, 0x00000002, 0x00007ffe, 0x00000002},
491 {NoFlag, 0x00000001, 0xcccccccc, 0x00000001},
492 {NoFlag, 0xffff8001, 0x00000000, 0xffff8001},
493 {NoFlag, 0x00000001, 0xffff8000, 0x00000001},
494 {NoFlag, 0xffffffe0, 0x00007fff, 0xffffffe0},
495 {NoFlag, 0xfffffffe, 0x00007fff, 0xfffffffe},
496 {NoFlag, 0xffffff83, 0x00000001, 0xffffff83},
497 {NoFlag, 0x00007fff, 0xffff8002, 0x00007fff},
498 {NoFlag, 0x7ffffffd, 0x7ffffffe, 0x7ffffffd},
499 {NoFlag, 0x80000001, 0xaaaaaaaa, 0x80000001},
500 {NoFlag, 0x80000001, 0xcccccccc, 0x80000001},
501 {NoFlag, 0x00007ffe, 0xffffffe0, 0x00007ffe},
502 {NoFlag, 0x00007ffe, 0xfffffffd, 0x00007ffe},
503 {NoFlag, 0x55555555, 0xaaaaaaaa, 0x55555555},
504 {NoFlag, 0xffffffe0, 0x00000001, 0xffffffe0},
505 {NoFlag, 0x0000007e, 0x00007fff, 0x0000007e},
506 {NoFlag, 0xfffffffe, 0xfffffffd, 0xfffffffe},
507 {NoFlag, 0x33333333, 0x0000007d, 0x33333333},
508 {NoFlag, 0xffffff81, 0x7fffffff, 0xffffff81},
509 {NoFlag, 0x0000007e, 0x0000007d, 0x0000007e},
510 {NoFlag, 0x00000001, 0xffffff81, 0x00000001},
511 {NoFlag, 0x80000000, 0x00000002, 0x80000000},
512 {NoFlag, 0x0000007d, 0xffff8003, 0x0000007d},
513 {NoFlag, 0x7ffffffe, 0x00007ffd, 0x7ffffffe},
514 {NoFlag, 0x7ffffffe, 0xaaaaaaaa, 0x7ffffffe},
515 {NoFlag, 0x00000000, 0xffff8000, 0x00000000},
516 {NoFlag, 0x33333333, 0x00000002, 0x33333333},
517 {NoFlag, 0xffffff81, 0xffffff83, 0xffffff81},
518 {NoFlag, 0x7ffffffe, 0x00007ffe, 0x7ffffffe},
519 {NoFlag, 0x80000000, 0x0000007d, 0x80000000},
520 {NoFlag, 0x00000020, 0x00000002, 0x00000020},
521 {NoFlag, 0x33333333, 0x80000001, 0x33333333},
522 {NoFlag, 0xffffff83, 0x00007ffd, 0xffffff83},
523 {NoFlag, 0x00007ffd, 0xffffff83, 0x00007ffd},
524 {NoFlag, 0xffff8001, 0x80000000, 0xffff8001},
525 {NoFlag, 0x00000000, 0x80000000, 0x00000000},
526 {NoFlag, 0xffffffe0, 0xffffffff, 0xffffffe0},
527 {NoFlag, 0x80000000, 0xffffff83, 0x80000000},
528 {NoFlag, 0x00000020, 0xffffff80, 0x00000020},
529 {NoFlag, 0x7ffffffd, 0xffff8001, 0x7ffffffd},
530 {NoFlag, 0x80000001, 0xffff8003, 0x80000001},
531 {NoFlag, 0x00007ffe, 0x7fffffff, 0x00007ffe},
532 {NoFlag, 0x7fffffff, 0x00000002, 0x7fffffff},
533 {NoFlag, 0xffffff83, 0xffff8003, 0xffffff83},
534 {NoFlag, 0xaaaaaaaa, 0xcccccccc, 0xaaaaaaaa},
535 {NoFlag, 0x0000007f, 0xffffff80, 0x0000007f},
536 {NoFlag, 0x80000001, 0x00007ffd, 0x80000001},
537 {NoFlag, 0xffff8000, 0x80000001, 0xffff8000},
538 {NoFlag, 0x00007fff, 0x00007ffd, 0x00007fff},
539 {NoFlag, 0x0000007e, 0x0000007f, 0x0000007e},
540 {NoFlag, 0x00000002, 0x0000007d, 0x00000002},
541 {NoFlag, 0x80000001, 0x7fffffff, 0x80000001},
542 {NoFlag, 0x0000007e, 0xffffff81, 0x0000007e},
543 {NoFlag, 0x7ffffffe, 0xffff8001, 0x7ffffffe},
544 {NoFlag, 0x7fffffff, 0x80000001, 0x7fffffff},
545 {NoFlag, 0x7ffffffd, 0x0000007f, 0x7ffffffd},
546 {NoFlag, 0xffffff81, 0xffffff81, 0xffffff81},
547 {NoFlag, 0x00000001, 0xfffffffd, 0x00000001},
548 {NoFlag, 0x00000001, 0xffffffff, 0x00000001},
549 {NoFlag, 0x7ffffffd, 0x55555555, 0x7ffffffd},
550 {NoFlag, 0x55555555, 0x0000007f, 0x55555555},
551 {NoFlag, 0x55555555, 0xffff8003, 0x55555555},
552 {NoFlag, 0xaaaaaaaa, 0x00007ffd, 0xaaaaaaaa},
553 {NoFlag, 0x0000007e, 0x33333333, 0x0000007e},
554 {NoFlag, 0xfffffffe, 0x80000001, 0xfffffffe},
555 {NoFlag, 0xfffffffe, 0xffff8000, 0xfffffffe},
556 {NoFlag, 0xffffffe0, 0xffffff81, 0xffffffe0},
557 {NoFlag, 0x7fffffff, 0x0000007f, 0x7fffffff},
558 {NoFlag, 0xffff8003, 0x0000007f, 0xffff8003},
559 {NoFlag, 0xffffff82, 0x00007ffd, 0xffffff82},
560 {NoFlag, 0x33333333, 0xffffffff, 0x33333333},
561 {NoFlag, 0xffffffe0, 0xcccccccc, 0xffffffe0},
562 {NoFlag, 0xffffff83, 0x7ffffffd, 0xffffff83},
563 {NoFlag, 0x0000007e, 0xcccccccc, 0x0000007e},
564 {NoFlag, 0x00000002, 0xfffffffd, 0x00000002},
565 {NoFlag, 0x00007fff, 0xcccccccc, 0x00007fff},
566 {NoFlag, 0x7fffffff, 0x00007fff, 0x7fffffff},
567 {NoFlag, 0xffffffe0, 0x33333333, 0xffffffe0},
568 {NoFlag, 0x0000007f, 0x0000007d, 0x0000007f},
569 {NoFlag, 0x0000007f, 0xffffffe0, 0x0000007f},
570 {NoFlag, 0x00007fff, 0xffff8000, 0x00007fff},
571 {NoFlag, 0x7fffffff, 0xffffffff, 0x7fffffff},
572 {NoFlag, 0xffff8000, 0x7ffffffd, 0xffff8000},
573 {NoFlag, 0xcccccccc, 0x0000007e, 0xcccccccc},
574 {NoFlag, 0x33333333, 0xffff8003, 0x33333333},
575 {NoFlag, 0x55555555, 0x00000002, 0x55555555},
576 {NoFlag, 0x00000001, 0x00000001, 0x00000001},
577 {NoFlag, 0xaaaaaaaa, 0x33333333, 0xaaaaaaaa},
578 {NoFlag, 0x7ffffffd, 0x00000001, 0x7ffffffd},
579 {NoFlag, 0xffffff82, 0xffff8000, 0xffffff82},
580 {NoFlag, 0x0000007d, 0x55555555, 0x0000007d},
581 {NoFlag, 0xffff8000, 0x7ffffffe, 0xffff8000},
582 {NoFlag, 0x7fffffff, 0xffffffe0, 0x7fffffff},
583 {NoFlag, 0x7fffffff, 0xffff8003, 0x7fffffff},
584 {NoFlag, 0xffffff82, 0xaaaaaaaa, 0xffffff82},
585 {NoFlag, 0xfffffffd, 0xffffff80, 0xfffffffd},
586 {NoFlag, 0x7ffffffd, 0x80000001, 0x7ffffffd},
587 {NoFlag, 0x00000000, 0x00007ffd, 0x00000000},
588 {NoFlag, 0xffffffff, 0xffffff80, 0xffffffff},
589 {NoFlag, 0xffffff80, 0xcccccccc, 0xffffff80},
590 {NoFlag, 0x00007ffe, 0x55555555, 0x00007ffe},
591 {NoFlag, 0xffff8000, 0xffff8000, 0xffff8000},
592 {NoFlag, 0xffffffff, 0xffff8000, 0xffffffff},
593 {NoFlag, 0x80000001, 0x0000007d, 0x80000001},
594 {NoFlag, 0xffffffe0, 0xffff8002, 0xffffffe0},
595 {NoFlag, 0xfffffffe, 0xffffffe0, 0xfffffffe},
596 {NoFlag, 0x80000000, 0xffff8003, 0x80000000},
597 {NoFlag, 0x80000001, 0xffffff81, 0x80000001},
598 {NoFlag, 0xffffffe0, 0x00007ffe, 0xffffffe0}};
599
600 static const Inputs kRdIsNotRnIsNotRm[] =
601 {{NoFlag, 0x0000007e, 0x0000007e, 0x0000007d},
602 {NoFlag, 0x55555555, 0x00000002, 0xffff8002},
603 {NoFlag, 0xffffffe0, 0x80000001, 0x00000000},
604 {NoFlag, 0x55555555, 0xffffff83, 0x00000002},
605 {NoFlag, 0xffffffe0, 0xffffffe0, 0x00000002},
606 {NoFlag, 0x00000000, 0x80000001, 0xffffff82},
607 {NoFlag, 0x80000001, 0x00007fff, 0x0000007f},
608 {NoFlag, 0xffffff80, 0x0000007d, 0x7ffffffe},
609 {NoFlag, 0xaaaaaaaa, 0x00000020, 0xffff8002},
610 {NoFlag, 0x33333333, 0x55555555, 0x00000001},
611 {NoFlag, 0x7ffffffe, 0x33333333, 0x00000000},
612 {NoFlag, 0x80000000, 0x7ffffffd, 0x55555555},
613 {NoFlag, 0xcccccccc, 0xffff8001, 0x7ffffffe},
614 {NoFlag, 0x00000020, 0xffffff83, 0xffff8003},
615 {NoFlag, 0x00007fff, 0xffffffe0, 0xffffff81},
616 {NoFlag, 0xffff8000, 0xffff8001, 0x0000007e},
617 {NoFlag, 0x33333333, 0x0000007e, 0x00000020},
618 {NoFlag, 0x0000007f, 0xfffffffd, 0xaaaaaaaa},
619 {NoFlag, 0xffffff83, 0xffffff82, 0x7ffffffd},
620 {NoFlag, 0x0000007e, 0xcccccccc, 0x7fffffff},
621 {NoFlag, 0xffff8001, 0x80000001, 0xffffffff},
622 {NoFlag, 0xffffff81, 0x00000020, 0x7ffffffe},
623 {NoFlag, 0xffffff83, 0xffffff81, 0xffffffe0},
624 {NoFlag, 0xffffffe0, 0xffffff81, 0xfffffffd},
625 {NoFlag, 0x80000001, 0xffffffff, 0xffffffff},
626 {NoFlag, 0x7ffffffe, 0xffff8000, 0xcccccccc},
627 {NoFlag, 0xffffff80, 0x00007ffe, 0xffffff82},
628 {NoFlag, 0x0000007e, 0x0000007d, 0xffff8003},
629 {NoFlag, 0xffff8002, 0xffffff81, 0x0000007e},
630 {NoFlag, 0x00007fff, 0x7ffffffd, 0xfffffffe},
631 {NoFlag, 0x00007ffe, 0x80000001, 0xffffff81},
632 {NoFlag, 0xffffff81, 0x00007ffd, 0xfffffffd},
633 {NoFlag, 0x00000020, 0x7fffffff, 0xffff8003},
634 {NoFlag, 0x0000007e, 0x0000007d, 0x33333333},
635 {NoFlag, 0xcccccccc, 0xffff8000, 0x00007ffe},
636 {NoFlag, 0x00007fff, 0xffff8000, 0x00000020},
637 {NoFlag, 0x00007ffd, 0x00007fff, 0xffffffe0},
638 {NoFlag, 0x7ffffffd, 0x00000000, 0x00007ffe},
639 {NoFlag, 0xffffff82, 0x33333333, 0x00000001},
640 {NoFlag, 0x7ffffffe, 0xffffff80, 0x00000020},
641 {NoFlag, 0x00007fff, 0xffffff83, 0x00007ffd},
642 {NoFlag, 0xffff8001, 0xffffffff, 0x80000001},
643 {NoFlag, 0x00000002, 0xffffff81, 0xcccccccc},
644 {NoFlag, 0x55555555, 0x0000007f, 0xffff8001},
645 {NoFlag, 0x80000000, 0x00000020, 0x80000000},
646 {NoFlag, 0xffffff83, 0x00007fff, 0xffffff80},
647 {NoFlag, 0x33333333, 0x7ffffffe, 0x7ffffffd},
648 {NoFlag, 0xffffff80, 0xffffffff, 0x00000001},
649 {NoFlag, 0x00007ffd, 0x7ffffffd, 0xffffff83},
650 {NoFlag, 0x33333333, 0xffff8001, 0xffffffe0},
651 {NoFlag, 0xffff8001, 0xffffff80, 0x00007ffd},
652 {NoFlag, 0xffffffe0, 0x00007fff, 0x00007ffe},
653 {NoFlag, 0x0000007d, 0x00000000, 0xffff8000},
654 {NoFlag, 0x7ffffffe, 0xaaaaaaaa, 0x7ffffffe},
655 {NoFlag, 0x0000007e, 0x00007ffd, 0xffffffe0},
656 {NoFlag, 0xfffffffd, 0xffffffe0, 0xffffff83},
657 {NoFlag, 0x00000001, 0xffffffe0, 0x7ffffffd},
658 {NoFlag, 0xfffffffd, 0xffff8002, 0x80000000},
659 {NoFlag, 0x00000020, 0xffffffff, 0x80000000},
660 {NoFlag, 0x00000001, 0x80000001, 0xffff8003},
661 {NoFlag, 0xffff8003, 0xaaaaaaaa, 0xffffff81},
662 {NoFlag, 0x0000007f, 0xfffffffd, 0xffffffe0},
663 {NoFlag, 0x00007ffe, 0xffffff80, 0x00007ffe},
664 {NoFlag, 0xffff8002, 0xffff8003, 0xffffffff},
665 {NoFlag, 0x7ffffffe, 0xffffff82, 0xffff8000},
666 {NoFlag, 0xffff8000, 0x00000002, 0x80000000},
667 {NoFlag, 0xffffff80, 0xffffff82, 0xffffff81},
668 {NoFlag, 0x00000000, 0xcccccccc, 0x00007ffd},
669 {NoFlag, 0x55555555, 0x00007ffe, 0x7fffffff},
670 {NoFlag, 0x00000002, 0xffffff81, 0xaaaaaaaa},
671 {NoFlag, 0x00007ffd, 0x0000007e, 0x00000002},
672 {NoFlag, 0xffffff83, 0x0000007e, 0xffffff80},
673 {NoFlag, 0xcccccccc, 0x00007ffe, 0xaaaaaaaa},
674 {NoFlag, 0x7ffffffe, 0x55555555, 0xffff8003},
675 {NoFlag, 0xfffffffd, 0x00000001, 0xffffff80},
676 {NoFlag, 0x00007ffd, 0x55555555, 0x80000001},
677 {NoFlag, 0x0000007f, 0x00000000, 0x0000007e},
678 {NoFlag, 0x7fffffff, 0xaaaaaaaa, 0x00000000},
679 {NoFlag, 0x7ffffffd, 0xffffff81, 0xcccccccc},
680 {NoFlag, 0xffffffe0, 0xcccccccc, 0xfffffffd},
681 {NoFlag, 0x00000002, 0xffff8000, 0x7ffffffd},
682 {NoFlag, 0xffffffe0, 0xffff8000, 0x80000001},
683 {NoFlag, 0x7ffffffd, 0xffff8003, 0xffff8001},
684 {NoFlag, 0x33333333, 0x00007ffd, 0x80000000},
685 {NoFlag, 0x7ffffffd, 0x00007fff, 0xcccccccc},
686 {NoFlag, 0xffffffff, 0xffffff80, 0x00007ffe},
687 {NoFlag, 0xffffff83, 0x7ffffffd, 0xaaaaaaaa},
688 {NoFlag, 0xfffffffd, 0xffff8003, 0x0000007f},
689 {NoFlag, 0xfffffffe, 0xfffffffe, 0xfffffffd},
690 {NoFlag, 0x00007fff, 0xfffffffe, 0x55555555},
691 {NoFlag, 0x7ffffffd, 0xfffffffe, 0xfffffffe},
692 {NoFlag, 0xfffffffe, 0xffffffff, 0x00007fff},
693 {NoFlag, 0x7ffffffd, 0x0000007e, 0x00007ffd},
694 {NoFlag, 0x7ffffffd, 0xffffffe0, 0x00000002},
695 {NoFlag, 0xffffffff, 0x00007ffd, 0xffffff81},
696 {NoFlag, 0xffff8001, 0x00000020, 0xfffffffd},
697 {NoFlag, 0x00007fff, 0x0000007d, 0xffffff83},
698 {NoFlag, 0x00000002, 0x55555555, 0x7ffffffe},
699 {NoFlag, 0x00007fff, 0x00007ffe, 0x00000002},
700 {NoFlag, 0x80000001, 0x7fffffff, 0x00007ffd},
701 {NoFlag, 0x0000007f, 0xffffffff, 0x00000001},
702 {NoFlag, 0xffff8001, 0x33333333, 0xffffff83},
703 {NoFlag, 0x00007fff, 0xcccccccc, 0x33333333},
704 {NoFlag, 0x33333333, 0xffffff80, 0x00000001},
705 {NoFlag, 0x00007fff, 0xcccccccc, 0x00007ffd},
706 {NoFlag, 0xffff8002, 0xfffffffd, 0x7ffffffe},
707 {NoFlag, 0x00007ffe, 0x7ffffffe, 0xffffff83},
708 {NoFlag, 0xffffffe0, 0x0000007f, 0xffff8001},
709 {NoFlag, 0x80000000, 0x00007fff, 0xffffff80},
710 {NoFlag, 0x7fffffff, 0x00007fff, 0x7ffffffe},
711 {NoFlag, 0xffff8002, 0x55555555, 0xffff8001},
712 {NoFlag, 0xffffff80, 0x00000000, 0xffffff80},
713 {NoFlag, 0x00007ffd, 0x00007fff, 0x00000002},
714 {NoFlag, 0x00000000, 0x55555555, 0xffff8003},
715 {NoFlag, 0x0000007f, 0xffff8003, 0x00000020},
716 {NoFlag, 0x00000000, 0xffff8002, 0x7fffffff},
717 {NoFlag, 0x00007fff, 0x55555555, 0x00000000},
718 {NoFlag, 0x7fffffff, 0x00007ffe, 0xffffff81},
719 {NoFlag, 0x0000007e, 0x80000001, 0x00007ffe},
720 {NoFlag, 0x7ffffffd, 0xaaaaaaaa, 0x00000020},
721 {NoFlag, 0xfffffffd, 0xfffffffe, 0x00000002},
722 {NoFlag, 0xffffff80, 0xffff8000, 0xffff8002},
723 {NoFlag, 0x0000007d, 0x00007fff, 0xaaaaaaaa},
724 {NoFlag, 0xfffffffd, 0xffffff80, 0x00007ffd},
725 {NoFlag, 0xffffff82, 0x80000000, 0xffffff80},
726 {NoFlag, 0xffffffe0, 0x55555555, 0xfffffffd},
727 {NoFlag, 0xffffffff, 0xffffffff, 0x00007ffd},
728 {NoFlag, 0x0000007e, 0xfffffffe, 0xffffff80},
729 {NoFlag, 0xffff8000, 0xffffff82, 0xffff8002},
730 {NoFlag, 0xaaaaaaaa, 0x7ffffffe, 0xffff8000},
731 {NoFlag, 0x55555555, 0xffff8003, 0xffffff80},
732 {NoFlag, 0x7ffffffe, 0x00000020, 0xffffffe0},
733 {NoFlag, 0x00000001, 0xffff8001, 0xffffffe0},
734 {NoFlag, 0xcccccccc, 0xffff8000, 0xffff8002},
735 {NoFlag, 0x80000000, 0x00000002, 0x7ffffffe},
736 {NoFlag, 0x00000002, 0x0000007f, 0xffffff81},
737 {NoFlag, 0xffffffff, 0x00000001, 0x7fffffff},
738 {NoFlag, 0xffffff83, 0x00000000, 0x33333333},
739 {NoFlag, 0xffff8000, 0xffffff83, 0xcccccccc},
740 {NoFlag, 0x80000000, 0x00000020, 0x00007ffd},
741 {NoFlag, 0xffffff81, 0xcccccccc, 0x00000000},
742 {NoFlag, 0xffffffff, 0xffff8000, 0x00007fff},
743 {NoFlag, 0xffff8003, 0xcccccccc, 0x00007ffe},
744 {NoFlag, 0xffffffff, 0xfffffffd, 0x7ffffffe},
745 {NoFlag, 0xffff8003, 0xaaaaaaaa, 0x55555555},
746 {NoFlag, 0x00000000, 0xaaaaaaaa, 0xffffff81},
747 {NoFlag, 0x0000007f, 0xfffffffe, 0xffff8000},
748 {NoFlag, 0x00000001, 0xffffffe0, 0xfffffffd},
749 {NoFlag, 0x33333333, 0x33333333, 0xfffffffd},
750 {NoFlag, 0xffffff82, 0xffff8002, 0x80000001},
751 {NoFlag, 0x55555555, 0xffffff83, 0xffffff83},
752 {NoFlag, 0xffffff83, 0xffff8002, 0x00000020},
753 {NoFlag, 0x0000007d, 0x7fffffff, 0x0000007f},
754 {NoFlag, 0x00000000, 0xcccccccc, 0xffff8000},
755 {NoFlag, 0x00000002, 0x7ffffffe, 0x00007fff},
756 {NoFlag, 0xffffff82, 0x7ffffffd, 0x7ffffffd},
757 {NoFlag, 0xaaaaaaaa, 0xfffffffd, 0xffff8002},
758 {NoFlag, 0xfffffffd, 0x00000002, 0x7fffffff},
759 {NoFlag, 0xfffffffe, 0xfffffffe, 0x00000020},
760 {NoFlag, 0x80000001, 0x0000007e, 0x00007ffe},
761 {NoFlag, 0x00007ffd, 0x00007ffd, 0xfffffffd},
762 {NoFlag, 0xffff8000, 0x0000007f, 0x00000002},
763 {NoFlag, 0x7ffffffd, 0x80000000, 0x7ffffffd},
764 {NoFlag, 0x0000007d, 0x00007fff, 0x80000001},
765 {NoFlag, 0xffffffff, 0x80000000, 0xaaaaaaaa},
766 {NoFlag, 0x00000000, 0xaaaaaaaa, 0xffff8001},
767 {NoFlag, 0xaaaaaaaa, 0xffffffe0, 0xffff8003},
768 {NoFlag, 0xffffff82, 0xffffffff, 0x00007ffd},
769 {NoFlag, 0x00000001, 0xffffff81, 0x00000001},
770 {NoFlag, 0x7fffffff, 0xaaaaaaaa, 0x80000001},
771 {NoFlag, 0x7fffffff, 0xffff8000, 0xffff8000},
772 {NoFlag, 0xaaaaaaaa, 0x00007ffd, 0xaaaaaaaa},
773 {NoFlag, 0x0000007f, 0x7ffffffe, 0x80000000},
774 {NoFlag, 0x00007ffd, 0x00007ffe, 0xffffff81},
775 {NoFlag, 0x0000007d, 0x0000007d, 0xffff8002},
776 {NoFlag, 0x80000001, 0x00000002, 0xffffff81},
777 {NoFlag, 0xffff8000, 0xfffffffd, 0x7ffffffd},
778 {NoFlag, 0xfffffffe, 0x00000020, 0xffffff80},
779 {NoFlag, 0x00000020, 0x7fffffff, 0xffffffe0},
780 {NoFlag, 0xffff8002, 0xffff8002, 0x0000007f},
781 {NoFlag, 0xffff8003, 0x7fffffff, 0xffff8002},
782 {NoFlag, 0x00000020, 0xfffffffd, 0x00000020},
783 {NoFlag, 0x7ffffffd, 0xffffffe0, 0x0000007e},
784 {NoFlag, 0x00000020, 0x00000020, 0x7ffffffe},
785 {NoFlag, 0xfffffffe, 0x0000007f, 0xffff8000},
786 {NoFlag, 0x80000001, 0x80000001, 0x0000007d},
787 {NoFlag, 0x55555555, 0x0000007f, 0x00007ffd},
788 {NoFlag, 0x55555555, 0xffffffe0, 0xffffff82},
789 {NoFlag, 0xffff8001, 0x0000007e, 0xffff8002},
790 {NoFlag, 0xffffffe0, 0x55555555, 0x0000007f},
791 {NoFlag, 0xffff8000, 0x7fffffff, 0x7ffffffe},
792 {NoFlag, 0xffffffff, 0xfffffffe, 0xffffff80},
793 {NoFlag, 0xffff8001, 0xffff8002, 0x33333333},
794 {NoFlag, 0x7ffffffd, 0xfffffffd, 0xaaaaaaaa},
795 {NoFlag, 0xaaaaaaaa, 0xfffffffd, 0x00000020},
796 {NoFlag, 0x0000007f, 0x00007ffe, 0x55555555},
797 {NoFlag, 0x00000020, 0x00000020, 0x00000002},
798 {NoFlag, 0x80000001, 0xffff8002, 0xfffffffe},
799 {NoFlag, 0x7fffffff, 0x80000001, 0xffff8002},
800 {NoFlag, 0x00000020, 0x0000007e, 0x33333333}};
801
802 static const Inputs kShiftTypes[] =
803 {{NoFlag, 0xabababab, 0xabababab, 0x00000000},
804 {NoFlag, 0xabababab, 0xabababab, 0x00000001},
805 {NoFlag, 0xabababab, 0xabababab, 0x00000002},
806 {NoFlag, 0xabababab, 0xabababab, 0x00000020},
807 {NoFlag, 0xabababab, 0xabababab, 0x0000007d},
808 {NoFlag, 0xabababab, 0xabababab, 0x0000007e},
809 {NoFlag, 0xabababab, 0xabababab, 0x0000007f},
810 {NoFlag, 0xabababab, 0xabababab, 0x00007ffd},
811 {NoFlag, 0xabababab, 0xabababab, 0x00007ffe},
812 {NoFlag, 0xabababab, 0xabababab, 0x00007fff},
813 {NoFlag, 0xabababab, 0xabababab, 0x33333333},
814 {NoFlag, 0xabababab, 0xabababab, 0x55555555},
815 {NoFlag, 0xabababab, 0xabababab, 0x7ffffffd},
816 {NoFlag, 0xabababab, 0xabababab, 0x7ffffffe},
817 {NoFlag, 0xabababab, 0xabababab, 0x7fffffff},
818 {NoFlag, 0xabababab, 0xabababab, 0x80000000},
819 {NoFlag, 0xabababab, 0xabababab, 0x80000001},
820 {NoFlag, 0xabababab, 0xabababab, 0xaaaaaaaa},
821 {NoFlag, 0xabababab, 0xabababab, 0xcccccccc},
822 {NoFlag, 0xabababab, 0xabababab, 0xffff8000},
823 {NoFlag, 0xabababab, 0xabababab, 0xffff8001},
824 {NoFlag, 0xabababab, 0xabababab, 0xffff8002},
825 {NoFlag, 0xabababab, 0xabababab, 0xffff8003},
826 {NoFlag, 0xabababab, 0xabababab, 0xffffff80},
827 {NoFlag, 0xabababab, 0xabababab, 0xffffff81},
828 {NoFlag, 0xabababab, 0xabababab, 0xffffff82},
829 {NoFlag, 0xabababab, 0xabababab, 0xffffff83},
830 {NoFlag, 0xabababab, 0xabababab, 0xffffffe0},
831 {NoFlag, 0xabababab, 0xabababab, 0xfffffffd},
832 {NoFlag, 0xabababab, 0xabababab, 0xfffffffe},
833 {NoFlag, 0xabababab, 0xabababab, 0xffffffff}};
834
835
836 // A loop will be generated for each element of this array.
837 const TestLoopData kTests[] = {{{eq, r0, r0, r0, LSR, 1},
838 "eq r0 r0 r0 LSR 1",
839 "Condition_eq_r0_r0_r0_LSR_1",
840 ARRAY_SIZE(kCondition),
841 kCondition},
842 {{ne, r0, r0, r0, LSR, 1},
843 "ne r0 r0 r0 LSR 1",
844 "Condition_ne_r0_r0_r0_LSR_1",
845 ARRAY_SIZE(kCondition),
846 kCondition},
847 {{cs, r0, r0, r0, LSR, 1},
848 "cs r0 r0 r0 LSR 1",
849 "Condition_cs_r0_r0_r0_LSR_1",
850 ARRAY_SIZE(kCondition),
851 kCondition},
852 {{cc, r0, r0, r0, LSR, 1},
853 "cc r0 r0 r0 LSR 1",
854 "Condition_cc_r0_r0_r0_LSR_1",
855 ARRAY_SIZE(kCondition),
856 kCondition},
857 {{mi, r0, r0, r0, LSR, 1},
858 "mi r0 r0 r0 LSR 1",
859 "Condition_mi_r0_r0_r0_LSR_1",
860 ARRAY_SIZE(kCondition),
861 kCondition},
862 {{pl, r0, r0, r0, LSR, 1},
863 "pl r0 r0 r0 LSR 1",
864 "Condition_pl_r0_r0_r0_LSR_1",
865 ARRAY_SIZE(kCondition),
866 kCondition},
867 {{vs, r0, r0, r0, LSR, 1},
868 "vs r0 r0 r0 LSR 1",
869 "Condition_vs_r0_r0_r0_LSR_1",
870 ARRAY_SIZE(kCondition),
871 kCondition},
872 {{vc, r0, r0, r0, LSR, 1},
873 "vc r0 r0 r0 LSR 1",
874 "Condition_vc_r0_r0_r0_LSR_1",
875 ARRAY_SIZE(kCondition),
876 kCondition},
877 {{hi, r0, r0, r0, LSR, 1},
878 "hi r0 r0 r0 LSR 1",
879 "Condition_hi_r0_r0_r0_LSR_1",
880 ARRAY_SIZE(kCondition),
881 kCondition},
882 {{ls, r0, r0, r0, LSR, 1},
883 "ls r0 r0 r0 LSR 1",
884 "Condition_ls_r0_r0_r0_LSR_1",
885 ARRAY_SIZE(kCondition),
886 kCondition},
887 {{ge, r0, r0, r0, LSR, 1},
888 "ge r0 r0 r0 LSR 1",
889 "Condition_ge_r0_r0_r0_LSR_1",
890 ARRAY_SIZE(kCondition),
891 kCondition},
892 {{lt, r0, r0, r0, LSR, 1},
893 "lt r0 r0 r0 LSR 1",
894 "Condition_lt_r0_r0_r0_LSR_1",
895 ARRAY_SIZE(kCondition),
896 kCondition},
897 {{gt, r0, r0, r0, LSR, 1},
898 "gt r0 r0 r0 LSR 1",
899 "Condition_gt_r0_r0_r0_LSR_1",
900 ARRAY_SIZE(kCondition),
901 kCondition},
902 {{le, r0, r0, r0, LSR, 1},
903 "le r0 r0 r0 LSR 1",
904 "Condition_le_r0_r0_r0_LSR_1",
905 ARRAY_SIZE(kCondition),
906 kCondition},
907 {{al, r0, r0, r0, LSR, 1},
908 "al r0 r0 r0 LSR 1",
909 "Condition_al_r0_r0_r0_LSR_1",
910 ARRAY_SIZE(kCondition),
911 kCondition},
912 {{al, r3, r3, r4, LSR, 1},
913 "al r3 r3 r4 LSR 1",
914 "RdIsRn_al_r3_r3_r4_LSR_1",
915 ARRAY_SIZE(kRdIsRn),
916 kRdIsRn},
917 {{al, r2, r2, r12, LSR, 1},
918 "al r2 r2 r12 LSR 1",
919 "RdIsRn_al_r2_r2_r12_LSR_1",
920 ARRAY_SIZE(kRdIsRn),
921 kRdIsRn},
922 {{al, r8, r8, r5, LSR, 1},
923 "al r8 r8 r5 LSR 1",
924 "RdIsRn_al_r8_r8_r5_LSR_1",
925 ARRAY_SIZE(kRdIsRn),
926 kRdIsRn},
927 {{al, r14, r14, r0, LSR, 1},
928 "al r14 r14 r0 LSR 1",
929 "RdIsRn_al_r14_r14_r0_LSR_1",
930 ARRAY_SIZE(kRdIsRn),
931 kRdIsRn},
932 {{al, r11, r11, r10, LSR, 1},
933 "al r11 r11 r10 LSR 1",
934 "RdIsRn_al_r11_r11_r10_LSR_1",
935 ARRAY_SIZE(kRdIsRn),
936 kRdIsRn},
937 {{al, r12, r12, r10, LSR, 1},
938 "al r12 r12 r10 LSR 1",
939 "RdIsRn_al_r12_r12_r10_LSR_1",
940 ARRAY_SIZE(kRdIsRn),
941 kRdIsRn},
942 {{al, r4, r4, r8, LSR, 1},
943 "al r4 r4 r8 LSR 1",
944 "RdIsRn_al_r4_r4_r8_LSR_1",
945 ARRAY_SIZE(kRdIsRn),
946 kRdIsRn},
947 {{al, r5, r5, r14, LSR, 1},
948 "al r5 r5 r14 LSR 1",
949 "RdIsRn_al_r5_r5_r14_LSR_1",
950 ARRAY_SIZE(kRdIsRn),
951 kRdIsRn},
952 {{al, r0, r0, r6, LSR, 1},
953 "al r0 r0 r6 LSR 1",
954 "RdIsRn_al_r0_r0_r6_LSR_1",
955 ARRAY_SIZE(kRdIsRn),
956 kRdIsRn},
957 {{al, r12, r12, r1, LSR, 1},
958 "al r12 r12 r1 LSR 1",
959 "RdIsRn_al_r12_r12_r1_LSR_1",
960 ARRAY_SIZE(kRdIsRn),
961 kRdIsRn},
962 {{al, r6, r11, r6, LSR, 1},
963 "al r6 r11 r6 LSR 1",
964 "RdIsRm_al_r6_r11_r6_LSR_1",
965 ARRAY_SIZE(kRdIsRm),
966 kRdIsRm},
967 {{al, r11, r9, r11, LSR, 1},
968 "al r11 r9 r11 LSR 1",
969 "RdIsRm_al_r11_r9_r11_LSR_1",
970 ARRAY_SIZE(kRdIsRm),
971 kRdIsRm},
972 {{al, r0, r8, r0, LSR, 1},
973 "al r0 r8 r0 LSR 1",
974 "RdIsRm_al_r0_r8_r0_LSR_1",
975 ARRAY_SIZE(kRdIsRm),
976 kRdIsRm},
977 {{al, r2, r11, r2, LSR, 1},
978 "al r2 r11 r2 LSR 1",
979 "RdIsRm_al_r2_r11_r2_LSR_1",
980 ARRAY_SIZE(kRdIsRm),
981 kRdIsRm},
982 {{al, r9, r4, r9, LSR, 1},
983 "al r9 r4 r9 LSR 1",
984 "RdIsRm_al_r9_r4_r9_LSR_1",
985 ARRAY_SIZE(kRdIsRm),
986 kRdIsRm},
987 {{al, r14, r10, r14, LSR, 1},
988 "al r14 r10 r14 LSR 1",
989 "RdIsRm_al_r14_r10_r14_LSR_1",
990 ARRAY_SIZE(kRdIsRm),
991 kRdIsRm},
992 {{al, r7, r0, r7, LSR, 1},
993 "al r7 r0 r7 LSR 1",
994 "RdIsRm_al_r7_r0_r7_LSR_1",
995 ARRAY_SIZE(kRdIsRm),
996 kRdIsRm},
997 {{al, r4, r9, r4, LSR, 1},
998 "al r4 r9 r4 LSR 1",
999 "RdIsRm_al_r4_r9_r4_LSR_1",
1000 ARRAY_SIZE(kRdIsRm),
1001 kRdIsRm},
1002 {{al, r6, r10, r6, LSR, 1},
1003 "al r6 r10 r6 LSR 1",
1004 "RdIsRm_al_r6_r10_r6_LSR_1",
1005 ARRAY_SIZE(kRdIsRm),
1006 kRdIsRm},
1007 {{al, r7, r6, r7, LSR, 1},
1008 "al r7 r6 r7 LSR 1",
1009 "RdIsRm_al_r7_r6_r7_LSR_1",
1010 ARRAY_SIZE(kRdIsRm),
1011 kRdIsRm},
1012 {{al, r3, r9, r10, LSR, 1},
1013 "al r3 r9 r10 LSR 1",
1014 "RdIsNotRnIsNotRm_al_r3_r9_r10_LSR_1",
1015 ARRAY_SIZE(kRdIsNotRnIsNotRm),
1016 kRdIsNotRnIsNotRm},
1017 {{al, r7, r12, r5, LSR, 1},
1018 "al r7 r12 r5 LSR 1",
1019 "RdIsNotRnIsNotRm_al_r7_r12_r5_LSR_1",
1020 ARRAY_SIZE(kRdIsNotRnIsNotRm),
1021 kRdIsNotRnIsNotRm},
1022 {{al, r8, r5, r6, LSR, 1},
1023 "al r8 r5 r6 LSR 1",
1024 "RdIsNotRnIsNotRm_al_r8_r5_r6_LSR_1",
1025 ARRAY_SIZE(kRdIsNotRnIsNotRm),
1026 kRdIsNotRnIsNotRm},
1027 {{al, r0, r6, r0, LSR, 1},
1028 "al r0 r6 r0 LSR 1",
1029 "RdIsNotRnIsNotRm_al_r0_r6_r0_LSR_1",
1030 ARRAY_SIZE(kRdIsNotRnIsNotRm),
1031 kRdIsNotRnIsNotRm},
1032 {{al, r11, r7, r8, LSR, 1},
1033 "al r11 r7 r8 LSR 1",
1034 "RdIsNotRnIsNotRm_al_r11_r7_r8_LSR_1",
1035 ARRAY_SIZE(kRdIsNotRnIsNotRm),
1036 kRdIsNotRnIsNotRm},
1037 {{al, r12, r2, r3, LSR, 1},
1038 "al r12 r2 r3 LSR 1",
1039 "RdIsNotRnIsNotRm_al_r12_r2_r3_LSR_1",
1040 ARRAY_SIZE(kRdIsNotRnIsNotRm),
1041 kRdIsNotRnIsNotRm},
1042 {{al, r7, r4, r10, LSR, 1},
1043 "al r7 r4 r10 LSR 1",
1044 "RdIsNotRnIsNotRm_al_r7_r4_r10_LSR_1",
1045 ARRAY_SIZE(kRdIsNotRnIsNotRm),
1046 kRdIsNotRnIsNotRm},
1047 {{al, r9, r6, r1, LSR, 1},
1048 "al r9 r6 r1 LSR 1",
1049 "RdIsNotRnIsNotRm_al_r9_r6_r1_LSR_1",
1050 ARRAY_SIZE(kRdIsNotRnIsNotRm),
1051 kRdIsNotRnIsNotRm},
1052 {{al, r10, r14, r3, LSR, 1},
1053 "al r10 r14 r3 LSR 1",
1054 "RdIsNotRnIsNotRm_al_r10_r14_r3_LSR_1",
1055 ARRAY_SIZE(kRdIsNotRnIsNotRm),
1056 kRdIsNotRnIsNotRm},
1057 {{al, r14, r3, r6, LSR, 1},
1058 "al r14 r3 r6 LSR 1",
1059 "RdIsNotRnIsNotRm_al_r14_r3_r6_LSR_1",
1060 ARRAY_SIZE(kRdIsNotRnIsNotRm),
1061 kRdIsNotRnIsNotRm},
1062 {{al, r0, r1, r2, LSR, 1},
1063 "al r0 r1 r2 LSR 1",
1064 "ShiftTypes_al_r0_r1_r2_LSR_1",
1065 ARRAY_SIZE(kShiftTypes),
1066 kShiftTypes},
1067 {{al, r0, r1, r2, LSR, 2},
1068 "al r0 r1 r2 LSR 2",
1069 "ShiftTypes_al_r0_r1_r2_LSR_2",
1070 ARRAY_SIZE(kShiftTypes),
1071 kShiftTypes},
1072 {{al, r0, r1, r2, LSR, 3},
1073 "al r0 r1 r2 LSR 3",
1074 "ShiftTypes_al_r0_r1_r2_LSR_3",
1075 ARRAY_SIZE(kShiftTypes),
1076 kShiftTypes},
1077 {{al, r0, r1, r2, LSR, 4},
1078 "al r0 r1 r2 LSR 4",
1079 "ShiftTypes_al_r0_r1_r2_LSR_4",
1080 ARRAY_SIZE(kShiftTypes),
1081 kShiftTypes},
1082 {{al, r0, r1, r2, LSR, 5},
1083 "al r0 r1 r2 LSR 5",
1084 "ShiftTypes_al_r0_r1_r2_LSR_5",
1085 ARRAY_SIZE(kShiftTypes),
1086 kShiftTypes},
1087 {{al, r0, r1, r2, LSR, 6},
1088 "al r0 r1 r2 LSR 6",
1089 "ShiftTypes_al_r0_r1_r2_LSR_6",
1090 ARRAY_SIZE(kShiftTypes),
1091 kShiftTypes},
1092 {{al, r0, r1, r2, LSR, 7},
1093 "al r0 r1 r2 LSR 7",
1094 "ShiftTypes_al_r0_r1_r2_LSR_7",
1095 ARRAY_SIZE(kShiftTypes),
1096 kShiftTypes},
1097 {{al, r0, r1, r2, LSR, 8},
1098 "al r0 r1 r2 LSR 8",
1099 "ShiftTypes_al_r0_r1_r2_LSR_8",
1100 ARRAY_SIZE(kShiftTypes),
1101 kShiftTypes},
1102 {{al, r0, r1, r2, LSR, 9},
1103 "al r0 r1 r2 LSR 9",
1104 "ShiftTypes_al_r0_r1_r2_LSR_9",
1105 ARRAY_SIZE(kShiftTypes),
1106 kShiftTypes},
1107 {{al, r0, r1, r2, LSR, 10},
1108 "al r0 r1 r2 LSR 10",
1109 "ShiftTypes_al_r0_r1_r2_LSR_10",
1110 ARRAY_SIZE(kShiftTypes),
1111 kShiftTypes},
1112 {{al, r0, r1, r2, LSR, 11},
1113 "al r0 r1 r2 LSR 11",
1114 "ShiftTypes_al_r0_r1_r2_LSR_11",
1115 ARRAY_SIZE(kShiftTypes),
1116 kShiftTypes},
1117 {{al, r0, r1, r2, LSR, 12},
1118 "al r0 r1 r2 LSR 12",
1119 "ShiftTypes_al_r0_r1_r2_LSR_12",
1120 ARRAY_SIZE(kShiftTypes),
1121 kShiftTypes},
1122 {{al, r0, r1, r2, LSR, 13},
1123 "al r0 r1 r2 LSR 13",
1124 "ShiftTypes_al_r0_r1_r2_LSR_13",
1125 ARRAY_SIZE(kShiftTypes),
1126 kShiftTypes},
1127 {{al, r0, r1, r2, LSR, 14},
1128 "al r0 r1 r2 LSR 14",
1129 "ShiftTypes_al_r0_r1_r2_LSR_14",
1130 ARRAY_SIZE(kShiftTypes),
1131 kShiftTypes},
1132 {{al, r0, r1, r2, LSR, 15},
1133 "al r0 r1 r2 LSR 15",
1134 "ShiftTypes_al_r0_r1_r2_LSR_15",
1135 ARRAY_SIZE(kShiftTypes),
1136 kShiftTypes},
1137 {{al, r0, r1, r2, LSR, 16},
1138 "al r0 r1 r2 LSR 16",
1139 "ShiftTypes_al_r0_r1_r2_LSR_16",
1140 ARRAY_SIZE(kShiftTypes),
1141 kShiftTypes},
1142 {{al, r0, r1, r2, LSR, 17},
1143 "al r0 r1 r2 LSR 17",
1144 "ShiftTypes_al_r0_r1_r2_LSR_17",
1145 ARRAY_SIZE(kShiftTypes),
1146 kShiftTypes},
1147 {{al, r0, r1, r2, LSR, 18},
1148 "al r0 r1 r2 LSR 18",
1149 "ShiftTypes_al_r0_r1_r2_LSR_18",
1150 ARRAY_SIZE(kShiftTypes),
1151 kShiftTypes},
1152 {{al, r0, r1, r2, LSR, 19},
1153 "al r0 r1 r2 LSR 19",
1154 "ShiftTypes_al_r0_r1_r2_LSR_19",
1155 ARRAY_SIZE(kShiftTypes),
1156 kShiftTypes},
1157 {{al, r0, r1, r2, LSR, 20},
1158 "al r0 r1 r2 LSR 20",
1159 "ShiftTypes_al_r0_r1_r2_LSR_20",
1160 ARRAY_SIZE(kShiftTypes),
1161 kShiftTypes},
1162 {{al, r0, r1, r2, LSR, 21},
1163 "al r0 r1 r2 LSR 21",
1164 "ShiftTypes_al_r0_r1_r2_LSR_21",
1165 ARRAY_SIZE(kShiftTypes),
1166 kShiftTypes},
1167 {{al, r0, r1, r2, LSR, 22},
1168 "al r0 r1 r2 LSR 22",
1169 "ShiftTypes_al_r0_r1_r2_LSR_22",
1170 ARRAY_SIZE(kShiftTypes),
1171 kShiftTypes},
1172 {{al, r0, r1, r2, LSR, 23},
1173 "al r0 r1 r2 LSR 23",
1174 "ShiftTypes_al_r0_r1_r2_LSR_23",
1175 ARRAY_SIZE(kShiftTypes),
1176 kShiftTypes},
1177 {{al, r0, r1, r2, LSR, 24},
1178 "al r0 r1 r2 LSR 24",
1179 "ShiftTypes_al_r0_r1_r2_LSR_24",
1180 ARRAY_SIZE(kShiftTypes),
1181 kShiftTypes},
1182 {{al, r0, r1, r2, LSR, 25},
1183 "al r0 r1 r2 LSR 25",
1184 "ShiftTypes_al_r0_r1_r2_LSR_25",
1185 ARRAY_SIZE(kShiftTypes),
1186 kShiftTypes},
1187 {{al, r0, r1, r2, LSR, 26},
1188 "al r0 r1 r2 LSR 26",
1189 "ShiftTypes_al_r0_r1_r2_LSR_26",
1190 ARRAY_SIZE(kShiftTypes),
1191 kShiftTypes},
1192 {{al, r0, r1, r2, LSR, 27},
1193 "al r0 r1 r2 LSR 27",
1194 "ShiftTypes_al_r0_r1_r2_LSR_27",
1195 ARRAY_SIZE(kShiftTypes),
1196 kShiftTypes},
1197 {{al, r0, r1, r2, LSR, 28},
1198 "al r0 r1 r2 LSR 28",
1199 "ShiftTypes_al_r0_r1_r2_LSR_28",
1200 ARRAY_SIZE(kShiftTypes),
1201 kShiftTypes},
1202 {{al, r0, r1, r2, LSR, 29},
1203 "al r0 r1 r2 LSR 29",
1204 "ShiftTypes_al_r0_r1_r2_LSR_29",
1205 ARRAY_SIZE(kShiftTypes),
1206 kShiftTypes},
1207 {{al, r0, r1, r2, LSR, 30},
1208 "al r0 r1 r2 LSR 30",
1209 "ShiftTypes_al_r0_r1_r2_LSR_30",
1210 ARRAY_SIZE(kShiftTypes),
1211 kShiftTypes},
1212 {{al, r0, r1, r2, LSR, 31},
1213 "al r0 r1 r2 LSR 31",
1214 "ShiftTypes_al_r0_r1_r2_LSR_31",
1215 ARRAY_SIZE(kShiftTypes),
1216 kShiftTypes},
1217 {{al, r0, r1, r2, LSR, 32},
1218 "al r0 r1 r2 LSR 32",
1219 "ShiftTypes_al_r0_r1_r2_LSR_32",
1220 ARRAY_SIZE(kShiftTypes),
1221 kShiftTypes},
1222 {{al, r0, r1, r2, ASR, 1},
1223 "al r0 r1 r2 ASR 1",
1224 "ShiftTypes_al_r0_r1_r2_ASR_1",
1225 ARRAY_SIZE(kShiftTypes),
1226 kShiftTypes},
1227 {{al, r0, r1, r2, ASR, 2},
1228 "al r0 r1 r2 ASR 2",
1229 "ShiftTypes_al_r0_r1_r2_ASR_2",
1230 ARRAY_SIZE(kShiftTypes),
1231 kShiftTypes},
1232 {{al, r0, r1, r2, ASR, 3},
1233 "al r0 r1 r2 ASR 3",
1234 "ShiftTypes_al_r0_r1_r2_ASR_3",
1235 ARRAY_SIZE(kShiftTypes),
1236 kShiftTypes},
1237 {{al, r0, r1, r2, ASR, 4},
1238 "al r0 r1 r2 ASR 4",
1239 "ShiftTypes_al_r0_r1_r2_ASR_4",
1240 ARRAY_SIZE(kShiftTypes),
1241 kShiftTypes},
1242 {{al, r0, r1, r2, ASR, 5},
1243 "al r0 r1 r2 ASR 5",
1244 "ShiftTypes_al_r0_r1_r2_ASR_5",
1245 ARRAY_SIZE(kShiftTypes),
1246 kShiftTypes},
1247 {{al, r0, r1, r2, ASR, 6},
1248 "al r0 r1 r2 ASR 6",
1249 "ShiftTypes_al_r0_r1_r2_ASR_6",
1250 ARRAY_SIZE(kShiftTypes),
1251 kShiftTypes},
1252 {{al, r0, r1, r2, ASR, 7},
1253 "al r0 r1 r2 ASR 7",
1254 "ShiftTypes_al_r0_r1_r2_ASR_7",
1255 ARRAY_SIZE(kShiftTypes),
1256 kShiftTypes},
1257 {{al, r0, r1, r2, ASR, 8},
1258 "al r0 r1 r2 ASR 8",
1259 "ShiftTypes_al_r0_r1_r2_ASR_8",
1260 ARRAY_SIZE(kShiftTypes),
1261 kShiftTypes},
1262 {{al, r0, r1, r2, ASR, 9},
1263 "al r0 r1 r2 ASR 9",
1264 "ShiftTypes_al_r0_r1_r2_ASR_9",
1265 ARRAY_SIZE(kShiftTypes),
1266 kShiftTypes},
1267 {{al, r0, r1, r2, ASR, 10},
1268 "al r0 r1 r2 ASR 10",
1269 "ShiftTypes_al_r0_r1_r2_ASR_10",
1270 ARRAY_SIZE(kShiftTypes),
1271 kShiftTypes},
1272 {{al, r0, r1, r2, ASR, 11},
1273 "al r0 r1 r2 ASR 11",
1274 "ShiftTypes_al_r0_r1_r2_ASR_11",
1275 ARRAY_SIZE(kShiftTypes),
1276 kShiftTypes},
1277 {{al, r0, r1, r2, ASR, 12},
1278 "al r0 r1 r2 ASR 12",
1279 "ShiftTypes_al_r0_r1_r2_ASR_12",
1280 ARRAY_SIZE(kShiftTypes),
1281 kShiftTypes},
1282 {{al, r0, r1, r2, ASR, 13},
1283 "al r0 r1 r2 ASR 13",
1284 "ShiftTypes_al_r0_r1_r2_ASR_13",
1285 ARRAY_SIZE(kShiftTypes),
1286 kShiftTypes},
1287 {{al, r0, r1, r2, ASR, 14},
1288 "al r0 r1 r2 ASR 14",
1289 "ShiftTypes_al_r0_r1_r2_ASR_14",
1290 ARRAY_SIZE(kShiftTypes),
1291 kShiftTypes},
1292 {{al, r0, r1, r2, ASR, 15},
1293 "al r0 r1 r2 ASR 15",
1294 "ShiftTypes_al_r0_r1_r2_ASR_15",
1295 ARRAY_SIZE(kShiftTypes),
1296 kShiftTypes},
1297 {{al, r0, r1, r2, ASR, 16},
1298 "al r0 r1 r2 ASR 16",
1299 "ShiftTypes_al_r0_r1_r2_ASR_16",
1300 ARRAY_SIZE(kShiftTypes),
1301 kShiftTypes},
1302 {{al, r0, r1, r2, ASR, 17},
1303 "al r0 r1 r2 ASR 17",
1304 "ShiftTypes_al_r0_r1_r2_ASR_17",
1305 ARRAY_SIZE(kShiftTypes),
1306 kShiftTypes},
1307 {{al, r0, r1, r2, ASR, 18},
1308 "al r0 r1 r2 ASR 18",
1309 "ShiftTypes_al_r0_r1_r2_ASR_18",
1310 ARRAY_SIZE(kShiftTypes),
1311 kShiftTypes},
1312 {{al, r0, r1, r2, ASR, 19},
1313 "al r0 r1 r2 ASR 19",
1314 "ShiftTypes_al_r0_r1_r2_ASR_19",
1315 ARRAY_SIZE(kShiftTypes),
1316 kShiftTypes},
1317 {{al, r0, r1, r2, ASR, 20},
1318 "al r0 r1 r2 ASR 20",
1319 "ShiftTypes_al_r0_r1_r2_ASR_20",
1320 ARRAY_SIZE(kShiftTypes),
1321 kShiftTypes},
1322 {{al, r0, r1, r2, ASR, 21},
1323 "al r0 r1 r2 ASR 21",
1324 "ShiftTypes_al_r0_r1_r2_ASR_21",
1325 ARRAY_SIZE(kShiftTypes),
1326 kShiftTypes},
1327 {{al, r0, r1, r2, ASR, 22},
1328 "al r0 r1 r2 ASR 22",
1329 "ShiftTypes_al_r0_r1_r2_ASR_22",
1330 ARRAY_SIZE(kShiftTypes),
1331 kShiftTypes},
1332 {{al, r0, r1, r2, ASR, 23},
1333 "al r0 r1 r2 ASR 23",
1334 "ShiftTypes_al_r0_r1_r2_ASR_23",
1335 ARRAY_SIZE(kShiftTypes),
1336 kShiftTypes},
1337 {{al, r0, r1, r2, ASR, 24},
1338 "al r0 r1 r2 ASR 24",
1339 "ShiftTypes_al_r0_r1_r2_ASR_24",
1340 ARRAY_SIZE(kShiftTypes),
1341 kShiftTypes},
1342 {{al, r0, r1, r2, ASR, 25},
1343 "al r0 r1 r2 ASR 25",
1344 "ShiftTypes_al_r0_r1_r2_ASR_25",
1345 ARRAY_SIZE(kShiftTypes),
1346 kShiftTypes},
1347 {{al, r0, r1, r2, ASR, 26},
1348 "al r0 r1 r2 ASR 26",
1349 "ShiftTypes_al_r0_r1_r2_ASR_26",
1350 ARRAY_SIZE(kShiftTypes),
1351 kShiftTypes},
1352 {{al, r0, r1, r2, ASR, 27},
1353 "al r0 r1 r2 ASR 27",
1354 "ShiftTypes_al_r0_r1_r2_ASR_27",
1355 ARRAY_SIZE(kShiftTypes),
1356 kShiftTypes},
1357 {{al, r0, r1, r2, ASR, 28},
1358 "al r0 r1 r2 ASR 28",
1359 "ShiftTypes_al_r0_r1_r2_ASR_28",
1360 ARRAY_SIZE(kShiftTypes),
1361 kShiftTypes},
1362 {{al, r0, r1, r2, ASR, 29},
1363 "al r0 r1 r2 ASR 29",
1364 "ShiftTypes_al_r0_r1_r2_ASR_29",
1365 ARRAY_SIZE(kShiftTypes),
1366 kShiftTypes},
1367 {{al, r0, r1, r2, ASR, 30},
1368 "al r0 r1 r2 ASR 30",
1369 "ShiftTypes_al_r0_r1_r2_ASR_30",
1370 ARRAY_SIZE(kShiftTypes),
1371 kShiftTypes},
1372 {{al, r0, r1, r2, ASR, 31},
1373 "al r0 r1 r2 ASR 31",
1374 "ShiftTypes_al_r0_r1_r2_ASR_31",
1375 ARRAY_SIZE(kShiftTypes),
1376 kShiftTypes},
1377 {{al, r0, r1, r2, ASR, 32},
1378 "al r0 r1 r2 ASR 32",
1379 "ShiftTypes_al_r0_r1_r2_ASR_32",
1380 ARRAY_SIZE(kShiftTypes),
1381 kShiftTypes}};
1382
1383 // We record all inputs to the instructions as outputs. This way, we also check
1384 // that what shouldn't change didn't change.
1385 struct TestResult {
1386 size_t output_size;
1387 const Inputs* outputs;
1388 };
1389
1390 // These headers each contain an array of `TestResult` with the reference output
1391 // values. The reference arrays are names `kReference{mnemonic}`.
1392 #include "aarch32/traces/simulator-cond-rd-rn-operand-rm-shift-amount-1to32-adc-t32.h"
1393 #include "aarch32/traces/simulator-cond-rd-rn-operand-rm-shift-amount-1to32-adcs-t32.h"
1394 #include "aarch32/traces/simulator-cond-rd-rn-operand-rm-shift-amount-1to32-add-t32.h"
1395 #include "aarch32/traces/simulator-cond-rd-rn-operand-rm-shift-amount-1to32-adds-t32.h"
1396 #include "aarch32/traces/simulator-cond-rd-rn-operand-rm-shift-amount-1to32-and-t32.h"
1397 #include "aarch32/traces/simulator-cond-rd-rn-operand-rm-shift-amount-1to32-ands-t32.h"
1398 #include "aarch32/traces/simulator-cond-rd-rn-operand-rm-shift-amount-1to32-bic-t32.h"
1399 #include "aarch32/traces/simulator-cond-rd-rn-operand-rm-shift-amount-1to32-bics-t32.h"
1400 #include "aarch32/traces/simulator-cond-rd-rn-operand-rm-shift-amount-1to32-eor-t32.h"
1401 #include "aarch32/traces/simulator-cond-rd-rn-operand-rm-shift-amount-1to32-eors-t32.h"
1402 #include "aarch32/traces/simulator-cond-rd-rn-operand-rm-shift-amount-1to32-orn-t32.h"
1403 #include "aarch32/traces/simulator-cond-rd-rn-operand-rm-shift-amount-1to32-orns-t32.h"
1404 #include "aarch32/traces/simulator-cond-rd-rn-operand-rm-shift-amount-1to32-orr-t32.h"
1405 #include "aarch32/traces/simulator-cond-rd-rn-operand-rm-shift-amount-1to32-orrs-t32.h"
1406 #include "aarch32/traces/simulator-cond-rd-rn-operand-rm-shift-amount-1to32-rsb-t32.h"
1407 #include "aarch32/traces/simulator-cond-rd-rn-operand-rm-shift-amount-1to32-rsbs-t32.h"
1408 #include "aarch32/traces/simulator-cond-rd-rn-operand-rm-shift-amount-1to32-sbc-t32.h"
1409 #include "aarch32/traces/simulator-cond-rd-rn-operand-rm-shift-amount-1to32-sbcs-t32.h"
1410 #include "aarch32/traces/simulator-cond-rd-rn-operand-rm-shift-amount-1to32-sub-t32.h"
1411 #include "aarch32/traces/simulator-cond-rd-rn-operand-rm-shift-amount-1to32-subs-t32.h"
1412
1413
1414 // The maximum number of errors to report in detail for each test.
1415 const unsigned kErrorReportLimit = 8;
1416
1417 typedef void (MacroAssembler::*Fn)(Condition cond,
1418 Register rd,
1419 Register rn,
1420 const Operand& op);
1421
TestHelper(Fn instruction,const char * mnemonic,const TestResult reference[])1422 void TestHelper(Fn instruction,
1423 const char* mnemonic,
1424 const TestResult reference[]) {
1425 SETUP();
1426 masm.UseT32();
1427 START();
1428
1429 // Data to compare to `reference`.
1430 TestResult* results[ARRAY_SIZE(kTests)];
1431
1432 // Test cases for memory bound instructions may allocate a buffer and save its
1433 // address in this array.
1434 byte* scratch_memory_buffers[ARRAY_SIZE(kTests)];
1435
1436 // Generate a loop for each element in `kTests`. Each loop tests one specific
1437 // instruction.
1438 for (unsigned i = 0; i < ARRAY_SIZE(kTests); i++) {
1439 // Allocate results on the heap for this test.
1440 results[i] = new TestResult;
1441 results[i]->outputs = new Inputs[kTests[i].input_size];
1442 results[i]->output_size = kTests[i].input_size;
1443
1444 size_t input_stride = sizeof(kTests[i].inputs[0]) * kTests[i].input_size;
1445 VIXL_ASSERT(IsUint32(input_stride));
1446
1447 scratch_memory_buffers[i] = NULL;
1448
1449 Label loop;
1450 UseScratchRegisterScope scratch_registers(&masm);
1451 // Include all registers from r0 ro r12.
1452 scratch_registers.Include(RegisterList(0x1fff));
1453
1454 // Values to pass to the macro-assembler.
1455 Condition cond = kTests[i].operands.cond;
1456 Register rd = kTests[i].operands.rd;
1457 Register rn = kTests[i].operands.rn;
1458 Register rm = kTests[i].operands.rm;
1459 ShiftType shift = kTests[i].operands.shift;
1460 uint32_t amount = kTests[i].operands.amount;
1461 Operand op(rm, shift, amount);
1462 scratch_registers.Exclude(rd);
1463 scratch_registers.Exclude(rn);
1464 scratch_registers.Exclude(rm);
1465
1466 // Allocate reserved registers for our own use.
1467 Register input_ptr = scratch_registers.Acquire();
1468 Register input_end = scratch_registers.Acquire();
1469 Register result_ptr = scratch_registers.Acquire();
1470
1471 // Initialize `input_ptr` to the first element and `input_end` the address
1472 // after the array.
1473 __ Mov(input_ptr, Operand::From(kTests[i].inputs));
1474 __ Add(input_end, input_ptr, static_cast<uint32_t>(input_stride));
1475 __ Mov(result_ptr, Operand::From(results[i]->outputs));
1476 __ Bind(&loop);
1477
1478 {
1479 UseScratchRegisterScope temp_registers(&masm);
1480 Register nzcv_bits = temp_registers.Acquire();
1481 Register saved_q_bit = temp_registers.Acquire();
1482 // Save the `Q` bit flag.
1483 __ Mrs(saved_q_bit, APSR);
1484 __ And(saved_q_bit, saved_q_bit, QFlag);
1485 // Set the `NZCV` and `Q` flags together.
1486 __ Ldr(nzcv_bits, MemOperand(input_ptr, offsetof(Inputs, apsr)));
1487 __ Orr(nzcv_bits, nzcv_bits, saved_q_bit);
1488 __ Msr(APSR_nzcvq, nzcv_bits);
1489 }
1490 __ Ldr(rd, MemOperand(input_ptr, offsetof(Inputs, rd)));
1491 __ Ldr(rn, MemOperand(input_ptr, offsetof(Inputs, rn)));
1492 __ Ldr(rm, MemOperand(input_ptr, offsetof(Inputs, rm)));
1493
1494 (masm.*instruction)(cond, rd, rn, op);
1495
1496 {
1497 UseScratchRegisterScope temp_registers(&masm);
1498 Register nzcv_bits = temp_registers.Acquire();
1499 __ Mrs(nzcv_bits, APSR);
1500 // Only record the NZCV bits.
1501 __ And(nzcv_bits, nzcv_bits, NZCVFlag);
1502 __ Str(nzcv_bits, MemOperand(result_ptr, offsetof(Inputs, apsr)));
1503 }
1504 __ Str(rd, MemOperand(result_ptr, offsetof(Inputs, rd)));
1505 __ Str(rn, MemOperand(result_ptr, offsetof(Inputs, rn)));
1506 __ Str(rm, MemOperand(result_ptr, offsetof(Inputs, rm)));
1507
1508 // Advance the result pointer.
1509 __ Add(result_ptr, result_ptr, Operand::From(sizeof(kTests[i].inputs[0])));
1510 // Loop back until `input_ptr` is lower than `input_base`.
1511 __ Add(input_ptr, input_ptr, Operand::From(sizeof(kTests[i].inputs[0])));
1512 __ Cmp(input_ptr, input_end);
1513 __ B(ne, &loop);
1514 }
1515
1516 END();
1517
1518 RUN();
1519
1520 if (Test::generate_test_trace()) {
1521 // Print the results.
1522 for (size_t i = 0; i < ARRAY_SIZE(kTests); i++) {
1523 printf("const Inputs kOutputs_%s_%s[] = {\n",
1524 mnemonic,
1525 kTests[i].identifier);
1526 for (size_t j = 0; j < results[i]->output_size; j++) {
1527 printf(" { ");
1528 printf("0x%08" PRIx32, results[i]->outputs[j].apsr);
1529 printf(", ");
1530 printf("0x%08" PRIx32, results[i]->outputs[j].rd);
1531 printf(", ");
1532 printf("0x%08" PRIx32, results[i]->outputs[j].rn);
1533 printf(", ");
1534 printf("0x%08" PRIx32, results[i]->outputs[j].rm);
1535 printf(" },\n");
1536 }
1537 printf("};\n");
1538 }
1539 printf("const TestResult kReference%s[] = {\n", mnemonic);
1540 for (size_t i = 0; i < ARRAY_SIZE(kTests); i++) {
1541 printf(" {\n");
1542 printf(" ARRAY_SIZE(kOutputs_%s_%s),\n",
1543 mnemonic,
1544 kTests[i].identifier);
1545 printf(" kOutputs_%s_%s,\n", mnemonic, kTests[i].identifier);
1546 printf(" },\n");
1547 }
1548 printf("};\n");
1549 } else if (kCheckSimulatorTestResults) {
1550 // Check the results.
1551 unsigned total_error_count = 0;
1552 for (size_t i = 0; i < ARRAY_SIZE(kTests); i++) {
1553 bool instruction_has_errors = false;
1554 for (size_t j = 0; j < kTests[i].input_size; j++) {
1555 uint32_t apsr = results[i]->outputs[j].apsr;
1556 uint32_t rd = results[i]->outputs[j].rd;
1557 uint32_t rn = results[i]->outputs[j].rn;
1558 uint32_t rm = results[i]->outputs[j].rm;
1559 uint32_t apsr_input = kTests[i].inputs[j].apsr;
1560 uint32_t rd_input = kTests[i].inputs[j].rd;
1561 uint32_t rn_input = kTests[i].inputs[j].rn;
1562 uint32_t rm_input = kTests[i].inputs[j].rm;
1563 uint32_t apsr_ref = reference[i].outputs[j].apsr;
1564 uint32_t rd_ref = reference[i].outputs[j].rd;
1565 uint32_t rn_ref = reference[i].outputs[j].rn;
1566 uint32_t rm_ref = reference[i].outputs[j].rm;
1567
1568 if (((apsr != apsr_ref) || (rd != rd_ref) || (rn != rn_ref) ||
1569 (rm != rm_ref)) &&
1570 (++total_error_count <= kErrorReportLimit)) {
1571 // Print the instruction once even if it triggered multiple failures.
1572 if (!instruction_has_errors) {
1573 printf("Error(s) when testing \"%s %s\":\n",
1574 mnemonic,
1575 kTests[i].operands_description);
1576 instruction_has_errors = true;
1577 }
1578 // Print subsequent errors.
1579 printf(" Input: ");
1580 printf("0x%08" PRIx32, apsr_input);
1581 printf(", ");
1582 printf("0x%08" PRIx32, rd_input);
1583 printf(", ");
1584 printf("0x%08" PRIx32, rn_input);
1585 printf(", ");
1586 printf("0x%08" PRIx32, rm_input);
1587 printf("\n");
1588 printf(" Expected: ");
1589 printf("0x%08" PRIx32, apsr_ref);
1590 printf(", ");
1591 printf("0x%08" PRIx32, rd_ref);
1592 printf(", ");
1593 printf("0x%08" PRIx32, rn_ref);
1594 printf(", ");
1595 printf("0x%08" PRIx32, rm_ref);
1596 printf("\n");
1597 printf(" Found: ");
1598 printf("0x%08" PRIx32, apsr);
1599 printf(", ");
1600 printf("0x%08" PRIx32, rd);
1601 printf(", ");
1602 printf("0x%08" PRIx32, rn);
1603 printf(", ");
1604 printf("0x%08" PRIx32, rm);
1605 printf("\n\n");
1606 }
1607 }
1608 }
1609
1610 if (total_error_count > kErrorReportLimit) {
1611 printf("%u other errors follow.\n",
1612 total_error_count - kErrorReportLimit);
1613 }
1614 VIXL_CHECK(total_error_count == 0);
1615 } else {
1616 VIXL_WARNING("Assembled the code, but did not run anything.\n");
1617 }
1618
1619 for (size_t i = 0; i < ARRAY_SIZE(kTests); i++) {
1620 delete[] results[i]->outputs;
1621 delete results[i];
1622 delete[] scratch_memory_buffers[i];
1623 }
1624 }
1625
1626 // Instantiate tests for each instruction in the list.
1627 // TODO: Remove this limitation by having a sandboxing mechanism.
1628 #if defined(VIXL_HOST_POINTER_32)
1629 #define TEST(mnemonic) \
1630 void Test_##mnemonic() { \
1631 TestHelper(&MacroAssembler::mnemonic, #mnemonic, kReference##mnemonic); \
1632 } \
1633 Test test_##mnemonic( \
1634 "AARCH32_SIMULATOR_COND_RD_RN_OPERAND_RM_SHIFT_AMOUNT_1TO32_" #mnemonic \
1635 "_T32", \
1636 &Test_##mnemonic);
1637 #else
1638 #define TEST(mnemonic) \
1639 void Test_##mnemonic() { \
1640 VIXL_WARNING("This test can only run on a 32-bit host.\n"); \
1641 USE(TestHelper); \
1642 } \
1643 Test test_##mnemonic( \
1644 "AARCH32_SIMULATOR_COND_RD_RN_OPERAND_RM_SHIFT_AMOUNT_1TO32_" #mnemonic \
1645 "_T32", \
1646 &Test_##mnemonic);
1647 #endif
1648
1649 FOREACH_INSTRUCTION(TEST)
1650 #undef TEST
1651
1652 } // namespace
1653 #endif
1654
1655 } // namespace aarch32
1656 } // namespace vixl
1657