• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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(crc32b)                    \
53   M(crc32cb)                   \
54   M(crc32ch)                   \
55   M(crc32cw)                   \
56   M(crc32h)                    \
57   M(crc32w)
58 
59 
60 // The following definitions are defined again in each generated test, therefore
61 // we need to place them in an anomymous namespace. It expresses that they are
62 // local to this file only, and the compiler is not allowed to share these types
63 // across test files during template instantiation. Specifically, `Operands` has
64 // various layouts across generated tests so it absolutely cannot be shared.
65 
66 #ifdef VIXL_INCLUDE_TARGET_A32
67 namespace {
68 
69 // Values to be passed to the assembler to produce the instruction under test.
70 struct Operands {
71   Register rd;
72   Register rn;
73   Register rm;
74 };
75 
76 // This structure contains all data needed to test one specific
77 // instruction.
78 struct TestData {
79   // The `operands` field represents what to pass to the assembler to
80   // produce the instruction.
81   Operands operands;
82   // True if we need to generate an IT instruction for this test to be valid.
83   bool in_it_block;
84   // The condition to give the IT instruction, this will be set to "al" by
85   // default.
86   Condition it_condition;
87   // Description of the operands, used for error reporting.
88   const char* operands_description;
89   // Unique identifier, used for generating traces.
90   const char* identifier;
91 };
92 
93 struct TestResult {
94   size_t size;
95   const byte* encoding;
96 };
97 
98 // Each element of this array produce one instruction encoding.
99 const TestData kTests[] =
100     {{{r2, r10, r12}, false, al, "r2 r10 r12", "r2_r10_r12"},
101      {{r2, r11, r11}, false, al, "r2 r11 r11", "r2_r11_r11"},
102      {{r3, r1, r0}, false, al, "r3 r1 r0", "r3_r1_r0"},
103      {{r1, r7, r13}, false, al, "r1 r7 r13", "r1_r7_r13"},
104      {{r3, r14, r11}, false, al, "r3 r14 r11", "r3_r14_r11"},
105      {{r12, r3, r1}, false, al, "r12 r3 r1", "r12_r3_r1"},
106      {{r3, r9, r2}, false, al, "r3 r9 r2", "r3_r9_r2"},
107      {{r1, r3, r3}, false, al, "r1 r3 r3", "r1_r3_r3"},
108      {{r4, r5, r10}, false, al, "r4 r5 r10", "r4_r5_r10"},
109      {{r13, r6, r8}, false, al, "r13 r6 r8", "r13_r6_r8"},
110      {{r9, r1, r8}, false, al, "r9 r1 r8", "r9_r1_r8"},
111      {{r3, r8, r8}, false, al, "r3 r8 r8", "r3_r8_r8"},
112      {{r13, r14, r13}, false, al, "r13 r14 r13", "r13_r14_r13"},
113      {{r6, r0, r7}, false, al, "r6 r0 r7", "r6_r0_r7"},
114      {{r10, r14, r3}, false, al, "r10 r14 r3", "r10_r14_r3"},
115      {{r12, r12, r9}, false, al, "r12 r12 r9", "r12_r12_r9"},
116      {{r12, r10, r12}, false, al, "r12 r10 r12", "r12_r10_r12"},
117      {{r4, r10, r12}, false, al, "r4 r10 r12", "r4_r10_r12"},
118      {{r14, r14, r13}, false, al, "r14 r14 r13", "r14_r14_r13"},
119      {{r11, r12, r2}, false, al, "r11 r12 r2", "r11_r12_r2"},
120      {{r0, r14, r1}, false, al, "r0 r14 r1", "r0_r14_r1"},
121      {{r12, r2, r6}, false, al, "r12 r2 r6", "r12_r2_r6"},
122      {{r12, r8, r4}, false, al, "r12 r8 r4", "r12_r8_r4"},
123      {{r11, r8, r9}, false, al, "r11 r8 r9", "r11_r8_r9"},
124      {{r6, r3, r11}, false, al, "r6 r3 r11", "r6_r3_r11"},
125      {{r14, r10, r13}, false, al, "r14 r10 r13", "r14_r10_r13"},
126      {{r9, r8, r13}, false, al, "r9 r8 r13", "r9_r8_r13"},
127      {{r0, r2, r2}, false, al, "r0 r2 r2", "r0_r2_r2"},
128      {{r7, r12, r0}, false, al, "r7 r12 r0", "r7_r12_r0"},
129      {{r3, r0, r1}, false, al, "r3 r0 r1", "r3_r0_r1"},
130      {{r6, r5, r7}, false, al, "r6 r5 r7", "r6_r5_r7"},
131      {{r14, r5, r3}, false, al, "r14 r5 r3", "r14_r5_r3"},
132      {{r8, r11, r0}, false, al, "r8 r11 r0", "r8_r11_r0"},
133      {{r14, r9, r9}, false, al, "r14 r9 r9", "r14_r9_r9"},
134      {{r5, r3, r7}, false, al, "r5 r3 r7", "r5_r3_r7"},
135      {{r8, r12, r13}, false, al, "r8 r12 r13", "r8_r12_r13"},
136      {{r13, r14, r14}, false, al, "r13 r14 r14", "r13_r14_r14"},
137      {{r3, r11, r7}, false, al, "r3 r11 r7", "r3_r11_r7"},
138      {{r8, r14, r5}, false, al, "r8 r14 r5", "r8_r14_r5"},
139      {{r4, r3, r5}, false, al, "r4 r3 r5", "r4_r3_r5"},
140      {{r13, r11, r11}, false, al, "r13 r11 r11", "r13_r11_r11"},
141      {{r8, r7, r14}, false, al, "r8 r7 r14", "r8_r7_r14"},
142      {{r4, r3, r7}, false, al, "r4 r3 r7", "r4_r3_r7"},
143      {{r3, r10, r4}, false, al, "r3 r10 r4", "r3_r10_r4"},
144      {{r0, r14, r5}, false, al, "r0 r14 r5", "r0_r14_r5"},
145      {{r4, r12, r4}, false, al, "r4 r12 r4", "r4_r12_r4"},
146      {{r7, r0, r8}, false, al, "r7 r0 r8", "r7_r0_r8"},
147      {{r13, r6, r1}, false, al, "r13 r6 r1", "r13_r6_r1"},
148      {{r13, r14, r6}, false, al, "r13 r14 r6", "r13_r14_r6"},
149      {{r13, r12, r10}, false, al, "r13 r12 r10", "r13_r12_r10"},
150      {{r1, r12, r13}, false, al, "r1 r12 r13", "r1_r12_r13"},
151      {{r1, r6, r13}, false, al, "r1 r6 r13", "r1_r6_r13"},
152      {{r10, r6, r12}, false, al, "r10 r6 r12", "r10_r6_r12"},
153      {{r7, r8, r2}, false, al, "r7 r8 r2", "r7_r8_r2"},
154      {{r7, r10, r5}, false, al, "r7 r10 r5", "r7_r10_r5"},
155      {{r14, r12, r12}, false, al, "r14 r12 r12", "r14_r12_r12"},
156      {{r1, r2, r0}, false, al, "r1 r2 r0", "r1_r2_r0"},
157      {{r14, r8, r8}, false, al, "r14 r8 r8", "r14_r8_r8"},
158      {{r5, r6, r11}, false, al, "r5 r6 r11", "r5_r6_r11"},
159      {{r4, r8, r1}, false, al, "r4 r8 r1", "r4_r8_r1"},
160      {{r1, r1, r1}, false, al, "r1 r1 r1", "r1_r1_r1"},
161      {{r4, r2, r14}, false, al, "r4 r2 r14", "r4_r2_r14"},
162      {{r3, r14, r6}, false, al, "r3 r14 r6", "r3_r14_r6"},
163      {{r4, r10, r6}, false, al, "r4 r10 r6", "r4_r10_r6"},
164      {{r9, r1, r10}, false, al, "r9 r1 r10", "r9_r1_r10"},
165      {{r10, r9, r12}, false, al, "r10 r9 r12", "r10_r9_r12"},
166      {{r10, r8, r9}, false, al, "r10 r8 r9", "r10_r8_r9"},
167      {{r14, r13, r1}, false, al, "r14 r13 r1", "r14_r13_r1"},
168      {{r7, r6, r1}, false, al, "r7 r6 r1", "r7_r6_r1"},
169      {{r14, r11, r0}, false, al, "r14 r11 r0", "r14_r11_r0"},
170      {{r12, r12, r7}, false, al, "r12 r12 r7", "r12_r12_r7"},
171      {{r1, r9, r4}, false, al, "r1 r9 r4", "r1_r9_r4"},
172      {{r3, r4, r9}, false, al, "r3 r4 r9", "r3_r4_r9"},
173      {{r10, r12, r9}, false, al, "r10 r12 r9", "r10_r12_r9"},
174      {{r5, r10, r11}, false, al, "r5 r10 r11", "r5_r10_r11"},
175      {{r5, r2, r4}, false, al, "r5 r2 r4", "r5_r2_r4"},
176      {{r12, r0, r2}, false, al, "r12 r0 r2", "r12_r0_r2"},
177      {{r5, r1, r3}, false, al, "r5 r1 r3", "r5_r1_r3"},
178      {{r3, r8, r10}, false, al, "r3 r8 r10", "r3_r8_r10"},
179      {{r4, r3, r10}, false, al, "r4 r3 r10", "r4_r3_r10"},
180      {{r0, r3, r9}, false, al, "r0 r3 r9", "r0_r3_r9"},
181      {{r8, r2, r4}, false, al, "r8 r2 r4", "r8_r2_r4"},
182      {{r14, r5, r0}, false, al, "r14 r5 r0", "r14_r5_r0"},
183      {{r4, r4, r6}, false, al, "r4 r4 r6", "r4_r4_r6"},
184      {{r6, r7, r8}, false, al, "r6 r7 r8", "r6_r7_r8"},
185      {{r3, r6, r4}, false, al, "r3 r6 r4", "r3_r6_r4"},
186      {{r2, r6, r1}, false, al, "r2 r6 r1", "r2_r6_r1"},
187      {{r14, r5, r8}, false, al, "r14 r5 r8", "r14_r5_r8"},
188      {{r14, r9, r12}, false, al, "r14 r9 r12", "r14_r9_r12"},
189      {{r4, r0, r4}, false, al, "r4 r0 r4", "r4_r0_r4"},
190      {{r5, r7, r10}, false, al, "r5 r7 r10", "r5_r7_r10"},
191      {{r10, r8, r11}, false, al, "r10 r8 r11", "r10_r8_r11"},
192      {{r0, r3, r3}, false, al, "r0 r3 r3", "r0_r3_r3"},
193      {{r2, r14, r6}, false, al, "r2 r14 r6", "r2_r14_r6"},
194      {{r4, r9, r9}, false, al, "r4 r9 r9", "r4_r9_r9"},
195      {{r4, r14, r3}, false, al, "r4 r14 r3", "r4_r14_r3"},
196      {{r3, r14, r4}, false, al, "r3 r14 r4", "r3_r14_r4"},
197      {{r13, r11, r0}, false, al, "r13 r11 r0", "r13_r11_r0"},
198      {{r0, r6, r9}, false, al, "r0 r6 r9", "r0_r6_r9"},
199      {{r0, r12, r5}, false, al, "r0 r12 r5", "r0_r12_r5"},
200      {{r14, r8, r3}, false, al, "r14 r8 r3", "r14_r8_r3"},
201      {{r0, r9, r5}, false, al, "r0 r9 r5", "r0_r9_r5"},
202      {{r0, r8, r8}, false, al, "r0 r8 r8", "r0_r8_r8"},
203      {{r8, r9, r2}, false, al, "r8 r9 r2", "r8_r9_r2"},
204      {{r9, r11, r4}, false, al, "r9 r11 r4", "r9_r11_r4"},
205      {{r10, r10, r6}, false, al, "r10 r10 r6", "r10_r10_r6"},
206      {{r14, r9, r7}, false, al, "r14 r9 r7", "r14_r9_r7"},
207      {{r14, r4, r7}, false, al, "r14 r4 r7", "r14_r4_r7"},
208      {{r5, r12, r5}, false, al, "r5 r12 r5", "r5_r12_r5"},
209      {{r12, r10, r5}, false, al, "r12 r10 r5", "r12_r10_r5"},
210      {{r10, r4, r5}, false, al, "r10 r4 r5", "r10_r4_r5"},
211      {{r3, r14, r0}, false, al, "r3 r14 r0", "r3_r14_r0"},
212      {{r1, r10, r11}, false, al, "r1 r10 r11", "r1_r10_r11"},
213      {{r7, r3, r14}, false, al, "r7 r3 r14", "r7_r3_r14"},
214      {{r11, r9, r11}, false, al, "r11 r9 r11", "r11_r9_r11"},
215      {{r3, r4, r11}, false, al, "r3 r4 r11", "r3_r4_r11"},
216      {{r0, r6, r4}, false, al, "r0 r6 r4", "r0_r6_r4"},
217      {{r3, r2, r6}, false, al, "r3 r2 r6", "r3_r2_r6"},
218      {{r2, r3, r7}, false, al, "r2 r3 r7", "r2_r3_r7"},
219      {{r9, r8, r14}, false, al, "r9 r8 r14", "r9_r8_r14"},
220      {{r4, r0, r7}, false, al, "r4 r0 r7", "r4_r0_r7"},
221      {{r7, r11, r6}, false, al, "r7 r11 r6", "r7_r11_r6"},
222      {{r12, r14, r10}, false, al, "r12 r14 r10", "r12_r14_r10"},
223      {{r13, r10, r6}, false, al, "r13 r10 r6", "r13_r10_r6"},
224      {{r10, r1, r6}, false, al, "r10 r1 r6", "r10_r1_r6"},
225      {{r11, r13, r10}, false, al, "r11 r13 r10", "r11_r13_r10"},
226      {{r3, r7, r2}, false, al, "r3 r7 r2", "r3_r7_r2"},
227      {{r11, r4, r10}, false, al, "r11 r4 r10", "r11_r4_r10"},
228      {{r9, r12, r12}, false, al, "r9 r12 r12", "r9_r12_r12"},
229      {{r11, r14, r0}, false, al, "r11 r14 r0", "r11_r14_r0"},
230      {{r2, r8, r2}, false, al, "r2 r8 r2", "r2_r8_r2"},
231      {{r7, r12, r10}, false, al, "r7 r12 r10", "r7_r12_r10"},
232      {{r0, r3, r4}, false, al, "r0 r3 r4", "r0_r3_r4"},
233      {{r2, r1, r14}, false, al, "r2 r1 r14", "r2_r1_r14"},
234      {{r8, r1, r4}, false, al, "r8 r1 r4", "r8_r1_r4"},
235      {{r2, r1, r12}, false, al, "r2 r1 r12", "r2_r1_r12"},
236      {{r6, r7, r6}, false, al, "r6 r7 r6", "r6_r7_r6"},
237      {{r7, r13, r14}, false, al, "r7 r13 r14", "r7_r13_r14"},
238      {{r4, r6, r5}, false, al, "r4 r6 r5", "r4_r6_r5"},
239      {{r1, r1, r3}, false, al, "r1 r1 r3", "r1_r1_r3"},
240      {{r11, r14, r4}, false, al, "r11 r14 r4", "r11_r14_r4"},
241      {{r2, r3, r9}, false, al, "r2 r3 r9", "r2_r3_r9"},
242      {{r11, r12, r0}, false, al, "r11 r12 r0", "r11_r12_r0"},
243      {{r2, r6, r12}, false, al, "r2 r6 r12", "r2_r6_r12"},
244      {{r2, r4, r13}, false, al, "r2 r4 r13", "r2_r4_r13"},
245      {{r9, r6, r11}, false, al, "r9 r6 r11", "r9_r6_r11"},
246      {{r5, r3, r1}, false, al, "r5 r3 r1", "r5_r3_r1"},
247      {{r14, r3, r7}, false, al, "r14 r3 r7", "r14_r3_r7"},
248      {{r5, r1, r12}, false, al, "r5 r1 r12", "r5_r1_r12"},
249      {{r0, r9, r2}, false, al, "r0 r9 r2", "r0_r9_r2"},
250      {{r8, r0, r14}, false, al, "r8 r0 r14", "r8_r0_r14"},
251      {{r8, r12, r0}, false, al, "r8 r12 r0", "r8_r12_r0"},
252      {{r10, r7, r12}, false, al, "r10 r7 r12", "r10_r7_r12"},
253      {{r3, r0, r11}, false, al, "r3 r0 r11", "r3_r0_r11"},
254      {{r9, r0, r5}, false, al, "r9 r0 r5", "r9_r0_r5"},
255      {{r5, r3, r11}, false, al, "r5 r3 r11", "r5_r3_r11"},
256      {{r6, r10, r0}, false, al, "r6 r10 r0", "r6_r10_r0"},
257      {{r6, r1, r0}, false, al, "r6 r1 r0", "r6_r1_r0"},
258      {{r6, r10, r11}, false, al, "r6 r10 r11", "r6_r10_r11"},
259      {{r10, r10, r5}, false, al, "r10 r10 r5", "r10_r10_r5"},
260      {{r1, r13, r14}, false, al, "r1 r13 r14", "r1_r13_r14"},
261      {{r4, r5, r13}, false, al, "r4 r5 r13", "r4_r5_r13"},
262      {{r9, r7, r14}, false, al, "r9 r7 r14", "r9_r7_r14"},
263      {{r12, r11, r1}, false, al, "r12 r11 r1", "r12_r11_r1"},
264      {{r5, r7, r4}, false, al, "r5 r7 r4", "r5_r7_r4"},
265      {{r10, r13, r0}, false, al, "r10 r13 r0", "r10_r13_r0"},
266      {{r7, r11, r12}, false, al, "r7 r11 r12", "r7_r11_r12"},
267      {{r1, r4, r14}, false, al, "r1 r4 r14", "r1_r4_r14"},
268      {{r3, r1, r10}, false, al, "r3 r1 r10", "r3_r1_r10"},
269      {{r10, r3, r4}, false, al, "r10 r3 r4", "r10_r3_r4"},
270      {{r10, r13, r9}, false, al, "r10 r13 r9", "r10_r13_r9"},
271      {{r3, r13, r7}, false, al, "r3 r13 r7", "r3_r13_r7"},
272      {{r3, r14, r2}, false, al, "r3 r14 r2", "r3_r14_r2"},
273      {{r8, r12, r3}, false, al, "r8 r12 r3", "r8_r12_r3"},
274      {{r9, r13, r13}, false, al, "r9 r13 r13", "r9_r13_r13"},
275      {{r2, r5, r0}, false, al, "r2 r5 r0", "r2_r5_r0"},
276      {{r7, r4, r10}, false, al, "r7 r4 r10", "r7_r4_r10"},
277      {{r11, r6, r6}, false, al, "r11 r6 r6", "r11_r6_r6"},
278      {{r8, r3, r4}, false, al, "r8 r3 r4", "r8_r3_r4"},
279      {{r12, r3, r12}, false, al, "r12 r3 r12", "r12_r3_r12"},
280      {{r13, r8, r6}, false, al, "r13 r8 r6", "r13_r8_r6"},
281      {{r11, r2, r2}, false, al, "r11 r2 r2", "r11_r2_r2"},
282      {{r9, r3, r1}, false, al, "r9 r3 r1", "r9_r3_r1"},
283      {{r0, r7, r5}, false, al, "r0 r7 r5", "r0_r7_r5"},
284      {{r11, r5, r7}, false, al, "r11 r5 r7", "r11_r5_r7"},
285      {{r13, r1, r8}, false, al, "r13 r1 r8", "r13_r1_r8"},
286      {{r8, r1, r6}, false, al, "r8 r1 r6", "r8_r1_r6"},
287      {{r1, r8, r11}, false, al, "r1 r8 r11", "r1_r8_r11"},
288      {{r14, r3, r1}, false, al, "r14 r3 r1", "r14_r3_r1"},
289      {{r3, r1, r3}, false, al, "r3 r1 r3", "r3_r1_r3"},
290      {{r5, r9, r10}, false, al, "r5 r9 r10", "r5_r9_r10"},
291      {{r6, r2, r13}, false, al, "r6 r2 r13", "r6_r2_r13"},
292      {{r14, r8, r9}, false, al, "r14 r8 r9", "r14_r8_r9"},
293      {{r5, r3, r5}, false, al, "r5 r3 r5", "r5_r3_r5"},
294      {{r6, r0, r9}, false, al, "r6 r0 r9", "r6_r0_r9"},
295      {{r14, r7, r2}, false, al, "r14 r7 r2", "r14_r7_r2"},
296      {{r4, r2, r0}, false, al, "r4 r2 r0", "r4_r2_r0"},
297      {{r4, r6, r1}, false, al, "r4 r6 r1", "r4_r6_r1"},
298      {{r7, r3, r6}, false, al, "r7 r3 r6", "r7_r3_r6"},
299      {{r7, r5, r9}, false, al, "r7 r5 r9", "r7_r5_r9"},
300      {{r6, r11, r11}, false, al, "r6 r11 r11", "r6_r11_r11"},
301      {{r4, r13, r2}, false, al, "r4 r13 r2", "r4_r13_r2"},
302      {{r8, r5, r13}, false, al, "r8 r5 r13", "r8_r5_r13"},
303      {{r8, r8, r7}, false, al, "r8 r8 r7", "r8_r8_r7"},
304      {{r9, r4, r2}, false, al, "r9 r4 r2", "r9_r4_r2"},
305      {{r0, r10, r6}, false, al, "r0 r10 r6", "r0_r10_r6"},
306      {{r3, r5, r5}, false, al, "r3 r5 r5", "r3_r5_r5"},
307      {{r6, r4, r12}, false, al, "r6 r4 r12", "r6_r4_r12"},
308      {{r8, r8, r0}, false, al, "r8 r8 r0", "r8_r8_r0"},
309      {{r1, r0, r12}, false, al, "r1 r0 r12", "r1_r0_r12"},
310      {{r4, r7, r11}, false, al, "r4 r7 r11", "r4_r7_r11"},
311      {{r5, r14, r10}, false, al, "r5 r14 r10", "r5_r14_r10"},
312      {{r8, r12, r2}, false, al, "r8 r12 r2", "r8_r12_r2"},
313      {{r14, r13, r4}, false, al, "r14 r13 r4", "r14_r13_r4"},
314      {{r8, r2, r12}, false, al, "r8 r2 r12", "r8_r2_r12"},
315      {{r12, r6, r1}, false, al, "r12 r6 r1", "r12_r6_r1"},
316      {{r1, r0, r14}, false, al, "r1 r0 r14", "r1_r0_r14"},
317      {{r1, r5, r5}, false, al, "r1 r5 r5", "r1_r5_r5"},
318      {{r3, r7, r4}, false, al, "r3 r7 r4", "r3_r7_r4"},
319      {{r9, r6, r12}, false, al, "r9 r6 r12", "r9_r6_r12"},
320      {{r13, r13, r1}, false, al, "r13 r13 r1", "r13_r13_r1"},
321      {{r5, r7, r13}, false, al, "r5 r7 r13", "r5_r7_r13"},
322      {{r9, r13, r2}, false, al, "r9 r13 r2", "r9_r13_r2"},
323      {{r2, r4, r2}, false, al, "r2 r4 r2", "r2_r4_r2"},
324      {{r13, r4, r0}, false, al, "r13 r4 r0", "r13_r4_r0"},
325      {{r8, r13, r6}, false, al, "r8 r13 r6", "r8_r13_r6"},
326      {{r6, r14, r2}, false, al, "r6 r14 r2", "r6_r14_r2"},
327      {{r2, r12, r9}, false, al, "r2 r12 r9", "r2_r12_r9"},
328      {{r14, r4, r0}, false, al, "r14 r4 r0", "r14_r4_r0"},
329      {{r5, r9, r1}, false, al, "r5 r9 r1", "r5_r9_r1"},
330      {{r6, r11, r7}, false, al, "r6 r11 r7", "r6_r11_r7"},
331      {{r6, r11, r3}, false, al, "r6 r11 r3", "r6_r11_r3"},
332      {{r11, r12, r6}, false, al, "r11 r12 r6", "r11_r12_r6"},
333      {{r1, r6, r10}, false, al, "r1 r6 r10", "r1_r6_r10"},
334      {{r9, r5, r4}, false, al, "r9 r5 r4", "r9_r5_r4"},
335      {{r11, r6, r13}, false, al, "r11 r6 r13", "r11_r6_r13"},
336      {{r1, r2, r4}, false, al, "r1 r2 r4", "r1_r2_r4"},
337      {{r2, r12, r3}, false, al, "r2 r12 r3", "r2_r12_r3"},
338      {{r9, r5, r6}, false, al, "r9 r5 r6", "r9_r5_r6"},
339      {{r1, r6, r6}, false, al, "r1 r6 r6", "r1_r6_r6"},
340      {{r7, r4, r11}, false, al, "r7 r4 r11", "r7_r4_r11"},
341      {{r4, r10, r3}, false, al, "r4 r10 r3", "r4_r10_r3"},
342      {{r13, r9, r3}, false, al, "r13 r9 r3", "r13_r9_r3"},
343      {{r11, r3, r6}, false, al, "r11 r3 r6", "r11_r3_r6"},
344      {{r9, r11, r1}, false, al, "r9 r11 r1", "r9_r11_r1"},
345      {{r7, r9, r4}, false, al, "r7 r9 r4", "r7_r9_r4"},
346      {{r5, r5, r1}, false, al, "r5 r5 r1", "r5_r5_r1"},
347      {{r12, r2, r8}, false, al, "r12 r2 r8", "r12_r2_r8"},
348      {{r2, r5, r6}, false, al, "r2 r5 r6", "r2_r5_r6"},
349      {{r10, r4, r10}, false, al, "r10 r4 r10", "r10_r4_r10"},
350      {{r0, r12, r12}, false, al, "r0 r12 r12", "r0_r12_r12"},
351      {{r9, r9, r13}, false, al, "r9 r9 r13", "r9_r9_r13"},
352      {{r12, r12, r14}, false, al, "r12 r12 r14", "r12_r12_r14"},
353      {{r4, r10, r0}, false, al, "r4 r10 r0", "r4_r10_r0"},
354      {{r7, r2, r14}, false, al, "r7 r2 r14", "r7_r2_r14"},
355      {{r6, r4, r2}, false, al, "r6 r4 r2", "r6_r4_r2"},
356      {{r7, r9, r13}, false, al, "r7 r9 r13", "r7_r9_r13"},
357      {{r2, r13, r11}, false, al, "r2 r13 r11", "r2_r13_r11"},
358      {{r4, r8, r8}, false, al, "r4 r8 r8", "r4_r8_r8"},
359      {{r2, r10, r7}, false, al, "r2 r10 r7", "r2_r10_r7"},
360      {{r7, r3, r10}, false, al, "r7 r3 r10", "r7_r3_r10"},
361      {{r4, r13, r7}, false, al, "r4 r13 r7", "r4_r13_r7"},
362      {{r8, r9, r11}, false, al, "r8 r9 r11", "r8_r9_r11"},
363      {{r5, r14, r13}, false, al, "r5 r14 r13", "r5_r14_r13"},
364      {{r12, r6, r10}, false, al, "r12 r6 r10", "r12_r6_r10"},
365      {{r8, r0, r5}, false, al, "r8 r0 r5", "r8_r0_r5"},
366      {{r12, r8, r1}, false, al, "r12 r8 r1", "r12_r8_r1"},
367      {{r14, r11, r7}, false, al, "r14 r11 r7", "r14_r11_r7"},
368      {{r5, r9, r0}, false, al, "r5 r9 r0", "r5_r9_r0"},
369      {{r14, r3, r4}, false, al, "r14 r3 r4", "r14_r3_r4"},
370      {{r1, r14, r0}, false, al, "r1 r14 r0", "r1_r14_r0"},
371      {{r4, r2, r13}, false, al, "r4 r2 r13", "r4_r2_r13"},
372      {{r9, r6, r10}, false, al, "r9 r6 r10", "r9_r6_r10"},
373      {{r7, r6, r5}, false, al, "r7 r6 r5", "r7_r6_r5"},
374      {{r11, r7, r6}, false, al, "r11 r7 r6", "r11_r7_r6"},
375      {{r3, r6, r8}, false, al, "r3 r6 r8", "r3_r6_r8"},
376      {{r8, r5, r2}, false, al, "r8 r5 r2", "r8_r5_r2"},
377      {{r13, r4, r8}, false, al, "r13 r4 r8", "r13_r4_r8"},
378      {{r14, r9, r5}, false, al, "r14 r9 r5", "r14_r9_r5"},
379      {{r7, r6, r2}, false, al, "r7 r6 r2", "r7_r6_r2"},
380      {{r12, r5, r12}, false, al, "r12 r5 r12", "r12_r5_r12"},
381      {{r11, r8, r13}, false, al, "r11 r8 r13", "r11_r8_r13"},
382      {{r10, r10, r7}, false, al, "r10 r10 r7", "r10_r10_r7"},
383      {{r11, r3, r1}, false, al, "r11 r3 r1", "r11_r3_r1"},
384      {{r10, r0, r12}, false, al, "r10 r0 r12", "r10_r0_r12"},
385      {{r9, r9, r4}, false, al, "r9 r9 r4", "r9_r9_r4"},
386      {{r10, r7, r7}, false, al, "r10 r7 r7", "r10_r7_r7"},
387      {{r13, r6, r4}, false, al, "r13 r6 r4", "r13_r6_r4"},
388      {{r5, r1, r7}, false, al, "r5 r1 r7", "r5_r1_r7"},
389      {{r9, r12, r8}, false, al, "r9 r12 r8", "r9_r12_r8"},
390      {{r13, r13, r9}, false, al, "r13 r13 r9", "r13_r13_r9"},
391      {{r1, r3, r8}, false, al, "r1 r3 r8", "r1_r3_r8"},
392      {{r14, r5, r4}, false, al, "r14 r5 r4", "r14_r5_r4"},
393      {{r10, r6, r1}, false, al, "r10 r6 r1", "r10_r6_r1"},
394      {{r2, r10, r14}, false, al, "r2 r10 r14", "r2_r10_r14"},
395      {{r7, r5, r14}, false, al, "r7 r5 r14", "r7_r5_r14"},
396      {{r6, r13, r9}, false, al, "r6 r13 r9", "r6_r13_r9"},
397      {{r6, r13, r14}, false, al, "r6 r13 r14", "r6_r13_r14"},
398      {{r4, r13, r0}, false, al, "r4 r13 r0", "r4_r13_r0"},
399      {{r10, r9, r10}, false, al, "r10 r9 r10", "r10_r9_r10"},
400      {{r7, r14, r8}, false, al, "r7 r14 r8", "r7_r14_r8"},
401      {{r13, r4, r5}, false, al, "r13 r4 r5", "r13_r4_r5"},
402      {{r4, r9, r14}, false, al, "r4 r9 r14", "r4_r9_r14"},
403      {{r7, r11, r13}, false, al, "r7 r11 r13", "r7_r11_r13"},
404      {{r10, r10, r10}, false, al, "r10 r10 r10", "r10_r10_r10"},
405      {{r12, r14, r14}, false, al, "r12 r14 r14", "r12_r14_r14"},
406      {{r8, r12, r11}, false, al, "r8 r12 r11", "r8_r12_r11"},
407      {{r0, r8, r3}, false, al, "r0 r8 r3", "r0_r8_r3"},
408      {{r3, r12, r4}, false, al, "r3 r12 r4", "r3_r12_r4"},
409      {{r10, r0, r0}, false, al, "r10 r0 r0", "r10_r0_r0"},
410      {{r1, r7, r8}, false, al, "r1 r7 r8", "r1_r7_r8"},
411      {{r3, r5, r12}, false, al, "r3 r5 r12", "r3_r5_r12"},
412      {{r7, r0, r2}, false, al, "r7 r0 r2", "r7_r0_r2"},
413      {{r2, r14, r4}, false, al, "r2 r14 r4", "r2_r14_r4"},
414      {{r0, r5, r7}, false, al, "r0 r5 r7", "r0_r5_r7"},
415      {{r2, r9, r6}, false, al, "r2 r9 r6", "r2_r9_r6"},
416      {{r1, r0, r5}, false, al, "r1 r0 r5", "r1_r0_r5"},
417      {{r3, r13, r14}, false, al, "r3 r13 r14", "r3_r13_r14"},
418      {{r1, r1, r13}, false, al, "r1 r1 r13", "r1_r1_r13"},
419      {{r10, r9, r9}, false, al, "r10 r9 r9", "r10_r9_r9"},
420      {{r0, r3, r11}, false, al, "r0 r3 r11", "r0_r3_r11"},
421      {{r0, r14, r4}, false, al, "r0 r14 r4", "r0_r14_r4"},
422      {{r8, r13, r4}, false, al, "r8 r13 r4", "r8_r13_r4"},
423      {{r1, r8, r5}, false, al, "r1 r8 r5", "r1_r8_r5"},
424      {{r13, r8, r10}, false, al, "r13 r8 r10", "r13_r8_r10"},
425      {{r10, r13, r12}, false, al, "r10 r13 r12", "r10_r13_r12"},
426      {{r5, r1, r2}, false, al, "r5 r1 r2", "r5_r1_r2"},
427      {{r10, r3, r8}, false, al, "r10 r3 r8", "r10_r3_r8"},
428      {{r5, r12, r13}, false, al, "r5 r12 r13", "r5_r12_r13"},
429      {{r9, r4, r10}, false, al, "r9 r4 r10", "r9_r4_r10"},
430      {{r1, r8, r6}, false, al, "r1 r8 r6", "r1_r8_r6"},
431      {{r9, r11, r0}, false, al, "r9 r11 r0", "r9_r11_r0"},
432      {{r11, r2, r10}, false, al, "r11 r2 r10", "r11_r2_r10"},
433      {{r11, r11, r7}, false, al, "r11 r11 r7", "r11_r11_r7"},
434      {{r6, r5, r10}, false, al, "r6 r5 r10", "r6_r5_r10"},
435      {{r0, r11, r2}, false, al, "r0 r11 r2", "r0_r11_r2"},
436      {{r5, r4, r0}, false, al, "r5 r4 r0", "r5_r4_r0"},
437      {{r11, r11, r0}, false, al, "r11 r11 r0", "r11_r11_r0"},
438      {{r9, r10, r3}, false, al, "r9 r10 r3", "r9_r10_r3"},
439      {{r9, r9, r9}, false, al, "r9 r9 r9", "r9_r9_r9"},
440      {{r3, r13, r3}, false, al, "r3 r13 r3", "r3_r13_r3"},
441      {{r1, r2, r13}, false, al, "r1 r2 r13", "r1_r2_r13"},
442      {{r3, r4, r6}, false, al, "r3 r4 r6", "r3_r4_r6"},
443      {{r1, r11, r12}, false, al, "r1 r11 r12", "r1_r11_r12"},
444      {{r3, r8, r0}, false, al, "r3 r8 r0", "r3_r8_r0"},
445      {{r4, r11, r4}, false, al, "r4 r11 r4", "r4_r11_r4"},
446      {{r14, r11, r11}, false, al, "r14 r11 r11", "r14_r11_r11"},
447      {{r3, r1, r12}, false, al, "r3 r1 r12", "r3_r1_r12"},
448      {{r2, r1, r3}, false, al, "r2 r1 r3", "r2_r1_r3"},
449      {{r2, r7, r14}, false, al, "r2 r7 r14", "r2_r7_r14"},
450      {{r6, r14, r5}, false, al, "r6 r14 r5", "r6_r14_r5"},
451      {{r8, r8, r6}, false, al, "r8 r8 r6", "r8_r8_r6"},
452      {{r9, r6, r7}, false, al, "r9 r6 r7", "r9_r6_r7"},
453      {{r10, r0, r6}, false, al, "r10 r0 r6", "r10_r0_r6"},
454      {{r0, r1, r9}, false, al, "r0 r1 r9", "r0_r1_r9"},
455      {{r3, r9, r7}, false, al, "r3 r9 r7", "r3_r9_r7"},
456      {{r2, r4, r5}, false, al, "r2 r4 r5", "r2_r4_r5"},
457      {{r0, r11, r10}, false, al, "r0 r11 r10", "r0_r11_r10"},
458      {{r4, r9, r8}, false, al, "r4 r9 r8", "r4_r9_r8"},
459      {{r12, r3, r4}, false, al, "r12 r3 r4", "r12_r3_r4"},
460      {{r1, r1, r14}, false, al, "r1 r1 r14", "r1_r1_r14"},
461      {{r14, r1, r9}, false, al, "r14 r1 r9", "r14_r1_r9"},
462      {{r0, r2, r10}, false, al, "r0 r2 r10", "r0_r2_r10"},
463      {{r4, r11, r3}, false, al, "r4 r11 r3", "r4_r11_r3"},
464      {{r3, r10, r13}, false, al, "r3 r10 r13", "r3_r10_r13"},
465      {{r2, r5, r3}, false, al, "r2 r5 r3", "r2_r5_r3"},
466      {{r14, r3, r6}, false, al, "r14 r3 r6", "r14_r3_r6"},
467      {{r12, r2, r3}, false, al, "r12 r2 r3", "r12_r2_r3"},
468      {{r3, r5, r9}, false, al, "r3 r5 r9", "r3_r5_r9"},
469      {{r5, r8, r14}, false, al, "r5 r8 r14", "r5_r8_r14"},
470      {{r0, r5, r1}, false, al, "r0 r5 r1", "r0_r5_r1"},
471      {{r8, r8, r1}, false, al, "r8 r8 r1", "r8_r8_r1"},
472      {{r6, r13, r4}, false, al, "r6 r13 r4", "r6_r13_r4"},
473      {{r8, r3, r0}, false, al, "r8 r3 r0", "r8_r3_r0"},
474      {{r4, r6, r7}, false, al, "r4 r6 r7", "r4_r6_r7"},
475      {{r8, r11, r11}, false, al, "r8 r11 r11", "r8_r11_r11"},
476      {{r3, r4, r12}, false, al, "r3 r4 r12", "r3_r4_r12"},
477      {{r10, r4, r8}, false, al, "r10 r4 r8", "r10_r4_r8"},
478      {{r3, r14, r7}, false, al, "r3 r14 r7", "r3_r14_r7"},
479      {{r8, r14, r0}, false, al, "r8 r14 r0", "r8_r14_r0"},
480      {{r14, r3, r9}, false, al, "r14 r3 r9", "r14_r3_r9"},
481      {{r4, r7, r0}, false, al, "r4 r7 r0", "r4_r7_r0"},
482      {{r8, r0, r2}, false, al, "r8 r0 r2", "r8_r0_r2"},
483      {{r2, r9, r9}, false, al, "r2 r9 r9", "r2_r9_r9"},
484      {{r10, r10, r14}, false, al, "r10 r10 r14", "r10_r10_r14"},
485      {{r1, r6, r4}, false, al, "r1 r6 r4", "r1_r6_r4"},
486      {{r8, r5, r8}, false, al, "r8 r5 r8", "r8_r5_r8"},
487      {{r9, r10, r9}, false, al, "r9 r10 r9", "r9_r10_r9"},
488      {{r11, r13, r14}, false, al, "r11 r13 r14", "r11_r13_r14"},
489      {{r3, r1, r7}, false, al, "r3 r1 r7", "r3_r1_r7"},
490      {{r12, r11, r9}, false, al, "r12 r11 r9", "r12_r11_r9"},
491      {{r3, r7, r12}, false, al, "r3 r7 r12", "r3_r7_r12"},
492      {{r6, r1, r10}, false, al, "r6 r1 r10", "r6_r1_r10"},
493      {{r0, r6, r10}, false, al, "r0 r6 r10", "r0_r6_r10"},
494      {{r10, r2, r2}, false, al, "r10 r2 r2", "r10_r2_r2"},
495      {{r9, r6, r3}, false, al, "r9 r6 r3", "r9_r6_r3"},
496      {{r11, r11, r3}, false, al, "r11 r11 r3", "r11_r11_r3"},
497      {{r2, r2, r12}, false, al, "r2 r2 r12", "r2_r2_r12"},
498      {{r7, r2, r11}, false, al, "r7 r2 r11", "r7_r2_r11"},
499      {{r8, r6, r7}, false, al, "r8 r6 r7", "r8_r6_r7"},
500      {{r7, r9, r11}, false, al, "r7 r9 r11", "r7_r9_r11"},
501      {{r10, r1, r12}, false, al, "r10 r1 r12", "r10_r1_r12"},
502      {{r4, r13, r12}, false, al, "r4 r13 r12", "r4_r13_r12"},
503      {{r6, r14, r4}, false, al, "r6 r14 r4", "r6_r14_r4"},
504      {{r12, r5, r11}, false, al, "r12 r5 r11", "r12_r5_r11"},
505      {{r10, r7, r5}, false, al, "r10 r7 r5", "r10_r7_r5"},
506      {{r13, r12, r11}, false, al, "r13 r12 r11", "r13_r12_r11"},
507      {{r12, r8, r2}, false, al, "r12 r8 r2", "r12_r8_r2"},
508      {{r0, r11, r0}, false, al, "r0 r11 r0", "r0_r11_r0"},
509      {{r10, r9, r8}, false, al, "r10 r9 r8", "r10_r9_r8"},
510      {{r4, r11, r13}, false, al, "r4 r11 r13", "r4_r11_r13"},
511      {{r13, r12, r12}, false, al, "r13 r12 r12", "r13_r12_r12"},
512      {{r10, r5, r14}, false, al, "r10 r5 r14", "r10_r5_r14"},
513      {{r10, r6, r11}, false, al, "r10 r6 r11", "r10_r6_r11"},
514      {{r10, r3, r12}, false, al, "r10 r3 r12", "r10_r3_r12"},
515      {{r6, r13, r6}, false, al, "r6 r13 r6", "r6_r13_r6"},
516      {{r8, r4, r3}, false, al, "r8 r4 r3", "r8_r4_r3"},
517      {{r9, r3, r12}, false, al, "r9 r3 r12", "r9_r3_r12"},
518      {{r2, r13, r10}, false, al, "r2 r13 r10", "r2_r13_r10"},
519      {{r7, r4, r9}, false, al, "r7 r4 r9", "r7_r4_r9"},
520      {{r9, r7, r5}, false, al, "r9 r7 r5", "r9_r7_r5"},
521      {{r1, r13, r9}, false, al, "r1 r13 r9", "r1_r13_r9"},
522      {{r2, r8, r0}, false, al, "r2 r8 r0", "r2_r8_r0"},
523      {{r11, r5, r13}, false, al, "r11 r5 r13", "r11_r5_r13"},
524      {{r4, r2, r9}, false, al, "r4 r2 r9", "r4_r2_r9"},
525      {{r12, r9, r13}, false, al, "r12 r9 r13", "r12_r9_r13"},
526      {{r5, r4, r13}, false, al, "r5 r4 r13", "r5_r4_r13"},
527      {{r12, r6, r3}, false, al, "r12 r6 r3", "r12_r6_r3"},
528      {{r4, r14, r6}, false, al, "r4 r14 r6", "r4_r14_r6"},
529      {{r11, r12, r9}, false, al, "r11 r12 r9", "r11_r12_r9"},
530      {{r13, r9, r7}, false, al, "r13 r9 r7", "r13_r9_r7"},
531      {{r10, r11, r8}, false, al, "r10 r11 r8", "r10_r11_r8"},
532      {{r4, r14, r5}, false, al, "r4 r14 r5", "r4_r14_r5"},
533      {{r13, r10, r5}, false, al, "r13 r10 r5", "r13_r10_r5"},
534      {{r8, r10, r8}, false, al, "r8 r10 r8", "r8_r10_r8"},
535      {{r10, r5, r5}, false, al, "r10 r5 r5", "r10_r5_r5"},
536      {{r2, r3, r14}, false, al, "r2 r3 r14", "r2_r3_r14"},
537      {{r0, r9, r10}, false, al, "r0 r9 r10", "r0_r9_r10"},
538      {{r1, r14, r14}, false, al, "r1 r14 r14", "r1_r14_r14"},
539      {{r6, r5, r12}, false, al, "r6 r5 r12", "r6_r5_r12"},
540      {{r9, r0, r7}, false, al, "r9 r0 r7", "r9_r0_r7"},
541      {{r3, r1, r11}, false, al, "r3 r1 r11", "r3_r1_r11"},
542      {{r10, r6, r3}, false, al, "r10 r6 r3", "r10_r6_r3"},
543      {{r13, r10, r0}, false, al, "r13 r10 r0", "r13_r10_r0"},
544      {{r3, r11, r8}, false, al, "r3 r11 r8", "r3_r11_r8"},
545      {{r3, r9, r13}, false, al, "r3 r9 r13", "r3_r9_r13"},
546      {{r7, r10, r2}, false, al, "r7 r10 r2", "r7_r10_r2"},
547      {{r9, r4, r6}, false, al, "r9 r4 r6", "r9_r4_r6"},
548      {{r8, r3, r2}, false, al, "r8 r3 r2", "r8_r3_r2"},
549      {{r14, r8, r1}, false, al, "r14 r8 r1", "r14_r8_r1"},
550      {{r11, r5, r9}, false, al, "r11 r5 r9", "r11_r5_r9"},
551      {{r2, r3, r2}, false, al, "r2 r3 r2", "r2_r3_r2"},
552      {{r1, r8, r13}, false, al, "r1 r8 r13", "r1_r8_r13"},
553      {{r11, r0, r11}, false, al, "r11 r0 r11", "r11_r0_r11"},
554      {{r6, r1, r9}, false, al, "r6 r1 r9", "r6_r1_r9"},
555      {{r12, r14, r6}, false, al, "r12 r14 r6", "r12_r14_r6"},
556      {{r5, r11, r12}, false, al, "r5 r11 r12", "r5_r11_r12"},
557      {{r13, r12, r9}, false, al, "r13 r12 r9", "r13_r12_r9"},
558      {{r14, r2, r10}, false, al, "r14 r2 r10", "r14_r2_r10"},
559      {{r1, r4, r10}, false, al, "r1 r4 r10", "r1_r4_r10"},
560      {{r1, r5, r14}, false, al, "r1 r5 r14", "r1_r5_r14"},
561      {{r7, r1, r13}, false, al, "r7 r1 r13", "r7_r1_r13"},
562      {{r8, r2, r8}, false, al, "r8 r2 r8", "r8_r2_r8"},
563      {{r13, r5, r2}, false, al, "r13 r5 r2", "r13_r5_r2"},
564      {{r7, r5, r3}, false, al, "r7 r5 r3", "r7_r5_r3"},
565      {{r11, r14, r5}, false, al, "r11 r14 r5", "r11_r14_r5"},
566      {{r8, r3, r12}, false, al, "r8 r3 r12", "r8_r3_r12"},
567      {{r10, r7, r2}, false, al, "r10 r7 r2", "r10_r7_r2"},
568      {{r2, r6, r2}, false, al, "r2 r6 r2", "r2_r6_r2"},
569      {{r13, r10, r1}, false, al, "r13 r10 r1", "r13_r10_r1"},
570      {{r12, r12, r2}, false, al, "r12 r12 r2", "r12_r12_r2"},
571      {{r1, r3, r6}, false, al, "r1 r3 r6", "r1_r3_r6"},
572      {{r14, r10, r4}, false, al, "r14 r10 r4", "r14_r10_r4"},
573      {{r7, r3, r5}, false, al, "r7 r3 r5", "r7_r3_r5"},
574      {{r13, r11, r14}, false, al, "r13 r11 r14", "r13_r11_r14"},
575      {{r0, r0, r9}, false, al, "r0 r0 r9", "r0_r0_r9"},
576      {{r3, r2, r11}, false, al, "r3 r2 r11", "r3_r2_r11"},
577      {{r7, r0, r3}, false, al, "r7 r0 r3", "r7_r0_r3"},
578      {{r1, r12, r11}, false, al, "r1 r12 r11", "r1_r12_r11"},
579      {{r3, r13, r8}, false, al, "r3 r13 r8", "r3_r13_r8"},
580      {{r7, r1, r10}, false, al, "r7 r1 r10", "r7_r1_r10"},
581      {{r4, r8, r11}, false, al, "r4 r8 r11", "r4_r8_r11"},
582      {{r1, r5, r3}, false, al, "r1 r5 r3", "r1_r5_r3"},
583      {{r12, r13, r14}, false, al, "r12 r13 r14", "r12_r13_r14"},
584      {{r13, r4, r10}, false, al, "r13 r4 r10", "r13_r4_r10"},
585      {{r1, r1, r2}, false, al, "r1 r1 r2", "r1_r1_r2"},
586      {{r12, r14, r2}, false, al, "r12 r14 r2", "r12_r14_r2"},
587      {{r2, r2, r3}, false, al, "r2 r2 r3", "r2_r2_r3"},
588      {{r12, r5, r6}, false, al, "r12 r5 r6", "r12_r5_r6"},
589      {{r14, r9, r0}, false, al, "r14 r9 r0", "r14_r9_r0"},
590      {{r0, r5, r11}, false, al, "r0 r5 r11", "r0_r5_r11"},
591      {{r7, r8, r5}, false, al, "r7 r8 r5", "r7_r8_r5"},
592      {{r13, r0, r13}, false, al, "r13 r0 r13", "r13_r0_r13"},
593      {{r5, r4, r12}, false, al, "r5 r4 r12", "r5_r4_r12"},
594      {{r9, r1, r9}, false, al, "r9 r1 r9", "r9_r1_r9"},
595      {{r3, r9, r0}, false, al, "r3 r9 r0", "r3_r9_r0"},
596      {{r11, r3, r0}, false, al, "r11 r3 r0", "r11_r3_r0"},
597      {{r14, r11, r3}, false, al, "r14 r11 r3", "r14_r11_r3"},
598      {{r14, r0, r2}, false, al, "r14 r0 r2", "r14_r0_r2"},
599      {{r1, r4, r6}, false, al, "r1 r4 r6", "r1_r4_r6"}};
600 
601 // These headers each contain an array of `TestResult` with the reference output
602 // values. The reference arrays are names `kReference{mnemonic}`.
603 #include "aarch32/traces/assembler-rd-rn-rm-crc32b-a32.h"
604 #include "aarch32/traces/assembler-rd-rn-rm-crc32cb-a32.h"
605 #include "aarch32/traces/assembler-rd-rn-rm-crc32ch-a32.h"
606 #include "aarch32/traces/assembler-rd-rn-rm-crc32cw-a32.h"
607 #include "aarch32/traces/assembler-rd-rn-rm-crc32h-a32.h"
608 #include "aarch32/traces/assembler-rd-rn-rm-crc32w-a32.h"
609 
610 
611 // The maximum number of errors to report in detail for each test.
612 const unsigned kErrorReportLimit = 8;
613 
614 typedef void (MacroAssembler::*Fn)(Register rd, Register rn, Register rm);
615 
TestHelper(Fn instruction,const char * mnemonic,const TestResult reference[])616 void TestHelper(Fn instruction,
617                 const char* mnemonic,
618                 const TestResult reference[]) {
619   unsigned total_error_count = 0;
620   MacroAssembler masm(BUF_SIZE);
621 
622   masm.UseA32();
623 
624   for (unsigned i = 0; i < ARRAY_SIZE(kTests); i++) {
625     // Values to pass to the macro-assembler.
626     Register rd = kTests[i].operands.rd;
627     Register rn = kTests[i].operands.rn;
628     Register rm = kTests[i].operands.rm;
629 
630     int32_t start = masm.GetCursorOffset();
631     {
632       // We never generate more that 4 bytes, as IT instructions are only
633       // allowed for narrow encodings.
634       ExactAssemblyScope scope(&masm, 4, ExactAssemblyScope::kMaximumSize);
635       if (kTests[i].in_it_block) {
636         masm.it(kTests[i].it_condition);
637       }
638       (masm.*instruction)(rd, rn, rm);
639     }
640     int32_t end = masm.GetCursorOffset();
641 
642     const byte* result_ptr =
643         masm.GetBuffer()->GetOffsetAddress<const byte*>(start);
644     VIXL_ASSERT(start < end);
645     uint32_t result_size = end - start;
646 
647     if (Test::generate_test_trace()) {
648       // Print the result bytes.
649       printf("const byte kInstruction_%s_%s[] = {\n",
650              mnemonic,
651              kTests[i].identifier);
652       for (uint32_t j = 0; j < result_size; j++) {
653         if (j == 0) {
654           printf("  0x%02" PRIx8, result_ptr[j]);
655         } else {
656           printf(", 0x%02" PRIx8, result_ptr[j]);
657         }
658       }
659       // This comment is meant to be used by external tools to validate
660       // the encoding. We can parse the comment to figure out what
661       // instruction this corresponds to.
662       if (kTests[i].in_it_block) {
663         printf(" // It %s; %s %s\n};\n",
664                kTests[i].it_condition.GetName(),
665                mnemonic,
666                kTests[i].operands_description);
667       } else {
668         printf(" // %s %s\n};\n", mnemonic, kTests[i].operands_description);
669       }
670     } else {
671       // Check we've emitted the exact same encoding as present in the
672       // trace file. Only print up to `kErrorReportLimit` errors.
673       if (((result_size != reference[i].size) ||
674            (memcmp(result_ptr, reference[i].encoding, reference[i].size) !=
675             0)) &&
676           (++total_error_count <= kErrorReportLimit)) {
677         printf("Error when testing \"%s\" with operands \"%s\":\n",
678                mnemonic,
679                kTests[i].operands_description);
680         printf("  Expected: ");
681         for (uint32_t j = 0; j < reference[i].size; j++) {
682           if (j == 0) {
683             printf("0x%02" PRIx8, reference[i].encoding[j]);
684           } else {
685             printf(", 0x%02" PRIx8, reference[i].encoding[j]);
686           }
687         }
688         printf("\n");
689         printf("  Found:    ");
690         for (uint32_t j = 0; j < result_size; j++) {
691           if (j == 0) {
692             printf("0x%02" PRIx8, result_ptr[j]);
693           } else {
694             printf(", 0x%02" PRIx8, result_ptr[j]);
695           }
696         }
697         printf("\n");
698       }
699     }
700   }
701 
702   masm.FinalizeCode();
703 
704   if (Test::generate_test_trace()) {
705     // Finalize the trace file by writing the final `TestResult` array
706     // which links all generated instruction encodings.
707     printf("const TestResult kReference%s[] = {\n", mnemonic);
708     for (unsigned i = 0; i < ARRAY_SIZE(kTests); i++) {
709       printf("  {\n");
710       printf("    ARRAY_SIZE(kInstruction_%s_%s),\n",
711              mnemonic,
712              kTests[i].identifier);
713       printf("    kInstruction_%s_%s,\n", mnemonic, kTests[i].identifier);
714       printf("  },\n");
715     }
716     printf("};\n");
717   } else {
718     if (total_error_count > kErrorReportLimit) {
719       printf("%u other errors follow.\n",
720              total_error_count - kErrorReportLimit);
721     }
722     // Crash if the test failed.
723     VIXL_CHECK(total_error_count == 0);
724   }
725 }
726 
727 // Instantiate tests for each instruction in the list.
728 #define TEST(mnemonic)                                                      \
729   void Test_##mnemonic() {                                                  \
730     TestHelper(&MacroAssembler::mnemonic, #mnemonic, kReference##mnemonic); \
731   }                                                                         \
732   Test test_##mnemonic("AARCH32_ASSEMBLER_RD_RN_RM_" #mnemonic "_A32",      \
733                        &Test_##mnemonic);
734 FOREACH_INSTRUCTION(TEST)
735 #undef TEST
736 
737 }  // namespace
738 #endif
739 
740 }  // namespace aarch32
741 }  // namespace vixl
742