xref: /aosp_15_r20/external/vixl/test/aarch32/test-simulator-cond-rd-rn-rm-t32.cc (revision f5c631da2f1efdd72b5fd1e20510e4042af13d77)
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(Mul)                       \
117   M(Qadd16)                    \
118   M(Qadd8)                     \
119   M(Qasx)                      \
120   M(Qsax)                      \
121   M(Qsub16)                    \
122   M(Qsub8)                     \
123   M(Sdiv)                      \
124   M(Shadd16)                   \
125   M(Shadd8)                    \
126   M(Shasx)                     \
127   M(Shsax)                     \
128   M(Shsub16)                   \
129   M(Shsub8)                    \
130   M(Smmul)                     \
131   M(Smmulr)                    \
132   M(Smuad)                     \
133   M(Smuadx)                    \
134   M(Smulbb)                    \
135   M(Smulbt)                    \
136   M(Smultb)                    \
137   M(Smultt)                    \
138   M(Smulwb)                    \
139   M(Smulwt)                    \
140   M(Smusd)                     \
141   M(Smusdx)                    \
142   M(Udiv)                      \
143   M(Uhadd16)                   \
144   M(Uhadd8)                    \
145   M(Uhasx)                     \
146   M(Uhsax)                     \
147   M(Uhsub16)                   \
148   M(Uhsub8)                    \
149   M(Uqadd16)                   \
150   M(Uqadd8)                    \
151   M(Uqasx)                     \
152   M(Uqsax)                     \
153   M(Uqsub16)                   \
154   M(Uqsub8)                    \
155   M(Usad8)                     \
156   M(Sadd16)                    \
157   M(Sadd8)                     \
158   M(Sasx)                      \
159   M(Sel)                       \
160   M(Ssax)                      \
161   M(Ssub16)                    \
162   M(Ssub8)                     \
163   M(Uadd16)                    \
164   M(Uadd8)                     \
165   M(Uasx)                      \
166   M(Usax)                      \
167   M(Usub16)                    \
168   M(Usub8)                     \
169   M(Qadd)                      \
170   M(Qdadd)                     \
171   M(Qdsub)                     \
172   M(Qsub)
173 
174 
175 // The following definitions are defined again in each generated test, therefore
176 // we need to place them in an anomymous namespace. It expresses that they are
177 // local to this file only, and the compiler is not allowed to share these types
178 // across test files during template instantiation. Specifically, `Operands` and
179 // `Inputs` have various layouts across generated tests so they absolutely
180 // cannot be shared.
181 
182 #ifdef VIXL_INCLUDE_TARGET_T32
183 namespace {
184 
185 // Values to be passed to the assembler to produce the instruction under test.
186 struct Operands {
187   Condition cond;
188   Register rd;
189   Register rn;
190   Register rm;
191 };
192 
193 // Input data to feed to the instruction.
194 struct Inputs {
195   uint32_t apsr;
196   uint32_t qbit;
197   uint32_t ge;
198   uint32_t rd;
199   uint32_t rn;
200   uint32_t rm;
201 };
202 
203 // This structure contains all input data needed to test one specific encoding.
204 // It used to generate a loop over an instruction.
205 struct TestLoopData {
206   // The `operands` fields represents the values to pass to the assembler to
207   // produce the instruction.
208   Operands operands;
209   // Description of the operands, used for error reporting.
210   const char* operands_description;
211   // Unique identifier, used for generating traces.
212   const char* identifier;
213   // Array of values to be fed to the instruction.
214   size_t input_size;
215   const Inputs* inputs;
216 };
217 
218 static const Inputs kCondition[] =
219     {{NFlag, NoFlag, NoFlag, 0xabababab, 0xabababab, 0xabababab},
220      {ZFlag, NoFlag, NoFlag, 0xabababab, 0xabababab, 0xabababab},
221      {CFlag, NoFlag, NoFlag, 0xabababab, 0xabababab, 0xabababab},
222      {VFlag, NoFlag, NoFlag, 0xabababab, 0xabababab, 0xabababab},
223      {NZFlag, NoFlag, NoFlag, 0xabababab, 0xabababab, 0xabababab},
224      {NCFlag, NoFlag, NoFlag, 0xabababab, 0xabababab, 0xabababab},
225      {NVFlag, NoFlag, NoFlag, 0xabababab, 0xabababab, 0xabababab},
226      {ZCFlag, NoFlag, NoFlag, 0xabababab, 0xabababab, 0xabababab},
227      {ZVFlag, NoFlag, NoFlag, 0xabababab, 0xabababab, 0xabababab},
228      {CVFlag, NoFlag, NoFlag, 0xabababab, 0xabababab, 0xabababab},
229      {NZCFlag, NoFlag, NoFlag, 0xabababab, 0xabababab, 0xabababab},
230      {NZVFlag, NoFlag, NoFlag, 0xabababab, 0xabababab, 0xabababab},
231      {NCVFlag, NoFlag, NoFlag, 0xabababab, 0xabababab, 0xabababab},
232      {ZCVFlag, NoFlag, NoFlag, 0xabababab, 0xabababab, 0xabababab},
233      {NZCVFlag, NoFlag, NoFlag, 0xabababab, 0xabababab, 0xabababab}};
234 
235 static const Inputs kRdIsRnIsRm[] =
236     {{NoFlag, NoFlag, NoFlag, 0x00000000, 0x00000000, 0x00000000},
237      {NoFlag, NoFlag, NoFlag, 0x00000001, 0x00000001, 0x00000001},
238      {NoFlag, NoFlag, NoFlag, 0x00000002, 0x00000002, 0x00000002},
239      {NoFlag, NoFlag, NoFlag, 0x00000020, 0x00000020, 0x00000020},
240      {NoFlag, NoFlag, NoFlag, 0x0000007d, 0x0000007d, 0x0000007d},
241      {NoFlag, NoFlag, NoFlag, 0x0000007e, 0x0000007e, 0x0000007e},
242      {NoFlag, NoFlag, NoFlag, 0x0000007f, 0x0000007f, 0x0000007f},
243      {NoFlag, NoFlag, NoFlag, 0x00007ffd, 0x00007ffd, 0x00007ffd},
244      {NoFlag, NoFlag, NoFlag, 0x00007ffe, 0x00007ffe, 0x00007ffe},
245      {NoFlag, NoFlag, NoFlag, 0x00007fff, 0x00007fff, 0x00007fff},
246      {NoFlag, NoFlag, NoFlag, 0x33333333, 0x33333333, 0x33333333},
247      {NoFlag, NoFlag, NoFlag, 0x55555555, 0x55555555, 0x55555555},
248      {NoFlag, NoFlag, NoFlag, 0x7ffffffd, 0x7ffffffd, 0x7ffffffd},
249      {NoFlag, NoFlag, NoFlag, 0x7ffffffe, 0x7ffffffe, 0x7ffffffe},
250      {NoFlag, NoFlag, NoFlag, 0x7fffffff, 0x7fffffff, 0x7fffffff},
251      {NoFlag, NoFlag, NoFlag, 0x80000000, 0x80000000, 0x80000000},
252      {NoFlag, NoFlag, NoFlag, 0x80000001, 0x80000001, 0x80000001},
253      {NoFlag, NoFlag, NoFlag, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa},
254      {NoFlag, NoFlag, NoFlag, 0xcccccccc, 0xcccccccc, 0xcccccccc},
255      {NoFlag, NoFlag, NoFlag, 0xffff8000, 0xffff8000, 0xffff8000},
256      {NoFlag, NoFlag, NoFlag, 0xffff8001, 0xffff8001, 0xffff8001},
257      {NoFlag, NoFlag, NoFlag, 0xffff8002, 0xffff8002, 0xffff8002},
258      {NoFlag, NoFlag, NoFlag, 0xffff8003, 0xffff8003, 0xffff8003},
259      {NoFlag, NoFlag, NoFlag, 0xffffff80, 0xffffff80, 0xffffff80},
260      {NoFlag, NoFlag, NoFlag, 0xffffff81, 0xffffff81, 0xffffff81},
261      {NoFlag, NoFlag, NoFlag, 0xffffff82, 0xffffff82, 0xffffff82},
262      {NoFlag, NoFlag, NoFlag, 0xffffff83, 0xffffff83, 0xffffff83},
263      {NoFlag, NoFlag, NoFlag, 0xffffffe0, 0xffffffe0, 0xffffffe0},
264      {NoFlag, NoFlag, NoFlag, 0xfffffffd, 0xfffffffd, 0xfffffffd},
265      {NoFlag, NoFlag, NoFlag, 0xfffffffe, 0xfffffffe, 0xfffffffe},
266      {NoFlag, NoFlag, NoFlag, 0xffffffff, 0xffffffff, 0xffffffff}};
267 
268 static const Inputs kRdIsRn[] =
269     {{NoFlag, NoFlag, NoFlag, 0xffff8003, 0xffff8003, 0x0000007f},
270      {NoFlag, NoFlag, NoFlag, 0x00000001, 0x00000001, 0xffffff82},
271      {NoFlag, NoFlag, NoFlag, 0xffff8002, 0xffff8002, 0x0000007d},
272      {NoFlag, NoFlag, NoFlag, 0xfffffffe, 0xfffffffe, 0x80000000},
273      {NoFlag, NoFlag, NoFlag, 0xaaaaaaaa, 0xaaaaaaaa, 0xffff8000},
274      {NoFlag, NoFlag, NoFlag, 0x00007ffd, 0x00007ffd, 0xffffff82},
275      {NoFlag, NoFlag, NoFlag, 0x00007fff, 0x00007fff, 0x0000007d},
276      {NoFlag, NoFlag, NoFlag, 0x00000020, 0x00000020, 0xffffff82},
277      {NoFlag, NoFlag, NoFlag, 0x7ffffffe, 0x7ffffffe, 0x00000020},
278      {NoFlag, NoFlag, NoFlag, 0x7ffffffe, 0x7ffffffe, 0x0000007f},
279      {NoFlag, NoFlag, NoFlag, 0xffffff82, 0xffffff82, 0xffffff80},
280      {NoFlag, NoFlag, NoFlag, 0x0000007d, 0x0000007d, 0xffff8000},
281      {NoFlag, NoFlag, NoFlag, 0x7ffffffe, 0x7ffffffe, 0x00007ffd},
282      {NoFlag, NoFlag, NoFlag, 0x00000020, 0x00000020, 0x7fffffff},
283      {NoFlag, NoFlag, NoFlag, 0xffffff82, 0xffffff82, 0xffffffe0},
284      {NoFlag, NoFlag, NoFlag, 0x0000007d, 0x0000007d, 0x00007ffd},
285      {NoFlag, NoFlag, NoFlag, 0xffffff83, 0xffffff83, 0xaaaaaaaa},
286      {NoFlag, NoFlag, NoFlag, 0xffffffe0, 0xffffffe0, 0xfffffffe},
287      {NoFlag, NoFlag, NoFlag, 0xffffff82, 0xffffff82, 0x00000000},
288      {NoFlag, NoFlag, NoFlag, 0x55555555, 0x55555555, 0x00007ffe},
289      {NoFlag, NoFlag, NoFlag, 0xffff8000, 0xffff8000, 0x33333333},
290      {NoFlag, NoFlag, NoFlag, 0x00000001, 0x00000001, 0x00000002},
291      {NoFlag, NoFlag, NoFlag, 0x00000020, 0x00000020, 0x0000007d},
292      {NoFlag, NoFlag, NoFlag, 0x80000000, 0x80000000, 0xfffffffd},
293      {NoFlag, NoFlag, NoFlag, 0xffff8003, 0xffff8003, 0xffff8002},
294      {NoFlag, NoFlag, NoFlag, 0x80000000, 0x80000000, 0x00007ffd},
295      {NoFlag, NoFlag, NoFlag, 0x00000020, 0x00000020, 0x00000001},
296      {NoFlag, NoFlag, NoFlag, 0x00000001, 0x00000001, 0x0000007e},
297      {NoFlag, NoFlag, NoFlag, 0x7ffffffe, 0x7ffffffe, 0x0000007d},
298      {NoFlag, NoFlag, NoFlag, 0x7ffffffd, 0x7ffffffd, 0xffffff80},
299      {NoFlag, NoFlag, NoFlag, 0x00000020, 0x00000020, 0x80000001},
300      {NoFlag, NoFlag, NoFlag, 0xffff8003, 0xffff8003, 0xffffff80},
301      {NoFlag, NoFlag, NoFlag, 0xaaaaaaaa, 0xaaaaaaaa, 0x7fffffff},
302      {NoFlag, NoFlag, NoFlag, 0x00007ffd, 0x00007ffd, 0x00000000},
303      {NoFlag, NoFlag, NoFlag, 0x80000000, 0x80000000, 0xffffffff},
304      {NoFlag, NoFlag, NoFlag, 0x00007fff, 0x00007fff, 0xffff8001},
305      {NoFlag, NoFlag, NoFlag, 0xffffff80, 0xffffff80, 0x80000000},
306      {NoFlag, NoFlag, NoFlag, 0x00000001, 0x00000001, 0xffff8000},
307      {NoFlag, NoFlag, NoFlag, 0x7ffffffd, 0x7ffffffd, 0xfffffffe},
308      {NoFlag, NoFlag, NoFlag, 0xffff8003, 0xffff8003, 0xffff8001},
309      {NoFlag, NoFlag, NoFlag, 0x00007fff, 0x00007fff, 0xffffff82},
310      {NoFlag, NoFlag, NoFlag, 0x80000000, 0x80000000, 0x0000007f},
311      {NoFlag, NoFlag, NoFlag, 0xfffffffe, 0xfffffffe, 0x00000002},
312      {NoFlag, NoFlag, NoFlag, 0xfffffffe, 0xfffffffe, 0x00000001},
313      {NoFlag, NoFlag, NoFlag, 0xffffff82, 0xffffff82, 0x80000001},
314      {NoFlag, NoFlag, NoFlag, 0x00007fff, 0x00007fff, 0x80000001},
315      {NoFlag, NoFlag, NoFlag, 0x80000000, 0x80000000, 0x7ffffffd},
316      {NoFlag, NoFlag, NoFlag, 0x0000007f, 0x0000007f, 0xffffff82},
317      {NoFlag, NoFlag, NoFlag, 0xffffffe0, 0xffffffe0, 0xffff8002},
318      {NoFlag, NoFlag, NoFlag, 0x00007ffd, 0x00007ffd, 0x80000000},
319      {NoFlag, NoFlag, NoFlag, 0xffff8002, 0xffff8002, 0xffff8002},
320      {NoFlag, NoFlag, NoFlag, 0x80000001, 0x80000001, 0x55555555},
321      {NoFlag, NoFlag, NoFlag, 0xffffff81, 0xffffff81, 0x00007ffe},
322      {NoFlag, NoFlag, NoFlag, 0x00000002, 0x00000002, 0x0000007f},
323      {NoFlag, NoFlag, NoFlag, 0xaaaaaaaa, 0xaaaaaaaa, 0x00007ffd},
324      {NoFlag, NoFlag, NoFlag, 0x00007ffe, 0x00007ffe, 0xffffff83},
325      {NoFlag, NoFlag, NoFlag, 0xffffff82, 0xffffff82, 0x00007fff},
326      {NoFlag, NoFlag, NoFlag, 0x7ffffffd, 0x7ffffffd, 0x80000000},
327      {NoFlag, NoFlag, NoFlag, 0xffffff80, 0xffffff80, 0x00007fff},
328      {NoFlag, NoFlag, NoFlag, 0xffffff80, 0xffffff80, 0xaaaaaaaa},
329      {NoFlag, NoFlag, NoFlag, 0xaaaaaaaa, 0xaaaaaaaa, 0x00000020},
330      {NoFlag, NoFlag, NoFlag, 0xffffff82, 0xffffff82, 0xffff8002},
331      {NoFlag, NoFlag, NoFlag, 0x0000007f, 0x0000007f, 0x7fffffff},
332      {NoFlag, NoFlag, NoFlag, 0x33333333, 0x33333333, 0x00007ffe},
333      {NoFlag, NoFlag, NoFlag, 0xaaaaaaaa, 0xaaaaaaaa, 0x0000007d},
334      {NoFlag, NoFlag, NoFlag, 0xffff8000, 0xffff8000, 0xffffff80},
335      {NoFlag, NoFlag, NoFlag, 0xfffffffd, 0xfffffffd, 0xffff8001},
336      {NoFlag, NoFlag, NoFlag, 0x80000001, 0x80000001, 0x0000007e},
337      {NoFlag, NoFlag, NoFlag, 0x00007ffd, 0x00007ffd, 0x00000020},
338      {NoFlag, NoFlag, NoFlag, 0x7ffffffd, 0x7ffffffd, 0x80000001},
339      {NoFlag, NoFlag, NoFlag, 0x80000000, 0x80000000, 0xffffff80},
340      {NoFlag, NoFlag, NoFlag, 0xffff8000, 0xffff8000, 0xffffff81},
341      {NoFlag, NoFlag, NoFlag, 0x33333333, 0x33333333, 0xffffffff},
342      {NoFlag, NoFlag, NoFlag, 0xffffffff, 0xffffffff, 0xffffff80},
343      {NoFlag, NoFlag, NoFlag, 0x55555555, 0x55555555, 0xaaaaaaaa},
344      {NoFlag, NoFlag, NoFlag, 0x00000000, 0x00000000, 0xfffffffd},
345      {NoFlag, NoFlag, NoFlag, 0x00000020, 0x00000020, 0xffffffe0},
346      {NoFlag, NoFlag, NoFlag, 0x00007fff, 0x00007fff, 0x00000001},
347      {NoFlag, NoFlag, NoFlag, 0x7fffffff, 0x7fffffff, 0x0000007e},
348      {NoFlag, NoFlag, NoFlag, 0xffffff82, 0xffffff82, 0xffff8003},
349      {NoFlag, NoFlag, NoFlag, 0xffffff81, 0xffffff81, 0x00000000},
350      {NoFlag, NoFlag, NoFlag, 0xfffffffd, 0xfffffffd, 0xcccccccc},
351      {NoFlag, NoFlag, NoFlag, 0x7ffffffe, 0x7ffffffe, 0x00000002},
352      {NoFlag, NoFlag, NoFlag, 0x00000002, 0x00000002, 0x00000001},
353      {NoFlag, NoFlag, NoFlag, 0xffff8000, 0xffff8000, 0xfffffffd},
354      {NoFlag, NoFlag, NoFlag, 0x00007ffe, 0x00007ffe, 0x00000000},
355      {NoFlag, NoFlag, NoFlag, 0x0000007d, 0x0000007d, 0xcccccccc},
356      {NoFlag, NoFlag, NoFlag, 0x55555555, 0x55555555, 0x00000002},
357      {NoFlag, NoFlag, NoFlag, 0xffffffff, 0xffffffff, 0x7ffffffd},
358      {NoFlag, NoFlag, NoFlag, 0x0000007e, 0x0000007e, 0xaaaaaaaa},
359      {NoFlag, NoFlag, NoFlag, 0x00000000, 0x00000000, 0x00007ffd},
360      {NoFlag, NoFlag, NoFlag, 0xffff8002, 0xffff8002, 0xffff8001},
361      {NoFlag, NoFlag, NoFlag, 0x7ffffffe, 0x7ffffffe, 0x00007ffe},
362      {NoFlag, NoFlag, NoFlag, 0xffffff83, 0xffffff83, 0x00007ffd},
363      {NoFlag, NoFlag, NoFlag, 0x00007ffe, 0x00007ffe, 0x00007ffe},
364      {NoFlag, NoFlag, NoFlag, 0x33333333, 0x33333333, 0xfffffffd},
365      {NoFlag, NoFlag, NoFlag, 0x0000007e, 0x0000007e, 0x80000000},
366      {NoFlag, NoFlag, NoFlag, 0xcccccccc, 0xcccccccc, 0x80000001},
367      {NoFlag, NoFlag, NoFlag, 0x55555555, 0x55555555, 0x80000000},
368      {NoFlag, NoFlag, NoFlag, 0x0000007f, 0x0000007f, 0x7ffffffd},
369      {NoFlag, NoFlag, NoFlag, 0x7ffffffe, 0x7ffffffe, 0xcccccccc},
370      {NoFlag, NoFlag, NoFlag, 0xfffffffe, 0xfffffffe, 0x0000007f},
371      {NoFlag, NoFlag, NoFlag, 0x33333333, 0x33333333, 0x00000002},
372      {NoFlag, NoFlag, NoFlag, 0x00000001, 0x00000001, 0xffffff83},
373      {NoFlag, NoFlag, NoFlag, 0x0000007d, 0x0000007d, 0xffffff81},
374      {NoFlag, NoFlag, NoFlag, 0xffff8000, 0xffff8000, 0xffffff82},
375      {NoFlag, NoFlag, NoFlag, 0xfffffffd, 0xfffffffd, 0x00000002},
376      {NoFlag, NoFlag, NoFlag, 0xffffffff, 0xffffffff, 0x7ffffffe},
377      {NoFlag, NoFlag, NoFlag, 0xfffffffe, 0xfffffffe, 0xffffff82},
378      {NoFlag, NoFlag, NoFlag, 0xffffffe0, 0xffffffe0, 0x80000001},
379      {NoFlag, NoFlag, NoFlag, 0x00007ffe, 0x00007ffe, 0xcccccccc},
380      {NoFlag, NoFlag, NoFlag, 0xffffff81, 0xffffff81, 0xffffff83},
381      {NoFlag, NoFlag, NoFlag, 0xfffffffe, 0xfffffffe, 0x0000007e},
382      {NoFlag, NoFlag, NoFlag, 0xcccccccc, 0xcccccccc, 0x00000000},
383      {NoFlag, NoFlag, NoFlag, 0x80000001, 0x80000001, 0x00007fff},
384      {NoFlag, NoFlag, NoFlag, 0xffffff82, 0xffffff82, 0xffff8001},
385      {NoFlag, NoFlag, NoFlag, 0xfffffffe, 0xfffffffe, 0xcccccccc},
386      {NoFlag, NoFlag, NoFlag, 0x7fffffff, 0x7fffffff, 0x00000001},
387      {NoFlag, NoFlag, NoFlag, 0x7fffffff, 0x7fffffff, 0x33333333},
388      {NoFlag, NoFlag, NoFlag, 0xffff8001, 0xffff8001, 0xffff8003},
389      {NoFlag, NoFlag, NoFlag, 0xffffff83, 0xffffff83, 0x00000000},
390      {NoFlag, NoFlag, NoFlag, 0x00000000, 0x00000000, 0x7ffffffe},
391      {NoFlag, NoFlag, NoFlag, 0x7ffffffe, 0x7ffffffe, 0xaaaaaaaa},
392      {NoFlag, NoFlag, NoFlag, 0x00000000, 0x00000000, 0xffff8002},
393      {NoFlag, NoFlag, NoFlag, 0x7ffffffd, 0x7ffffffd, 0xffff8001},
394      {NoFlag, NoFlag, NoFlag, 0x00000001, 0x00000001, 0x80000001},
395      {NoFlag, NoFlag, NoFlag, 0xffffff81, 0xffffff81, 0xffff8001},
396      {NoFlag, NoFlag, NoFlag, 0x80000001, 0x80000001, 0xffffffff},
397      {NoFlag, NoFlag, NoFlag, 0x7fffffff, 0x7fffffff, 0x00000020},
398      {NoFlag, NoFlag, NoFlag, 0xffffffff, 0xffffffff, 0x00000001},
399      {NoFlag, NoFlag, NoFlag, 0xffff8000, 0xffff8000, 0x00000001},
400      {NoFlag, NoFlag, NoFlag, 0x80000001, 0x80000001, 0xffffffe0},
401      {NoFlag, NoFlag, NoFlag, 0xffffff83, 0xffffff83, 0xffff8002},
402      {NoFlag, NoFlag, NoFlag, 0xffffff81, 0xffffff81, 0xfffffffd},
403      {NoFlag, NoFlag, NoFlag, 0xffffff80, 0xffffff80, 0x55555555},
404      {NoFlag, NoFlag, NoFlag, 0x33333333, 0x33333333, 0xffffff82},
405      {NoFlag, NoFlag, NoFlag, 0x7ffffffd, 0x7ffffffd, 0x0000007f},
406      {NoFlag, NoFlag, NoFlag, 0xffff8001, 0xffff8001, 0xffff8000},
407      {NoFlag, NoFlag, NoFlag, 0x80000001, 0x80000001, 0x7ffffffd},
408      {NoFlag, NoFlag, NoFlag, 0x0000007d, 0x0000007d, 0xfffffffe},
409      {NoFlag, NoFlag, NoFlag, 0x55555555, 0x55555555, 0x0000007d},
410      {NoFlag, NoFlag, NoFlag, 0x0000007f, 0x0000007f, 0x33333333},
411      {NoFlag, NoFlag, NoFlag, 0xffff8001, 0xffff8001, 0x00000001},
412      {NoFlag, NoFlag, NoFlag, 0xffff8001, 0xffff8001, 0xffffff80},
413      {NoFlag, NoFlag, NoFlag, 0xffffffff, 0xffffffff, 0x00007ffe},
414      {NoFlag, NoFlag, NoFlag, 0x00007fff, 0x00007fff, 0x00000000},
415      {NoFlag, NoFlag, NoFlag, 0xffff8001, 0xffff8001, 0x55555555},
416      {NoFlag, NoFlag, NoFlag, 0x00000020, 0x00000020, 0x00000002},
417      {NoFlag, NoFlag, NoFlag, 0x7fffffff, 0x7fffffff, 0x7ffffffd},
418      {NoFlag, NoFlag, NoFlag, 0x7ffffffd, 0x7ffffffd, 0xaaaaaaaa},
419      {NoFlag, NoFlag, NoFlag, 0x80000000, 0x80000000, 0x00007ffe},
420      {NoFlag, NoFlag, NoFlag, 0x55555555, 0x55555555, 0x0000007e},
421      {NoFlag, NoFlag, NoFlag, 0xffff8001, 0xffff8001, 0xfffffffe},
422      {NoFlag, NoFlag, NoFlag, 0x80000000, 0x80000000, 0x0000007e},
423      {NoFlag, NoFlag, NoFlag, 0xffffff82, 0xffffff82, 0x55555555},
424      {NoFlag, NoFlag, NoFlag, 0x00000002, 0x00000002, 0x7fffffff},
425      {NoFlag, NoFlag, NoFlag, 0xffffff80, 0xffffff80, 0x33333333},
426      {NoFlag, NoFlag, NoFlag, 0xffffffff, 0xffffffff, 0xffffff81},
427      {NoFlag, NoFlag, NoFlag, 0x00000002, 0x00000002, 0x00000020},
428      {NoFlag, NoFlag, NoFlag, 0xcccccccc, 0xcccccccc, 0x00007ffe},
429      {NoFlag, NoFlag, NoFlag, 0xffff8002, 0xffff8002, 0xfffffffd},
430      {NoFlag, NoFlag, NoFlag, 0xffff8000, 0xffff8000, 0xffff8001},
431      {NoFlag, NoFlag, NoFlag, 0x00000001, 0x00000001, 0x7fffffff},
432      {NoFlag, NoFlag, NoFlag, 0xffffffe0, 0xffffffe0, 0x80000000},
433      {NoFlag, NoFlag, NoFlag, 0x00007ffe, 0x00007ffe, 0x7ffffffd},
434      {NoFlag, NoFlag, NoFlag, 0x00007ffd, 0x00007ffd, 0x33333333},
435      {NoFlag, NoFlag, NoFlag, 0x0000007f, 0x0000007f, 0x00007ffd},
436      {NoFlag, NoFlag, NoFlag, 0x00000000, 0x00000000, 0x0000007e},
437      {NoFlag, NoFlag, NoFlag, 0xfffffffe, 0xfffffffe, 0xaaaaaaaa},
438      {NoFlag, NoFlag, NoFlag, 0x00000000, 0x00000000, 0xffff8001},
439      {NoFlag, NoFlag, NoFlag, 0x33333333, 0x33333333, 0x33333333},
440      {NoFlag, NoFlag, NoFlag, 0xffffffe0, 0xffffffe0, 0x00000001},
441      {NoFlag, NoFlag, NoFlag, 0xfffffffd, 0xfffffffd, 0xffff8003},
442      {NoFlag, NoFlag, NoFlag, 0xffffffe0, 0xffffffe0, 0x33333333},
443      {NoFlag, NoFlag, NoFlag, 0xffffff83, 0xffffff83, 0xffff8001},
444      {NoFlag, NoFlag, NoFlag, 0x55555555, 0x55555555, 0xffff8001},
445      {NoFlag, NoFlag, NoFlag, 0xfffffffd, 0xfffffffd, 0x55555555},
446      {NoFlag, NoFlag, NoFlag, 0x00007ffe, 0x00007ffe, 0x00000002},
447      {NoFlag, NoFlag, NoFlag, 0xffffff82, 0xffffff82, 0x33333333},
448      {NoFlag, NoFlag, NoFlag, 0x80000000, 0x80000000, 0xfffffffe},
449      {NoFlag, NoFlag, NoFlag, 0x00000020, 0x00000020, 0xffff8001},
450      {NoFlag, NoFlag, NoFlag, 0x0000007d, 0x0000007d, 0x55555555},
451      {NoFlag, NoFlag, NoFlag, 0x00007fff, 0x00007fff, 0x00000002},
452      {NoFlag, NoFlag, NoFlag, 0x80000001, 0x80000001, 0x00000000},
453      {NoFlag, NoFlag, NoFlag, 0x00007ffd, 0x00007ffd, 0x00000002},
454      {NoFlag, NoFlag, NoFlag, 0xffffff80, 0xffffff80, 0xffffff83},
455      {NoFlag, NoFlag, NoFlag, 0x0000007d, 0x0000007d, 0xffff8001},
456      {NoFlag, NoFlag, NoFlag, 0xffffff83, 0xffffff83, 0x00000001},
457      {NoFlag, NoFlag, NoFlag, 0x00007ffd, 0x00007ffd, 0xffffff83},
458      {NoFlag, NoFlag, NoFlag, 0xffffff82, 0xffffff82, 0xfffffffe},
459      {NoFlag, NoFlag, NoFlag, 0x33333333, 0x33333333, 0xffffff81},
460      {NoFlag, NoFlag, NoFlag, 0x0000007d, 0x0000007d, 0xfffffffd},
461      {NoFlag, NoFlag, NoFlag, 0x80000001, 0x80000001, 0xffffff80},
462      {NoFlag, NoFlag, NoFlag, 0xaaaaaaaa, 0xaaaaaaaa, 0xffffff83},
463      {NoFlag, NoFlag, NoFlag, 0xffff8003, 0xffff8003, 0x7ffffffe},
464      {NoFlag, NoFlag, NoFlag, 0xffffffe0, 0xffffffe0, 0xaaaaaaaa},
465      {NoFlag, NoFlag, NoFlag, 0x80000000, 0x80000000, 0xffffffe0},
466      {NoFlag, NoFlag, NoFlag, 0x0000007e, 0x0000007e, 0x7fffffff},
467      {NoFlag, NoFlag, NoFlag, 0x00000000, 0x00000000, 0x0000007f},
468      {NoFlag, NoFlag, NoFlag, 0xffff8002, 0xffff8002, 0xffffff81}};
469 
470 static const Inputs kRdIsRm[] =
471     {{NoFlag, NoFlag, NoFlag, 0x00000020, 0x0000007f, 0x00000020},
472      {NoFlag, NoFlag, NoFlag, 0x00007ffd, 0x00000020, 0x00007ffd},
473      {NoFlag, NoFlag, NoFlag, 0x00000000, 0x00007ffd, 0x00000000},
474      {NoFlag, NoFlag, NoFlag, 0xaaaaaaaa, 0x7ffffffd, 0xaaaaaaaa},
475      {NoFlag, NoFlag, NoFlag, 0x00007ffd, 0xffff8000, 0x00007ffd},
476      {NoFlag, NoFlag, NoFlag, 0x0000007f, 0xfffffffd, 0x0000007f},
477      {NoFlag, NoFlag, NoFlag, 0xffffffff, 0x80000000, 0xffffffff},
478      {NoFlag, NoFlag, NoFlag, 0x7fffffff, 0xffffff82, 0x7fffffff},
479      {NoFlag, NoFlag, NoFlag, 0x00000002, 0xfffffffe, 0x00000002},
480      {NoFlag, NoFlag, NoFlag, 0x00000020, 0x55555555, 0x00000020},
481      {NoFlag, NoFlag, NoFlag, 0x33333333, 0xfffffffe, 0x33333333},
482      {NoFlag, NoFlag, NoFlag, 0xfffffffd, 0x80000000, 0xfffffffd},
483      {NoFlag, NoFlag, NoFlag, 0xffffff82, 0xffff8003, 0xffffff82},
484      {NoFlag, NoFlag, NoFlag, 0x0000007e, 0x7ffffffe, 0x0000007e},
485      {NoFlag, NoFlag, NoFlag, 0x00007fff, 0x00007fff, 0x00007fff},
486      {NoFlag, NoFlag, NoFlag, 0x0000007d, 0xffffff80, 0x0000007d},
487      {NoFlag, NoFlag, NoFlag, 0xffffff80, 0x00000020, 0xffffff80},
488      {NoFlag, NoFlag, NoFlag, 0x33333333, 0xffff8002, 0x33333333},
489      {NoFlag, NoFlag, NoFlag, 0x0000007e, 0xffffff80, 0x0000007e},
490      {NoFlag, NoFlag, NoFlag, 0x80000000, 0x00000020, 0x80000000},
491      {NoFlag, NoFlag, NoFlag, 0x00000002, 0xffffff81, 0x00000002},
492      {NoFlag, NoFlag, NoFlag, 0x0000007d, 0xffffff82, 0x0000007d},
493      {NoFlag, NoFlag, NoFlag, 0x00000000, 0xffffff82, 0x00000000},
494      {NoFlag, NoFlag, NoFlag, 0xffffff81, 0xffffff83, 0xffffff81},
495      {NoFlag, NoFlag, NoFlag, 0x80000001, 0x55555555, 0x80000001},
496      {NoFlag, NoFlag, NoFlag, 0xffff8001, 0x00000001, 0xffff8001},
497      {NoFlag, NoFlag, NoFlag, 0x00000000, 0x7ffffffe, 0x00000000},
498      {NoFlag, NoFlag, NoFlag, 0x33333333, 0xffff8001, 0x33333333},
499      {NoFlag, NoFlag, NoFlag, 0x80000000, 0x00000002, 0x80000000},
500      {NoFlag, NoFlag, NoFlag, 0x80000000, 0xaaaaaaaa, 0x80000000},
501      {NoFlag, NoFlag, NoFlag, 0xfffffffe, 0x00000020, 0xfffffffe},
502      {NoFlag, NoFlag, NoFlag, 0x00007fff, 0xfffffffe, 0x00007fff},
503      {NoFlag, NoFlag, NoFlag, 0x00007fff, 0xfffffffd, 0x00007fff},
504      {NoFlag, NoFlag, NoFlag, 0x7ffffffd, 0x00007ffe, 0x7ffffffd},
505      {NoFlag, NoFlag, NoFlag, 0xffff8002, 0xcccccccc, 0xffff8002},
506      {NoFlag, NoFlag, NoFlag, 0xfffffffe, 0x7ffffffe, 0xfffffffe},
507      {NoFlag, NoFlag, NoFlag, 0x7ffffffd, 0xffffffff, 0x7ffffffd},
508      {NoFlag, NoFlag, NoFlag, 0x0000007f, 0xaaaaaaaa, 0x0000007f},
509      {NoFlag, NoFlag, NoFlag, 0x00000000, 0x0000007d, 0x00000000},
510      {NoFlag, NoFlag, NoFlag, 0x00007fff, 0xaaaaaaaa, 0x00007fff},
511      {NoFlag, NoFlag, NoFlag, 0x7ffffffd, 0xaaaaaaaa, 0x7ffffffd},
512      {NoFlag, NoFlag, NoFlag, 0xffffffe0, 0x55555555, 0xffffffe0},
513      {NoFlag, NoFlag, NoFlag, 0xffff8002, 0x0000007e, 0xffff8002},
514      {NoFlag, NoFlag, NoFlag, 0x80000000, 0x33333333, 0x80000000},
515      {NoFlag, NoFlag, NoFlag, 0xcccccccc, 0xffffff80, 0xcccccccc},
516      {NoFlag, NoFlag, NoFlag, 0x00000000, 0x00007ffe, 0x00000000},
517      {NoFlag, NoFlag, NoFlag, 0x80000000, 0x55555555, 0x80000000},
518      {NoFlag, NoFlag, NoFlag, 0xffffffe0, 0xffff8001, 0xffffffe0},
519      {NoFlag, NoFlag, NoFlag, 0xaaaaaaaa, 0x00000002, 0xaaaaaaaa},
520      {NoFlag, NoFlag, NoFlag, 0x7ffffffe, 0xaaaaaaaa, 0x7ffffffe},
521      {NoFlag, NoFlag, NoFlag, 0xffffff83, 0x0000007f, 0xffffff83},
522      {NoFlag, NoFlag, NoFlag, 0xffffff81, 0x7fffffff, 0xffffff81},
523      {NoFlag, NoFlag, NoFlag, 0xffffff81, 0xffff8001, 0xffffff81},
524      {NoFlag, NoFlag, NoFlag, 0x80000000, 0xffff8003, 0x80000000},
525      {NoFlag, NoFlag, NoFlag, 0x33333333, 0xaaaaaaaa, 0x33333333},
526      {NoFlag, NoFlag, NoFlag, 0x00007ffe, 0xaaaaaaaa, 0x00007ffe},
527      {NoFlag, NoFlag, NoFlag, 0xffff8001, 0xcccccccc, 0xffff8001},
528      {NoFlag, NoFlag, NoFlag, 0xfffffffd, 0xffffff81, 0xfffffffd},
529      {NoFlag, NoFlag, NoFlag, 0xffffffe0, 0xfffffffe, 0xffffffe0},
530      {NoFlag, NoFlag, NoFlag, 0x00007ffe, 0xcccccccc, 0x00007ffe},
531      {NoFlag, NoFlag, NoFlag, 0x00007fff, 0x00000020, 0x00007fff},
532      {NoFlag, NoFlag, NoFlag, 0xffffff81, 0x00007ffe, 0xffffff81},
533      {NoFlag, NoFlag, NoFlag, 0xaaaaaaaa, 0x0000007d, 0xaaaaaaaa},
534      {NoFlag, NoFlag, NoFlag, 0xffff8002, 0xfffffffe, 0xffff8002},
535      {NoFlag, NoFlag, NoFlag, 0xcccccccc, 0xaaaaaaaa, 0xcccccccc},
536      {NoFlag, NoFlag, NoFlag, 0x33333333, 0x0000007f, 0x33333333},
537      {NoFlag, NoFlag, NoFlag, 0x00007ffd, 0x00000001, 0x00007ffd},
538      {NoFlag, NoFlag, NoFlag, 0x80000000, 0xffff8000, 0x80000000},
539      {NoFlag, NoFlag, NoFlag, 0xaaaaaaaa, 0xffffffff, 0xaaaaaaaa},
540      {NoFlag, NoFlag, NoFlag, 0x00000001, 0xffffff83, 0x00000001},
541      {NoFlag, NoFlag, NoFlag, 0x80000001, 0xffff8000, 0x80000001},
542      {NoFlag, NoFlag, NoFlag, 0x0000007e, 0xffff8000, 0x0000007e},
543      {NoFlag, NoFlag, NoFlag, 0x00000020, 0xffffffff, 0x00000020},
544      {NoFlag, NoFlag, NoFlag, 0xffff8001, 0xffff8000, 0xffff8001},
545      {NoFlag, NoFlag, NoFlag, 0x7ffffffe, 0xffffffe0, 0x7ffffffe},
546      {NoFlag, NoFlag, NoFlag, 0xffffff83, 0x7ffffffe, 0xffffff83},
547      {NoFlag, NoFlag, NoFlag, 0x7fffffff, 0xfffffffe, 0x7fffffff},
548      {NoFlag, NoFlag, NoFlag, 0x0000007f, 0x00000000, 0x0000007f},
549      {NoFlag, NoFlag, NoFlag, 0x0000007e, 0x0000007f, 0x0000007e},
550      {NoFlag, NoFlag, NoFlag, 0xffffff83, 0x7ffffffd, 0xffffff83},
551      {NoFlag, NoFlag, NoFlag, 0x00000001, 0x80000001, 0x00000001},
552      {NoFlag, NoFlag, NoFlag, 0x00000001, 0x00007ffd, 0x00000001},
553      {NoFlag, NoFlag, NoFlag, 0xffffff80, 0xaaaaaaaa, 0xffffff80},
554      {NoFlag, NoFlag, NoFlag, 0xffffffff, 0x00000000, 0xffffffff},
555      {NoFlag, NoFlag, NoFlag, 0xffffff80, 0xffffff82, 0xffffff80},
556      {NoFlag, NoFlag, NoFlag, 0xffff8001, 0xaaaaaaaa, 0xffff8001},
557      {NoFlag, NoFlag, NoFlag, 0xffffff80, 0xffff8000, 0xffffff80},
558      {NoFlag, NoFlag, NoFlag, 0xaaaaaaaa, 0xffffffe0, 0xaaaaaaaa},
559      {NoFlag, NoFlag, NoFlag, 0x33333333, 0x00007ffd, 0x33333333},
560      {NoFlag, NoFlag, NoFlag, 0x33333333, 0x00007fff, 0x33333333},
561      {NoFlag, NoFlag, NoFlag, 0xffffff82, 0xfffffffd, 0xffffff82},
562      {NoFlag, NoFlag, NoFlag, 0x0000007d, 0x7ffffffd, 0x0000007d},
563      {NoFlag, NoFlag, NoFlag, 0x00000001, 0x00000001, 0x00000001},
564      {NoFlag, NoFlag, NoFlag, 0xffffff83, 0xfffffffe, 0xffffff83},
565      {NoFlag, NoFlag, NoFlag, 0xffff8001, 0x00007fff, 0xffff8001},
566      {NoFlag, NoFlag, NoFlag, 0xfffffffd, 0x00000020, 0xfffffffd},
567      {NoFlag, NoFlag, NoFlag, 0x00007fff, 0x0000007d, 0x00007fff},
568      {NoFlag, NoFlag, NoFlag, 0x0000007d, 0xffff8002, 0x0000007d},
569      {NoFlag, NoFlag, NoFlag, 0xffff8001, 0x00000000, 0xffff8001},
570      {NoFlag, NoFlag, NoFlag, 0xffffff82, 0x0000007f, 0xffffff82},
571      {NoFlag, NoFlag, NoFlag, 0xffffff83, 0x00007ffe, 0xffffff83},
572      {NoFlag, NoFlag, NoFlag, 0xffffff83, 0xffff8003, 0xffffff83},
573      {NoFlag, NoFlag, NoFlag, 0x00007ffe, 0x80000001, 0x00007ffe},
574      {NoFlag, NoFlag, NoFlag, 0xffff8000, 0x00007ffd, 0xffff8000},
575      {NoFlag, NoFlag, NoFlag, 0xffff8003, 0x00007ffe, 0xffff8003},
576      {NoFlag, NoFlag, NoFlag, 0xfffffffe, 0x80000001, 0xfffffffe},
577      {NoFlag, NoFlag, NoFlag, 0x00000002, 0x00007ffe, 0x00000002},
578      {NoFlag, NoFlag, NoFlag, 0x00000001, 0x7ffffffd, 0x00000001},
579      {NoFlag, NoFlag, NoFlag, 0xffff8002, 0xfffffffd, 0xffff8002},
580      {NoFlag, NoFlag, NoFlag, 0x7fffffff, 0x7ffffffd, 0x7fffffff},
581      {NoFlag, NoFlag, NoFlag, 0xcccccccc, 0xffffff82, 0xcccccccc},
582      {NoFlag, NoFlag, NoFlag, 0x7ffffffd, 0x80000000, 0x7ffffffd},
583      {NoFlag, NoFlag, NoFlag, 0xcccccccc, 0xffffffff, 0xcccccccc},
584      {NoFlag, NoFlag, NoFlag, 0xffffffff, 0xffffff81, 0xffffffff},
585      {NoFlag, NoFlag, NoFlag, 0x00007ffe, 0x00000020, 0x00007ffe},
586      {NoFlag, NoFlag, NoFlag, 0xffff8001, 0x00000002, 0xffff8001},
587      {NoFlag, NoFlag, NoFlag, 0xffff8003, 0xffffffe0, 0xffff8003},
588      {NoFlag, NoFlag, NoFlag, 0x55555555, 0xffffff83, 0x55555555},
589      {NoFlag, NoFlag, NoFlag, 0x55555555, 0x33333333, 0x55555555},
590      {NoFlag, NoFlag, NoFlag, 0xffff8000, 0xffffff82, 0xffff8000},
591      {NoFlag, NoFlag, NoFlag, 0xffff8001, 0x55555555, 0xffff8001},
592      {NoFlag, NoFlag, NoFlag, 0x00000002, 0x00007ffd, 0x00000002},
593      {NoFlag, NoFlag, NoFlag, 0xffffff80, 0x00007ffd, 0xffffff80},
594      {NoFlag, NoFlag, NoFlag, 0x00007fff, 0xffffff80, 0x00007fff},
595      {NoFlag, NoFlag, NoFlag, 0x00000002, 0x00000001, 0x00000002},
596      {NoFlag, NoFlag, NoFlag, 0x00000020, 0x00007ffe, 0x00000020},
597      {NoFlag, NoFlag, NoFlag, 0xfffffffe, 0xffffffff, 0xfffffffe},
598      {NoFlag, NoFlag, NoFlag, 0xffffff81, 0x00000002, 0xffffff81},
599      {NoFlag, NoFlag, NoFlag, 0x0000007d, 0x7fffffff, 0x0000007d},
600      {NoFlag, NoFlag, NoFlag, 0x00007fff, 0x00007ffd, 0x00007fff},
601      {NoFlag, NoFlag, NoFlag, 0xffff8002, 0x80000001, 0xffff8002},
602      {NoFlag, NoFlag, NoFlag, 0x00000020, 0xffffff82, 0x00000020},
603      {NoFlag, NoFlag, NoFlag, 0x55555555, 0x00000020, 0x55555555},
604      {NoFlag, NoFlag, NoFlag, 0x80000000, 0x00007fff, 0x80000000},
605      {NoFlag, NoFlag, NoFlag, 0x55555555, 0xffffff81, 0x55555555},
606      {NoFlag, NoFlag, NoFlag, 0x00007fff, 0x7ffffffe, 0x00007fff},
607      {NoFlag, NoFlag, NoFlag, 0x00007ffd, 0xaaaaaaaa, 0x00007ffd},
608      {NoFlag, NoFlag, NoFlag, 0xcccccccc, 0x00000001, 0xcccccccc},
609      {NoFlag, NoFlag, NoFlag, 0x00000000, 0x00000001, 0x00000000},
610      {NoFlag, NoFlag, NoFlag, 0xcccccccc, 0xfffffffd, 0xcccccccc},
611      {NoFlag, NoFlag, NoFlag, 0xaaaaaaaa, 0xffff8002, 0xaaaaaaaa},
612      {NoFlag, NoFlag, NoFlag, 0x7ffffffd, 0x00000020, 0x7ffffffd},
613      {NoFlag, NoFlag, NoFlag, 0x55555555, 0x0000007f, 0x55555555},
614      {NoFlag, NoFlag, NoFlag, 0x7ffffffe, 0x0000007f, 0x7ffffffe},
615      {NoFlag, NoFlag, NoFlag, 0xffff8003, 0xffffff83, 0xffff8003},
616      {NoFlag, NoFlag, NoFlag, 0xfffffffd, 0xcccccccc, 0xfffffffd},
617      {NoFlag, NoFlag, NoFlag, 0x00007fff, 0xffffffff, 0x00007fff},
618      {NoFlag, NoFlag, NoFlag, 0xaaaaaaaa, 0xcccccccc, 0xaaaaaaaa},
619      {NoFlag, NoFlag, NoFlag, 0x7fffffff, 0xffffff83, 0x7fffffff},
620      {NoFlag, NoFlag, NoFlag, 0xffff8000, 0x00007ffe, 0xffff8000},
621      {NoFlag, NoFlag, NoFlag, 0x7ffffffe, 0x00007ffe, 0x7ffffffe},
622      {NoFlag, NoFlag, NoFlag, 0x80000000, 0x0000007f, 0x80000000},
623      {NoFlag, NoFlag, NoFlag, 0x00000020, 0x00007ffd, 0x00000020},
624      {NoFlag, NoFlag, NoFlag, 0x80000001, 0x00000001, 0x80000001},
625      {NoFlag, NoFlag, NoFlag, 0xffffffe0, 0xffff8003, 0xffffffe0},
626      {NoFlag, NoFlag, NoFlag, 0x7fffffff, 0xffff8003, 0x7fffffff},
627      {NoFlag, NoFlag, NoFlag, 0x80000001, 0xffffff82, 0x80000001},
628      {NoFlag, NoFlag, NoFlag, 0x80000001, 0x7ffffffe, 0x80000001},
629      {NoFlag, NoFlag, NoFlag, 0xffffff80, 0x7ffffffd, 0xffffff80},
630      {NoFlag, NoFlag, NoFlag, 0xfffffffd, 0xffff8001, 0xfffffffd},
631      {NoFlag, NoFlag, NoFlag, 0xfffffffe, 0x7fffffff, 0xfffffffe},
632      {NoFlag, NoFlag, NoFlag, 0x33333333, 0x80000001, 0x33333333},
633      {NoFlag, NoFlag, NoFlag, 0x00007ffd, 0xffffffff, 0x00007ffd},
634      {NoFlag, NoFlag, NoFlag, 0xffffffe0, 0x0000007e, 0xffffffe0},
635      {NoFlag, NoFlag, NoFlag, 0xfffffffe, 0xffffff80, 0xfffffffe},
636      {NoFlag, NoFlag, NoFlag, 0xcccccccc, 0x7ffffffd, 0xcccccccc},
637      {NoFlag, NoFlag, NoFlag, 0xffffff82, 0xffffffe0, 0xffffff82},
638      {NoFlag, NoFlag, NoFlag, 0xffffff81, 0xaaaaaaaa, 0xffffff81},
639      {NoFlag, NoFlag, NoFlag, 0xffffff83, 0x0000007e, 0xffffff83},
640      {NoFlag, NoFlag, NoFlag, 0xffffff81, 0x0000007f, 0xffffff81},
641      {NoFlag, NoFlag, NoFlag, 0x0000007f, 0x0000007f, 0x0000007f},
642      {NoFlag, NoFlag, NoFlag, 0x00000002, 0x80000000, 0x00000002},
643      {NoFlag, NoFlag, NoFlag, 0x0000007d, 0x00000000, 0x0000007d},
644      {NoFlag, NoFlag, NoFlag, 0x7ffffffe, 0xffffff80, 0x7ffffffe},
645      {NoFlag, NoFlag, NoFlag, 0xffffff82, 0x33333333, 0xffffff82},
646      {NoFlag, NoFlag, NoFlag, 0xffffff81, 0xffffff81, 0xffffff81},
647      {NoFlag, NoFlag, NoFlag, 0xffffff82, 0xaaaaaaaa, 0xffffff82},
648      {NoFlag, NoFlag, NoFlag, 0xffffffe0, 0x0000007f, 0xffffffe0},
649      {NoFlag, NoFlag, NoFlag, 0x00000000, 0x7ffffffd, 0x00000000},
650      {NoFlag, NoFlag, NoFlag, 0x0000007e, 0x33333333, 0x0000007e},
651      {NoFlag, NoFlag, NoFlag, 0x55555555, 0xfffffffe, 0x55555555},
652      {NoFlag, NoFlag, NoFlag, 0xffff8003, 0x0000007d, 0xffff8003},
653      {NoFlag, NoFlag, NoFlag, 0xcccccccc, 0x80000000, 0xcccccccc},
654      {NoFlag, NoFlag, NoFlag, 0x7ffffffe, 0xffffff81, 0x7ffffffe},
655      {NoFlag, NoFlag, NoFlag, 0x80000000, 0x7ffffffe, 0x80000000},
656      {NoFlag, NoFlag, NoFlag, 0x7fffffff, 0xffffff80, 0x7fffffff},
657      {NoFlag, NoFlag, NoFlag, 0x7fffffff, 0x00000001, 0x7fffffff},
658      {NoFlag, NoFlag, NoFlag, 0x00000000, 0x00000000, 0x00000000},
659      {NoFlag, NoFlag, NoFlag, 0xffff8001, 0xffffff82, 0xffff8001},
660      {NoFlag, NoFlag, NoFlag, 0x0000007d, 0xffff8001, 0x0000007d},
661      {NoFlag, NoFlag, NoFlag, 0x00007fff, 0x00007ffe, 0x00007fff},
662      {NoFlag, NoFlag, NoFlag, 0xfffffffd, 0x00007fff, 0xfffffffd},
663      {NoFlag, NoFlag, NoFlag, 0x7ffffffd, 0xffff8003, 0x7ffffffd},
664      {NoFlag, NoFlag, NoFlag, 0x7ffffffe, 0x80000001, 0x7ffffffe},
665      {NoFlag, NoFlag, NoFlag, 0xfffffffd, 0x7fffffff, 0xfffffffd},
666      {NoFlag, NoFlag, NoFlag, 0xffffff82, 0xffff8000, 0xffffff82},
667      {NoFlag, NoFlag, NoFlag, 0x7ffffffd, 0xffffff82, 0x7ffffffd},
668      {NoFlag, NoFlag, NoFlag, 0xffff8000, 0xcccccccc, 0xffff8000},
669      {NoFlag, NoFlag, NoFlag, 0xffffff83, 0x7fffffff, 0xffffff83},
670      {NoFlag, NoFlag, NoFlag, 0xffff8003, 0x00007fff, 0xffff8003}};
671 
672 static const Inputs kRnIsRm[] =
673     {{NoFlag, NoFlag, NoFlag, 0xffffff82, 0x00000002, 0x00000002},
674      {NoFlag, NoFlag, NoFlag, 0x00000020, 0x0000007f, 0x0000007f},
675      {NoFlag, NoFlag, NoFlag, 0x55555555, 0x0000007d, 0x0000007d},
676      {NoFlag, NoFlag, NoFlag, 0xffff8002, 0x00000020, 0x00000020},
677      {NoFlag, NoFlag, NoFlag, 0xffff8000, 0xcccccccc, 0xcccccccc},
678      {NoFlag, NoFlag, NoFlag, 0xffff8002, 0xffffffe0, 0xffffffe0},
679      {NoFlag, NoFlag, NoFlag, 0x7fffffff, 0x00000000, 0x00000000},
680      {NoFlag, NoFlag, NoFlag, 0x00000000, 0xffffffff, 0xffffffff},
681      {NoFlag, NoFlag, NoFlag, 0x00007ffe, 0xffffffe0, 0xffffffe0},
682      {NoFlag, NoFlag, NoFlag, 0x7fffffff, 0x00000002, 0x00000002},
683      {NoFlag, NoFlag, NoFlag, 0x00007fff, 0xcccccccc, 0xcccccccc},
684      {NoFlag, NoFlag, NoFlag, 0x80000000, 0x80000000, 0x80000000},
685      {NoFlag, NoFlag, NoFlag, 0xffff8001, 0x33333333, 0x33333333},
686      {NoFlag, NoFlag, NoFlag, 0x00000000, 0x00007ffd, 0x00007ffd},
687      {NoFlag, NoFlag, NoFlag, 0x00007fff, 0xaaaaaaaa, 0xaaaaaaaa},
688      {NoFlag, NoFlag, NoFlag, 0xffff8003, 0x7ffffffd, 0x7ffffffd},
689      {NoFlag, NoFlag, NoFlag, 0x7ffffffd, 0xfffffffd, 0xfffffffd},
690      {NoFlag, NoFlag, NoFlag, 0xfffffffe, 0x00000001, 0x00000001},
691      {NoFlag, NoFlag, NoFlag, 0x00000000, 0x00000002, 0x00000002},
692      {NoFlag, NoFlag, NoFlag, 0x00000002, 0xffff8001, 0xffff8001},
693      {NoFlag, NoFlag, NoFlag, 0xffff8002, 0xfffffffd, 0xfffffffd},
694      {NoFlag, NoFlag, NoFlag, 0x00007fff, 0xffff8000, 0xffff8000},
695      {NoFlag, NoFlag, NoFlag, 0x00000002, 0x7fffffff, 0x7fffffff},
696      {NoFlag, NoFlag, NoFlag, 0x0000007d, 0xffffff83, 0xffffff83},
697      {NoFlag, NoFlag, NoFlag, 0x7ffffffe, 0x00000002, 0x00000002},
698      {NoFlag, NoFlag, NoFlag, 0x7ffffffe, 0x0000007f, 0x0000007f},
699      {NoFlag, NoFlag, NoFlag, 0xffff8000, 0x00000020, 0x00000020},
700      {NoFlag, NoFlag, NoFlag, 0xffffff82, 0xffff8001, 0xffff8001},
701      {NoFlag, NoFlag, NoFlag, 0x7ffffffd, 0xffffff83, 0xffffff83},
702      {NoFlag, NoFlag, NoFlag, 0x00000020, 0xffffff81, 0xffffff81},
703      {NoFlag, NoFlag, NoFlag, 0x00007ffd, 0x00000002, 0x00000002},
704      {NoFlag, NoFlag, NoFlag, 0xcccccccc, 0xffff8000, 0xffff8000},
705      {NoFlag, NoFlag, NoFlag, 0x80000000, 0x00000001, 0x00000001},
706      {NoFlag, NoFlag, NoFlag, 0xffff8001, 0x7ffffffe, 0x7ffffffe},
707      {NoFlag, NoFlag, NoFlag, 0x7fffffff, 0x00000001, 0x00000001},
708      {NoFlag, NoFlag, NoFlag, 0x80000000, 0x7ffffffd, 0x7ffffffd},
709      {NoFlag, NoFlag, NoFlag, 0xffffffe0, 0x00000001, 0x00000001},
710      {NoFlag, NoFlag, NoFlag, 0x7ffffffd, 0x55555555, 0x55555555},
711      {NoFlag, NoFlag, NoFlag, 0xffff8002, 0x80000001, 0x80000001},
712      {NoFlag, NoFlag, NoFlag, 0xffffff82, 0xffffff82, 0xffffff82},
713      {NoFlag, NoFlag, NoFlag, 0xaaaaaaaa, 0xffff8001, 0xffff8001},
714      {NoFlag, NoFlag, NoFlag, 0xffff8002, 0xffffff80, 0xffffff80},
715      {NoFlag, NoFlag, NoFlag, 0x33333333, 0x7ffffffe, 0x7ffffffe},
716      {NoFlag, NoFlag, NoFlag, 0xffffff80, 0xffffff83, 0xffffff83},
717      {NoFlag, NoFlag, NoFlag, 0x0000007e, 0x7ffffffe, 0x7ffffffe},
718      {NoFlag, NoFlag, NoFlag, 0xfffffffe, 0xffff8002, 0xffff8002},
719      {NoFlag, NoFlag, NoFlag, 0x00007ffd, 0x80000000, 0x80000000},
720      {NoFlag, NoFlag, NoFlag, 0xffffff80, 0x00007ffe, 0x00007ffe},
721      {NoFlag, NoFlag, NoFlag, 0x00000020, 0xaaaaaaaa, 0xaaaaaaaa},
722      {NoFlag, NoFlag, NoFlag, 0x33333333, 0x00000020, 0x00000020},
723      {NoFlag, NoFlag, NoFlag, 0x0000007d, 0x7ffffffe, 0x7ffffffe},
724      {NoFlag, NoFlag, NoFlag, 0x7ffffffd, 0x7ffffffe, 0x7ffffffe},
725      {NoFlag, NoFlag, NoFlag, 0xffff8002, 0xffff8000, 0xffff8000},
726      {NoFlag, NoFlag, NoFlag, 0x80000001, 0x7fffffff, 0x7fffffff},
727      {NoFlag, NoFlag, NoFlag, 0xffffff82, 0x00000020, 0x00000020},
728      {NoFlag, NoFlag, NoFlag, 0xffffffff, 0xffffffe0, 0xffffffe0},
729      {NoFlag, NoFlag, NoFlag, 0x0000007d, 0xcccccccc, 0xcccccccc},
730      {NoFlag, NoFlag, NoFlag, 0x80000001, 0xaaaaaaaa, 0xaaaaaaaa},
731      {NoFlag, NoFlag, NoFlag, 0x00007ffe, 0x33333333, 0x33333333},
732      {NoFlag, NoFlag, NoFlag, 0x0000007e, 0xffff8002, 0xffff8002},
733      {NoFlag, NoFlag, NoFlag, 0x00000002, 0xffffffe0, 0xffffffe0},
734      {NoFlag, NoFlag, NoFlag, 0x80000000, 0xffff8000, 0xffff8000},
735      {NoFlag, NoFlag, NoFlag, 0xfffffffd, 0xffffff80, 0xffffff80},
736      {NoFlag, NoFlag, NoFlag, 0x33333333, 0x00000001, 0x00000001},
737      {NoFlag, NoFlag, NoFlag, 0x00007ffe, 0x80000001, 0x80000001},
738      {NoFlag, NoFlag, NoFlag, 0x00007fff, 0x00000002, 0x00000002},
739      {NoFlag, NoFlag, NoFlag, 0x7ffffffd, 0x0000007d, 0x0000007d},
740      {NoFlag, NoFlag, NoFlag, 0x33333333, 0xfffffffd, 0xfffffffd},
741      {NoFlag, NoFlag, NoFlag, 0xffffffe0, 0xaaaaaaaa, 0xaaaaaaaa},
742      {NoFlag, NoFlag, NoFlag, 0x0000007e, 0xffffff83, 0xffffff83},
743      {NoFlag, NoFlag, NoFlag, 0x0000007f, 0x00000002, 0x00000002},
744      {NoFlag, NoFlag, NoFlag, 0x0000007e, 0x0000007f, 0x0000007f},
745      {NoFlag, NoFlag, NoFlag, 0x00007fff, 0xfffffffe, 0xfffffffe},
746      {NoFlag, NoFlag, NoFlag, 0x00007ffd, 0xffffffff, 0xffffffff},
747      {NoFlag, NoFlag, NoFlag, 0x00000020, 0xffff8002, 0xffff8002},
748      {NoFlag, NoFlag, NoFlag, 0x00007fff, 0x55555555, 0x55555555},
749      {NoFlag, NoFlag, NoFlag, 0x7ffffffe, 0xcccccccc, 0xcccccccc},
750      {NoFlag, NoFlag, NoFlag, 0xffffff83, 0x00000020, 0x00000020},
751      {NoFlag, NoFlag, NoFlag, 0x55555555, 0x0000007e, 0x0000007e},
752      {NoFlag, NoFlag, NoFlag, 0x00000000, 0xfffffffe, 0xfffffffe},
753      {NoFlag, NoFlag, NoFlag, 0x00000001, 0x55555555, 0x55555555},
754      {NoFlag, NoFlag, NoFlag, 0xffffff80, 0x0000007f, 0x0000007f},
755      {NoFlag, NoFlag, NoFlag, 0xfffffffd, 0x7fffffff, 0x7fffffff},
756      {NoFlag, NoFlag, NoFlag, 0xaaaaaaaa, 0x7ffffffe, 0x7ffffffe},
757      {NoFlag, NoFlag, NoFlag, 0xffffff82, 0x7fffffff, 0x7fffffff},
758      {NoFlag, NoFlag, NoFlag, 0x0000007d, 0x7ffffffd, 0x7ffffffd},
759      {NoFlag, NoFlag, NoFlag, 0x00007ffd, 0x33333333, 0x33333333},
760      {NoFlag, NoFlag, NoFlag, 0xfffffffd, 0xfffffffd, 0xfffffffd},
761      {NoFlag, NoFlag, NoFlag, 0x0000007d, 0x0000007e, 0x0000007e},
762      {NoFlag, NoFlag, NoFlag, 0xffffffe0, 0xffffff82, 0xffffff82},
763      {NoFlag, NoFlag, NoFlag, 0x33333333, 0x0000007f, 0x0000007f},
764      {NoFlag, NoFlag, NoFlag, 0x00007ffe, 0x7ffffffd, 0x7ffffffd},
765      {NoFlag, NoFlag, NoFlag, 0xffffff82, 0xffffffe0, 0xffffffe0},
766      {NoFlag, NoFlag, NoFlag, 0x0000007e, 0xffff8001, 0xffff8001},
767      {NoFlag, NoFlag, NoFlag, 0x7ffffffe, 0xffffff82, 0xffffff82},
768      {NoFlag, NoFlag, NoFlag, 0xffffff83, 0x0000007f, 0x0000007f},
769      {NoFlag, NoFlag, NoFlag, 0x80000001, 0x00000020, 0x00000020},
770      {NoFlag, NoFlag, NoFlag, 0xcccccccc, 0xffff8002, 0xffff8002},
771      {NoFlag, NoFlag, NoFlag, 0xffff8000, 0x00007fff, 0x00007fff},
772      {NoFlag, NoFlag, NoFlag, 0xffff8002, 0x7ffffffe, 0x7ffffffe},
773      {NoFlag, NoFlag, NoFlag, 0xffff8003, 0x00007ffe, 0x00007ffe},
774      {NoFlag, NoFlag, NoFlag, 0x00000000, 0xffffff82, 0xffffff82},
775      {NoFlag, NoFlag, NoFlag, 0xffff8001, 0xffff8002, 0xffff8002},
776      {NoFlag, NoFlag, NoFlag, 0x7ffffffe, 0x00007ffd, 0x00007ffd},
777      {NoFlag, NoFlag, NoFlag, 0x0000007d, 0xffff8003, 0xffff8003},
778      {NoFlag, NoFlag, NoFlag, 0xaaaaaaaa, 0xffff8003, 0xffff8003},
779      {NoFlag, NoFlag, NoFlag, 0x00007fff, 0xffffff83, 0xffffff83},
780      {NoFlag, NoFlag, NoFlag, 0x55555555, 0x33333333, 0x33333333},
781      {NoFlag, NoFlag, NoFlag, 0x00007fff, 0x00007ffe, 0x00007ffe},
782      {NoFlag, NoFlag, NoFlag, 0xffffff83, 0x00007ffd, 0x00007ffd},
783      {NoFlag, NoFlag, NoFlag, 0x33333333, 0xffffff80, 0xffffff80},
784      {NoFlag, NoFlag, NoFlag, 0x00007ffd, 0xffffffe0, 0xffffffe0},
785      {NoFlag, NoFlag, NoFlag, 0xffffffe0, 0x7ffffffd, 0x7ffffffd},
786      {NoFlag, NoFlag, NoFlag, 0xffffff83, 0x00000000, 0x00000000},
787      {NoFlag, NoFlag, NoFlag, 0x00007fff, 0x00007fff, 0x00007fff},
788      {NoFlag, NoFlag, NoFlag, 0x33333333, 0x00000002, 0x00000002},
789      {NoFlag, NoFlag, NoFlag, 0x80000001, 0x00007ffe, 0x00007ffe},
790      {NoFlag, NoFlag, NoFlag, 0x00000000, 0x00000001, 0x00000001},
791      {NoFlag, NoFlag, NoFlag, 0x55555555, 0xfffffffe, 0xfffffffe},
792      {NoFlag, NoFlag, NoFlag, 0xffff8002, 0xffffff83, 0xffffff83},
793      {NoFlag, NoFlag, NoFlag, 0x0000007f, 0xffffff80, 0xffffff80},
794      {NoFlag, NoFlag, NoFlag, 0xffffff83, 0xffff8002, 0xffff8002},
795      {NoFlag, NoFlag, NoFlag, 0x0000007e, 0xffffffe0, 0xffffffe0},
796      {NoFlag, NoFlag, NoFlag, 0xffff8000, 0x0000007f, 0x0000007f},
797      {NoFlag, NoFlag, NoFlag, 0x00000002, 0x80000001, 0x80000001},
798      {NoFlag, NoFlag, NoFlag, 0x80000001, 0x00000000, 0x00000000},
799      {NoFlag, NoFlag, NoFlag, 0xffffff82, 0x7ffffffe, 0x7ffffffe},
800      {NoFlag, NoFlag, NoFlag, 0x00007ffe, 0xffff8002, 0xffff8002},
801      {NoFlag, NoFlag, NoFlag, 0xffff8003, 0x7fffffff, 0x7fffffff},
802      {NoFlag, NoFlag, NoFlag, 0xffffff81, 0x0000007e, 0x0000007e},
803      {NoFlag, NoFlag, NoFlag, 0xfffffffe, 0x00007fff, 0x00007fff},
804      {NoFlag, NoFlag, NoFlag, 0xfffffffe, 0x33333333, 0x33333333},
805      {NoFlag, NoFlag, NoFlag, 0xcccccccc, 0xaaaaaaaa, 0xaaaaaaaa},
806      {NoFlag, NoFlag, NoFlag, 0xffff8001, 0xaaaaaaaa, 0xaaaaaaaa},
807      {NoFlag, NoFlag, NoFlag, 0x0000007e, 0x7ffffffd, 0x7ffffffd},
808      {NoFlag, NoFlag, NoFlag, 0xffffffe0, 0x0000007f, 0x0000007f},
809      {NoFlag, NoFlag, NoFlag, 0x00007fff, 0xffff8001, 0xffff8001},
810      {NoFlag, NoFlag, NoFlag, 0x00007ffe, 0xfffffffd, 0xfffffffd},
811      {NoFlag, NoFlag, NoFlag, 0xfffffffd, 0x0000007d, 0x0000007d},
812      {NoFlag, NoFlag, NoFlag, 0x0000007f, 0x0000007d, 0x0000007d},
813      {NoFlag, NoFlag, NoFlag, 0x00000001, 0xaaaaaaaa, 0xaaaaaaaa},
814      {NoFlag, NoFlag, NoFlag, 0xffff8001, 0x0000007d, 0x0000007d},
815      {NoFlag, NoFlag, NoFlag, 0xffff8003, 0x00000020, 0x00000020},
816      {NoFlag, NoFlag, NoFlag, 0x00007ffe, 0x00000000, 0x00000000},
817      {NoFlag, NoFlag, NoFlag, 0xfffffffe, 0x0000007d, 0x0000007d},
818      {NoFlag, NoFlag, NoFlag, 0xffffff80, 0xfffffffe, 0xfffffffe},
819      {NoFlag, NoFlag, NoFlag, 0x0000007f, 0xffff8001, 0xffff8001},
820      {NoFlag, NoFlag, NoFlag, 0x7ffffffd, 0xffffff80, 0xffffff80},
821      {NoFlag, NoFlag, NoFlag, 0xffffffe0, 0x80000001, 0x80000001},
822      {NoFlag, NoFlag, NoFlag, 0xfffffffe, 0x0000007f, 0x0000007f},
823      {NoFlag, NoFlag, NoFlag, 0x00000000, 0xffffff81, 0xffffff81},
824      {NoFlag, NoFlag, NoFlag, 0x00007ffe, 0xfffffffe, 0xfffffffe},
825      {NoFlag, NoFlag, NoFlag, 0x80000001, 0xcccccccc, 0xcccccccc},
826      {NoFlag, NoFlag, NoFlag, 0xffff8001, 0x80000001, 0x80000001},
827      {NoFlag, NoFlag, NoFlag, 0x80000000, 0xffff8002, 0xffff8002},
828      {NoFlag, NoFlag, NoFlag, 0x00000001, 0x7fffffff, 0x7fffffff},
829      {NoFlag, NoFlag, NoFlag, 0xffffff80, 0xffff8003, 0xffff8003},
830      {NoFlag, NoFlag, NoFlag, 0xffff8002, 0x00007ffe, 0x00007ffe},
831      {NoFlag, NoFlag, NoFlag, 0x00007fff, 0x80000001, 0x80000001},
832      {NoFlag, NoFlag, NoFlag, 0xffff8000, 0x00007ffe, 0x00007ffe},
833      {NoFlag, NoFlag, NoFlag, 0xffffff80, 0xfffffffd, 0xfffffffd},
834      {NoFlag, NoFlag, NoFlag, 0xcccccccc, 0xffff8003, 0xffff8003},
835      {NoFlag, NoFlag, NoFlag, 0x0000007f, 0x00000001, 0x00000001},
836      {NoFlag, NoFlag, NoFlag, 0x80000001, 0x33333333, 0x33333333},
837      {NoFlag, NoFlag, NoFlag, 0x00007fff, 0xffffff81, 0xffffff81},
838      {NoFlag, NoFlag, NoFlag, 0xffffff81, 0x00007fff, 0x00007fff},
839      {NoFlag, NoFlag, NoFlag, 0x00007ffd, 0xfffffffe, 0xfffffffe},
840      {NoFlag, NoFlag, NoFlag, 0xaaaaaaaa, 0x80000001, 0x80000001},
841      {NoFlag, NoFlag, NoFlag, 0xffff8003, 0xaaaaaaaa, 0xaaaaaaaa},
842      {NoFlag, NoFlag, NoFlag, 0x0000007d, 0x55555555, 0x55555555},
843      {NoFlag, NoFlag, NoFlag, 0x00000020, 0xffffff83, 0xffffff83},
844      {NoFlag, NoFlag, NoFlag, 0xffff8003, 0x00000001, 0x00000001},
845      {NoFlag, NoFlag, NoFlag, 0xffffffe0, 0x00000000, 0x00000000},
846      {NoFlag, NoFlag, NoFlag, 0x0000007e, 0x0000007d, 0x0000007d},
847      {NoFlag, NoFlag, NoFlag, 0xcccccccc, 0xffffff83, 0xffffff83},
848      {NoFlag, NoFlag, NoFlag, 0xffffffff, 0x00007ffd, 0x00007ffd},
849      {NoFlag, NoFlag, NoFlag, 0x7ffffffd, 0xffffff81, 0xffffff81},
850      {NoFlag, NoFlag, NoFlag, 0x7ffffffd, 0xffff8000, 0xffff8000},
851      {NoFlag, NoFlag, NoFlag, 0x00000020, 0xffffffff, 0xffffffff},
852      {NoFlag, NoFlag, NoFlag, 0x00007ffe, 0x80000000, 0x80000000},
853      {NoFlag, NoFlag, NoFlag, 0xffffff80, 0xffff8001, 0xffff8001},
854      {NoFlag, NoFlag, NoFlag, 0xcccccccc, 0x00007fff, 0x00007fff},
855      {NoFlag, NoFlag, NoFlag, 0x55555555, 0xffffff81, 0xffffff81},
856      {NoFlag, NoFlag, NoFlag, 0x00007fff, 0xfffffffd, 0xfffffffd},
857      {NoFlag, NoFlag, NoFlag, 0x7ffffffd, 0x33333333, 0x33333333},
858      {NoFlag, NoFlag, NoFlag, 0x00007ffd, 0xffff8002, 0xffff8002},
859      {NoFlag, NoFlag, NoFlag, 0xffff8000, 0x0000007e, 0x0000007e},
860      {NoFlag, NoFlag, NoFlag, 0x0000007d, 0xffffff80, 0xffffff80},
861      {NoFlag, NoFlag, NoFlag, 0x7ffffffe, 0xffffff80, 0xffffff80},
862      {NoFlag, NoFlag, NoFlag, 0x80000000, 0x00000020, 0x00000020},
863      {NoFlag, NoFlag, NoFlag, 0x7ffffffe, 0xffffff81, 0xffffff81},
864      {NoFlag, NoFlag, NoFlag, 0x7fffffff, 0x80000001, 0x80000001},
865      {NoFlag, NoFlag, NoFlag, 0x7ffffffd, 0x7fffffff, 0x7fffffff},
866      {NoFlag, NoFlag, NoFlag, 0x00000020, 0x00000002, 0x00000002},
867      {NoFlag, NoFlag, NoFlag, 0x00000020, 0x80000001, 0x80000001},
868      {NoFlag, NoFlag, NoFlag, 0x00000001, 0xfffffffd, 0xfffffffd},
869      {NoFlag, NoFlag, NoFlag, 0x0000007f, 0x80000000, 0x80000000},
870      {NoFlag, NoFlag, NoFlag, 0x55555555, 0x00000020, 0x00000020},
871      {NoFlag, NoFlag, NoFlag, 0xffffff80, 0xffff8002, 0xffff8002},
872      {NoFlag, NoFlag, NoFlag, 0x7fffffff, 0x0000007e, 0x0000007e}};
873 
874 static const Inputs kRdIsNotRnIsNotRm[] =
875     {{NoFlag, NoFlag, NoFlag, 0xcccccccc, 0xffff8001, 0x00007ffd},
876      {NoFlag, NoFlag, NoFlag, 0xfffffffe, 0xffff8003, 0x7ffffffe},
877      {NoFlag, NoFlag, NoFlag, 0x0000007e, 0x00007fff, 0xffff8001},
878      {NoFlag, NoFlag, NoFlag, 0x80000000, 0xffffff80, 0x00000000},
879      {NoFlag, NoFlag, NoFlag, 0xcccccccc, 0x33333333, 0x33333333},
880      {NoFlag, NoFlag, NoFlag, 0x80000001, 0x0000007f, 0xfffffffe},
881      {NoFlag, NoFlag, NoFlag, 0x7fffffff, 0xffffffff, 0x00007ffd},
882      {NoFlag, NoFlag, NoFlag, 0x0000007e, 0xfffffffe, 0xffffff82},
883      {NoFlag, NoFlag, NoFlag, 0xffffff80, 0xffff8001, 0xffffff81},
884      {NoFlag, NoFlag, NoFlag, 0xcccccccc, 0x0000007e, 0xaaaaaaaa},
885      {NoFlag, NoFlag, NoFlag, 0x7ffffffe, 0x0000007e, 0x80000001},
886      {NoFlag, NoFlag, NoFlag, 0xcccccccc, 0xffffff81, 0x00000001},
887      {NoFlag, NoFlag, NoFlag, 0xffff8000, 0x00007ffd, 0x00007fff},
888      {NoFlag, NoFlag, NoFlag, 0x00000020, 0xcccccccc, 0x00000020},
889      {NoFlag, NoFlag, NoFlag, 0x7ffffffe, 0x00000020, 0xaaaaaaaa},
890      {NoFlag, NoFlag, NoFlag, 0x7ffffffe, 0x00000002, 0x33333333},
891      {NoFlag, NoFlag, NoFlag, 0xffffff81, 0x0000007f, 0xffffffe0},
892      {NoFlag, NoFlag, NoFlag, 0x00007ffe, 0x00007ffd, 0xcccccccc},
893      {NoFlag, NoFlag, NoFlag, 0x00007ffe, 0x00007ffd, 0xffffff81},
894      {NoFlag, NoFlag, NoFlag, 0x80000000, 0xfffffffe, 0xffffff80},
895      {NoFlag, NoFlag, NoFlag, 0xffff8002, 0x00007fff, 0xfffffffd},
896      {NoFlag, NoFlag, NoFlag, 0x33333333, 0x00007fff, 0x55555555},
897      {NoFlag, NoFlag, NoFlag, 0x00000002, 0x80000000, 0xcccccccc},
898      {NoFlag, NoFlag, NoFlag, 0xffffff81, 0x00000001, 0x0000007d},
899      {NoFlag, NoFlag, NoFlag, 0x80000001, 0x55555555, 0xffffffff},
900      {NoFlag, NoFlag, NoFlag, 0x55555555, 0xffffffff, 0xffffff80},
901      {NoFlag, NoFlag, NoFlag, 0x00007ffd, 0xffff8003, 0x0000007e},
902      {NoFlag, NoFlag, NoFlag, 0x80000001, 0xffffff82, 0xaaaaaaaa},
903      {NoFlag, NoFlag, NoFlag, 0x33333333, 0x00000002, 0xffffff82},
904      {NoFlag, NoFlag, NoFlag, 0x55555555, 0xffffff80, 0xfffffffe},
905      {NoFlag, NoFlag, NoFlag, 0xffff8001, 0x00007ffd, 0xffffff82},
906      {NoFlag, NoFlag, NoFlag, 0xffff8003, 0xffff8002, 0x0000007e},
907      {NoFlag, NoFlag, NoFlag, 0x0000007f, 0x00000000, 0xcccccccc},
908      {NoFlag, NoFlag, NoFlag, 0x00000020, 0x7ffffffe, 0xcccccccc},
909      {NoFlag, NoFlag, NoFlag, 0x55555555, 0x00007ffd, 0xffffff81},
910      {NoFlag, NoFlag, NoFlag, 0x0000007e, 0x80000001, 0x00000001},
911      {NoFlag, NoFlag, NoFlag, 0xfffffffd, 0x00000001, 0x00000001},
912      {NoFlag, NoFlag, NoFlag, 0xffffff80, 0xffff8001, 0x7ffffffe},
913      {NoFlag, NoFlag, NoFlag, 0x55555555, 0x33333333, 0x00000020},
914      {NoFlag, NoFlag, NoFlag, 0x00007ffe, 0xffffffe0, 0x00000002},
915      {NoFlag, NoFlag, NoFlag, 0xffff8000, 0x7ffffffe, 0x55555555},
916      {NoFlag, NoFlag, NoFlag, 0x00007ffd, 0xcccccccc, 0xffffff82},
917      {NoFlag, NoFlag, NoFlag, 0xffffff82, 0x33333333, 0xffffffe0},
918      {NoFlag, NoFlag, NoFlag, 0x80000001, 0x7ffffffe, 0xfffffffe},
919      {NoFlag, NoFlag, NoFlag, 0xffffffe0, 0xffffff80, 0x80000001},
920      {NoFlag, NoFlag, NoFlag, 0x7ffffffd, 0x0000007e, 0x00000020},
921      {NoFlag, NoFlag, NoFlag, 0x55555555, 0x00000020, 0x7ffffffd},
922      {NoFlag, NoFlag, NoFlag, 0x00000000, 0x00000001, 0x7ffffffd},
923      {NoFlag, NoFlag, NoFlag, 0x00007ffd, 0xcccccccc, 0xcccccccc},
924      {NoFlag, NoFlag, NoFlag, 0xffff8003, 0xaaaaaaaa, 0x00007fff},
925      {NoFlag, NoFlag, NoFlag, 0xffffff80, 0x0000007f, 0x80000001},
926      {NoFlag, NoFlag, NoFlag, 0xffffff83, 0xffffffff, 0xffffff80},
927      {NoFlag, NoFlag, NoFlag, 0xffffff81, 0xffffff81, 0x0000007f},
928      {NoFlag, NoFlag, NoFlag, 0xffff8000, 0x0000007d, 0xffff8000},
929      {NoFlag, NoFlag, NoFlag, 0xffff8001, 0xaaaaaaaa, 0x7fffffff},
930      {NoFlag, NoFlag, NoFlag, 0x00007ffd, 0x00000002, 0x00007fff},
931      {NoFlag, NoFlag, NoFlag, 0xffffff83, 0x00000001, 0xfffffffd},
932      {NoFlag, NoFlag, NoFlag, 0x00000020, 0x00000000, 0x55555555},
933      {NoFlag, NoFlag, NoFlag, 0xffff8001, 0xffffff80, 0x55555555},
934      {NoFlag, NoFlag, NoFlag, 0x00000000, 0x0000007e, 0xffff8001},
935      {NoFlag, NoFlag, NoFlag, 0x00000020, 0xaaaaaaaa, 0x0000007f},
936      {NoFlag, NoFlag, NoFlag, 0xffff8001, 0x80000000, 0xffffff81},
937      {NoFlag, NoFlag, NoFlag, 0xffffffe0, 0x00007ffd, 0x00000000},
938      {NoFlag, NoFlag, NoFlag, 0x80000000, 0xffffff80, 0x00000020},
939      {NoFlag, NoFlag, NoFlag, 0xffff8003, 0xffff8000, 0x00000020},
940      {NoFlag, NoFlag, NoFlag, 0xffff8001, 0xaaaaaaaa, 0xaaaaaaaa},
941      {NoFlag, NoFlag, NoFlag, 0xffffffe0, 0x7ffffffe, 0xffffff82},
942      {NoFlag, NoFlag, NoFlag, 0xffff8002, 0x00000002, 0x00000020},
943      {NoFlag, NoFlag, NoFlag, 0x00007fff, 0xfffffffd, 0x00000000},
944      {NoFlag, NoFlag, NoFlag, 0x00000000, 0xffffff83, 0x55555555},
945      {NoFlag, NoFlag, NoFlag, 0x0000007e, 0xffff8001, 0x00000001},
946      {NoFlag, NoFlag, NoFlag, 0x00007ffe, 0x00007fff, 0x00007fff},
947      {NoFlag, NoFlag, NoFlag, 0xcccccccc, 0xfffffffe, 0xffffff82},
948      {NoFlag, NoFlag, NoFlag, 0xffff8002, 0x80000000, 0xffffffff},
949      {NoFlag, NoFlag, NoFlag, 0x55555555, 0xfffffffd, 0x7ffffffd},
950      {NoFlag, NoFlag, NoFlag, 0xffffffe0, 0x7fffffff, 0x0000007d},
951      {NoFlag, NoFlag, NoFlag, 0xffffff83, 0xffffffe0, 0x0000007e},
952      {NoFlag, NoFlag, NoFlag, 0x00000002, 0x00000001, 0xffffff81},
953      {NoFlag, NoFlag, NoFlag, 0x7ffffffd, 0xffffff82, 0x80000000},
954      {NoFlag, NoFlag, NoFlag, 0x00000002, 0xffff8003, 0x33333333},
955      {NoFlag, NoFlag, NoFlag, 0xffffff82, 0x33333333, 0x7ffffffd},
956      {NoFlag, NoFlag, NoFlag, 0xffff8000, 0xffffffff, 0x0000007d},
957      {NoFlag, NoFlag, NoFlag, 0xffffffe0, 0x0000007f, 0x00000020},
958      {NoFlag, NoFlag, NoFlag, 0xffffff81, 0xffff8003, 0x55555555},
959      {NoFlag, NoFlag, NoFlag, 0x00000002, 0xfffffffd, 0xffffff80},
960      {NoFlag, NoFlag, NoFlag, 0x00007ffe, 0xfffffffe, 0xfffffffe},
961      {NoFlag, NoFlag, NoFlag, 0x00000000, 0xffffffe0, 0xffff8001},
962      {NoFlag, NoFlag, NoFlag, 0xfffffffd, 0xffffff82, 0xffff8001},
963      {NoFlag, NoFlag, NoFlag, 0xffffff81, 0x00007ffd, 0x80000001},
964      {NoFlag, NoFlag, NoFlag, 0xffffff82, 0x00000002, 0x0000007d},
965      {NoFlag, NoFlag, NoFlag, 0x0000007e, 0x00007ffd, 0x0000007d},
966      {NoFlag, NoFlag, NoFlag, 0x7ffffffd, 0x7fffffff, 0xaaaaaaaa},
967      {NoFlag, NoFlag, NoFlag, 0xcccccccc, 0xfffffffe, 0xaaaaaaaa},
968      {NoFlag, NoFlag, NoFlag, 0xcccccccc, 0xffff8003, 0xffff8003},
969      {NoFlag, NoFlag, NoFlag, 0x33333333, 0xaaaaaaaa, 0xfffffffd},
970      {NoFlag, NoFlag, NoFlag, 0x7ffffffd, 0x00000020, 0xffffffe0},
971      {NoFlag, NoFlag, NoFlag, 0xffffff82, 0x0000007d, 0xfffffffe},
972      {NoFlag, NoFlag, NoFlag, 0x55555555, 0x80000001, 0xffff8003},
973      {NoFlag, NoFlag, NoFlag, 0x7ffffffe, 0xffffffff, 0x00000001},
974      {NoFlag, NoFlag, NoFlag, 0xffffffe0, 0x00000000, 0x33333333},
975      {NoFlag, NoFlag, NoFlag, 0x33333333, 0x80000000, 0xffff8001},
976      {NoFlag, NoFlag, NoFlag, 0xfffffffe, 0x55555555, 0x0000007f},
977      {NoFlag, NoFlag, NoFlag, 0xffff8003, 0xffff8003, 0x0000007e},
978      {NoFlag, NoFlag, NoFlag, 0xffffff80, 0x80000001, 0x00000020},
979      {NoFlag, NoFlag, NoFlag, 0xaaaaaaaa, 0xffffff82, 0x0000007f},
980      {NoFlag, NoFlag, NoFlag, 0xffffff80, 0x00000000, 0xffff8000},
981      {NoFlag, NoFlag, NoFlag, 0x33333333, 0x0000007e, 0x7ffffffd},
982      {NoFlag, NoFlag, NoFlag, 0xffff8001, 0x7fffffff, 0xffff8003},
983      {NoFlag, NoFlag, NoFlag, 0xaaaaaaaa, 0xaaaaaaaa, 0x80000001},
984      {NoFlag, NoFlag, NoFlag, 0x00007ffd, 0xffffff80, 0x33333333},
985      {NoFlag, NoFlag, NoFlag, 0x80000000, 0x00000001, 0xffff8001},
986      {NoFlag, NoFlag, NoFlag, 0xffff8002, 0x00007ffe, 0x00000002},
987      {NoFlag, NoFlag, NoFlag, 0xffffff80, 0x00000000, 0xffff8001},
988      {NoFlag, NoFlag, NoFlag, 0xfffffffd, 0xffffff82, 0xffffff81},
989      {NoFlag, NoFlag, NoFlag, 0x33333333, 0xaaaaaaaa, 0xffffff81},
990      {NoFlag, NoFlag, NoFlag, 0x80000001, 0x80000000, 0x00007ffd},
991      {NoFlag, NoFlag, NoFlag, 0xffff8002, 0x55555555, 0xfffffffe},
992      {NoFlag, NoFlag, NoFlag, 0x00000000, 0xffffff81, 0x33333333},
993      {NoFlag, NoFlag, NoFlag, 0xffffff82, 0xffffffe0, 0x80000000},
994      {NoFlag, NoFlag, NoFlag, 0xffffff82, 0x00000001, 0xffff8001},
995      {NoFlag, NoFlag, NoFlag, 0xffffff80, 0xffffff80, 0x00000020},
996      {NoFlag, NoFlag, NoFlag, 0xffff8002, 0xcccccccc, 0x00000000},
997      {NoFlag, NoFlag, NoFlag, 0xffffffe0, 0xffff8001, 0x7ffffffe},
998      {NoFlag, NoFlag, NoFlag, 0x00007ffd, 0xffff8001, 0xaaaaaaaa},
999      {NoFlag, NoFlag, NoFlag, 0x00007fff, 0xfffffffe, 0xcccccccc},
1000      {NoFlag, NoFlag, NoFlag, 0x80000001, 0xcccccccc, 0xffff8001},
1001      {NoFlag, NoFlag, NoFlag, 0xffffff82, 0x00007ffd, 0x00000020},
1002      {NoFlag, NoFlag, NoFlag, 0xcccccccc, 0xfffffffd, 0x00007fff},
1003      {NoFlag, NoFlag, NoFlag, 0xffff8003, 0x00000001, 0xfffffffd},
1004      {NoFlag, NoFlag, NoFlag, 0xffffff82, 0x7ffffffd, 0x00000020},
1005      {NoFlag, NoFlag, NoFlag, 0x00000000, 0xffff8001, 0xffffff82},
1006      {NoFlag, NoFlag, NoFlag, 0x55555555, 0x00007ffe, 0x00000002},
1007      {NoFlag, NoFlag, NoFlag, 0x80000001, 0x00000001, 0x00000002},
1008      {NoFlag, NoFlag, NoFlag, 0xaaaaaaaa, 0x33333333, 0x33333333},
1009      {NoFlag, NoFlag, NoFlag, 0xffffff80, 0xffff8002, 0xffffff82},
1010      {NoFlag, NoFlag, NoFlag, 0x0000007d, 0xffffff82, 0x80000000},
1011      {NoFlag, NoFlag, NoFlag, 0xffff8003, 0x0000007f, 0x0000007d},
1012      {NoFlag, NoFlag, NoFlag, 0xffffffe0, 0x00000001, 0x00000002},
1013      {NoFlag, NoFlag, NoFlag, 0x00000020, 0x00007fff, 0x0000007f},
1014      {NoFlag, NoFlag, NoFlag, 0x00000000, 0xffff8000, 0x0000007e},
1015      {NoFlag, NoFlag, NoFlag, 0xcccccccc, 0xffffff81, 0x7ffffffd},
1016      {NoFlag, NoFlag, NoFlag, 0xaaaaaaaa, 0xffff8003, 0x00007ffe},
1017      {NoFlag, NoFlag, NoFlag, 0x80000001, 0x7fffffff, 0x0000007f},
1018      {NoFlag, NoFlag, NoFlag, 0x00000020, 0x80000000, 0xffffff83},
1019      {NoFlag, NoFlag, NoFlag, 0xffff8002, 0x7ffffffe, 0x00000020},
1020      {NoFlag, NoFlag, NoFlag, 0xffff8002, 0x00000020, 0xffffff83},
1021      {NoFlag, NoFlag, NoFlag, 0xfffffffe, 0xffffff81, 0x80000000},
1022      {NoFlag, NoFlag, NoFlag, 0xffffffff, 0xffff8001, 0xffff8003},
1023      {NoFlag, NoFlag, NoFlag, 0x00000001, 0x7ffffffe, 0xffff8000},
1024      {NoFlag, NoFlag, NoFlag, 0x00000002, 0x80000000, 0xfffffffe},
1025      {NoFlag, NoFlag, NoFlag, 0xffffff80, 0xaaaaaaaa, 0xffffff82},
1026      {NoFlag, NoFlag, NoFlag, 0x00007ffd, 0xffffffff, 0xffffff81},
1027      {NoFlag, NoFlag, NoFlag, 0x7ffffffe, 0xffff8001, 0xfffffffe},
1028      {NoFlag, NoFlag, NoFlag, 0x7ffffffd, 0x0000007f, 0x7fffffff},
1029      {NoFlag, NoFlag, NoFlag, 0x00000000, 0x0000007f, 0x00007ffe},
1030      {NoFlag, NoFlag, NoFlag, 0xaaaaaaaa, 0xffff8000, 0x7fffffff},
1031      {NoFlag, NoFlag, NoFlag, 0xffff8002, 0xfffffffe, 0xfffffffd},
1032      {NoFlag, NoFlag, NoFlag, 0x7fffffff, 0xfffffffd, 0x0000007f},
1033      {NoFlag, NoFlag, NoFlag, 0x0000007e, 0xffffffff, 0x00007fff},
1034      {NoFlag, NoFlag, NoFlag, 0x0000007d, 0xcccccccc, 0x00000002},
1035      {NoFlag, NoFlag, NoFlag, 0xffffff83, 0xffffff80, 0xffffff80},
1036      {NoFlag, NoFlag, NoFlag, 0x00000002, 0x0000007e, 0x55555555},
1037      {NoFlag, NoFlag, NoFlag, 0xffffff82, 0xffffff80, 0xffff8000},
1038      {NoFlag, NoFlag, NoFlag, 0xffff8002, 0x0000007d, 0xfffffffe},
1039      {NoFlag, NoFlag, NoFlag, 0xfffffffe, 0xffffff82, 0x00000000},
1040      {NoFlag, NoFlag, NoFlag, 0x0000007f, 0x55555555, 0xffffff81},
1041      {NoFlag, NoFlag, NoFlag, 0x33333333, 0xffff8001, 0x00000002},
1042      {NoFlag, NoFlag, NoFlag, 0x7ffffffe, 0xffffffe0, 0x33333333},
1043      {NoFlag, NoFlag, NoFlag, 0x55555555, 0x00000001, 0x55555555},
1044      {NoFlag, NoFlag, NoFlag, 0xffffff80, 0xffffffff, 0x0000007d},
1045      {NoFlag, NoFlag, NoFlag, 0x00007fff, 0x00000000, 0x7fffffff},
1046      {NoFlag, NoFlag, NoFlag, 0xffff8002, 0x0000007d, 0x7ffffffe},
1047      {NoFlag, NoFlag, NoFlag, 0xffffffff, 0x0000007e, 0xffff8001},
1048      {NoFlag, NoFlag, NoFlag, 0xffffffff, 0x00007fff, 0xffffff83},
1049      {NoFlag, NoFlag, NoFlag, 0x0000007e, 0x0000007d, 0x00000020},
1050      {NoFlag, NoFlag, NoFlag, 0x80000000, 0xffffff81, 0x0000007d},
1051      {NoFlag, NoFlag, NoFlag, 0xffffffff, 0xffff8002, 0x00007ffd},
1052      {NoFlag, NoFlag, NoFlag, 0x0000007f, 0x55555555, 0x0000007f},
1053      {NoFlag, NoFlag, NoFlag, 0xffffffe0, 0x00000020, 0x00007ffd},
1054      {NoFlag, NoFlag, NoFlag, 0xffff8001, 0xffffff80, 0x00000001},
1055      {NoFlag, NoFlag, NoFlag, 0x7ffffffe, 0x00007ffd, 0x0000007e},
1056      {NoFlag, NoFlag, NoFlag, 0xffffff83, 0x7ffffffe, 0x00000001},
1057      {NoFlag, NoFlag, NoFlag, 0x00007ffd, 0xffff8001, 0x80000001},
1058      {NoFlag, NoFlag, NoFlag, 0x00000001, 0xffff8003, 0x0000007e},
1059      {NoFlag, NoFlag, NoFlag, 0x80000001, 0xffff8003, 0xffffff81},
1060      {NoFlag, NoFlag, NoFlag, 0xffff8000, 0x0000007d, 0x00000001},
1061      {NoFlag, NoFlag, NoFlag, 0x00007ffd, 0x0000007f, 0xffff8003},
1062      {NoFlag, NoFlag, NoFlag, 0xfffffffd, 0xffffffff, 0x00000000},
1063      {NoFlag, NoFlag, NoFlag, 0xffff8000, 0x00007fff, 0x55555555},
1064      {NoFlag, NoFlag, NoFlag, 0x33333333, 0xffffff82, 0x00007ffe},
1065      {NoFlag, NoFlag, NoFlag, 0xffffff80, 0x7ffffffe, 0x0000007e},
1066      {NoFlag, NoFlag, NoFlag, 0xffff8002, 0xffffffff, 0x00000002},
1067      {NoFlag, NoFlag, NoFlag, 0xffff8003, 0x00007ffd, 0xffffff80},
1068      {NoFlag, NoFlag, NoFlag, 0x00007ffe, 0x00000002, 0xcccccccc},
1069      {NoFlag, NoFlag, NoFlag, 0x00000002, 0xffffff81, 0xfffffffd},
1070      {NoFlag, NoFlag, NoFlag, 0xffffffe0, 0x0000007d, 0x00000001},
1071      {NoFlag, NoFlag, NoFlag, 0x00000000, 0xffffff82, 0xffffff82},
1072      {NoFlag, NoFlag, NoFlag, 0xfffffffd, 0x00000020, 0xffff8002},
1073      {NoFlag, NoFlag, NoFlag, 0xffff8003, 0xffffff81, 0x0000007d},
1074      {NoFlag, NoFlag, NoFlag, 0x00000001, 0x7fffffff, 0x55555555}};
1075 
1076 
1077 // A loop will be generated for each element of this array.
1078 const TestLoopData kTests[] = {{{eq, r0, r0, r0},
1079                                 "eq r0 r0 r0",
1080                                 "Condition_eq_r0_r0_r0",
1081                                 ARRAY_SIZE(kCondition),
1082                                 kCondition},
1083                                {{ne, r0, r0, r0},
1084                                 "ne r0 r0 r0",
1085                                 "Condition_ne_r0_r0_r0",
1086                                 ARRAY_SIZE(kCondition),
1087                                 kCondition},
1088                                {{cs, r0, r0, r0},
1089                                 "cs r0 r0 r0",
1090                                 "Condition_cs_r0_r0_r0",
1091                                 ARRAY_SIZE(kCondition),
1092                                 kCondition},
1093                                {{cc, r0, r0, r0},
1094                                 "cc r0 r0 r0",
1095                                 "Condition_cc_r0_r0_r0",
1096                                 ARRAY_SIZE(kCondition),
1097                                 kCondition},
1098                                {{mi, r0, r0, r0},
1099                                 "mi r0 r0 r0",
1100                                 "Condition_mi_r0_r0_r0",
1101                                 ARRAY_SIZE(kCondition),
1102                                 kCondition},
1103                                {{pl, r0, r0, r0},
1104                                 "pl r0 r0 r0",
1105                                 "Condition_pl_r0_r0_r0",
1106                                 ARRAY_SIZE(kCondition),
1107                                 kCondition},
1108                                {{vs, r0, r0, r0},
1109                                 "vs r0 r0 r0",
1110                                 "Condition_vs_r0_r0_r0",
1111                                 ARRAY_SIZE(kCondition),
1112                                 kCondition},
1113                                {{vc, r0, r0, r0},
1114                                 "vc r0 r0 r0",
1115                                 "Condition_vc_r0_r0_r0",
1116                                 ARRAY_SIZE(kCondition),
1117                                 kCondition},
1118                                {{hi, r0, r0, r0},
1119                                 "hi r0 r0 r0",
1120                                 "Condition_hi_r0_r0_r0",
1121                                 ARRAY_SIZE(kCondition),
1122                                 kCondition},
1123                                {{ls, r0, r0, r0},
1124                                 "ls r0 r0 r0",
1125                                 "Condition_ls_r0_r0_r0",
1126                                 ARRAY_SIZE(kCondition),
1127                                 kCondition},
1128                                {{ge, r0, r0, r0},
1129                                 "ge r0 r0 r0",
1130                                 "Condition_ge_r0_r0_r0",
1131                                 ARRAY_SIZE(kCondition),
1132                                 kCondition},
1133                                {{lt, r0, r0, r0},
1134                                 "lt r0 r0 r0",
1135                                 "Condition_lt_r0_r0_r0",
1136                                 ARRAY_SIZE(kCondition),
1137                                 kCondition},
1138                                {{gt, r0, r0, r0},
1139                                 "gt r0 r0 r0",
1140                                 "Condition_gt_r0_r0_r0",
1141                                 ARRAY_SIZE(kCondition),
1142                                 kCondition},
1143                                {{le, r0, r0, r0},
1144                                 "le r0 r0 r0",
1145                                 "Condition_le_r0_r0_r0",
1146                                 ARRAY_SIZE(kCondition),
1147                                 kCondition},
1148                                {{al, r0, r0, r0},
1149                                 "al r0 r0 r0",
1150                                 "Condition_al_r0_r0_r0",
1151                                 ARRAY_SIZE(kCondition),
1152                                 kCondition},
1153                                {{al, r0, r0, r0},
1154                                 "al r0 r0 r0",
1155                                 "RdIsRnIsRm_al_r0_r0_r0",
1156                                 ARRAY_SIZE(kRdIsRnIsRm),
1157                                 kRdIsRnIsRm},
1158                                {{al, r1, r1, r1},
1159                                 "al r1 r1 r1",
1160                                 "RdIsRnIsRm_al_r1_r1_r1",
1161                                 ARRAY_SIZE(kRdIsRnIsRm),
1162                                 kRdIsRnIsRm},
1163                                {{al, r2, r2, r2},
1164                                 "al r2 r2 r2",
1165                                 "RdIsRnIsRm_al_r2_r2_r2",
1166                                 ARRAY_SIZE(kRdIsRnIsRm),
1167                                 kRdIsRnIsRm},
1168                                {{al, r3, r3, r3},
1169                                 "al r3 r3 r3",
1170                                 "RdIsRnIsRm_al_r3_r3_r3",
1171                                 ARRAY_SIZE(kRdIsRnIsRm),
1172                                 kRdIsRnIsRm},
1173                                {{al, r4, r4, r4},
1174                                 "al r4 r4 r4",
1175                                 "RdIsRnIsRm_al_r4_r4_r4",
1176                                 ARRAY_SIZE(kRdIsRnIsRm),
1177                                 kRdIsRnIsRm},
1178                                {{al, r5, r5, r5},
1179                                 "al r5 r5 r5",
1180                                 "RdIsRnIsRm_al_r5_r5_r5",
1181                                 ARRAY_SIZE(kRdIsRnIsRm),
1182                                 kRdIsRnIsRm},
1183                                {{al, r6, r6, r6},
1184                                 "al r6 r6 r6",
1185                                 "RdIsRnIsRm_al_r6_r6_r6",
1186                                 ARRAY_SIZE(kRdIsRnIsRm),
1187                                 kRdIsRnIsRm},
1188                                {{al, r7, r7, r7},
1189                                 "al r7 r7 r7",
1190                                 "RdIsRnIsRm_al_r7_r7_r7",
1191                                 ARRAY_SIZE(kRdIsRnIsRm),
1192                                 kRdIsRnIsRm},
1193                                {{al, r8, r8, r8},
1194                                 "al r8 r8 r8",
1195                                 "RdIsRnIsRm_al_r8_r8_r8",
1196                                 ARRAY_SIZE(kRdIsRnIsRm),
1197                                 kRdIsRnIsRm},
1198                                {{al, r9, r9, r9},
1199                                 "al r9 r9 r9",
1200                                 "RdIsRnIsRm_al_r9_r9_r9",
1201                                 ARRAY_SIZE(kRdIsRnIsRm),
1202                                 kRdIsRnIsRm},
1203                                {{al, r10, r10, r10},
1204                                 "al r10 r10 r10",
1205                                 "RdIsRnIsRm_al_r10_r10_r10",
1206                                 ARRAY_SIZE(kRdIsRnIsRm),
1207                                 kRdIsRnIsRm},
1208                                {{al, r11, r11, r11},
1209                                 "al r11 r11 r11",
1210                                 "RdIsRnIsRm_al_r11_r11_r11",
1211                                 ARRAY_SIZE(kRdIsRnIsRm),
1212                                 kRdIsRnIsRm},
1213                                {{al, r12, r12, r12},
1214                                 "al r12 r12 r12",
1215                                 "RdIsRnIsRm_al_r12_r12_r12",
1216                                 ARRAY_SIZE(kRdIsRnIsRm),
1217                                 kRdIsRnIsRm},
1218                                {{al, r14, r14, r14},
1219                                 "al r14 r14 r14",
1220                                 "RdIsRnIsRm_al_r14_r14_r14",
1221                                 ARRAY_SIZE(kRdIsRnIsRm),
1222                                 kRdIsRnIsRm},
1223                                {{al, r14, r14, r3},
1224                                 "al r14 r14 r3",
1225                                 "RdIsRn_al_r14_r14_r3",
1226                                 ARRAY_SIZE(kRdIsRn),
1227                                 kRdIsRn},
1228                                {{al, r1, r1, r2},
1229                                 "al r1 r1 r2",
1230                                 "RdIsRn_al_r1_r1_r2",
1231                                 ARRAY_SIZE(kRdIsRn),
1232                                 kRdIsRn},
1233                                {{al, r12, r12, r7},
1234                                 "al r12 r12 r7",
1235                                 "RdIsRn_al_r12_r12_r7",
1236                                 ARRAY_SIZE(kRdIsRn),
1237                                 kRdIsRn},
1238                                {{al, r10, r10, r6},
1239                                 "al r10 r10 r6",
1240                                 "RdIsRn_al_r10_r10_r6",
1241                                 ARRAY_SIZE(kRdIsRn),
1242                                 kRdIsRn},
1243                                {{al, r4, r4, r9},
1244                                 "al r4 r4 r9",
1245                                 "RdIsRn_al_r4_r4_r9",
1246                                 ARRAY_SIZE(kRdIsRn),
1247                                 kRdIsRn},
1248                                {{al, r5, r5, r6},
1249                                 "al r5 r5 r6",
1250                                 "RdIsRn_al_r5_r5_r6",
1251                                 ARRAY_SIZE(kRdIsRn),
1252                                 kRdIsRn},
1253                                {{al, r2, r2, r4},
1254                                 "al r2 r2 r4",
1255                                 "RdIsRn_al_r2_r2_r4",
1256                                 ARRAY_SIZE(kRdIsRn),
1257                                 kRdIsRn},
1258                                {{al, r7, r7, r11},
1259                                 "al r7 r7 r11",
1260                                 "RdIsRn_al_r7_r7_r11",
1261                                 ARRAY_SIZE(kRdIsRn),
1262                                 kRdIsRn},
1263                                {{al, r7, r7, r12},
1264                                 "al r7 r7 r12",
1265                                 "RdIsRn_al_r7_r7_r12",
1266                                 ARRAY_SIZE(kRdIsRn),
1267                                 kRdIsRn},
1268                                {{al, r2, r2, r10},
1269                                 "al r2 r2 r10",
1270                                 "RdIsRn_al_r2_r2_r10",
1271                                 ARRAY_SIZE(kRdIsRn),
1272                                 kRdIsRn},
1273                                {{al, r1, r12, r1},
1274                                 "al r1 r12 r1",
1275                                 "RdIsRm_al_r1_r12_r1",
1276                                 ARRAY_SIZE(kRdIsRm),
1277                                 kRdIsRm},
1278                                {{al, r4, r3, r4},
1279                                 "al r4 r3 r4",
1280                                 "RdIsRm_al_r4_r3_r4",
1281                                 ARRAY_SIZE(kRdIsRm),
1282                                 kRdIsRm},
1283                                {{al, r0, r2, r0},
1284                                 "al r0 r2 r0",
1285                                 "RdIsRm_al_r0_r2_r0",
1286                                 ARRAY_SIZE(kRdIsRm),
1287                                 kRdIsRm},
1288                                {{al, r10, r4, r10},
1289                                 "al r10 r4 r10",
1290                                 "RdIsRm_al_r10_r4_r10",
1291                                 ARRAY_SIZE(kRdIsRm),
1292                                 kRdIsRm},
1293                                {{al, r4, r8, r4},
1294                                 "al r4 r8 r4",
1295                                 "RdIsRm_al_r4_r8_r4",
1296                                 ARRAY_SIZE(kRdIsRm),
1297                                 kRdIsRm},
1298                                {{al, r4, r1, r4},
1299                                 "al r4 r1 r4",
1300                                 "RdIsRm_al_r4_r1_r4",
1301                                 ARRAY_SIZE(kRdIsRm),
1302                                 kRdIsRm},
1303                                {{al, r8, r11, r8},
1304                                 "al r8 r11 r8",
1305                                 "RdIsRm_al_r8_r11_r8",
1306                                 ARRAY_SIZE(kRdIsRm),
1307                                 kRdIsRm},
1308                                {{al, r1, r10, r1},
1309                                 "al r1 r10 r1",
1310                                 "RdIsRm_al_r1_r10_r1",
1311                                 ARRAY_SIZE(kRdIsRm),
1312                                 kRdIsRm},
1313                                {{al, r2, r0, r2},
1314                                 "al r2 r0 r2",
1315                                 "RdIsRm_al_r2_r0_r2",
1316                                 ARRAY_SIZE(kRdIsRm),
1317                                 kRdIsRm},
1318                                {{al, r6, r7, r6},
1319                                 "al r6 r7 r6",
1320                                 "RdIsRm_al_r6_r7_r6",
1321                                 ARRAY_SIZE(kRdIsRm),
1322                                 kRdIsRm},
1323                                {{al, r1, r12, r12},
1324                                 "al r1 r12 r12",
1325                                 "RnIsRm_al_r1_r12_r12",
1326                                 ARRAY_SIZE(kRnIsRm),
1327                                 kRnIsRm},
1328                                {{al, r6, r9, r9},
1329                                 "al r6 r9 r9",
1330                                 "RnIsRm_al_r6_r9_r9",
1331                                 ARRAY_SIZE(kRnIsRm),
1332                                 kRnIsRm},
1333                                {{al, r12, r7, r7},
1334                                 "al r12 r7 r7",
1335                                 "RnIsRm_al_r12_r7_r7",
1336                                 ARRAY_SIZE(kRnIsRm),
1337                                 kRnIsRm},
1338                                {{al, r11, r8, r8},
1339                                 "al r11 r8 r8",
1340                                 "RnIsRm_al_r11_r8_r8",
1341                                 ARRAY_SIZE(kRnIsRm),
1342                                 kRnIsRm},
1343                                {{al, r14, r0, r0},
1344                                 "al r14 r0 r0",
1345                                 "RnIsRm_al_r14_r0_r0",
1346                                 ARRAY_SIZE(kRnIsRm),
1347                                 kRnIsRm},
1348                                {{al, r8, r4, r4},
1349                                 "al r8 r4 r4",
1350                                 "RnIsRm_al_r8_r4_r4",
1351                                 ARRAY_SIZE(kRnIsRm),
1352                                 kRnIsRm},
1353                                {{al, r0, r8, r8},
1354                                 "al r0 r8 r8",
1355                                 "RnIsRm_al_r0_r8_r8",
1356                                 ARRAY_SIZE(kRnIsRm),
1357                                 kRnIsRm},
1358                                {{al, r5, r3, r3},
1359                                 "al r5 r3 r3",
1360                                 "RnIsRm_al_r5_r3_r3",
1361                                 ARRAY_SIZE(kRnIsRm),
1362                                 kRnIsRm},
1363                                {{al, r8, r5, r5},
1364                                 "al r8 r5 r5",
1365                                 "RnIsRm_al_r8_r5_r5",
1366                                 ARRAY_SIZE(kRnIsRm),
1367                                 kRnIsRm},
1368                                {{al, r5, r10, r10},
1369                                 "al r5 r10 r10",
1370                                 "RnIsRm_al_r5_r10_r10",
1371                                 ARRAY_SIZE(kRnIsRm),
1372                                 kRnIsRm},
1373                                {{al, r14, r3, r4},
1374                                 "al r14 r3 r4",
1375                                 "RdIsNotRnIsNotRm_al_r14_r3_r4",
1376                                 ARRAY_SIZE(kRdIsNotRnIsNotRm),
1377                                 kRdIsNotRnIsNotRm},
1378                                {{al, r3, r11, r1},
1379                                 "al r3 r11 r1",
1380                                 "RdIsNotRnIsNotRm_al_r3_r11_r1",
1381                                 ARRAY_SIZE(kRdIsNotRnIsNotRm),
1382                                 kRdIsNotRnIsNotRm},
1383                                {{al, r11, r2, r6},
1384                                 "al r11 r2 r6",
1385                                 "RdIsNotRnIsNotRm_al_r11_r2_r6",
1386                                 ARRAY_SIZE(kRdIsNotRnIsNotRm),
1387                                 kRdIsNotRnIsNotRm},
1388                                {{al, r14, r0, r5},
1389                                 "al r14 r0 r5",
1390                                 "RdIsNotRnIsNotRm_al_r14_r0_r5",
1391                                 ARRAY_SIZE(kRdIsNotRnIsNotRm),
1392                                 kRdIsNotRnIsNotRm},
1393                                {{al, r11, r6, r12},
1394                                 "al r11 r6 r12",
1395                                 "RdIsNotRnIsNotRm_al_r11_r6_r12",
1396                                 ARRAY_SIZE(kRdIsNotRnIsNotRm),
1397                                 kRdIsNotRnIsNotRm},
1398                                {{al, r10, r8, r4},
1399                                 "al r10 r8 r4",
1400                                 "RdIsNotRnIsNotRm_al_r10_r8_r4",
1401                                 ARRAY_SIZE(kRdIsNotRnIsNotRm),
1402                                 kRdIsNotRnIsNotRm},
1403                                {{al, r4, r3, r1},
1404                                 "al r4 r3 r1",
1405                                 "RdIsNotRnIsNotRm_al_r4_r3_r1",
1406                                 ARRAY_SIZE(kRdIsNotRnIsNotRm),
1407                                 kRdIsNotRnIsNotRm},
1408                                {{al, r12, r11, r14},
1409                                 "al r12 r11 r14",
1410                                 "RdIsNotRnIsNotRm_al_r12_r11_r14",
1411                                 ARRAY_SIZE(kRdIsNotRnIsNotRm),
1412                                 kRdIsNotRnIsNotRm},
1413                                {{al, r9, r4, r11},
1414                                 "al r9 r4 r11",
1415                                 "RdIsNotRnIsNotRm_al_r9_r4_r11",
1416                                 ARRAY_SIZE(kRdIsNotRnIsNotRm),
1417                                 kRdIsNotRnIsNotRm},
1418                                {{al, r14, r4, r6},
1419                                 "al r14 r4 r6",
1420                                 "RdIsNotRnIsNotRm_al_r14_r4_r6",
1421                                 ARRAY_SIZE(kRdIsNotRnIsNotRm),
1422                                 kRdIsNotRnIsNotRm}};
1423 
1424 // We record all inputs to the instructions as outputs. This way, we also check
1425 // that what shouldn't change didn't change.
1426 struct TestResult {
1427   size_t output_size;
1428   const Inputs* outputs;
1429 };
1430 
1431 // These headers each contain an array of `TestResult` with the reference output
1432 // values. The reference arrays are names `kReference{mnemonic}`.
1433 #include "aarch32/traces/simulator-cond-rd-rn-rm-mul-t32.h"
1434 #include "aarch32/traces/simulator-cond-rd-rn-rm-qadd-t32.h"
1435 #include "aarch32/traces/simulator-cond-rd-rn-rm-qadd16-t32.h"
1436 #include "aarch32/traces/simulator-cond-rd-rn-rm-qadd8-t32.h"
1437 #include "aarch32/traces/simulator-cond-rd-rn-rm-qasx-t32.h"
1438 #include "aarch32/traces/simulator-cond-rd-rn-rm-qdadd-t32.h"
1439 #include "aarch32/traces/simulator-cond-rd-rn-rm-qdsub-t32.h"
1440 #include "aarch32/traces/simulator-cond-rd-rn-rm-qsax-t32.h"
1441 #include "aarch32/traces/simulator-cond-rd-rn-rm-qsub-t32.h"
1442 #include "aarch32/traces/simulator-cond-rd-rn-rm-qsub16-t32.h"
1443 #include "aarch32/traces/simulator-cond-rd-rn-rm-qsub8-t32.h"
1444 #include "aarch32/traces/simulator-cond-rd-rn-rm-sadd16-t32.h"
1445 #include "aarch32/traces/simulator-cond-rd-rn-rm-sadd8-t32.h"
1446 #include "aarch32/traces/simulator-cond-rd-rn-rm-sasx-t32.h"
1447 #include "aarch32/traces/simulator-cond-rd-rn-rm-sdiv-t32.h"
1448 #include "aarch32/traces/simulator-cond-rd-rn-rm-sel-t32.h"
1449 #include "aarch32/traces/simulator-cond-rd-rn-rm-shadd16-t32.h"
1450 #include "aarch32/traces/simulator-cond-rd-rn-rm-shadd8-t32.h"
1451 #include "aarch32/traces/simulator-cond-rd-rn-rm-shasx-t32.h"
1452 #include "aarch32/traces/simulator-cond-rd-rn-rm-shsax-t32.h"
1453 #include "aarch32/traces/simulator-cond-rd-rn-rm-shsub16-t32.h"
1454 #include "aarch32/traces/simulator-cond-rd-rn-rm-shsub8-t32.h"
1455 #include "aarch32/traces/simulator-cond-rd-rn-rm-smmul-t32.h"
1456 #include "aarch32/traces/simulator-cond-rd-rn-rm-smmulr-t32.h"
1457 #include "aarch32/traces/simulator-cond-rd-rn-rm-smuad-t32.h"
1458 #include "aarch32/traces/simulator-cond-rd-rn-rm-smuadx-t32.h"
1459 #include "aarch32/traces/simulator-cond-rd-rn-rm-smulbb-t32.h"
1460 #include "aarch32/traces/simulator-cond-rd-rn-rm-smulbt-t32.h"
1461 #include "aarch32/traces/simulator-cond-rd-rn-rm-smultb-t32.h"
1462 #include "aarch32/traces/simulator-cond-rd-rn-rm-smultt-t32.h"
1463 #include "aarch32/traces/simulator-cond-rd-rn-rm-smulwb-t32.h"
1464 #include "aarch32/traces/simulator-cond-rd-rn-rm-smulwt-t32.h"
1465 #include "aarch32/traces/simulator-cond-rd-rn-rm-smusd-t32.h"
1466 #include "aarch32/traces/simulator-cond-rd-rn-rm-smusdx-t32.h"
1467 #include "aarch32/traces/simulator-cond-rd-rn-rm-ssax-t32.h"
1468 #include "aarch32/traces/simulator-cond-rd-rn-rm-ssub16-t32.h"
1469 #include "aarch32/traces/simulator-cond-rd-rn-rm-ssub8-t32.h"
1470 #include "aarch32/traces/simulator-cond-rd-rn-rm-uadd16-t32.h"
1471 #include "aarch32/traces/simulator-cond-rd-rn-rm-uadd8-t32.h"
1472 #include "aarch32/traces/simulator-cond-rd-rn-rm-uasx-t32.h"
1473 #include "aarch32/traces/simulator-cond-rd-rn-rm-udiv-t32.h"
1474 #include "aarch32/traces/simulator-cond-rd-rn-rm-uhadd16-t32.h"
1475 #include "aarch32/traces/simulator-cond-rd-rn-rm-uhadd8-t32.h"
1476 #include "aarch32/traces/simulator-cond-rd-rn-rm-uhasx-t32.h"
1477 #include "aarch32/traces/simulator-cond-rd-rn-rm-uhsax-t32.h"
1478 #include "aarch32/traces/simulator-cond-rd-rn-rm-uhsub16-t32.h"
1479 #include "aarch32/traces/simulator-cond-rd-rn-rm-uhsub8-t32.h"
1480 #include "aarch32/traces/simulator-cond-rd-rn-rm-uqadd16-t32.h"
1481 #include "aarch32/traces/simulator-cond-rd-rn-rm-uqadd8-t32.h"
1482 #include "aarch32/traces/simulator-cond-rd-rn-rm-uqasx-t32.h"
1483 #include "aarch32/traces/simulator-cond-rd-rn-rm-uqsax-t32.h"
1484 #include "aarch32/traces/simulator-cond-rd-rn-rm-uqsub16-t32.h"
1485 #include "aarch32/traces/simulator-cond-rd-rn-rm-uqsub8-t32.h"
1486 #include "aarch32/traces/simulator-cond-rd-rn-rm-usad8-t32.h"
1487 #include "aarch32/traces/simulator-cond-rd-rn-rm-usax-t32.h"
1488 #include "aarch32/traces/simulator-cond-rd-rn-rm-usub16-t32.h"
1489 #include "aarch32/traces/simulator-cond-rd-rn-rm-usub8-t32.h"
1490 
1491 
1492 // The maximum number of errors to report in detail for each test.
1493 const unsigned kErrorReportLimit = 8;
1494 
1495 typedef void (MacroAssembler::*Fn)(Condition cond,
1496                                    Register rd,
1497                                    Register rn,
1498                                    Register rm);
1499 
TestHelper(Fn instruction,const char * mnemonic,const TestResult reference[])1500 void TestHelper(Fn instruction,
1501                 const char* mnemonic,
1502                 const TestResult reference[]) {
1503   SETUP();
1504   masm.UseT32();
1505   START();
1506 
1507   // Data to compare to `reference`.
1508   TestResult* results[ARRAY_SIZE(kTests)];
1509 
1510   // Test cases for memory bound instructions may allocate a buffer and save its
1511   // address in this array.
1512   byte* scratch_memory_buffers[ARRAY_SIZE(kTests)];
1513 
1514   // Generate a loop for each element in `kTests`. Each loop tests one specific
1515   // instruction.
1516   for (unsigned i = 0; i < ARRAY_SIZE(kTests); i++) {
1517     // Allocate results on the heap for this test.
1518     results[i] = new TestResult;
1519     results[i]->outputs = new Inputs[kTests[i].input_size];
1520     results[i]->output_size = kTests[i].input_size;
1521 
1522     size_t input_stride = sizeof(kTests[i].inputs[0]) * kTests[i].input_size;
1523     VIXL_ASSERT(IsUint32(input_stride));
1524 
1525     scratch_memory_buffers[i] = NULL;
1526 
1527     Label loop;
1528     UseScratchRegisterScope scratch_registers(&masm);
1529     // Include all registers from r0 ro r12.
1530     scratch_registers.Include(RegisterList(0x1fff));
1531 
1532     // Values to pass to the macro-assembler.
1533     Condition cond = kTests[i].operands.cond;
1534     Register rd = kTests[i].operands.rd;
1535     Register rn = kTests[i].operands.rn;
1536     Register rm = kTests[i].operands.rm;
1537     scratch_registers.Exclude(rd);
1538     scratch_registers.Exclude(rn);
1539     scratch_registers.Exclude(rm);
1540 
1541     // Allocate reserved registers for our own use.
1542     Register input_ptr = scratch_registers.Acquire();
1543     Register input_end = scratch_registers.Acquire();
1544     Register result_ptr = scratch_registers.Acquire();
1545 
1546     // Initialize `input_ptr` to the first element and `input_end` the address
1547     // after the array.
1548     __ Mov(input_ptr, Operand::From(kTests[i].inputs));
1549     __ Add(input_end, input_ptr, static_cast<uint32_t>(input_stride));
1550     __ Mov(result_ptr, Operand::From(results[i]->outputs));
1551     __ Bind(&loop);
1552 
1553     {
1554       UseScratchRegisterScope temp_registers(&masm);
1555       Register nzcv_bits = temp_registers.Acquire();
1556       Register saved_q_bit = temp_registers.Acquire();
1557       // Save the `Q` bit flag.
1558       __ Mrs(saved_q_bit, APSR);
1559       __ And(saved_q_bit, saved_q_bit, QFlag);
1560       // Set the `NZCV` and `Q` flags together.
1561       __ Ldr(nzcv_bits, MemOperand(input_ptr, offsetof(Inputs, apsr)));
1562       __ Orr(nzcv_bits, nzcv_bits, saved_q_bit);
1563       __ Msr(APSR_nzcvq, nzcv_bits);
1564     }
1565     {
1566       UseScratchRegisterScope temp_registers(&masm);
1567       Register q_bit = temp_registers.Acquire();
1568       Register saved_nzcv_bits = temp_registers.Acquire();
1569       // Save the `NZCV` flags.
1570       __ Mrs(saved_nzcv_bits, APSR);
1571       __ And(saved_nzcv_bits, saved_nzcv_bits, NZCVFlag);
1572       // Set the `NZCV` and `Q` flags together.
1573       __ Ldr(q_bit, MemOperand(input_ptr, offsetof(Inputs, qbit)));
1574       __ Orr(q_bit, q_bit, saved_nzcv_bits);
1575       __ Msr(APSR_nzcvq, q_bit);
1576     }
1577     {
1578       UseScratchRegisterScope temp_registers(&masm);
1579       Register ge_bits = temp_registers.Acquire();
1580       __ Ldr(ge_bits, MemOperand(input_ptr, offsetof(Inputs, ge)));
1581       __ Msr(APSR_g, ge_bits);
1582     }
1583     __ Ldr(rd, MemOperand(input_ptr, offsetof(Inputs, rd)));
1584     __ Ldr(rn, MemOperand(input_ptr, offsetof(Inputs, rn)));
1585     __ Ldr(rm, MemOperand(input_ptr, offsetof(Inputs, rm)));
1586 
1587     (masm.*instruction)(cond, rd, rn, rm);
1588 
1589     {
1590       UseScratchRegisterScope temp_registers(&masm);
1591       Register nzcv_bits = temp_registers.Acquire();
1592       __ Mrs(nzcv_bits, APSR);
1593       // Only record the NZCV bits.
1594       __ And(nzcv_bits, nzcv_bits, NZCVFlag);
1595       __ Str(nzcv_bits, MemOperand(result_ptr, offsetof(Inputs, apsr)));
1596     }
1597     {
1598       UseScratchRegisterScope temp_registers(&masm);
1599       Register q_bit = temp_registers.Acquire();
1600       __ Mrs(q_bit, APSR);
1601       // Only record the Q bit.
1602       __ And(q_bit, q_bit, QFlag);
1603       __ Str(q_bit, MemOperand(result_ptr, offsetof(Inputs, qbit)));
1604     }
1605     {
1606       UseScratchRegisterScope temp_registers(&masm);
1607       Register ge_bits = temp_registers.Acquire();
1608       __ Mrs(ge_bits, APSR);
1609       // Only record the GE bits.
1610       __ And(ge_bits, ge_bits, GEFlags);
1611       __ Str(ge_bits, MemOperand(result_ptr, offsetof(Inputs, ge)));
1612     }
1613     __ Str(rd, MemOperand(result_ptr, offsetof(Inputs, rd)));
1614     __ Str(rn, MemOperand(result_ptr, offsetof(Inputs, rn)));
1615     __ Str(rm, MemOperand(result_ptr, offsetof(Inputs, rm)));
1616 
1617     // Advance the result pointer.
1618     __ Add(result_ptr, result_ptr, Operand::From(sizeof(kTests[i].inputs[0])));
1619     // Loop back until `input_ptr` is lower than `input_base`.
1620     __ Add(input_ptr, input_ptr, Operand::From(sizeof(kTests[i].inputs[0])));
1621     __ Cmp(input_ptr, input_end);
1622     __ B(ne, &loop);
1623   }
1624 
1625   END();
1626 
1627   RUN();
1628 
1629   if (Test::generate_test_trace()) {
1630     // Print the results.
1631     for (size_t i = 0; i < ARRAY_SIZE(kTests); i++) {
1632       printf("const Inputs kOutputs_%s_%s[] = {\n",
1633              mnemonic,
1634              kTests[i].identifier);
1635       for (size_t j = 0; j < results[i]->output_size; j++) {
1636         printf("  { ");
1637         printf("0x%08" PRIx32, results[i]->outputs[j].apsr);
1638         printf(", ");
1639         printf("0x%08" PRIx32, results[i]->outputs[j].qbit);
1640         printf(", ");
1641         printf("0x%08" PRIx32, results[i]->outputs[j].ge);
1642         printf(", ");
1643         printf("0x%08" PRIx32, results[i]->outputs[j].rd);
1644         printf(", ");
1645         printf("0x%08" PRIx32, results[i]->outputs[j].rn);
1646         printf(", ");
1647         printf("0x%08" PRIx32, results[i]->outputs[j].rm);
1648         printf(" },\n");
1649       }
1650       printf("};\n");
1651     }
1652     printf("const TestResult kReference%s[] = {\n", mnemonic);
1653     for (size_t i = 0; i < ARRAY_SIZE(kTests); i++) {
1654       printf("  {\n");
1655       printf("    ARRAY_SIZE(kOutputs_%s_%s),\n",
1656              mnemonic,
1657              kTests[i].identifier);
1658       printf("    kOutputs_%s_%s,\n", mnemonic, kTests[i].identifier);
1659       printf("  },\n");
1660     }
1661     printf("};\n");
1662   } else if (kCheckSimulatorTestResults) {
1663     // Check the results.
1664     unsigned total_error_count = 0;
1665     for (size_t i = 0; i < ARRAY_SIZE(kTests); i++) {
1666       bool instruction_has_errors = false;
1667       for (size_t j = 0; j < kTests[i].input_size; j++) {
1668         uint32_t apsr = results[i]->outputs[j].apsr;
1669         uint32_t qbit = results[i]->outputs[j].qbit;
1670         uint32_t ge = results[i]->outputs[j].ge;
1671         uint32_t rd = results[i]->outputs[j].rd;
1672         uint32_t rn = results[i]->outputs[j].rn;
1673         uint32_t rm = results[i]->outputs[j].rm;
1674         uint32_t apsr_input = kTests[i].inputs[j].apsr;
1675         uint32_t qbit_input = kTests[i].inputs[j].qbit;
1676         uint32_t ge_input = kTests[i].inputs[j].ge;
1677         uint32_t rd_input = kTests[i].inputs[j].rd;
1678         uint32_t rn_input = kTests[i].inputs[j].rn;
1679         uint32_t rm_input = kTests[i].inputs[j].rm;
1680         uint32_t apsr_ref = reference[i].outputs[j].apsr;
1681         uint32_t qbit_ref = reference[i].outputs[j].qbit;
1682         uint32_t ge_ref = reference[i].outputs[j].ge;
1683         uint32_t rd_ref = reference[i].outputs[j].rd;
1684         uint32_t rn_ref = reference[i].outputs[j].rn;
1685         uint32_t rm_ref = reference[i].outputs[j].rm;
1686 
1687         if (((apsr != apsr_ref) || (qbit != qbit_ref) || (ge != ge_ref) ||
1688              (rd != rd_ref) || (rn != rn_ref) || (rm != rm_ref)) &&
1689             (++total_error_count <= kErrorReportLimit)) {
1690           // Print the instruction once even if it triggered multiple failures.
1691           if (!instruction_has_errors) {
1692             printf("Error(s) when testing \"%s %s\":\n",
1693                    mnemonic,
1694                    kTests[i].operands_description);
1695             instruction_has_errors = true;
1696           }
1697           // Print subsequent errors.
1698           printf("  Input:    ");
1699           printf("0x%08" PRIx32, apsr_input);
1700           printf(", ");
1701           printf("0x%08" PRIx32, qbit_input);
1702           printf(", ");
1703           printf("0x%08" PRIx32, ge_input);
1704           printf(", ");
1705           printf("0x%08" PRIx32, rd_input);
1706           printf(", ");
1707           printf("0x%08" PRIx32, rn_input);
1708           printf(", ");
1709           printf("0x%08" PRIx32, rm_input);
1710           printf("\n");
1711           printf("  Expected: ");
1712           printf("0x%08" PRIx32, apsr_ref);
1713           printf(", ");
1714           printf("0x%08" PRIx32, qbit_ref);
1715           printf(", ");
1716           printf("0x%08" PRIx32, ge_ref);
1717           printf(", ");
1718           printf("0x%08" PRIx32, rd_ref);
1719           printf(", ");
1720           printf("0x%08" PRIx32, rn_ref);
1721           printf(", ");
1722           printf("0x%08" PRIx32, rm_ref);
1723           printf("\n");
1724           printf("  Found:    ");
1725           printf("0x%08" PRIx32, apsr);
1726           printf(", ");
1727           printf("0x%08" PRIx32, qbit);
1728           printf(", ");
1729           printf("0x%08" PRIx32, ge);
1730           printf(", ");
1731           printf("0x%08" PRIx32, rd);
1732           printf(", ");
1733           printf("0x%08" PRIx32, rn);
1734           printf(", ");
1735           printf("0x%08" PRIx32, rm);
1736           printf("\n\n");
1737         }
1738       }
1739     }
1740 
1741     if (total_error_count > kErrorReportLimit) {
1742       printf("%u other errors follow.\n",
1743              total_error_count - kErrorReportLimit);
1744     }
1745     VIXL_CHECK(total_error_count == 0);
1746   } else {
1747     VIXL_WARNING("Assembled the code, but did not run anything.\n");
1748   }
1749 
1750   for (size_t i = 0; i < ARRAY_SIZE(kTests); i++) {
1751     delete[] results[i]->outputs;
1752     delete results[i];
1753     delete[] scratch_memory_buffers[i];
1754   }
1755 }
1756 
1757 // Instantiate tests for each instruction in the list.
1758 // TODO: Remove this limitation by having a sandboxing mechanism.
1759 #if defined(VIXL_HOST_POINTER_32)
1760 #define TEST(mnemonic)                                                      \
1761   void Test_##mnemonic() {                                                  \
1762     TestHelper(&MacroAssembler::mnemonic, #mnemonic, kReference##mnemonic); \
1763   }                                                                         \
1764   Test test_##mnemonic("AARCH32_SIMULATOR_COND_RD_RN_RM_" #mnemonic "_T32", \
1765                        &Test_##mnemonic);
1766 #else
1767 #define TEST(mnemonic)                                                      \
1768   void Test_##mnemonic() {                                                  \
1769     VIXL_WARNING("This test can only run on a 32-bit host.\n");             \
1770     USE(TestHelper);                                                        \
1771   }                                                                         \
1772   Test test_##mnemonic("AARCH32_SIMULATOR_COND_RD_RN_RM_" #mnemonic "_T32", \
1773                        &Test_##mnemonic);
1774 #endif
1775 
1776 FOREACH_INSTRUCTION(TEST)
1777 #undef TEST
1778 
1779 }  // namespace
1780 #endif
1781 
1782 }  // namespace aarch32
1783 }  // namespace vixl
1784