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-assembler-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/macro-assembler-aarch32.h"
44 
45 #define BUF_SIZE (4096)
46 
47 namespace vixl {
48 namespace aarch32 {
49 
50 // List of instruction mnemonics.
51 #define FOREACH_INSTRUCTION(M) \
52   M(clz)                       \
53   M(rbit)                      \
54   M(rev)                       \
55   M(rev16)                     \
56   M(revsh)                     \
57   M(rrx)                       \
58   M(rrxs)
59 
60 
61 // The following definitions are defined again in each generated test, therefore
62 // we need to place them in an anomymous namespace. It expresses that they are
63 // local to this file only, and the compiler is not allowed to share these types
64 // across test files during template instantiation. Specifically, `Operands` has
65 // various layouts across generated tests so it absolutely cannot be shared.
66 
67 #ifdef VIXL_INCLUDE_TARGET_A32
68 namespace {
69 
70 // Values to be passed to the assembler to produce the instruction under test.
71 struct Operands {
72   Condition cond;
73   Register rd;
74   Register rn;
75 };
76 
77 // This structure contains all data needed to test one specific
78 // instruction.
79 struct TestData {
80   // The `operands` field represents what to pass to the assembler to
81   // produce the instruction.
82   Operands operands;
83   // True if we need to generate an IT instruction for this test to be valid.
84   bool in_it_block;
85   // The condition to give the IT instruction, this will be set to "al" by
86   // default.
87   Condition it_condition;
88   // Description of the operands, used for error reporting.
89   const char* operands_description;
90   // Unique identifier, used for generating traces.
91   const char* identifier;
92 };
93 
94 struct TestResult {
95   size_t size;
96   const byte* encoding;
97 };
98 
99 // Each element of this array produce one instruction encoding.
100 const TestData kTests[] =
101     {{{cs, r12, r1}, false, al, "cs r12 r1", "cs_r12_r1"},
102      {{hi, r6, r12}, false, al, "hi r6 r12", "hi_r6_r12"},
103      {{lt, r11, r10}, false, al, "lt r11 r10", "lt_r11_r10"},
104      {{vs, r10, r8}, false, al, "vs r10 r8", "vs_r10_r8"},
105      {{pl, r5, r8}, false, al, "pl r5 r8", "pl_r5_r8"},
106      {{ls, r14, r14}, false, al, "ls r14 r14", "ls_r14_r14"},
107      {{gt, r8, r6}, false, al, "gt r8 r6", "gt_r8_r6"},
108      {{vc, r7, r11}, false, al, "vc r7 r11", "vc_r7_r11"},
109      {{pl, r4, r12}, false, al, "pl r4 r12", "pl_r4_r12"},
110      {{gt, r12, r12}, false, al, "gt r12 r12", "gt_r12_r12"},
111      {{ne, r8, r4}, false, al, "ne r8 r4", "ne_r8_r4"},
112      {{le, r1, r11}, false, al, "le r1 r11", "le_r1_r11"},
113      {{cc, r4, r10}, false, al, "cc r4 r10", "cc_r4_r10"},
114      {{gt, r14, r0}, false, al, "gt r14 r0", "gt_r14_r0"},
115      {{cs, r2, r11}, false, al, "cs r2 r11", "cs_r2_r11"},
116      {{al, r3, r12}, false, al, "al r3 r12", "al_r3_r12"},
117      {{hi, r6, r0}, false, al, "hi r6 r0", "hi_r6_r0"},
118      {{ls, r10, r10}, false, al, "ls r10 r10", "ls_r10_r10"},
119      {{ls, r4, r8}, false, al, "ls r4 r8", "ls_r4_r8"},
120      {{le, r8, r0}, false, al, "le r8 r0", "le_r8_r0"},
121      {{pl, r5, r3}, false, al, "pl r5 r3", "pl_r5_r3"},
122      {{ls, r8, r5}, false, al, "ls r8 r5", "ls_r8_r5"},
123      {{ge, r0, r10}, false, al, "ge r0 r10", "ge_r0_r10"},
124      {{lt, r10, r6}, false, al, "lt r10 r6", "lt_r10_r6"},
125      {{ne, r9, r9}, false, al, "ne r9 r9", "ne_r9_r9"},
126      {{hi, r5, r0}, false, al, "hi r5 r0", "hi_r5_r0"},
127      {{pl, r10, r6}, false, al, "pl r10 r6", "pl_r10_r6"},
128      {{vs, r1, r3}, false, al, "vs r1 r3", "vs_r1_r3"},
129      {{vs, r9, r8}, false, al, "vs r9 r8", "vs_r9_r8"},
130      {{cc, r2, r10}, false, al, "cc r2 r10", "cc_r2_r10"},
131      {{cs, r11, r3}, false, al, "cs r11 r3", "cs_r11_r3"},
132      {{hi, r8, r2}, false, al, "hi r8 r2", "hi_r8_r2"},
133      {{pl, r6, r0}, false, al, "pl r6 r0", "pl_r6_r0"},
134      {{hi, r9, r2}, false, al, "hi r9 r2", "hi_r9_r2"},
135      {{al, r14, r11}, false, al, "al r14 r11", "al_r14_r11"},
136      {{eq, r8, r13}, false, al, "eq r8 r13", "eq_r8_r13"},
137      {{ge, r12, r2}, false, al, "ge r12 r2", "ge_r12_r2"},
138      {{cc, r2, r6}, false, al, "cc r2 r6", "cc_r2_r6"},
139      {{ne, r13, r9}, false, al, "ne r13 r9", "ne_r13_r9"},
140      {{ne, r13, r10}, false, al, "ne r13 r10", "ne_r13_r10"},
141      {{mi, r10, r9}, false, al, "mi r10 r9", "mi_r10_r9"},
142      {{lt, r13, r12}, false, al, "lt r13 r12", "lt_r13_r12"},
143      {{lt, r14, r3}, false, al, "lt r14 r3", "lt_r14_r3"},
144      {{mi, r12, r14}, false, al, "mi r12 r14", "mi_r12_r14"},
145      {{vs, r11, r2}, false, al, "vs r11 r2", "vs_r11_r2"},
146      {{ls, r11, r0}, false, al, "ls r11 r0", "ls_r11_r0"},
147      {{gt, r10, r9}, false, al, "gt r10 r9", "gt_r10_r9"},
148      {{le, r10, r12}, false, al, "le r10 r12", "le_r10_r12"},
149      {{ge, r0, r14}, false, al, "ge r0 r14", "ge_r0_r14"},
150      {{mi, r5, r8}, false, al, "mi r5 r8", "mi_r5_r8"},
151      {{vs, r4, r11}, false, al, "vs r4 r11", "vs_r4_r11"},
152      {{lt, r7, r12}, false, al, "lt r7 r12", "lt_r7_r12"},
153      {{gt, r2, r8}, false, al, "gt r2 r8", "gt_r2_r8"},
154      {{gt, r5, r7}, false, al, "gt r5 r7", "gt_r5_r7"},
155      {{pl, r6, r3}, false, al, "pl r6 r3", "pl_r6_r3"},
156      {{ne, r2, r12}, false, al, "ne r2 r12", "ne_r2_r12"},
157      {{hi, r11, r11}, false, al, "hi r11 r11", "hi_r11_r11"},
158      {{vs, r4, r14}, false, al, "vs r4 r14", "vs_r4_r14"},
159      {{vs, r13, r1}, false, al, "vs r13 r1", "vs_r13_r1"},
160      {{cs, r4, r3}, false, al, "cs r4 r3", "cs_r4_r3"},
161      {{eq, r13, r6}, false, al, "eq r13 r6", "eq_r13_r6"},
162      {{gt, r11, r14}, false, al, "gt r11 r14", "gt_r11_r14"},
163      {{vc, r14, r4}, false, al, "vc r14 r4", "vc_r14_r4"},
164      {{vc, r1, r10}, false, al, "vc r1 r10", "vc_r1_r10"},
165      {{mi, r10, r3}, false, al, "mi r10 r3", "mi_r10_r3"},
166      {{vs, r9, r3}, false, al, "vs r9 r3", "vs_r9_r3"},
167      {{vc, r14, r5}, false, al, "vc r14 r5", "vc_r14_r5"},
168      {{ne, r9, r1}, false, al, "ne r9 r1", "ne_r9_r1"},
169      {{al, r9, r6}, false, al, "al r9 r6", "al_r9_r6"},
170      {{vc, r7, r8}, false, al, "vc r7 r8", "vc_r7_r8"},
171      {{ls, r6, r9}, false, al, "ls r6 r9", "ls_r6_r9"},
172      {{le, r14, r2}, false, al, "le r14 r2", "le_r14_r2"},
173      {{ls, r9, r13}, false, al, "ls r9 r13", "ls_r9_r13"},
174      {{eq, r1, r5}, false, al, "eq r1 r5", "eq_r1_r5"},
175      {{le, r9, r2}, false, al, "le r9 r2", "le_r9_r2"},
176      {{eq, r2, r1}, false, al, "eq r2 r1", "eq_r2_r1"},
177      {{ls, r9, r11}, false, al, "ls r9 r11", "ls_r9_r11"},
178      {{lt, r7, r13}, false, al, "lt r7 r13", "lt_r7_r13"},
179      {{cc, r8, r7}, false, al, "cc r8 r7", "cc_r8_r7"},
180      {{ls, r5, r1}, false, al, "ls r5 r1", "ls_r5_r1"},
181      {{le, r1, r9}, false, al, "le r1 r9", "le_r1_r9"},
182      {{ls, r8, r14}, false, al, "ls r8 r14", "ls_r8_r14"},
183      {{le, r9, r1}, false, al, "le r9 r1", "le_r9_r1"},
184      {{gt, r1, r6}, false, al, "gt r1 r6", "gt_r1_r6"},
185      {{gt, r11, r10}, false, al, "gt r11 r10", "gt_r11_r10"},
186      {{hi, r0, r12}, false, al, "hi r0 r12", "hi_r0_r12"},
187      {{gt, r1, r7}, false, al, "gt r1 r7", "gt_r1_r7"},
188      {{mi, r7, r1}, false, al, "mi r7 r1", "mi_r7_r1"},
189      {{mi, r7, r0}, false, al, "mi r7 r0", "mi_r7_r0"},
190      {{ls, r1, r3}, false, al, "ls r1 r3", "ls_r1_r3"},
191      {{mi, r13, r3}, false, al, "mi r13 r3", "mi_r13_r3"},
192      {{eq, r4, r3}, false, al, "eq r4 r3", "eq_r4_r3"},
193      {{vc, r14, r9}, false, al, "vc r14 r9", "vc_r14_r9"},
194      {{pl, r3, r1}, false, al, "pl r3 r1", "pl_r3_r1"},
195      {{mi, r0, r2}, false, al, "mi r0 r2", "mi_r0_r2"},
196      {{hi, r2, r7}, false, al, "hi r2 r7", "hi_r2_r7"},
197      {{hi, r13, r12}, false, al, "hi r13 r12", "hi_r13_r12"},
198      {{ls, r12, r8}, false, al, "ls r12 r8", "ls_r12_r8"},
199      {{ne, r5, r6}, false, al, "ne r5 r6", "ne_r5_r6"},
200      {{pl, r5, r4}, false, al, "pl r5 r4", "pl_r5_r4"},
201      {{ge, r1, r6}, false, al, "ge r1 r6", "ge_r1_r6"},
202      {{eq, r8, r10}, false, al, "eq r8 r10", "eq_r8_r10"},
203      {{cs, r5, r4}, false, al, "cs r5 r4", "cs_r5_r4"},
204      {{eq, r11, r6}, false, al, "eq r11 r6", "eq_r11_r6"},
205      {{cs, r13, r3}, false, al, "cs r13 r3", "cs_r13_r3"},
206      {{pl, r2, r8}, false, al, "pl r2 r8", "pl_r2_r8"},
207      {{gt, r10, r0}, false, al, "gt r10 r0", "gt_r10_r0"},
208      {{lt, r4, r10}, false, al, "lt r4 r10", "lt_r4_r10"},
209      {{vs, r14, r14}, false, al, "vs r14 r14", "vs_r14_r14"},
210      {{hi, r0, r7}, false, al, "hi r0 r7", "hi_r0_r7"},
211      {{cc, r9, r6}, false, al, "cc r9 r6", "cc_r9_r6"},
212      {{ne, r7, r13}, false, al, "ne r7 r13", "ne_r7_r13"},
213      {{eq, r2, r6}, false, al, "eq r2 r6", "eq_r2_r6"},
214      {{cs, r12, r12}, false, al, "cs r12 r12", "cs_r12_r12"},
215      {{mi, r3, r10}, false, al, "mi r3 r10", "mi_r3_r10"},
216      {{le, r6, r13}, false, al, "le r6 r13", "le_r6_r13"},
217      {{al, r2, r1}, false, al, "al r2 r1", "al_r2_r1"},
218      {{le, r3, r4}, false, al, "le r3 r4", "le_r3_r4"},
219      {{pl, r4, r4}, false, al, "pl r4 r4", "pl_r4_r4"},
220      {{lt, r12, r3}, false, al, "lt r12 r3", "lt_r12_r3"},
221      {{ls, r7, r4}, false, al, "ls r7 r4", "ls_r7_r4"},
222      {{le, r9, r4}, false, al, "le r9 r4", "le_r9_r4"},
223      {{vc, r13, r3}, false, al, "vc r13 r3", "vc_r13_r3"},
224      {{vc, r8, r8}, false, al, "vc r8 r8", "vc_r8_r8"},
225      {{ge, r2, r8}, false, al, "ge r2 r8", "ge_r2_r8"},
226      {{le, r11, r13}, false, al, "le r11 r13", "le_r11_r13"},
227      {{le, r1, r5}, false, al, "le r1 r5", "le_r1_r5"},
228      {{ge, r9, r12}, false, al, "ge r9 r12", "ge_r9_r12"},
229      {{cs, r14, r14}, false, al, "cs r14 r14", "cs_r14_r14"},
230      {{cc, r1, r0}, false, al, "cc r1 r0", "cc_r1_r0"},
231      {{ge, r3, r0}, false, al, "ge r3 r0", "ge_r3_r0"},
232      {{al, r10, r0}, false, al, "al r10 r0", "al_r10_r0"},
233      {{cc, r11, r10}, false, al, "cc r11 r10", "cc_r11_r10"},
234      {{mi, r11, r11}, false, al, "mi r11 r11", "mi_r11_r11"},
235      {{ne, r12, r7}, false, al, "ne r12 r7", "ne_r12_r7"},
236      {{lt, r4, r12}, false, al, "lt r4 r12", "lt_r4_r12"},
237      {{gt, r14, r5}, false, al, "gt r14 r5", "gt_r14_r5"},
238      {{ge, r1, r7}, false, al, "ge r1 r7", "ge_r1_r7"},
239      {{al, r7, r0}, false, al, "al r7 r0", "al_r7_r0"},
240      {{ls, r2, r0}, false, al, "ls r2 r0", "ls_r2_r0"},
241      {{pl, r6, r11}, false, al, "pl r6 r11", "pl_r6_r11"},
242      {{vc, r0, r6}, false, al, "vc r0 r6", "vc_r0_r6"},
243      {{pl, r6, r9}, false, al, "pl r6 r9", "pl_r6_r9"},
244      {{vs, r8, r1}, false, al, "vs r8 r1", "vs_r8_r1"},
245      {{cs, r1, r6}, false, al, "cs r1 r6", "cs_r1_r6"},
246      {{hi, r4, r11}, false, al, "hi r4 r11", "hi_r4_r11"},
247      {{gt, r5, r5}, false, al, "gt r5 r5", "gt_r5_r5"},
248      {{al, r3, r4}, false, al, "al r3 r4", "al_r3_r4"},
249      {{ge, r11, r12}, false, al, "ge r11 r12", "ge_r11_r12"},
250      {{cc, r14, r2}, false, al, "cc r14 r2", "cc_r14_r2"},
251      {{ge, r2, r4}, false, al, "ge r2 r4", "ge_r2_r4"},
252      {{lt, r5, r11}, false, al, "lt r5 r11", "lt_r5_r11"},
253      {{mi, r11, r14}, false, al, "mi r11 r14", "mi_r11_r14"},
254      {{ne, r3, r3}, false, al, "ne r3 r3", "ne_r3_r3"},
255      {{pl, r14, r0}, false, al, "pl r14 r0", "pl_r14_r0"},
256      {{vc, r4, r10}, false, al, "vc r4 r10", "vc_r4_r10"},
257      {{vs, r6, r8}, false, al, "vs r6 r8", "vs_r6_r8"},
258      {{vc, r4, r7}, false, al, "vc r4 r7", "vc_r4_r7"},
259      {{cs, r11, r10}, false, al, "cs r11 r10", "cs_r11_r10"},
260      {{eq, r11, r8}, false, al, "eq r11 r8", "eq_r11_r8"},
261      {{ne, r9, r2}, false, al, "ne r9 r2", "ne_r9_r2"},
262      {{hi, r9, r7}, false, al, "hi r9 r7", "hi_r9_r7"},
263      {{lt, r0, r6}, false, al, "lt r0 r6", "lt_r0_r6"},
264      {{vc, r5, r8}, false, al, "vc r5 r8", "vc_r5_r8"},
265      {{gt, r3, r1}, false, al, "gt r3 r1", "gt_r3_r1"},
266      {{pl, r3, r5}, false, al, "pl r3 r5", "pl_r3_r5"},
267      {{al, r11, r5}, false, al, "al r11 r5", "al_r11_r5"},
268      {{hi, r8, r14}, false, al, "hi r8 r14", "hi_r8_r14"},
269      {{le, r5, r4}, false, al, "le r5 r4", "le_r5_r4"},
270      {{ge, r13, r3}, false, al, "ge r13 r3", "ge_r13_r3"},
271      {{pl, r7, r14}, false, al, "pl r7 r14", "pl_r7_r14"},
272      {{cs, r6, r9}, false, al, "cs r6 r9", "cs_r6_r9"},
273      {{lt, r8, r12}, false, al, "lt r8 r12", "lt_r8_r12"},
274      {{cc, r12, r0}, false, al, "cc r12 r0", "cc_r12_r0"},
275      {{mi, r14, r13}, false, al, "mi r14 r13", "mi_r14_r13"},
276      {{pl, r12, r13}, false, al, "pl r12 r13", "pl_r12_r13"},
277      {{al, r4, r8}, false, al, "al r4 r8", "al_r4_r8"},
278      {{ls, r5, r11}, false, al, "ls r5 r11", "ls_r5_r11"},
279      {{ge, r11, r3}, false, al, "ge r11 r3", "ge_r11_r3"},
280      {{le, r1, r0}, false, al, "le r1 r0", "le_r1_r0"},
281      {{gt, r14, r4}, false, al, "gt r14 r4", "gt_r14_r4"},
282      {{ne, r3, r14}, false, al, "ne r3 r14", "ne_r3_r14"},
283      {{cc, r3, r8}, false, al, "cc r3 r8", "cc_r3_r8"},
284      {{eq, r7, r10}, false, al, "eq r7 r10", "eq_r7_r10"},
285      {{pl, r0, r10}, false, al, "pl r0 r10", "pl_r0_r10"},
286      {{mi, r6, r13}, false, al, "mi r6 r13", "mi_r6_r13"},
287      {{gt, r10, r5}, false, al, "gt r10 r5", "gt_r10_r5"},
288      {{ne, r0, r1}, false, al, "ne r0 r1", "ne_r0_r1"},
289      {{ge, r4, r8}, false, al, "ge r4 r8", "ge_r4_r8"},
290      {{cs, r3, r7}, false, al, "cs r3 r7", "cs_r3_r7"},
291      {{pl, r2, r12}, false, al, "pl r2 r12", "pl_r2_r12"},
292      {{ls, r9, r12}, false, al, "ls r9 r12", "ls_r9_r12"},
293      {{ge, r4, r9}, false, al, "ge r4 r9", "ge_r4_r9"},
294      {{lt, r7, r2}, false, al, "lt r7 r2", "lt_r7_r2"},
295      {{hi, r10, r10}, false, al, "hi r10 r10", "hi_r10_r10"},
296      {{ls, r1, r7}, false, al, "ls r1 r7", "ls_r1_r7"},
297      {{vs, r1, r12}, false, al, "vs r1 r12", "vs_r1_r12"},
298      {{ge, r9, r14}, false, al, "ge r9 r14", "ge_r9_r14"},
299      {{pl, r6, r4}, false, al, "pl r6 r4", "pl_r6_r4"},
300      {{ls, r3, r2}, false, al, "ls r3 r2", "ls_r3_r2"},
301      {{cs, r4, r4}, false, al, "cs r4 r4", "cs_r4_r4"},
302      {{eq, r6, r2}, false, al, "eq r6 r2", "eq_r6_r2"},
303      {{ge, r14, r0}, false, al, "ge r14 r0", "ge_r14_r0"},
304      {{le, r11, r6}, false, al, "le r11 r6", "le_r11_r6"},
305      {{vs, r0, r0}, false, al, "vs r0 r0", "vs_r0_r0"},
306      {{vs, r4, r6}, false, al, "vs r4 r6", "vs_r4_r6"},
307      {{gt, r6, r10}, false, al, "gt r6 r10", "gt_r6_r10"},
308      {{vc, r12, r7}, false, al, "vc r12 r7", "vc_r12_r7"},
309      {{gt, r8, r3}, false, al, "gt r8 r3", "gt_r8_r3"},
310      {{hi, r14, r4}, false, al, "hi r14 r4", "hi_r14_r4"},
311      {{hi, r9, r14}, false, al, "hi r9 r14", "hi_r9_r14"},
312      {{vs, r6, r1}, false, al, "vs r6 r1", "vs_r6_r1"},
313      {{hi, r5, r4}, false, al, "hi r5 r4", "hi_r5_r4"},
314      {{lt, r10, r14}, false, al, "lt r10 r14", "lt_r10_r14"},
315      {{cc, r8, r10}, false, al, "cc r8 r10", "cc_r8_r10"},
316      {{lt, r11, r0}, false, al, "lt r11 r0", "lt_r11_r0"},
317      {{ge, r4, r12}, false, al, "ge r4 r12", "ge_r4_r12"},
318      {{cc, r5, r7}, false, al, "cc r5 r7", "cc_r5_r7"},
319      {{gt, r3, r9}, false, al, "gt r3 r9", "gt_r3_r9"},
320      {{vc, r11, r5}, false, al, "vc r11 r5", "vc_r11_r5"},
321      {{lt, r7, r1}, false, al, "lt r7 r1", "lt_r7_r1"},
322      {{lt, r1, r8}, false, al, "lt r1 r8", "lt_r1_r8"},
323      {{hi, r11, r13}, false, al, "hi r11 r13", "hi_r11_r13"},
324      {{vs, r10, r2}, false, al, "vs r10 r2", "vs_r10_r2"},
325      {{ne, r1, r10}, false, al, "ne r1 r10", "ne_r1_r10"},
326      {{vc, r10, r0}, false, al, "vc r10 r0", "vc_r10_r0"},
327      {{al, r2, r2}, false, al, "al r2 r2", "al_r2_r2"},
328      {{ne, r7, r8}, false, al, "ne r7 r8", "ne_r7_r8"},
329      {{hi, r11, r14}, false, al, "hi r11 r14", "hi_r11_r14"},
330      {{ne, r6, r14}, false, al, "ne r6 r14", "ne_r6_r14"},
331      {{ge, r8, r5}, false, al, "ge r8 r5", "ge_r8_r5"},
332      {{vs, r7, r3}, false, al, "vs r7 r3", "vs_r7_r3"},
333      {{ne, r14, r13}, false, al, "ne r14 r13", "ne_r14_r13"},
334      {{hi, r12, r11}, false, al, "hi r12 r11", "hi_r12_r11"},
335      {{ls, r11, r9}, false, al, "ls r11 r9", "ls_r11_r9"},
336      {{mi, r12, r7}, false, al, "mi r12 r7", "mi_r12_r7"},
337      {{cc, r8, r8}, false, al, "cc r8 r8", "cc_r8_r8"},
338      {{ls, r14, r12}, false, al, "ls r14 r12", "ls_r14_r12"},
339      {{ls, r3, r6}, false, al, "ls r3 r6", "ls_r3_r6"},
340      {{hi, r7, r8}, false, al, "hi r7 r8", "hi_r7_r8"},
341      {{vs, r4, r10}, false, al, "vs r4 r10", "vs_r4_r10"},
342      {{ne, r12, r1}, false, al, "ne r12 r1", "ne_r12_r1"},
343      {{vs, r12, r4}, false, al, "vs r12 r4", "vs_r12_r4"},
344      {{hi, r5, r5}, false, al, "hi r5 r5", "hi_r5_r5"},
345      {{gt, r8, r8}, false, al, "gt r8 r8", "gt_r8_r8"},
346      {{lt, r10, r10}, false, al, "lt r10 r10", "lt_r10_r10"},
347      {{vs, r13, r4}, false, al, "vs r13 r4", "vs_r13_r4"},
348      {{mi, r8, r3}, false, al, "mi r8 r3", "mi_r8_r3"},
349      {{eq, r6, r13}, false, al, "eq r6 r13", "eq_r6_r13"},
350      {{al, r2, r0}, false, al, "al r2 r0", "al_r2_r0"},
351      {{ls, r6, r12}, false, al, "ls r6 r12", "ls_r6_r12"},
352      {{vs, r1, r4}, false, al, "vs r1 r4", "vs_r1_r4"},
353      {{vc, r11, r1}, false, al, "vc r11 r1", "vc_r11_r1"},
354      {{ne, r9, r10}, false, al, "ne r9 r10", "ne_r9_r10"},
355      {{ne, r3, r10}, false, al, "ne r3 r10", "ne_r3_r10"},
356      {{hi, r7, r10}, false, al, "hi r7 r10", "hi_r7_r10"},
357      {{pl, r4, r10}, false, al, "pl r4 r10", "pl_r4_r10"},
358      {{le, r7, r1}, false, al, "le r7 r1", "le_r7_r1"},
359      {{gt, r13, r10}, false, al, "gt r13 r10", "gt_r13_r10"},
360      {{lt, r4, r14}, false, al, "lt r4 r14", "lt_r4_r14"},
361      {{al, r10, r1}, false, al, "al r10 r1", "al_r10_r1"},
362      {{mi, r6, r12}, false, al, "mi r6 r12", "mi_r6_r12"},
363      {{eq, r13, r9}, false, al, "eq r13 r9", "eq_r13_r9"},
364      {{ge, r11, r4}, false, al, "ge r11 r4", "ge_r11_r4"},
365      {{hi, r1, r12}, false, al, "hi r1 r12", "hi_r1_r12"},
366      {{ge, r0, r1}, false, al, "ge r0 r1", "ge_r0_r1"},
367      {{lt, r2, r3}, false, al, "lt r2 r3", "lt_r2_r3"},
368      {{al, r12, r9}, false, al, "al r12 r9", "al_r12_r9"},
369      {{hi, r2, r10}, false, al, "hi r2 r10", "hi_r2_r10"},
370      {{mi, r14, r11}, false, al, "mi r14 r11", "mi_r14_r11"},
371      {{pl, r3, r10}, false, al, "pl r3 r10", "pl_r3_r10"},
372      {{vs, r1, r6}, false, al, "vs r1 r6", "vs_r1_r6"},
373      {{al, r7, r6}, false, al, "al r7 r6", "al_r7_r6"},
374      {{ge, r6, r8}, false, al, "ge r6 r8", "ge_r6_r8"},
375      {{eq, r3, r3}, false, al, "eq r3 r3", "eq_r3_r3"},
376      {{ne, r14, r4}, false, al, "ne r14 r4", "ne_r14_r4"},
377      {{vc, r13, r10}, false, al, "vc r13 r10", "vc_r13_r10"},
378      {{mi, r3, r12}, false, al, "mi r3 r12", "mi_r3_r12"},
379      {{pl, r9, r1}, false, al, "pl r9 r1", "pl_r9_r1"},
380      {{hi, r14, r14}, false, al, "hi r14 r14", "hi_r14_r14"},
381      {{ne, r0, r9}, false, al, "ne r0 r9", "ne_r0_r9"},
382      {{mi, r1, r1}, false, al, "mi r1 r1", "mi_r1_r1"},
383      {{hi, r7, r2}, false, al, "hi r7 r2", "hi_r7_r2"},
384      {{gt, r2, r3}, false, al, "gt r2 r3", "gt_r2_r3"},
385      {{eq, r2, r0}, false, al, "eq r2 r0", "eq_r2_r0"},
386      {{vs, r10, r12}, false, al, "vs r10 r12", "vs_r10_r12"},
387      {{gt, r11, r7}, false, al, "gt r11 r7", "gt_r11_r7"},
388      {{vs, r13, r2}, false, al, "vs r13 r2", "vs_r13_r2"},
389      {{ls, r11, r12}, false, al, "ls r11 r12", "ls_r11_r12"},
390      {{al, r8, r8}, false, al, "al r8 r8", "al_r8_r8"},
391      {{hi, r6, r10}, false, al, "hi r6 r10", "hi_r6_r10"},
392      {{vs, r5, r1}, false, al, "vs r5 r1", "vs_r5_r1"},
393      {{ls, r0, r10}, false, al, "ls r0 r10", "ls_r0_r10"},
394      {{gt, r0, r1}, false, al, "gt r0 r1", "gt_r0_r1"},
395      {{ne, r11, r12}, false, al, "ne r11 r12", "ne_r11_r12"},
396      {{ne, r13, r5}, false, al, "ne r13 r5", "ne_r13_r5"},
397      {{mi, r0, r12}, false, al, "mi r0 r12", "mi_r0_r12"},
398      {{lt, r11, r6}, false, al, "lt r11 r6", "lt_r11_r6"},
399      {{eq, r11, r14}, false, al, "eq r11 r14", "eq_r11_r14"},
400      {{vc, r11, r10}, false, al, "vc r11 r10", "vc_r11_r10"},
401      {{cs, r3, r3}, false, al, "cs r3 r3", "cs_r3_r3"},
402      {{le, r12, r2}, false, al, "le r12 r2", "le_r12_r2"},
403      {{hi, r13, r8}, false, al, "hi r13 r8", "hi_r13_r8"},
404      {{pl, r6, r6}, false, al, "pl r6 r6", "pl_r6_r6"},
405      {{al, r4, r5}, false, al, "al r4 r5", "al_r4_r5"},
406      {{hi, r1, r0}, false, al, "hi r1 r0", "hi_r1_r0"},
407      {{ls, r10, r11}, false, al, "ls r10 r11", "ls_r10_r11"},
408      {{al, r8, r7}, false, al, "al r8 r7", "al_r8_r7"},
409      {{vc, r7, r1}, false, al, "vc r7 r1", "vc_r7_r1"},
410      {{ne, r7, r14}, false, al, "ne r7 r14", "ne_r7_r14"},
411      {{lt, r5, r9}, false, al, "lt r5 r9", "lt_r5_r9"},
412      {{al, r13, r8}, false, al, "al r13 r8", "al_r13_r8"},
413      {{ls, r6, r14}, false, al, "ls r6 r14", "ls_r6_r14"},
414      {{eq, r12, r0}, false, al, "eq r12 r0", "eq_r12_r0"},
415      {{mi, r8, r14}, false, al, "mi r8 r14", "mi_r8_r14"},
416      {{hi, r13, r2}, false, al, "hi r13 r2", "hi_r13_r2"},
417      {{al, r13, r2}, false, al, "al r13 r2", "al_r13_r2"},
418      {{vs, r8, r9}, false, al, "vs r8 r9", "vs_r8_r9"},
419      {{cc, r6, r2}, false, al, "cc r6 r2", "cc_r6_r2"},
420      {{lt, r8, r0}, false, al, "lt r8 r0", "lt_r8_r0"},
421      {{ls, r3, r13}, false, al, "ls r3 r13", "ls_r3_r13"},
422      {{gt, r10, r14}, false, al, "gt r10 r14", "gt_r10_r14"},
423      {{pl, r9, r8}, false, al, "pl r9 r8", "pl_r9_r8"},
424      {{pl, r14, r11}, false, al, "pl r14 r11", "pl_r14_r11"},
425      {{lt, r9, r3}, false, al, "lt r9 r3", "lt_r9_r3"},
426      {{hi, r9, r0}, false, al, "hi r9 r0", "hi_r9_r0"},
427      {{cc, r9, r3}, false, al, "cc r9 r3", "cc_r9_r3"},
428      {{ge, r10, r14}, false, al, "ge r10 r14", "ge_r10_r14"},
429      {{vs, r2, r1}, false, al, "vs r2 r1", "vs_r2_r1"},
430      {{vc, r4, r13}, false, al, "vc r4 r13", "vc_r4_r13"},
431      {{ls, r1, r9}, false, al, "ls r1 r9", "ls_r1_r9"},
432      {{lt, r13, r11}, false, al, "lt r13 r11", "lt_r13_r11"},
433      {{cs, r2, r10}, false, al, "cs r2 r10", "cs_r2_r10"},
434      {{le, r0, r13}, false, al, "le r0 r13", "le_r0_r13"},
435      {{al, r13, r11}, false, al, "al r13 r11", "al_r13_r11"},
436      {{eq, r5, r2}, false, al, "eq r5 r2", "eq_r5_r2"},
437      {{vs, r5, r12}, false, al, "vs r5 r12", "vs_r5_r12"},
438      {{al, r12, r0}, false, al, "al r12 r0", "al_r12_r0"},
439      {{le, r13, r9}, false, al, "le r13 r9", "le_r13_r9"},
440      {{cs, r14, r4}, false, al, "cs r14 r4", "cs_r14_r4"},
441      {{ne, r5, r7}, false, al, "ne r5 r7", "ne_r5_r7"},
442      {{al, r6, r6}, false, al, "al r6 r6", "al_r6_r6"},
443      {{gt, r4, r8}, false, al, "gt r4 r8", "gt_r4_r8"},
444      {{gt, r12, r8}, false, al, "gt r12 r8", "gt_r12_r8"},
445      {{eq, r4, r12}, false, al, "eq r4 r12", "eq_r4_r12"},
446      {{cs, r7, r13}, false, al, "cs r7 r13", "cs_r7_r13"},
447      {{cs, r2, r4}, false, al, "cs r2 r4", "cs_r2_r4"},
448      {{al, r10, r3}, false, al, "al r10 r3", "al_r10_r3"},
449      {{cs, r8, r9}, false, al, "cs r8 r9", "cs_r8_r9"},
450      {{cs, r1, r12}, false, al, "cs r1 r12", "cs_r1_r12"},
451      {{gt, r13, r0}, false, al, "gt r13 r0", "gt_r13_r0"},
452      {{vc, r13, r12}, false, al, "vc r13 r12", "vc_r13_r12"},
453      {{lt, r12, r14}, false, al, "lt r12 r14", "lt_r12_r14"},
454      {{lt, r0, r1}, false, al, "lt r0 r1", "lt_r0_r1"},
455      {{cc, r10, r2}, false, al, "cc r10 r2", "cc_r10_r2"},
456      {{le, r3, r5}, false, al, "le r3 r5", "le_r3_r5"},
457      {{eq, r2, r11}, false, al, "eq r2 r11", "eq_r2_r11"},
458      {{al, r12, r4}, false, al, "al r12 r4", "al_r12_r4"},
459      {{cs, r6, r5}, false, al, "cs r6 r5", "cs_r6_r5"},
460      {{hi, r13, r10}, false, al, "hi r13 r10", "hi_r13_r10"},
461      {{vs, r4, r3}, false, al, "vs r4 r3", "vs_r4_r3"},
462      {{ls, r7, r9}, false, al, "ls r7 r9", "ls_r7_r9"},
463      {{vs, r14, r8}, false, al, "vs r14 r8", "vs_r14_r8"},
464      {{cs, r1, r0}, false, al, "cs r1 r0", "cs_r1_r0"},
465      {{mi, r10, r8}, false, al, "mi r10 r8", "mi_r10_r8"},
466      {{ge, r10, r4}, false, al, "ge r10 r4", "ge_r10_r4"},
467      {{cc, r5, r4}, false, al, "cc r5 r4", "cc_r5_r4"},
468      {{lt, r0, r7}, false, al, "lt r0 r7", "lt_r0_r7"},
469      {{mi, r14, r10}, false, al, "mi r14 r10", "mi_r14_r10"},
470      {{mi, r0, r14}, false, al, "mi r0 r14", "mi_r0_r14"},
471      {{eq, r14, r10}, false, al, "eq r14 r10", "eq_r14_r10"},
472      {{ls, r4, r4}, false, al, "ls r4 r4", "ls_r4_r4"},
473      {{pl, r14, r1}, false, al, "pl r14 r1", "pl_r14_r1"},
474      {{eq, r10, r8}, false, al, "eq r10 r8", "eq_r10_r8"},
475      {{cs, r10, r6}, false, al, "cs r10 r6", "cs_r10_r6"},
476      {{al, r12, r2}, false, al, "al r12 r2", "al_r12_r2"},
477      {{ls, r12, r1}, false, al, "ls r12 r1", "ls_r12_r1"},
478      {{eq, r12, r11}, false, al, "eq r12 r11", "eq_r12_r11"},
479      {{vc, r4, r1}, false, al, "vc r4 r1", "vc_r4_r1"},
480      {{vs, r12, r2}, false, al, "vs r12 r2", "vs_r12_r2"},
481      {{al, r11, r8}, false, al, "al r11 r8", "al_r11_r8"},
482      {{hi, r6, r13}, false, al, "hi r6 r13", "hi_r6_r13"},
483      {{eq, r2, r8}, false, al, "eq r2 r8", "eq_r2_r8"},
484      {{cc, r9, r5}, false, al, "cc r9 r5", "cc_r9_r5"},
485      {{cc, r9, r7}, false, al, "cc r9 r7", "cc_r9_r7"},
486      {{lt, r4, r6}, false, al, "lt r4 r6", "lt_r4_r6"},
487      {{cc, r14, r13}, false, al, "cc r14 r13", "cc_r14_r13"},
488      {{vc, r3, r2}, false, al, "vc r3 r2", "vc_r3_r2"},
489      {{al, r6, r13}, false, al, "al r6 r13", "al_r6_r13"},
490      {{vs, r10, r10}, false, al, "vs r10 r10", "vs_r10_r10"},
491      {{cs, r6, r10}, false, al, "cs r6 r10", "cs_r6_r10"},
492      {{cc, r8, r12}, false, al, "cc r8 r12", "cc_r8_r12"},
493      {{vs, r7, r5}, false, al, "vs r7 r5", "vs_r7_r5"},
494      {{pl, r14, r10}, false, al, "pl r14 r10", "pl_r14_r10"},
495      {{hi, r1, r14}, false, al, "hi r1 r14", "hi_r1_r14"},
496      {{vc, r8, r12}, false, al, "vc r8 r12", "vc_r8_r12"},
497      {{ls, r2, r4}, false, al, "ls r2 r4", "ls_r2_r4"},
498      {{mi, r5, r12}, false, al, "mi r5 r12", "mi_r5_r12"},
499      {{eq, r6, r12}, false, al, "eq r6 r12", "eq_r6_r12"},
500      {{lt, r14, r9}, false, al, "lt r14 r9", "lt_r14_r9"},
501      {{lt, r11, r9}, false, al, "lt r11 r9", "lt_r11_r9"},
502      {{ne, r1, r9}, false, al, "ne r1 r9", "ne_r1_r9"},
503      {{pl, r11, r8}, false, al, "pl r11 r8", "pl_r11_r8"},
504      {{ne, r0, r6}, false, al, "ne r0 r6", "ne_r0_r6"},
505      {{vs, r4, r4}, false, al, "vs r4 r4", "vs_r4_r4"},
506      {{ls, r12, r9}, false, al, "ls r12 r9", "ls_r12_r9"},
507      {{cs, r9, r7}, false, al, "cs r9 r7", "cs_r9_r7"},
508      {{ne, r7, r2}, false, al, "ne r7 r2", "ne_r7_r2"},
509      {{hi, r9, r10}, false, al, "hi r9 r10", "hi_r9_r10"},
510      {{gt, r5, r2}, false, al, "gt r5 r2", "gt_r5_r2"},
511      {{pl, r4, r6}, false, al, "pl r4 r6", "pl_r4_r6"},
512      {{lt, r11, r8}, false, al, "lt r11 r8", "lt_r11_r8"},
513      {{hi, r13, r4}, false, al, "hi r13 r4", "hi_r13_r4"},
514      {{le, r1, r10}, false, al, "le r1 r10", "le_r1_r10"},
515      {{le, r11, r3}, false, al, "le r11 r3", "le_r11_r3"},
516      {{pl, r0, r11}, false, al, "pl r0 r11", "pl_r0_r11"},
517      {{le, r7, r4}, false, al, "le r7 r4", "le_r7_r4"},
518      {{le, r2, r11}, false, al, "le r2 r11", "le_r2_r11"},
519      {{cc, r1, r10}, false, al, "cc r1 r10", "cc_r1_r10"},
520      {{gt, r13, r14}, false, al, "gt r13 r14", "gt_r13_r14"},
521      {{ls, r10, r6}, false, al, "ls r10 r6", "ls_r10_r6"},
522      {{ls, r13, r4}, false, al, "ls r13 r4", "ls_r13_r4"},
523      {{gt, r12, r13}, false, al, "gt r12 r13", "gt_r12_r13"},
524      {{pl, r13, r7}, false, al, "pl r13 r7", "pl_r13_r7"},
525      {{le, r14, r0}, false, al, "le r14 r0", "le_r14_r0"},
526      {{gt, r1, r4}, false, al, "gt r1 r4", "gt_r1_r4"},
527      {{mi, r3, r5}, false, al, "mi r3 r5", "mi_r3_r5"},
528      {{vc, r4, r0}, false, al, "vc r4 r0", "vc_r4_r0"},
529      {{gt, r4, r11}, false, al, "gt r4 r11", "gt_r4_r11"},
530      {{vc, r5, r3}, false, al, "vc r5 r3", "vc_r5_r3"},
531      {{pl, r4, r7}, false, al, "pl r4 r7", "pl_r4_r7"},
532      {{al, r12, r6}, false, al, "al r12 r6", "al_r12_r6"},
533      {{mi, r2, r3}, false, al, "mi r2 r3", "mi_r2_r3"},
534      {{lt, r12, r4}, false, al, "lt r12 r4", "lt_r12_r4"},
535      {{lt, r10, r4}, false, al, "lt r10 r4", "lt_r10_r4"},
536      {{hi, r10, r8}, false, al, "hi r10 r8", "hi_r10_r8"},
537      {{al, r0, r14}, false, al, "al r0 r14", "al_r0_r14"},
538      {{cc, r3, r3}, false, al, "cc r3 r3", "cc_r3_r3"},
539      {{pl, r10, r13}, false, al, "pl r10 r13", "pl_r10_r13"},
540      {{lt, r7, r8}, false, al, "lt r7 r8", "lt_r7_r8"},
541      {{le, r12, r7}, false, al, "le r12 r7", "le_r12_r7"},
542      {{ge, r11, r8}, false, al, "ge r11 r8", "ge_r11_r8"},
543      {{ls, r10, r8}, false, al, "ls r10 r8", "ls_r10_r8"},
544      {{vs, r9, r1}, false, al, "vs r9 r1", "vs_r9_r1"},
545      {{ne, r10, r10}, false, al, "ne r10 r10", "ne_r10_r10"},
546      {{al, r6, r4}, false, al, "al r6 r4", "al_r6_r4"},
547      {{ls, r10, r0}, false, al, "ls r10 r0", "ls_r10_r0"},
548      {{eq, r7, r1}, false, al, "eq r7 r1", "eq_r7_r1"},
549      {{al, r11, r6}, false, al, "al r11 r6", "al_r11_r6"},
550      {{ge, r5, r10}, false, al, "ge r5 r10", "ge_r5_r10"},
551      {{vs, r0, r8}, false, al, "vs r0 r8", "vs_r0_r8"},
552      {{lt, r2, r1}, false, al, "lt r2 r1", "lt_r2_r1"},
553      {{le, r13, r2}, false, al, "le r13 r2", "le_r13_r2"},
554      {{al, r13, r6}, false, al, "al r13 r6", "al_r13_r6"},
555      {{lt, r12, r10}, false, al, "lt r12 r10", "lt_r12_r10"},
556      {{al, r13, r1}, false, al, "al r13 r1", "al_r13_r1"},
557      {{ge, r8, r14}, false, al, "ge r8 r14", "ge_r8_r14"},
558      {{mi, r11, r6}, false, al, "mi r11 r6", "mi_r11_r6"},
559      {{pl, r12, r14}, false, al, "pl r12 r14", "pl_r12_r14"},
560      {{ne, r14, r9}, false, al, "ne r14 r9", "ne_r14_r9"},
561      {{cc, r3, r1}, false, al, "cc r3 r1", "cc_r3_r1"},
562      {{ge, r0, r8}, false, al, "ge r0 r8", "ge_r0_r8"},
563      {{vc, r7, r9}, false, al, "vc r7 r9", "vc_r7_r9"},
564      {{gt, r11, r4}, false, al, "gt r11 r4", "gt_r11_r4"},
565      {{mi, r4, r0}, false, al, "mi r4 r0", "mi_r4_r0"},
566      {{ls, r3, r11}, false, al, "ls r3 r11", "ls_r3_r11"},
567      {{le, r14, r5}, false, al, "le r14 r5", "le_r14_r5"},
568      {{ls, r6, r7}, false, al, "ls r6 r7", "ls_r6_r7"},
569      {{ne, r4, r6}, false, al, "ne r4 r6", "ne_r4_r6"},
570      {{cc, r1, r14}, false, al, "cc r1 r14", "cc_r1_r14"},
571      {{pl, r11, r7}, false, al, "pl r11 r7", "pl_r11_r7"},
572      {{vc, r6, r5}, false, al, "vc r6 r5", "vc_r6_r5"},
573      {{al, r1, r11}, false, al, "al r1 r11", "al_r1_r11"},
574      {{ne, r2, r13}, false, al, "ne r2 r13", "ne_r2_r13"},
575      {{vc, r14, r6}, false, al, "vc r14 r6", "vc_r14_r6"},
576      {{gt, r3, r8}, false, al, "gt r3 r8", "gt_r3_r8"},
577      {{pl, r1, r8}, false, al, "pl r1 r8", "pl_r1_r8"},
578      {{vc, r2, r14}, false, al, "vc r2 r14", "vc_r2_r14"},
579      {{pl, r12, r3}, false, al, "pl r12 r3", "pl_r12_r3"},
580      {{ls, r0, r12}, false, al, "ls r0 r12", "ls_r0_r12"},
581      {{le, r2, r1}, false, al, "le r2 r1", "le_r2_r1"},
582      {{eq, r13, r5}, false, al, "eq r13 r5", "eq_r13_r5"},
583      {{al, r11, r11}, false, al, "al r11 r11", "al_r11_r11"},
584      {{ls, r9, r3}, false, al, "ls r9 r3", "ls_r9_r3"},
585      {{ne, r7, r12}, false, al, "ne r7 r12", "ne_r7_r12"},
586      {{al, r6, r2}, false, al, "al r6 r2", "al_r6_r2"},
587      {{ne, r7, r4}, false, al, "ne r7 r4", "ne_r7_r4"},
588      {{vc, r7, r5}, false, al, "vc r7 r5", "vc_r7_r5"},
589      {{ne, r7, r1}, false, al, "ne r7 r1", "ne_r7_r1"},
590      {{eq, r5, r3}, false, al, "eq r5 r3", "eq_r5_r3"},
591      {{cs, r3, r5}, false, al, "cs r3 r5", "cs_r3_r5"},
592      {{lt, r7, r4}, false, al, "lt r7 r4", "lt_r7_r4"},
593      {{ls, r4, r5}, false, al, "ls r4 r5", "ls_r4_r5"},
594      {{eq, r11, r2}, false, al, "eq r11 r2", "eq_r11_r2"},
595      {{hi, r2, r6}, false, al, "hi r2 r6", "hi_r2_r6"},
596      {{vc, r2, r3}, false, al, "vc r2 r3", "vc_r2_r3"},
597      {{ls, r12, r12}, false, al, "ls r12 r12", "ls_r12_r12"},
598      {{lt, r8, r2}, false, al, "lt r8 r2", "lt_r8_r2"},
599      {{cc, r14, r8}, false, al, "cc r14 r8", "cc_r14_r8"},
600      {{ge, r12, r8}, false, al, "ge r12 r8", "ge_r12_r8"}};
601 
602 // These headers each contain an array of `TestResult` with the reference output
603 // values. The reference arrays are names `kReference{mnemonic}`.
604 #include "aarch32/traces/assembler-cond-rd-rn-clz-a32.h"
605 #include "aarch32/traces/assembler-cond-rd-rn-rbit-a32.h"
606 #include "aarch32/traces/assembler-cond-rd-rn-rev-a32.h"
607 #include "aarch32/traces/assembler-cond-rd-rn-rev16-a32.h"
608 #include "aarch32/traces/assembler-cond-rd-rn-revsh-a32.h"
609 #include "aarch32/traces/assembler-cond-rd-rn-rrx-a32.h"
610 #include "aarch32/traces/assembler-cond-rd-rn-rrxs-a32.h"
611 
612 
613 // The maximum number of errors to report in detail for each test.
614 const unsigned kErrorReportLimit = 8;
615 
616 typedef void (MacroAssembler::*Fn)(Condition cond, Register rd, Register rn);
617 
TestHelper(Fn instruction,const char * mnemonic,const TestResult reference[])618 void TestHelper(Fn instruction,
619                 const char* mnemonic,
620                 const TestResult reference[]) {
621   unsigned total_error_count = 0;
622   MacroAssembler masm(BUF_SIZE);
623 
624   masm.UseA32();
625 
626   for (unsigned i = 0; i < ARRAY_SIZE(kTests); i++) {
627     // Values to pass to the macro-assembler.
628     Condition cond = kTests[i].operands.cond;
629     Register rd = kTests[i].operands.rd;
630     Register rn = kTests[i].operands.rn;
631 
632     int32_t start = masm.GetCursorOffset();
633     {
634       // We never generate more that 4 bytes, as IT instructions are only
635       // allowed for narrow encodings.
636       ExactAssemblyScope scope(&masm, 4, ExactAssemblyScope::kMaximumSize);
637       if (kTests[i].in_it_block) {
638         masm.it(kTests[i].it_condition);
639       }
640       (masm.*instruction)(cond, rd, rn);
641     }
642     int32_t end = masm.GetCursorOffset();
643 
644     const byte* result_ptr =
645         masm.GetBuffer()->GetOffsetAddress<const byte*>(start);
646     VIXL_ASSERT(start < end);
647     uint32_t result_size = end - start;
648 
649     if (Test::generate_test_trace()) {
650       // Print the result bytes.
651       printf("const byte kInstruction_%s_%s[] = {\n",
652              mnemonic,
653              kTests[i].identifier);
654       for (uint32_t j = 0; j < result_size; j++) {
655         if (j == 0) {
656           printf("  0x%02" PRIx8, result_ptr[j]);
657         } else {
658           printf(", 0x%02" PRIx8, result_ptr[j]);
659         }
660       }
661       // This comment is meant to be used by external tools to validate
662       // the encoding. We can parse the comment to figure out what
663       // instruction this corresponds to.
664       if (kTests[i].in_it_block) {
665         printf(" // It %s; %s %s\n};\n",
666                kTests[i].it_condition.GetName(),
667                mnemonic,
668                kTests[i].operands_description);
669       } else {
670         printf(" // %s %s\n};\n", mnemonic, kTests[i].operands_description);
671       }
672     } else {
673       // Check we've emitted the exact same encoding as present in the
674       // trace file. Only print up to `kErrorReportLimit` errors.
675       if (((result_size != reference[i].size) ||
676            (memcmp(result_ptr, reference[i].encoding, reference[i].size) !=
677             0)) &&
678           (++total_error_count <= kErrorReportLimit)) {
679         printf("Error when testing \"%s\" with operands \"%s\":\n",
680                mnemonic,
681                kTests[i].operands_description);
682         printf("  Expected: ");
683         for (uint32_t j = 0; j < reference[i].size; j++) {
684           if (j == 0) {
685             printf("0x%02" PRIx8, reference[i].encoding[j]);
686           } else {
687             printf(", 0x%02" PRIx8, reference[i].encoding[j]);
688           }
689         }
690         printf("\n");
691         printf("  Found:    ");
692         for (uint32_t j = 0; j < result_size; j++) {
693           if (j == 0) {
694             printf("0x%02" PRIx8, result_ptr[j]);
695           } else {
696             printf(", 0x%02" PRIx8, result_ptr[j]);
697           }
698         }
699         printf("\n");
700       }
701     }
702   }
703 
704   masm.FinalizeCode();
705 
706   if (Test::generate_test_trace()) {
707     // Finalize the trace file by writing the final `TestResult` array
708     // which links all generated instruction encodings.
709     printf("const TestResult kReference%s[] = {\n", mnemonic);
710     for (unsigned i = 0; i < ARRAY_SIZE(kTests); i++) {
711       printf("  {\n");
712       printf("    ARRAY_SIZE(kInstruction_%s_%s),\n",
713              mnemonic,
714              kTests[i].identifier);
715       printf("    kInstruction_%s_%s,\n", mnemonic, kTests[i].identifier);
716       printf("  },\n");
717     }
718     printf("};\n");
719   } else {
720     if (total_error_count > kErrorReportLimit) {
721       printf("%u other errors follow.\n",
722              total_error_count - kErrorReportLimit);
723     }
724     // Crash if the test failed.
725     VIXL_CHECK(total_error_count == 0);
726   }
727 }
728 
729 // Instantiate tests for each instruction in the list.
730 #define TEST(mnemonic)                                                      \
731   void Test_##mnemonic() {                                                  \
732     TestHelper(&MacroAssembler::mnemonic, #mnemonic, kReference##mnemonic); \
733   }                                                                         \
734   Test test_##mnemonic("AARCH32_ASSEMBLER_COND_RD_RN_" #mnemonic "_A32",    \
735                        &Test_##mnemonic);
736 FOREACH_INSTRUCTION(TEST)
737 #undef TEST
738 
739 }  // namespace
740 #endif
741 
742 }  // namespace aarch32
743 }  // namespace vixl
744