Home | History | Annotate | Download | only in aarch32
      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/macro-assembler-aarch32.h"
     44 #include "aarch32/disasm-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 #define TEARDOWN()
     64 
     65 #else  // ifdef VIXL_INCLUDE_SIMULATOR_AARCH32.
     66 
     67 #define SETUP()                                   \
     68   MacroAssembler masm(BUF_SIZE);                  \
     69   UseScratchRegisterScope harness_scratch(&masm); \
     70   harness_scratch.ExcludeAll();
     71 
     72 #define START()              \
     73   masm.GetBuffer()->Reset(); \
     74   __ Push(r4);               \
     75   __ Push(r5);               \
     76   __ Push(r6);               \
     77   __ Push(r7);               \
     78   __ Push(r8);               \
     79   __ Push(r9);               \
     80   __ Push(r10);              \
     81   __ Push(r11);              \
     82   __ Push(lr);               \
     83   harness_scratch.Include(ip);
     84 
     85 #define END()                  \
     86   harness_scratch.Exclude(ip); \
     87   __ Pop(lr);                  \
     88   __ Pop(r11);                 \
     89   __ Pop(r10);                 \
     90   __ Pop(r9);                  \
     91   __ Pop(r8);                  \
     92   __ Pop(r7);                  \
     93   __ Pop(r6);                  \
     94   __ Pop(r5);                  \
     95   __ Pop(r4);                  \
     96   __ Bx(lr);                   \
     97   __ FinalizeCode();
     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 #define TEARDOWN() harness_scratch.Close();
    110 
    111 #endif  // ifdef VIXL_INCLUDE_SIMULATOR_AARCH32
    112 
    113 namespace vixl {
    114 namespace aarch32 {
    115 
    116 // List of instruction encodings:
    117 #define FOREACH_INSTRUCTION(M) \
    118   M(Clz)                       \
    119   M(Rbit)                      \
    120   M(Rev)                       \
    121   M(Rev16)                     \
    122   M(Revsh)                     \
    123   M(Rrx)                       \
    124   M(Rrxs)
    125 
    126 
    127 // The following definitions are defined again in each generated test, therefore
    128 // we need to place them in an anomymous namespace. It expresses that they are
    129 // local to this file only, and the compiler is not allowed to share these types
    130 // across test files during template instantiation. Specifically, `Operands` and
    131 // `Inputs` have various layouts across generated tests so they absolutely
    132 // cannot be shared.
    133 
    134 #ifdef VIXL_INCLUDE_TARGET_T32
    135 namespace {
    136 
    137 // Values to be passed to the assembler to produce the instruction under test.
    138 struct Operands {
    139   Condition cond;
    140   Register rd;
    141   Register rn;
    142 };
    143 
    144 // Input data to feed to the instruction.
    145 struct Inputs {
    146   uint32_t apsr;
    147   uint32_t rd;
    148   uint32_t rn;
    149 };
    150 
    151 // This structure contains all input data needed to test one specific encoding.
    152 // It used to generate a loop over an instruction.
    153 struct TestLoopData {
    154   // The `operands` fields represents the values to pass to the assembler to
    155   // produce the instruction.
    156   Operands operands;
    157   // Description of the operands, used for error reporting.
    158   const char* operands_description;
    159   // Unique identifier, used for generating traces.
    160   const char* identifier;
    161   // Array of values to be fed to the instruction.
    162   size_t input_size;
    163   const Inputs* inputs;
    164 };
    165 
    166 static const Inputs kCondition[] = {{NFlag, 0xabababab, 0xabababab},
    167                                     {ZFlag, 0xabababab, 0xabababab},
    168                                     {CFlag, 0xabababab, 0xabababab},
    169                                     {VFlag, 0xabababab, 0xabababab},
    170                                     {NZFlag, 0xabababab, 0xabababab},
    171                                     {NCFlag, 0xabababab, 0xabababab},
    172                                     {NVFlag, 0xabababab, 0xabababab},
    173                                     {ZCFlag, 0xabababab, 0xabababab},
    174                                     {ZVFlag, 0xabababab, 0xabababab},
    175                                     {CVFlag, 0xabababab, 0xabababab},
    176                                     {NZCFlag, 0xabababab, 0xabababab},
    177                                     {NZVFlag, 0xabababab, 0xabababab},
    178                                     {NCVFlag, 0xabababab, 0xabababab},
    179                                     {ZCVFlag, 0xabababab, 0xabababab},
    180                                     {NZCVFlag, 0xabababab, 0xabababab}};
    181 
    182 static const Inputs kRdIsRn[] = {{NoFlag, 0x00000000, 0x00000000},
    183                                  {NoFlag, 0x00000001, 0x00000001},
    184                                  {NoFlag, 0x00000002, 0x00000002},
    185                                  {NoFlag, 0x00000020, 0x00000020},
    186                                  {NoFlag, 0x0000007d, 0x0000007d},
    187                                  {NoFlag, 0x0000007e, 0x0000007e},
    188                                  {NoFlag, 0x0000007f, 0x0000007f},
    189                                  {NoFlag, 0x00007ffd, 0x00007ffd},
    190                                  {NoFlag, 0x00007ffe, 0x00007ffe},
    191                                  {NoFlag, 0x00007fff, 0x00007fff},
    192                                  {NoFlag, 0x33333333, 0x33333333},
    193                                  {NoFlag, 0x55555555, 0x55555555},
    194                                  {NoFlag, 0x7ffffffd, 0x7ffffffd},
    195                                  {NoFlag, 0x7ffffffe, 0x7ffffffe},
    196                                  {NoFlag, 0x7fffffff, 0x7fffffff},
    197                                  {NoFlag, 0x80000000, 0x80000000},
    198                                  {NoFlag, 0x80000001, 0x80000001},
    199                                  {NoFlag, 0xaaaaaaaa, 0xaaaaaaaa},
    200                                  {NoFlag, 0xcccccccc, 0xcccccccc},
    201                                  {NoFlag, 0xffff8000, 0xffff8000},
    202                                  {NoFlag, 0xffff8001, 0xffff8001},
    203                                  {NoFlag, 0xffff8002, 0xffff8002},
    204                                  {NoFlag, 0xffff8003, 0xffff8003},
    205                                  {NoFlag, 0xffffff80, 0xffffff80},
    206                                  {NoFlag, 0xffffff81, 0xffffff81},
    207                                  {NoFlag, 0xffffff82, 0xffffff82},
    208                                  {NoFlag, 0xffffff83, 0xffffff83},
    209                                  {NoFlag, 0xffffffe0, 0xffffffe0},
    210                                  {NoFlag, 0xfffffffd, 0xfffffffd},
    211                                  {NoFlag, 0xfffffffe, 0xfffffffe},
    212                                  {NoFlag, 0xffffffff, 0xffffffff}};
    213 
    214 static const Inputs kRdIsNotRn[] = {{NoFlag, 0x00000000, 0x00000001},
    215                                     {NoFlag, 0x00000000, 0x00000002},
    216                                     {NoFlag, 0x00000000, 0x00000020},
    217                                     {NoFlag, 0x00000000, 0x0000007d},
    218                                     {NoFlag, 0x00000000, 0x0000007e},
    219                                     {NoFlag, 0x00000000, 0x0000007f},
    220                                     {NoFlag, 0x00000000, 0x00007ffd},
    221                                     {NoFlag, 0x00000000, 0x00007ffe},
    222                                     {NoFlag, 0x00000000, 0x00007fff},
    223                                     {NoFlag, 0x00000000, 0x33333333},
    224                                     {NoFlag, 0x00000000, 0x55555555},
    225                                     {NoFlag, 0x00000000, 0x7ffffffd},
    226                                     {NoFlag, 0x00000000, 0x7ffffffe},
    227                                     {NoFlag, 0x00000000, 0x7fffffff},
    228                                     {NoFlag, 0x00000000, 0x80000000},
    229                                     {NoFlag, 0x00000000, 0x80000001},
    230                                     {NoFlag, 0x00000000, 0xaaaaaaaa},
    231                                     {NoFlag, 0x00000000, 0xcccccccc},
    232                                     {NoFlag, 0x00000000, 0xffff8000},
    233                                     {NoFlag, 0x00000000, 0xffff8001},
    234                                     {NoFlag, 0x00000000, 0xffff8002},
    235                                     {NoFlag, 0x00000000, 0xffff8003},
    236                                     {NoFlag, 0x00000000, 0xffffff80},
    237                                     {NoFlag, 0x00000000, 0xffffff81},
    238                                     {NoFlag, 0x00000000, 0xffffff82},
    239                                     {NoFlag, 0x00000000, 0xffffff83},
    240                                     {NoFlag, 0x00000000, 0xffffffe0},
    241                                     {NoFlag, 0x00000000, 0xfffffffd},
    242                                     {NoFlag, 0x00000000, 0xfffffffe},
    243                                     {NoFlag, 0x00000000, 0xffffffff},
    244                                     {NoFlag, 0x00000001, 0x00000000},
    245                                     {NoFlag, 0x00000001, 0x00000002},
    246                                     {NoFlag, 0x00000001, 0x00000020},
    247                                     {NoFlag, 0x00000001, 0x0000007d},
    248                                     {NoFlag, 0x00000001, 0x0000007e},
    249                                     {NoFlag, 0x00000001, 0x0000007f},
    250                                     {NoFlag, 0x00000001, 0x00007ffd},
    251                                     {NoFlag, 0x00000001, 0x00007ffe},
    252                                     {NoFlag, 0x00000001, 0x00007fff},
    253                                     {NoFlag, 0x00000001, 0x33333333},
    254                                     {NoFlag, 0x00000001, 0x55555555},
    255                                     {NoFlag, 0x00000001, 0x7ffffffd},
    256                                     {NoFlag, 0x00000001, 0x7ffffffe},
    257                                     {NoFlag, 0x00000001, 0x7fffffff},
    258                                     {NoFlag, 0x00000001, 0x80000000},
    259                                     {NoFlag, 0x00000001, 0x80000001},
    260                                     {NoFlag, 0x00000001, 0xaaaaaaaa},
    261                                     {NoFlag, 0x00000001, 0xcccccccc},
    262                                     {NoFlag, 0x00000001, 0xffff8000},
    263                                     {NoFlag, 0x00000001, 0xffff8001},
    264                                     {NoFlag, 0x00000001, 0xffff8002},
    265                                     {NoFlag, 0x00000001, 0xffff8003},
    266                                     {NoFlag, 0x00000001, 0xffffff80},
    267                                     {NoFlag, 0x00000001, 0xffffff81},
    268                                     {NoFlag, 0x00000001, 0xffffff82},
    269                                     {NoFlag, 0x00000001, 0xffffff83},
    270                                     {NoFlag, 0x00000001, 0xffffffe0},
    271                                     {NoFlag, 0x00000001, 0xfffffffd},
    272                                     {NoFlag, 0x00000001, 0xfffffffe},
    273                                     {NoFlag, 0x00000001, 0xffffffff},
    274                                     {NoFlag, 0x00000002, 0x00000000},
    275                                     {NoFlag, 0x00000002, 0x00000001},
    276                                     {NoFlag, 0x00000002, 0x00000020},
    277                                     {NoFlag, 0x00000002, 0x0000007d},
    278                                     {NoFlag, 0x00000002, 0x0000007e},
    279                                     {NoFlag, 0x00000002, 0x0000007f},
    280                                     {NoFlag, 0x00000002, 0x00007ffd},
    281                                     {NoFlag, 0x00000002, 0x00007ffe},
    282                                     {NoFlag, 0x00000002, 0x00007fff},
    283                                     {NoFlag, 0x00000002, 0x33333333},
    284                                     {NoFlag, 0x00000002, 0x55555555},
    285                                     {NoFlag, 0x00000002, 0x7ffffffd},
    286                                     {NoFlag, 0x00000002, 0x7ffffffe},
    287                                     {NoFlag, 0x00000002, 0x7fffffff},
    288                                     {NoFlag, 0x00000002, 0x80000000},
    289                                     {NoFlag, 0x00000002, 0x80000001},
    290                                     {NoFlag, 0x00000002, 0xaaaaaaaa},
    291                                     {NoFlag, 0x00000002, 0xcccccccc},
    292                                     {NoFlag, 0x00000002, 0xffff8000},
    293                                     {NoFlag, 0x00000002, 0xffff8001},
    294                                     {NoFlag, 0x00000002, 0xffff8002},
    295                                     {NoFlag, 0x00000002, 0xffff8003},
    296                                     {NoFlag, 0x00000002, 0xffffff80},
    297                                     {NoFlag, 0x00000002, 0xffffff81},
    298                                     {NoFlag, 0x00000002, 0xffffff82},
    299                                     {NoFlag, 0x00000002, 0xffffff83},
    300                                     {NoFlag, 0x00000002, 0xffffffe0},
    301                                     {NoFlag, 0x00000002, 0xfffffffd},
    302                                     {NoFlag, 0x00000002, 0xfffffffe},
    303                                     {NoFlag, 0x00000002, 0xffffffff},
    304                                     {NoFlag, 0x00000020, 0x00000000},
    305                                     {NoFlag, 0x00000020, 0x00000001},
    306                                     {NoFlag, 0x00000020, 0x00000002},
    307                                     {NoFlag, 0x00000020, 0x0000007d},
    308                                     {NoFlag, 0x00000020, 0x0000007e},
    309                                     {NoFlag, 0x00000020, 0x0000007f},
    310                                     {NoFlag, 0x00000020, 0x00007ffd},
    311                                     {NoFlag, 0x00000020, 0x00007ffe},
    312                                     {NoFlag, 0x00000020, 0x00007fff},
    313                                     {NoFlag, 0x00000020, 0x33333333},
    314                                     {NoFlag, 0x00000020, 0x55555555},
    315                                     {NoFlag, 0x00000020, 0x7ffffffd},
    316                                     {NoFlag, 0x00000020, 0x7ffffffe},
    317                                     {NoFlag, 0x00000020, 0x7fffffff},
    318                                     {NoFlag, 0x00000020, 0x80000000},
    319                                     {NoFlag, 0x00000020, 0x80000001},
    320                                     {NoFlag, 0x00000020, 0xaaaaaaaa},
    321                                     {NoFlag, 0x00000020, 0xcccccccc},
    322                                     {NoFlag, 0x00000020, 0xffff8000},
    323                                     {NoFlag, 0x00000020, 0xffff8001},
    324                                     {NoFlag, 0x00000020, 0xffff8002},
    325                                     {NoFlag, 0x00000020, 0xffff8003},
    326                                     {NoFlag, 0x00000020, 0xffffff80},
    327                                     {NoFlag, 0x00000020, 0xffffff81},
    328                                     {NoFlag, 0x00000020, 0xffffff82},
    329                                     {NoFlag, 0x00000020, 0xffffff83},
    330                                     {NoFlag, 0x00000020, 0xffffffe0},
    331                                     {NoFlag, 0x00000020, 0xfffffffd},
    332                                     {NoFlag, 0x00000020, 0xfffffffe},
    333                                     {NoFlag, 0x00000020, 0xffffffff},
    334                                     {NoFlag, 0x0000007d, 0x00000000},
    335                                     {NoFlag, 0x0000007d, 0x00000001},
    336                                     {NoFlag, 0x0000007d, 0x00000002},
    337                                     {NoFlag, 0x0000007d, 0x00000020},
    338                                     {NoFlag, 0x0000007d, 0x0000007e},
    339                                     {NoFlag, 0x0000007d, 0x0000007f},
    340                                     {NoFlag, 0x0000007d, 0x00007ffd},
    341                                     {NoFlag, 0x0000007d, 0x00007ffe},
    342                                     {NoFlag, 0x0000007d, 0x00007fff},
    343                                     {NoFlag, 0x0000007d, 0x33333333},
    344                                     {NoFlag, 0x0000007d, 0x55555555},
    345                                     {NoFlag, 0x0000007d, 0x7ffffffd},
    346                                     {NoFlag, 0x0000007d, 0x7ffffffe},
    347                                     {NoFlag, 0x0000007d, 0x7fffffff},
    348                                     {NoFlag, 0x0000007d, 0x80000000},
    349                                     {NoFlag, 0x0000007d, 0x80000001},
    350                                     {NoFlag, 0x0000007d, 0xaaaaaaaa},
    351                                     {NoFlag, 0x0000007d, 0xcccccccc},
    352                                     {NoFlag, 0x0000007d, 0xffff8000},
    353                                     {NoFlag, 0x0000007d, 0xffff8001},
    354                                     {NoFlag, 0x0000007d, 0xffff8002},
    355                                     {NoFlag, 0x0000007d, 0xffff8003},
    356                                     {NoFlag, 0x0000007d, 0xffffff80},
    357                                     {NoFlag, 0x0000007d, 0xffffff81},
    358                                     {NoFlag, 0x0000007d, 0xffffff82},
    359                                     {NoFlag, 0x0000007d, 0xffffff83},
    360                                     {NoFlag, 0x0000007d, 0xffffffe0},
    361                                     {NoFlag, 0x0000007d, 0xfffffffd},
    362                                     {NoFlag, 0x0000007d, 0xfffffffe},
    363                                     {NoFlag, 0x0000007d, 0xffffffff},
    364                                     {NoFlag, 0x0000007e, 0x00000000},
    365                                     {NoFlag, 0x0000007e, 0x00000001},
    366                                     {NoFlag, 0x0000007e, 0x00000002},
    367                                     {NoFlag, 0x0000007e, 0x00000020},
    368                                     {NoFlag, 0x0000007e, 0x0000007d},
    369                                     {NoFlag, 0x0000007e, 0x0000007f},
    370                                     {NoFlag, 0x0000007e, 0x00007ffd},
    371                                     {NoFlag, 0x0000007e, 0x00007ffe},
    372                                     {NoFlag, 0x0000007e, 0x00007fff},
    373                                     {NoFlag, 0x0000007e, 0x33333333},
    374                                     {NoFlag, 0x0000007e, 0x55555555},
    375                                     {NoFlag, 0x0000007e, 0x7ffffffd},
    376                                     {NoFlag, 0x0000007e, 0x7ffffffe},
    377                                     {NoFlag, 0x0000007e, 0x7fffffff},
    378                                     {NoFlag, 0x0000007e, 0x80000000},
    379                                     {NoFlag, 0x0000007e, 0x80000001},
    380                                     {NoFlag, 0x0000007e, 0xaaaaaaaa},
    381                                     {NoFlag, 0x0000007e, 0xcccccccc},
    382                                     {NoFlag, 0x0000007e, 0xffff8000},
    383                                     {NoFlag, 0x0000007e, 0xffff8001},
    384                                     {NoFlag, 0x0000007e, 0xffff8002},
    385                                     {NoFlag, 0x0000007e, 0xffff8003},
    386                                     {NoFlag, 0x0000007e, 0xffffff80},
    387                                     {NoFlag, 0x0000007e, 0xffffff81},
    388                                     {NoFlag, 0x0000007e, 0xffffff82},
    389                                     {NoFlag, 0x0000007e, 0xffffff83},
    390                                     {NoFlag, 0x0000007e, 0xffffffe0},
    391                                     {NoFlag, 0x0000007e, 0xfffffffd},
    392                                     {NoFlag, 0x0000007e, 0xfffffffe},
    393                                     {NoFlag, 0x0000007e, 0xffffffff},
    394                                     {NoFlag, 0x0000007f, 0x00000000},
    395                                     {NoFlag, 0x0000007f, 0x00000001},
    396                                     {NoFlag, 0x0000007f, 0x00000002},
    397                                     {NoFlag, 0x0000007f, 0x00000020},
    398                                     {NoFlag, 0x0000007f, 0x0000007d},
    399                                     {NoFlag, 0x0000007f, 0x0000007e},
    400                                     {NoFlag, 0x0000007f, 0x00007ffd},
    401                                     {NoFlag, 0x0000007f, 0x00007ffe},
    402                                     {NoFlag, 0x0000007f, 0x00007fff},
    403                                     {NoFlag, 0x0000007f, 0x33333333},
    404                                     {NoFlag, 0x0000007f, 0x55555555},
    405                                     {NoFlag, 0x0000007f, 0x7ffffffd},
    406                                     {NoFlag, 0x0000007f, 0x7ffffffe},
    407                                     {NoFlag, 0x0000007f, 0x7fffffff},
    408                                     {NoFlag, 0x0000007f, 0x80000000},
    409                                     {NoFlag, 0x0000007f, 0x80000001},
    410                                     {NoFlag, 0x0000007f, 0xaaaaaaaa},
    411                                     {NoFlag, 0x0000007f, 0xcccccccc},
    412                                     {NoFlag, 0x0000007f, 0xffff8000},
    413                                     {NoFlag, 0x0000007f, 0xffff8001},
    414                                     {NoFlag, 0x0000007f, 0xffff8002},
    415                                     {NoFlag, 0x0000007f, 0xffff8003},
    416                                     {NoFlag, 0x0000007f, 0xffffff80},
    417                                     {NoFlag, 0x0000007f, 0xffffff81},
    418                                     {NoFlag, 0x0000007f, 0xffffff82},
    419                                     {NoFlag, 0x0000007f, 0xffffff83},
    420                                     {NoFlag, 0x0000007f, 0xffffffe0},
    421                                     {NoFlag, 0x0000007f, 0xfffffffd},
    422                                     {NoFlag, 0x0000007f, 0xfffffffe},
    423                                     {NoFlag, 0x0000007f, 0xffffffff},
    424                                     {NoFlag, 0x00007ffd, 0x00000000},
    425                                     {NoFlag, 0x00007ffd, 0x00000001},
    426                                     {NoFlag, 0x00007ffd, 0x00000002},
    427                                     {NoFlag, 0x00007ffd, 0x00000020},
    428                                     {NoFlag, 0x00007ffd, 0x0000007d},
    429                                     {NoFlag, 0x00007ffd, 0x0000007e},
    430                                     {NoFlag, 0x00007ffd, 0x0000007f},
    431                                     {NoFlag, 0x00007ffd, 0x00007ffe},
    432                                     {NoFlag, 0x00007ffd, 0x00007fff},
    433                                     {NoFlag, 0x00007ffd, 0x33333333},
    434                                     {NoFlag, 0x00007ffd, 0x55555555},
    435                                     {NoFlag, 0x00007ffd, 0x7ffffffd},
    436                                     {NoFlag, 0x00007ffd, 0x7ffffffe},
    437                                     {NoFlag, 0x00007ffd, 0x7fffffff},
    438                                     {NoFlag, 0x00007ffd, 0x80000000},
    439                                     {NoFlag, 0x00007ffd, 0x80000001},
    440                                     {NoFlag, 0x00007ffd, 0xaaaaaaaa},
    441                                     {NoFlag, 0x00007ffd, 0xcccccccc},
    442                                     {NoFlag, 0x00007ffd, 0xffff8000},
    443                                     {NoFlag, 0x00007ffd, 0xffff8001},
    444                                     {NoFlag, 0x00007ffd, 0xffff8002},
    445                                     {NoFlag, 0x00007ffd, 0xffff8003},
    446                                     {NoFlag, 0x00007ffd, 0xffffff80},
    447                                     {NoFlag, 0x00007ffd, 0xffffff81},
    448                                     {NoFlag, 0x00007ffd, 0xffffff82},
    449                                     {NoFlag, 0x00007ffd, 0xffffff83},
    450                                     {NoFlag, 0x00007ffd, 0xffffffe0},
    451                                     {NoFlag, 0x00007ffd, 0xfffffffd},
    452                                     {NoFlag, 0x00007ffd, 0xfffffffe},
    453                                     {NoFlag, 0x00007ffd, 0xffffffff},
    454                                     {NoFlag, 0x00007ffe, 0x00000000},
    455                                     {NoFlag, 0x00007ffe, 0x00000001},
    456                                     {NoFlag, 0x00007ffe, 0x00000002},
    457                                     {NoFlag, 0x00007ffe, 0x00000020},
    458                                     {NoFlag, 0x00007ffe, 0x0000007d},
    459                                     {NoFlag, 0x00007ffe, 0x0000007e},
    460                                     {NoFlag, 0x00007ffe, 0x0000007f},
    461                                     {NoFlag, 0x00007ffe, 0x00007ffd},
    462                                     {NoFlag, 0x00007ffe, 0x00007fff},
    463                                     {NoFlag, 0x00007ffe, 0x33333333},
    464                                     {NoFlag, 0x00007ffe, 0x55555555},
    465                                     {NoFlag, 0x00007ffe, 0x7ffffffd},
    466                                     {NoFlag, 0x00007ffe, 0x7ffffffe},
    467                                     {NoFlag, 0x00007ffe, 0x7fffffff},
    468                                     {NoFlag, 0x00007ffe, 0x80000000},
    469                                     {NoFlag, 0x00007ffe, 0x80000001},
    470                                     {NoFlag, 0x00007ffe, 0xaaaaaaaa},
    471                                     {NoFlag, 0x00007ffe, 0xcccccccc},
    472                                     {NoFlag, 0x00007ffe, 0xffff8000},
    473                                     {NoFlag, 0x00007ffe, 0xffff8001},
    474                                     {NoFlag, 0x00007ffe, 0xffff8002},
    475                                     {NoFlag, 0x00007ffe, 0xffff8003},
    476                                     {NoFlag, 0x00007ffe, 0xffffff80},
    477                                     {NoFlag, 0x00007ffe, 0xffffff81},
    478                                     {NoFlag, 0x00007ffe, 0xffffff82},
    479                                     {NoFlag, 0x00007ffe, 0xffffff83},
    480                                     {NoFlag, 0x00007ffe, 0xffffffe0},
    481                                     {NoFlag, 0x00007ffe, 0xfffffffd},
    482                                     {NoFlag, 0x00007ffe, 0xfffffffe},
    483                                     {NoFlag, 0x00007ffe, 0xffffffff},
    484                                     {NoFlag, 0x00007fff, 0x00000000},
    485                                     {NoFlag, 0x00007fff, 0x00000001},
    486                                     {NoFlag, 0x00007fff, 0x00000002},
    487                                     {NoFlag, 0x00007fff, 0x00000020},
    488                                     {NoFlag, 0x00007fff, 0x0000007d},
    489                                     {NoFlag, 0x00007fff, 0x0000007e},
    490                                     {NoFlag, 0x00007fff, 0x0000007f},
    491                                     {NoFlag, 0x00007fff, 0x00007ffd},
    492                                     {NoFlag, 0x00007fff, 0x00007ffe},
    493                                     {NoFlag, 0x00007fff, 0x33333333},
    494                                     {NoFlag, 0x00007fff, 0x55555555},
    495                                     {NoFlag, 0x00007fff, 0x7ffffffd},
    496                                     {NoFlag, 0x00007fff, 0x7ffffffe},
    497                                     {NoFlag, 0x00007fff, 0x7fffffff},
    498                                     {NoFlag, 0x00007fff, 0x80000000},
    499                                     {NoFlag, 0x00007fff, 0x80000001},
    500                                     {NoFlag, 0x00007fff, 0xaaaaaaaa},
    501                                     {NoFlag, 0x00007fff, 0xcccccccc},
    502                                     {NoFlag, 0x00007fff, 0xffff8000},
    503                                     {NoFlag, 0x00007fff, 0xffff8001},
    504                                     {NoFlag, 0x00007fff, 0xffff8002},
    505                                     {NoFlag, 0x00007fff, 0xffff8003},
    506                                     {NoFlag, 0x00007fff, 0xffffff80},
    507                                     {NoFlag, 0x00007fff, 0xffffff81},
    508                                     {NoFlag, 0x00007fff, 0xffffff82},
    509                                     {NoFlag, 0x00007fff, 0xffffff83},
    510                                     {NoFlag, 0x00007fff, 0xffffffe0},
    511                                     {NoFlag, 0x00007fff, 0xfffffffd},
    512                                     {NoFlag, 0x00007fff, 0xfffffffe},
    513                                     {NoFlag, 0x00007fff, 0xffffffff},
    514                                     {NoFlag, 0x33333333, 0x00000000},
    515                                     {NoFlag, 0x33333333, 0x00000001},
    516                                     {NoFlag, 0x33333333, 0x00000002},
    517                                     {NoFlag, 0x33333333, 0x00000020},
    518                                     {NoFlag, 0x33333333, 0x0000007d},
    519                                     {NoFlag, 0x33333333, 0x0000007e},
    520                                     {NoFlag, 0x33333333, 0x0000007f},
    521                                     {NoFlag, 0x33333333, 0x00007ffd},
    522                                     {NoFlag, 0x33333333, 0x00007ffe},
    523                                     {NoFlag, 0x33333333, 0x00007fff},
    524                                     {NoFlag, 0x33333333, 0x55555555},
    525                                     {NoFlag, 0x33333333, 0x7ffffffd},
    526                                     {NoFlag, 0x33333333, 0x7ffffffe},
    527                                     {NoFlag, 0x33333333, 0x7fffffff},
    528                                     {NoFlag, 0x33333333, 0x80000000},
    529                                     {NoFlag, 0x33333333, 0x80000001},
    530                                     {NoFlag, 0x33333333, 0xaaaaaaaa},
    531                                     {NoFlag, 0x33333333, 0xcccccccc},
    532                                     {NoFlag, 0x33333333, 0xffff8000},
    533                                     {NoFlag, 0x33333333, 0xffff8001},
    534                                     {NoFlag, 0x33333333, 0xffff8002},
    535                                     {NoFlag, 0x33333333, 0xffff8003},
    536                                     {NoFlag, 0x33333333, 0xffffff80},
    537                                     {NoFlag, 0x33333333, 0xffffff81},
    538                                     {NoFlag, 0x33333333, 0xffffff82},
    539                                     {NoFlag, 0x33333333, 0xffffff83},
    540                                     {NoFlag, 0x33333333, 0xffffffe0},
    541                                     {NoFlag, 0x33333333, 0xfffffffd},
    542                                     {NoFlag, 0x33333333, 0xfffffffe},
    543                                     {NoFlag, 0x33333333, 0xffffffff},
    544                                     {NoFlag, 0x55555555, 0x00000000},
    545                                     {NoFlag, 0x55555555, 0x00000001},
    546                                     {NoFlag, 0x55555555, 0x00000002},
    547                                     {NoFlag, 0x55555555, 0x00000020},
    548                                     {NoFlag, 0x55555555, 0x0000007d},
    549                                     {NoFlag, 0x55555555, 0x0000007e},
    550                                     {NoFlag, 0x55555555, 0x0000007f},
    551                                     {NoFlag, 0x55555555, 0x00007ffd},
    552                                     {NoFlag, 0x55555555, 0x00007ffe},
    553                                     {NoFlag, 0x55555555, 0x00007fff},
    554                                     {NoFlag, 0x55555555, 0x33333333},
    555                                     {NoFlag, 0x55555555, 0x7ffffffd},
    556                                     {NoFlag, 0x55555555, 0x7ffffffe},
    557                                     {NoFlag, 0x55555555, 0x7fffffff},
    558                                     {NoFlag, 0x55555555, 0x80000000},
    559                                     {NoFlag, 0x55555555, 0x80000001},
    560                                     {NoFlag, 0x55555555, 0xaaaaaaaa},
    561                                     {NoFlag, 0x55555555, 0xcccccccc},
    562                                     {NoFlag, 0x55555555, 0xffff8000},
    563                                     {NoFlag, 0x55555555, 0xffff8001},
    564                                     {NoFlag, 0x55555555, 0xffff8002},
    565                                     {NoFlag, 0x55555555, 0xffff8003},
    566                                     {NoFlag, 0x55555555, 0xffffff80},
    567                                     {NoFlag, 0x55555555, 0xffffff81},
    568                                     {NoFlag, 0x55555555, 0xffffff82},
    569                                     {NoFlag, 0x55555555, 0xffffff83},
    570                                     {NoFlag, 0x55555555, 0xffffffe0},
    571                                     {NoFlag, 0x55555555, 0xfffffffd},
    572                                     {NoFlag, 0x55555555, 0xfffffffe},
    573                                     {NoFlag, 0x55555555, 0xffffffff},
    574                                     {NoFlag, 0x7ffffffd, 0x00000000},
    575                                     {NoFlag, 0x7ffffffd, 0x00000001},
    576                                     {NoFlag, 0x7ffffffd, 0x00000002},
    577                                     {NoFlag, 0x7ffffffd, 0x00000020},
    578                                     {NoFlag, 0x7ffffffd, 0x0000007d},
    579                                     {NoFlag, 0x7ffffffd, 0x0000007e},
    580                                     {NoFlag, 0x7ffffffd, 0x0000007f},
    581                                     {NoFlag, 0x7ffffffd, 0x00007ffd},
    582                                     {NoFlag, 0x7ffffffd, 0x00007ffe},
    583                                     {NoFlag, 0x7ffffffd, 0x00007fff},
    584                                     {NoFlag, 0x7ffffffd, 0x33333333},
    585                                     {NoFlag, 0x7ffffffd, 0x55555555},
    586                                     {NoFlag, 0x7ffffffd, 0x7ffffffe},
    587                                     {NoFlag, 0x7ffffffd, 0x7fffffff},
    588                                     {NoFlag, 0x7ffffffd, 0x80000000},
    589                                     {NoFlag, 0x7ffffffd, 0x80000001},
    590                                     {NoFlag, 0x7ffffffd, 0xaaaaaaaa},
    591                                     {NoFlag, 0x7ffffffd, 0xcccccccc},
    592                                     {NoFlag, 0x7ffffffd, 0xffff8000},
    593                                     {NoFlag, 0x7ffffffd, 0xffff8001},
    594                                     {NoFlag, 0x7ffffffd, 0xffff8002},
    595                                     {NoFlag, 0x7ffffffd, 0xffff8003},
    596                                     {NoFlag, 0x7ffffffd, 0xffffff80},
    597                                     {NoFlag, 0x7ffffffd, 0xffffff81},
    598                                     {NoFlag, 0x7ffffffd, 0xffffff82},
    599                                     {NoFlag, 0x7ffffffd, 0xffffff83},
    600                                     {NoFlag, 0x7ffffffd, 0xffffffe0},
    601                                     {NoFlag, 0x7ffffffd, 0xfffffffd},
    602                                     {NoFlag, 0x7ffffffd, 0xfffffffe},
    603                                     {NoFlag, 0x7ffffffd, 0xffffffff},
    604                                     {NoFlag, 0x7ffffffe, 0x00000000},
    605                                     {NoFlag, 0x7ffffffe, 0x00000001},
    606                                     {NoFlag, 0x7ffffffe, 0x00000002},
    607                                     {NoFlag, 0x7ffffffe, 0x00000020},
    608                                     {NoFlag, 0x7ffffffe, 0x0000007d},
    609                                     {NoFlag, 0x7ffffffe, 0x0000007e},
    610                                     {NoFlag, 0x7ffffffe, 0x0000007f},
    611                                     {NoFlag, 0x7ffffffe, 0x00007ffd},
    612                                     {NoFlag, 0x7ffffffe, 0x00007ffe},
    613                                     {NoFlag, 0x7ffffffe, 0x00007fff},
    614                                     {NoFlag, 0x7ffffffe, 0x33333333},
    615                                     {NoFlag, 0x7ffffffe, 0x55555555},
    616                                     {NoFlag, 0x7ffffffe, 0x7ffffffd},
    617                                     {NoFlag, 0x7ffffffe, 0x7fffffff},
    618                                     {NoFlag, 0x7ffffffe, 0x80000000},
    619                                     {NoFlag, 0x7ffffffe, 0x80000001},
    620                                     {NoFlag, 0x7ffffffe, 0xaaaaaaaa},
    621                                     {NoFlag, 0x7ffffffe, 0xcccccccc},
    622                                     {NoFlag, 0x7ffffffe, 0xffff8000},
    623                                     {NoFlag, 0x7ffffffe, 0xffff8001},
    624                                     {NoFlag, 0x7ffffffe, 0xffff8002},
    625                                     {NoFlag, 0x7ffffffe, 0xffff8003},
    626                                     {NoFlag, 0x7ffffffe, 0xffffff80},
    627                                     {NoFlag, 0x7ffffffe, 0xffffff81},
    628                                     {NoFlag, 0x7ffffffe, 0xffffff82},
    629                                     {NoFlag, 0x7ffffffe, 0xffffff83},
    630                                     {NoFlag, 0x7ffffffe, 0xffffffe0},
    631                                     {NoFlag, 0x7ffffffe, 0xfffffffd},
    632                                     {NoFlag, 0x7ffffffe, 0xfffffffe},
    633                                     {NoFlag, 0x7ffffffe, 0xffffffff},
    634                                     {NoFlag, 0x7fffffff, 0x00000000},
    635                                     {NoFlag, 0x7fffffff, 0x00000001},
    636                                     {NoFlag, 0x7fffffff, 0x00000002},
    637                                     {NoFlag, 0x7fffffff, 0x00000020},
    638                                     {NoFlag, 0x7fffffff, 0x0000007d},
    639                                     {NoFlag, 0x7fffffff, 0x0000007e},
    640                                     {NoFlag, 0x7fffffff, 0x0000007f},
    641                                     {NoFlag, 0x7fffffff, 0x00007ffd},
    642                                     {NoFlag, 0x7fffffff, 0x00007ffe},
    643                                     {NoFlag, 0x7fffffff, 0x00007fff},
    644                                     {NoFlag, 0x7fffffff, 0x33333333},
    645                                     {NoFlag, 0x7fffffff, 0x55555555},
    646                                     {NoFlag, 0x7fffffff, 0x7ffffffd},
    647                                     {NoFlag, 0x7fffffff, 0x7ffffffe},
    648                                     {NoFlag, 0x7fffffff, 0x80000000},
    649                                     {NoFlag, 0x7fffffff, 0x80000001},
    650                                     {NoFlag, 0x7fffffff, 0xaaaaaaaa},
    651                                     {NoFlag, 0x7fffffff, 0xcccccccc},
    652                                     {NoFlag, 0x7fffffff, 0xffff8000},
    653                                     {NoFlag, 0x7fffffff, 0xffff8001},
    654                                     {NoFlag, 0x7fffffff, 0xffff8002},
    655                                     {NoFlag, 0x7fffffff, 0xffff8003},
    656                                     {NoFlag, 0x7fffffff, 0xffffff80},
    657                                     {NoFlag, 0x7fffffff, 0xffffff81},
    658                                     {NoFlag, 0x7fffffff, 0xffffff82},
    659                                     {NoFlag, 0x7fffffff, 0xffffff83},
    660                                     {NoFlag, 0x7fffffff, 0xffffffe0},
    661                                     {NoFlag, 0x7fffffff, 0xfffffffd},
    662                                     {NoFlag, 0x7fffffff, 0xfffffffe},
    663                                     {NoFlag, 0x7fffffff, 0xffffffff},
    664                                     {NoFlag, 0x80000000, 0x00000000},
    665                                     {NoFlag, 0x80000000, 0x00000001},
    666                                     {NoFlag, 0x80000000, 0x00000002},
    667                                     {NoFlag, 0x80000000, 0x00000020},
    668                                     {NoFlag, 0x80000000, 0x0000007d},
    669                                     {NoFlag, 0x80000000, 0x0000007e},
    670                                     {NoFlag, 0x80000000, 0x0000007f},
    671                                     {NoFlag, 0x80000000, 0x00007ffd},
    672                                     {NoFlag, 0x80000000, 0x00007ffe},
    673                                     {NoFlag, 0x80000000, 0x00007fff},
    674                                     {NoFlag, 0x80000000, 0x33333333},
    675                                     {NoFlag, 0x80000000, 0x55555555},
    676                                     {NoFlag, 0x80000000, 0x7ffffffd},
    677                                     {NoFlag, 0x80000000, 0x7ffffffe},
    678                                     {NoFlag, 0x80000000, 0x7fffffff},
    679                                     {NoFlag, 0x80000000, 0x80000001},
    680                                     {NoFlag, 0x80000000, 0xaaaaaaaa},
    681                                     {NoFlag, 0x80000000, 0xcccccccc},
    682                                     {NoFlag, 0x80000000, 0xffff8000},
    683                                     {NoFlag, 0x80000000, 0xffff8001},
    684                                     {NoFlag, 0x80000000, 0xffff8002},
    685                                     {NoFlag, 0x80000000, 0xffff8003},
    686                                     {NoFlag, 0x80000000, 0xffffff80},
    687                                     {NoFlag, 0x80000000, 0xffffff81},
    688                                     {NoFlag, 0x80000000, 0xffffff82},
    689                                     {NoFlag, 0x80000000, 0xffffff83},
    690                                     {NoFlag, 0x80000000, 0xffffffe0},
    691                                     {NoFlag, 0x80000000, 0xfffffffd},
    692                                     {NoFlag, 0x80000000, 0xfffffffe},
    693                                     {NoFlag, 0x80000000, 0xffffffff},
    694                                     {NoFlag, 0x80000001, 0x00000000},
    695                                     {NoFlag, 0x80000001, 0x00000001},
    696                                     {NoFlag, 0x80000001, 0x00000002},
    697                                     {NoFlag, 0x80000001, 0x00000020},
    698                                     {NoFlag, 0x80000001, 0x0000007d},
    699                                     {NoFlag, 0x80000001, 0x0000007e},
    700                                     {NoFlag, 0x80000001, 0x0000007f},
    701                                     {NoFlag, 0x80000001, 0x00007ffd},
    702                                     {NoFlag, 0x80000001, 0x00007ffe},
    703                                     {NoFlag, 0x80000001, 0x00007fff},
    704                                     {NoFlag, 0x80000001, 0x33333333},
    705                                     {NoFlag, 0x80000001, 0x55555555},
    706                                     {NoFlag, 0x80000001, 0x7ffffffd},
    707                                     {NoFlag, 0x80000001, 0x7ffffffe},
    708                                     {NoFlag, 0x80000001, 0x7fffffff},
    709                                     {NoFlag, 0x80000001, 0x80000000},
    710                                     {NoFlag, 0x80000001, 0xaaaaaaaa},
    711                                     {NoFlag, 0x80000001, 0xcccccccc},
    712                                     {NoFlag, 0x80000001, 0xffff8000},
    713                                     {NoFlag, 0x80000001, 0xffff8001},
    714                                     {NoFlag, 0x80000001, 0xffff8002},
    715                                     {NoFlag, 0x80000001, 0xffff8003},
    716                                     {NoFlag, 0x80000001, 0xffffff80},
    717                                     {NoFlag, 0x80000001, 0xffffff81},
    718                                     {NoFlag, 0x80000001, 0xffffff82},
    719                                     {NoFlag, 0x80000001, 0xffffff83},
    720                                     {NoFlag, 0x80000001, 0xffffffe0},
    721                                     {NoFlag, 0x80000001, 0xfffffffd},
    722                                     {NoFlag, 0x80000001, 0xfffffffe},
    723                                     {NoFlag, 0x80000001, 0xffffffff},
    724                                     {NoFlag, 0xaaaaaaaa, 0x00000000},
    725                                     {NoFlag, 0xaaaaaaaa, 0x00000001},
    726                                     {NoFlag, 0xaaaaaaaa, 0x00000002},
    727                                     {NoFlag, 0xaaaaaaaa, 0x00000020},
    728                                     {NoFlag, 0xaaaaaaaa, 0x0000007d},
    729                                     {NoFlag, 0xaaaaaaaa, 0x0000007e},
    730                                     {NoFlag, 0xaaaaaaaa, 0x0000007f},
    731                                     {NoFlag, 0xaaaaaaaa, 0x00007ffd},
    732                                     {NoFlag, 0xaaaaaaaa, 0x00007ffe},
    733                                     {NoFlag, 0xaaaaaaaa, 0x00007fff},
    734                                     {NoFlag, 0xaaaaaaaa, 0x33333333},
    735                                     {NoFlag, 0xaaaaaaaa, 0x55555555},
    736                                     {NoFlag, 0xaaaaaaaa, 0x7ffffffd},
    737                                     {NoFlag, 0xaaaaaaaa, 0x7ffffffe},
    738                                     {NoFlag, 0xaaaaaaaa, 0x7fffffff},
    739                                     {NoFlag, 0xaaaaaaaa, 0x80000000},
    740                                     {NoFlag, 0xaaaaaaaa, 0x80000001},
    741                                     {NoFlag, 0xaaaaaaaa, 0xcccccccc},
    742                                     {NoFlag, 0xaaaaaaaa, 0xffff8000},
    743                                     {NoFlag, 0xaaaaaaaa, 0xffff8001},
    744                                     {NoFlag, 0xaaaaaaaa, 0xffff8002},
    745                                     {NoFlag, 0xaaaaaaaa, 0xffff8003},
    746                                     {NoFlag, 0xaaaaaaaa, 0xffffff80},
    747                                     {NoFlag, 0xaaaaaaaa, 0xffffff81},
    748                                     {NoFlag, 0xaaaaaaaa, 0xffffff82},
    749                                     {NoFlag, 0xaaaaaaaa, 0xffffff83},
    750                                     {NoFlag, 0xaaaaaaaa, 0xffffffe0},
    751                                     {NoFlag, 0xaaaaaaaa, 0xfffffffd},
    752                                     {NoFlag, 0xaaaaaaaa, 0xfffffffe},
    753                                     {NoFlag, 0xaaaaaaaa, 0xffffffff},
    754                                     {NoFlag, 0xcccccccc, 0x00000000},
    755                                     {NoFlag, 0xcccccccc, 0x00000001},
    756                                     {NoFlag, 0xcccccccc, 0x00000002},
    757                                     {NoFlag, 0xcccccccc, 0x00000020},
    758                                     {NoFlag, 0xcccccccc, 0x0000007d},
    759                                     {NoFlag, 0xcccccccc, 0x0000007e},
    760                                     {NoFlag, 0xcccccccc, 0x0000007f},
    761                                     {NoFlag, 0xcccccccc, 0x00007ffd},
    762                                     {NoFlag, 0xcccccccc, 0x00007ffe},
    763                                     {NoFlag, 0xcccccccc, 0x00007fff},
    764                                     {NoFlag, 0xcccccccc, 0x33333333},
    765                                     {NoFlag, 0xcccccccc, 0x55555555},
    766                                     {NoFlag, 0xcccccccc, 0x7ffffffd},
    767                                     {NoFlag, 0xcccccccc, 0x7ffffffe},
    768                                     {NoFlag, 0xcccccccc, 0x7fffffff},
    769                                     {NoFlag, 0xcccccccc, 0x80000000},
    770                                     {NoFlag, 0xcccccccc, 0x80000001},
    771                                     {NoFlag, 0xcccccccc, 0xaaaaaaaa},
    772                                     {NoFlag, 0xcccccccc, 0xffff8000},
    773                                     {NoFlag, 0xcccccccc, 0xffff8001},
    774                                     {NoFlag, 0xcccccccc, 0xffff8002},
    775                                     {NoFlag, 0xcccccccc, 0xffff8003},
    776                                     {NoFlag, 0xcccccccc, 0xffffff80},
    777                                     {NoFlag, 0xcccccccc, 0xffffff81},
    778                                     {NoFlag, 0xcccccccc, 0xffffff82},
    779                                     {NoFlag, 0xcccccccc, 0xffffff83},
    780                                     {NoFlag, 0xcccccccc, 0xffffffe0},
    781                                     {NoFlag, 0xcccccccc, 0xfffffffd},
    782                                     {NoFlag, 0xcccccccc, 0xfffffffe},
    783                                     {NoFlag, 0xcccccccc, 0xffffffff},
    784                                     {NoFlag, 0xffff8000, 0x00000000},
    785                                     {NoFlag, 0xffff8000, 0x00000001},
    786                                     {NoFlag, 0xffff8000, 0x00000002},
    787                                     {NoFlag, 0xffff8000, 0x00000020},
    788                                     {NoFlag, 0xffff8000, 0x0000007d},
    789                                     {NoFlag, 0xffff8000, 0x0000007e},
    790                                     {NoFlag, 0xffff8000, 0x0000007f},
    791                                     {NoFlag, 0xffff8000, 0x00007ffd},
    792                                     {NoFlag, 0xffff8000, 0x00007ffe},
    793                                     {NoFlag, 0xffff8000, 0x00007fff},
    794                                     {NoFlag, 0xffff8000, 0x33333333},
    795                                     {NoFlag, 0xffff8000, 0x55555555},
    796                                     {NoFlag, 0xffff8000, 0x7ffffffd},
    797                                     {NoFlag, 0xffff8000, 0x7ffffffe},
    798                                     {NoFlag, 0xffff8000, 0x7fffffff},
    799                                     {NoFlag, 0xffff8000, 0x80000000},
    800                                     {NoFlag, 0xffff8000, 0x80000001},
    801                                     {NoFlag, 0xffff8000, 0xaaaaaaaa},
    802                                     {NoFlag, 0xffff8000, 0xcccccccc},
    803                                     {NoFlag, 0xffff8000, 0xffff8001},
    804                                     {NoFlag, 0xffff8000, 0xffff8002},
    805                                     {NoFlag, 0xffff8000, 0xffff8003},
    806                                     {NoFlag, 0xffff8000, 0xffffff80},
    807                                     {NoFlag, 0xffff8000, 0xffffff81},
    808                                     {NoFlag, 0xffff8000, 0xffffff82},
    809                                     {NoFlag, 0xffff8000, 0xffffff83},
    810                                     {NoFlag, 0xffff8000, 0xffffffe0},
    811                                     {NoFlag, 0xffff8000, 0xfffffffd},
    812                                     {NoFlag, 0xffff8000, 0xfffffffe},
    813                                     {NoFlag, 0xffff8000, 0xffffffff},
    814                                     {NoFlag, 0xffff8001, 0x00000000},
    815                                     {NoFlag, 0xffff8001, 0x00000001},
    816                                     {NoFlag, 0xffff8001, 0x00000002},
    817                                     {NoFlag, 0xffff8001, 0x00000020},
    818                                     {NoFlag, 0xffff8001, 0x0000007d},
    819                                     {NoFlag, 0xffff8001, 0x0000007e},
    820                                     {NoFlag, 0xffff8001, 0x0000007f},
    821                                     {NoFlag, 0xffff8001, 0x00007ffd},
    822                                     {NoFlag, 0xffff8001, 0x00007ffe},
    823                                     {NoFlag, 0xffff8001, 0x00007fff},
    824                                     {NoFlag, 0xffff8001, 0x33333333},
    825                                     {NoFlag, 0xffff8001, 0x55555555},
    826                                     {NoFlag, 0xffff8001, 0x7ffffffd},
    827                                     {NoFlag, 0xffff8001, 0x7ffffffe},
    828                                     {NoFlag, 0xffff8001, 0x7fffffff},
    829                                     {NoFlag, 0xffff8001, 0x80000000},
    830                                     {NoFlag, 0xffff8001, 0x80000001},
    831                                     {NoFlag, 0xffff8001, 0xaaaaaaaa},
    832                                     {NoFlag, 0xffff8001, 0xcccccccc},
    833                                     {NoFlag, 0xffff8001, 0xffff8000},
    834                                     {NoFlag, 0xffff8001, 0xffff8002},
    835                                     {NoFlag, 0xffff8001, 0xffff8003},
    836                                     {NoFlag, 0xffff8001, 0xffffff80},
    837                                     {NoFlag, 0xffff8001, 0xffffff81},
    838                                     {NoFlag, 0xffff8001, 0xffffff82},
    839                                     {NoFlag, 0xffff8001, 0xffffff83},
    840                                     {NoFlag, 0xffff8001, 0xffffffe0},
    841                                     {NoFlag, 0xffff8001, 0xfffffffd},
    842                                     {NoFlag, 0xffff8001, 0xfffffffe},
    843                                     {NoFlag, 0xffff8001, 0xffffffff},
    844                                     {NoFlag, 0xffff8002, 0x00000000},
    845                                     {NoFlag, 0xffff8002, 0x00000001},
    846                                     {NoFlag, 0xffff8002, 0x00000002},
    847                                     {NoFlag, 0xffff8002, 0x00000020},
    848                                     {NoFlag, 0xffff8002, 0x0000007d},
    849                                     {NoFlag, 0xffff8002, 0x0000007e},
    850                                     {NoFlag, 0xffff8002, 0x0000007f},
    851                                     {NoFlag, 0xffff8002, 0x00007ffd},
    852                                     {NoFlag, 0xffff8002, 0x00007ffe},
    853                                     {NoFlag, 0xffff8002, 0x00007fff},
    854                                     {NoFlag, 0xffff8002, 0x33333333},
    855                                     {NoFlag, 0xffff8002, 0x55555555},
    856                                     {NoFlag, 0xffff8002, 0x7ffffffd},
    857                                     {NoFlag, 0xffff8002, 0x7ffffffe},
    858                                     {NoFlag, 0xffff8002, 0x7fffffff},
    859                                     {NoFlag, 0xffff8002, 0x80000000},
    860                                     {NoFlag, 0xffff8002, 0x80000001},
    861                                     {NoFlag, 0xffff8002, 0xaaaaaaaa},
    862                                     {NoFlag, 0xffff8002, 0xcccccccc},
    863                                     {NoFlag, 0xffff8002, 0xffff8000},
    864                                     {NoFlag, 0xffff8002, 0xffff8001},
    865                                     {NoFlag, 0xffff8002, 0xffff8003},
    866                                     {NoFlag, 0xffff8002, 0xffffff80},
    867                                     {NoFlag, 0xffff8002, 0xffffff81},
    868                                     {NoFlag, 0xffff8002, 0xffffff82},
    869                                     {NoFlag, 0xffff8002, 0xffffff83},
    870                                     {NoFlag, 0xffff8002, 0xffffffe0},
    871                                     {NoFlag, 0xffff8002, 0xfffffffd},
    872                                     {NoFlag, 0xffff8002, 0xfffffffe},
    873                                     {NoFlag, 0xffff8002, 0xffffffff},
    874                                     {NoFlag, 0xffff8003, 0x00000000},
    875                                     {NoFlag, 0xffff8003, 0x00000001},
    876                                     {NoFlag, 0xffff8003, 0x00000002},
    877                                     {NoFlag, 0xffff8003, 0x00000020},
    878                                     {NoFlag, 0xffff8003, 0x0000007d},
    879                                     {NoFlag, 0xffff8003, 0x0000007e},
    880                                     {NoFlag, 0xffff8003, 0x0000007f},
    881                                     {NoFlag, 0xffff8003, 0x00007ffd},
    882                                     {NoFlag, 0xffff8003, 0x00007ffe},
    883                                     {NoFlag, 0xffff8003, 0x00007fff},
    884                                     {NoFlag, 0xffff8003, 0x33333333},
    885                                     {NoFlag, 0xffff8003, 0x55555555},
    886                                     {NoFlag, 0xffff8003, 0x7ffffffd},
    887                                     {NoFlag, 0xffff8003, 0x7ffffffe},
    888                                     {NoFlag, 0xffff8003, 0x7fffffff},
    889                                     {NoFlag, 0xffff8003, 0x80000000},
    890                                     {NoFlag, 0xffff8003, 0x80000001},
    891                                     {NoFlag, 0xffff8003, 0xaaaaaaaa},
    892                                     {NoFlag, 0xffff8003, 0xcccccccc},
    893                                     {NoFlag, 0xffff8003, 0xffff8000},
    894                                     {NoFlag, 0xffff8003, 0xffff8001},
    895                                     {NoFlag, 0xffff8003, 0xffff8002},
    896                                     {NoFlag, 0xffff8003, 0xffffff80},
    897                                     {NoFlag, 0xffff8003, 0xffffff81},
    898                                     {NoFlag, 0xffff8003, 0xffffff82},
    899                                     {NoFlag, 0xffff8003, 0xffffff83},
    900                                     {NoFlag, 0xffff8003, 0xffffffe0},
    901                                     {NoFlag, 0xffff8003, 0xfffffffd},
    902                                     {NoFlag, 0xffff8003, 0xfffffffe},
    903                                     {NoFlag, 0xffff8003, 0xffffffff},
    904                                     {NoFlag, 0xffffff80, 0x00000000},
    905                                     {NoFlag, 0xffffff80, 0x00000001},
    906                                     {NoFlag, 0xffffff80, 0x00000002},
    907                                     {NoFlag, 0xffffff80, 0x00000020},
    908                                     {NoFlag, 0xffffff80, 0x0000007d},
    909                                     {NoFlag, 0xffffff80, 0x0000007e},
    910                                     {NoFlag, 0xffffff80, 0x0000007f},
    911                                     {NoFlag, 0xffffff80, 0x00007ffd},
    912                                     {NoFlag, 0xffffff80, 0x00007ffe},
    913                                     {NoFlag, 0xffffff80, 0x00007fff},
    914                                     {NoFlag, 0xffffff80, 0x33333333},
    915                                     {NoFlag, 0xffffff80, 0x55555555},
    916                                     {NoFlag, 0xffffff80, 0x7ffffffd},
    917                                     {NoFlag, 0xffffff80, 0x7ffffffe},
    918                                     {NoFlag, 0xffffff80, 0x7fffffff},
    919                                     {NoFlag, 0xffffff80, 0x80000000},
    920                                     {NoFlag, 0xffffff80, 0x80000001},
    921                                     {NoFlag, 0xffffff80, 0xaaaaaaaa},
    922                                     {NoFlag, 0xffffff80, 0xcccccccc},
    923                                     {NoFlag, 0xffffff80, 0xffff8000},
    924                                     {NoFlag, 0xffffff80, 0xffff8001},
    925                                     {NoFlag, 0xffffff80, 0xffff8002},
    926                                     {NoFlag, 0xffffff80, 0xffff8003},
    927                                     {NoFlag, 0xffffff80, 0xffffff81},
    928                                     {NoFlag, 0xffffff80, 0xffffff82},
    929                                     {NoFlag, 0xffffff80, 0xffffff83},
    930                                     {NoFlag, 0xffffff80, 0xffffffe0},
    931                                     {NoFlag, 0xffffff80, 0xfffffffd},
    932                                     {NoFlag, 0xffffff80, 0xfffffffe},
    933                                     {NoFlag, 0xffffff80, 0xffffffff},
    934                                     {NoFlag, 0xffffff81, 0x00000000},
    935                                     {NoFlag, 0xffffff81, 0x00000001},
    936                                     {NoFlag, 0xffffff81, 0x00000002},
    937                                     {NoFlag, 0xffffff81, 0x00000020},
    938                                     {NoFlag, 0xffffff81, 0x0000007d},
    939                                     {NoFlag, 0xffffff81, 0x0000007e},
    940                                     {NoFlag, 0xffffff81, 0x0000007f},
    941                                     {NoFlag, 0xffffff81, 0x00007ffd},
    942                                     {NoFlag, 0xffffff81, 0x00007ffe},
    943                                     {NoFlag, 0xffffff81, 0x00007fff},
    944                                     {NoFlag, 0xffffff81, 0x33333333},
    945                                     {NoFlag, 0xffffff81, 0x55555555},
    946                                     {NoFlag, 0xffffff81, 0x7ffffffd},
    947                                     {NoFlag, 0xffffff81, 0x7ffffffe},
    948                                     {NoFlag, 0xffffff81, 0x7fffffff},
    949                                     {NoFlag, 0xffffff81, 0x80000000},
    950                                     {NoFlag, 0xffffff81, 0x80000001},
    951                                     {NoFlag, 0xffffff81, 0xaaaaaaaa},
    952                                     {NoFlag, 0xffffff81, 0xcccccccc},
    953                                     {NoFlag, 0xffffff81, 0xffff8000},
    954                                     {NoFlag, 0xffffff81, 0xffff8001},
    955                                     {NoFlag, 0xffffff81, 0xffff8002},
    956                                     {NoFlag, 0xffffff81, 0xffff8003},
    957                                     {NoFlag, 0xffffff81, 0xffffff80},
    958                                     {NoFlag, 0xffffff81, 0xffffff82},
    959                                     {NoFlag, 0xffffff81, 0xffffff83},
    960                                     {NoFlag, 0xffffff81, 0xffffffe0},
    961                                     {NoFlag, 0xffffff81, 0xfffffffd},
    962                                     {NoFlag, 0xffffff81, 0xfffffffe},
    963                                     {NoFlag, 0xffffff81, 0xffffffff},
    964                                     {NoFlag, 0xffffff82, 0x00000000},
    965                                     {NoFlag, 0xffffff82, 0x00000001},
    966                                     {NoFlag, 0xffffff82, 0x00000002},
    967                                     {NoFlag, 0xffffff82, 0x00000020},
    968                                     {NoFlag, 0xffffff82, 0x0000007d},
    969                                     {NoFlag, 0xffffff82, 0x0000007e},
    970                                     {NoFlag, 0xffffff82, 0x0000007f},
    971                                     {NoFlag, 0xffffff82, 0x00007ffd},
    972                                     {NoFlag, 0xffffff82, 0x00007ffe},
    973                                     {NoFlag, 0xffffff82, 0x00007fff},
    974                                     {NoFlag, 0xffffff82, 0x33333333},
    975                                     {NoFlag, 0xffffff82, 0x55555555},
    976                                     {NoFlag, 0xffffff82, 0x7ffffffd},
    977                                     {NoFlag, 0xffffff82, 0x7ffffffe},
    978                                     {NoFlag, 0xffffff82, 0x7fffffff},
    979                                     {NoFlag, 0xffffff82, 0x80000000},
    980                                     {NoFlag, 0xffffff82, 0x80000001},
    981                                     {NoFlag, 0xffffff82, 0xaaaaaaaa},
    982                                     {NoFlag, 0xffffff82, 0xcccccccc},
    983                                     {NoFlag, 0xffffff82, 0xffff8000},
    984                                     {NoFlag, 0xffffff82, 0xffff8001},
    985                                     {NoFlag, 0xffffff82, 0xffff8002},
    986                                     {NoFlag, 0xffffff82, 0xffff8003},
    987                                     {NoFlag, 0xffffff82, 0xffffff80},
    988                                     {NoFlag, 0xffffff82, 0xffffff81},
    989                                     {NoFlag, 0xffffff82, 0xffffff83},
    990                                     {NoFlag, 0xffffff82, 0xffffffe0},
    991                                     {NoFlag, 0xffffff82, 0xfffffffd},
    992                                     {NoFlag, 0xffffff82, 0xfffffffe},
    993                                     {NoFlag, 0xffffff82, 0xffffffff},
    994                                     {NoFlag, 0xffffff83, 0x00000000},
    995                                     {NoFlag, 0xffffff83, 0x00000001},
    996                                     {NoFlag, 0xffffff83, 0x00000002},
    997                                     {NoFlag, 0xffffff83, 0x00000020},
    998                                     {NoFlag, 0xffffff83, 0x0000007d},
    999                                     {NoFlag, 0xffffff83, 0x0000007e},
   1000                                     {NoFlag, 0xffffff83, 0x0000007f},
   1001                                     {NoFlag, 0xffffff83, 0x00007ffd},
   1002                                     {NoFlag, 0xffffff83, 0x00007ffe},
   1003                                     {NoFlag, 0xffffff83, 0x00007fff},
   1004                                     {NoFlag, 0xffffff83, 0x33333333},
   1005                                     {NoFlag, 0xffffff83, 0x55555555},
   1006                                     {NoFlag, 0xffffff83, 0x7ffffffd},
   1007                                     {NoFlag, 0xffffff83, 0x7ffffffe},
   1008                                     {NoFlag, 0xffffff83, 0x7fffffff},
   1009                                     {NoFlag, 0xffffff83, 0x80000000},
   1010                                     {NoFlag, 0xffffff83, 0x80000001},
   1011                                     {NoFlag, 0xffffff83, 0xaaaaaaaa},
   1012                                     {NoFlag, 0xffffff83, 0xcccccccc},
   1013                                     {NoFlag, 0xffffff83, 0xffff8000},
   1014                                     {NoFlag, 0xffffff83, 0xffff8001},
   1015                                     {NoFlag, 0xffffff83, 0xffff8002},
   1016                                     {NoFlag, 0xffffff83, 0xffff8003},
   1017                                     {NoFlag, 0xffffff83, 0xffffff80},
   1018                                     {NoFlag, 0xffffff83, 0xffffff81},
   1019                                     {NoFlag, 0xffffff83, 0xffffff82},
   1020                                     {NoFlag, 0xffffff83, 0xffffffe0},
   1021                                     {NoFlag, 0xffffff83, 0xfffffffd},
   1022                                     {NoFlag, 0xffffff83, 0xfffffffe},
   1023                                     {NoFlag, 0xffffff83, 0xffffffff},
   1024                                     {NoFlag, 0xffffffe0, 0x00000000},
   1025                                     {NoFlag, 0xffffffe0, 0x00000001},
   1026                                     {NoFlag, 0xffffffe0, 0x00000002},
   1027                                     {NoFlag, 0xffffffe0, 0x00000020},
   1028                                     {NoFlag, 0xffffffe0, 0x0000007d},
   1029                                     {NoFlag, 0xffffffe0, 0x0000007e},
   1030                                     {NoFlag, 0xffffffe0, 0x0000007f},
   1031                                     {NoFlag, 0xffffffe0, 0x00007ffd},
   1032                                     {NoFlag, 0xffffffe0, 0x00007ffe},
   1033                                     {NoFlag, 0xffffffe0, 0x00007fff},
   1034                                     {NoFlag, 0xffffffe0, 0x33333333},
   1035                                     {NoFlag, 0xffffffe0, 0x55555555},
   1036                                     {NoFlag, 0xffffffe0, 0x7ffffffd},
   1037                                     {NoFlag, 0xffffffe0, 0x7ffffffe},
   1038                                     {NoFlag, 0xffffffe0, 0x7fffffff},
   1039                                     {NoFlag, 0xffffffe0, 0x80000000},
   1040                                     {NoFlag, 0xffffffe0, 0x80000001},
   1041                                     {NoFlag, 0xffffffe0, 0xaaaaaaaa},
   1042                                     {NoFlag, 0xffffffe0, 0xcccccccc},
   1043                                     {NoFlag, 0xffffffe0, 0xffff8000},
   1044                                     {NoFlag, 0xffffffe0, 0xffff8001},
   1045                                     {NoFlag, 0xffffffe0, 0xffff8002},
   1046                                     {NoFlag, 0xffffffe0, 0xffff8003},
   1047                                     {NoFlag, 0xffffffe0, 0xffffff80},
   1048                                     {NoFlag, 0xffffffe0, 0xffffff81},
   1049                                     {NoFlag, 0xffffffe0, 0xffffff82},
   1050                                     {NoFlag, 0xffffffe0, 0xffffff83},
   1051                                     {NoFlag, 0xffffffe0, 0xfffffffd},
   1052                                     {NoFlag, 0xffffffe0, 0xfffffffe},
   1053                                     {NoFlag, 0xffffffe0, 0xffffffff},
   1054                                     {NoFlag, 0xfffffffd, 0x00000000},
   1055                                     {NoFlag, 0xfffffffd, 0x00000001},
   1056                                     {NoFlag, 0xfffffffd, 0x00000002},
   1057                                     {NoFlag, 0xfffffffd, 0x00000020},
   1058                                     {NoFlag, 0xfffffffd, 0x0000007d},
   1059                                     {NoFlag, 0xfffffffd, 0x0000007e},
   1060                                     {NoFlag, 0xfffffffd, 0x0000007f},
   1061                                     {NoFlag, 0xfffffffd, 0x00007ffd},
   1062                                     {NoFlag, 0xfffffffd, 0x00007ffe},
   1063                                     {NoFlag, 0xfffffffd, 0x00007fff},
   1064                                     {NoFlag, 0xfffffffd, 0x33333333},
   1065                                     {NoFlag, 0xfffffffd, 0x55555555},
   1066                                     {NoFlag, 0xfffffffd, 0x7ffffffd},
   1067                                     {NoFlag, 0xfffffffd, 0x7ffffffe},
   1068                                     {NoFlag, 0xfffffffd, 0x7fffffff},
   1069                                     {NoFlag, 0xfffffffd, 0x80000000},
   1070                                     {NoFlag, 0xfffffffd, 0x80000001},
   1071                                     {NoFlag, 0xfffffffd, 0xaaaaaaaa},
   1072                                     {NoFlag, 0xfffffffd, 0xcccccccc},
   1073                                     {NoFlag, 0xfffffffd, 0xffff8000},
   1074                                     {NoFlag, 0xfffffffd, 0xffff8001},
   1075                                     {NoFlag, 0xfffffffd, 0xffff8002},
   1076                                     {NoFlag, 0xfffffffd, 0xffff8003},
   1077                                     {NoFlag, 0xfffffffd, 0xffffff80},
   1078                                     {NoFlag, 0xfffffffd, 0xffffff81},
   1079                                     {NoFlag, 0xfffffffd, 0xffffff82},
   1080                                     {NoFlag, 0xfffffffd, 0xffffff83},
   1081                                     {NoFlag, 0xfffffffd, 0xffffffe0},
   1082                                     {NoFlag, 0xfffffffd, 0xfffffffe},
   1083                                     {NoFlag, 0xfffffffd, 0xffffffff},
   1084                                     {NoFlag, 0xfffffffe, 0x00000000},
   1085                                     {NoFlag, 0xfffffffe, 0x00000001},
   1086                                     {NoFlag, 0xfffffffe, 0x00000002},
   1087                                     {NoFlag, 0xfffffffe, 0x00000020},
   1088                                     {NoFlag, 0xfffffffe, 0x0000007d},
   1089                                     {NoFlag, 0xfffffffe, 0x0000007e},
   1090                                     {NoFlag, 0xfffffffe, 0x0000007f},
   1091                                     {NoFlag, 0xfffffffe, 0x00007ffd},
   1092                                     {NoFlag, 0xfffffffe, 0x00007ffe},
   1093                                     {NoFlag, 0xfffffffe, 0x00007fff},
   1094                                     {NoFlag, 0xfffffffe, 0x33333333},
   1095                                     {NoFlag, 0xfffffffe, 0x55555555},
   1096                                     {NoFlag, 0xfffffffe, 0x7ffffffd},
   1097                                     {NoFlag, 0xfffffffe, 0x7ffffffe},
   1098                                     {NoFlag, 0xfffffffe, 0x7fffffff},
   1099                                     {NoFlag, 0xfffffffe, 0x80000000},
   1100                                     {NoFlag, 0xfffffffe, 0x80000001},
   1101                                     {NoFlag, 0xfffffffe, 0xaaaaaaaa},
   1102                                     {NoFlag, 0xfffffffe, 0xcccccccc},
   1103                                     {NoFlag, 0xfffffffe, 0xffff8000},
   1104                                     {NoFlag, 0xfffffffe, 0xffff8001},
   1105                                     {NoFlag, 0xfffffffe, 0xffff8002},
   1106                                     {NoFlag, 0xfffffffe, 0xffff8003},
   1107                                     {NoFlag, 0xfffffffe, 0xffffff80},
   1108                                     {NoFlag, 0xfffffffe, 0xffffff81},
   1109                                     {NoFlag, 0xfffffffe, 0xffffff82},
   1110                                     {NoFlag, 0xfffffffe, 0xffffff83},
   1111                                     {NoFlag, 0xfffffffe, 0xffffffe0},
   1112                                     {NoFlag, 0xfffffffe, 0xfffffffd},
   1113                                     {NoFlag, 0xfffffffe, 0xffffffff},
   1114                                     {NoFlag, 0xffffffff, 0x00000000},
   1115                                     {NoFlag, 0xffffffff, 0x00000001},
   1116                                     {NoFlag, 0xffffffff, 0x00000002},
   1117                                     {NoFlag, 0xffffffff, 0x00000020},
   1118                                     {NoFlag, 0xffffffff, 0x0000007d},
   1119                                     {NoFlag, 0xffffffff, 0x0000007e},
   1120                                     {NoFlag, 0xffffffff, 0x0000007f},
   1121                                     {NoFlag, 0xffffffff, 0x00007ffd},
   1122                                     {NoFlag, 0xffffffff, 0x00007ffe},
   1123                                     {NoFlag, 0xffffffff, 0x00007fff},
   1124                                     {NoFlag, 0xffffffff, 0x33333333},
   1125                                     {NoFlag, 0xffffffff, 0x55555555},
   1126                                     {NoFlag, 0xffffffff, 0x7ffffffd},
   1127                                     {NoFlag, 0xffffffff, 0x7ffffffe},
   1128                                     {NoFlag, 0xffffffff, 0x7fffffff},
   1129                                     {NoFlag, 0xffffffff, 0x80000000},
   1130                                     {NoFlag, 0xffffffff, 0x80000001},
   1131                                     {NoFlag, 0xffffffff, 0xaaaaaaaa},
   1132                                     {NoFlag, 0xffffffff, 0xcccccccc},
   1133                                     {NoFlag, 0xffffffff, 0xffff8000},
   1134                                     {NoFlag, 0xffffffff, 0xffff8001},
   1135                                     {NoFlag, 0xffffffff, 0xffff8002},
   1136                                     {NoFlag, 0xffffffff, 0xffff8003},
   1137                                     {NoFlag, 0xffffffff, 0xffffff80},
   1138                                     {NoFlag, 0xffffffff, 0xffffff81},
   1139                                     {NoFlag, 0xffffffff, 0xffffff82},
   1140                                     {NoFlag, 0xffffffff, 0xffffff83},
   1141                                     {NoFlag, 0xffffffff, 0xffffffe0},
   1142                                     {NoFlag, 0xffffffff, 0xfffffffd},
   1143                                     {NoFlag, 0xffffffff, 0xfffffffe}};
   1144 
   1145 
   1146 // A loop will be generated for each element of this array.
   1147 const TestLoopData kTests[] = {
   1148     {{eq, r0, r0},
   1149      "eq r0 r0",
   1150      "Condition_eq_r0_r0",
   1151      ARRAY_SIZE(kCondition),
   1152      kCondition},
   1153     {{ne, r0, r0},
   1154      "ne r0 r0",
   1155      "Condition_ne_r0_r0",
   1156      ARRAY_SIZE(kCondition),
   1157      kCondition},
   1158     {{cs, r0, r0},
   1159      "cs r0 r0",
   1160      "Condition_cs_r0_r0",
   1161      ARRAY_SIZE(kCondition),
   1162      kCondition},
   1163     {{cc, r0, r0},
   1164      "cc r0 r0",
   1165      "Condition_cc_r0_r0",
   1166      ARRAY_SIZE(kCondition),
   1167      kCondition},
   1168     {{mi, r0, r0},
   1169      "mi r0 r0",
   1170      "Condition_mi_r0_r0",
   1171      ARRAY_SIZE(kCondition),
   1172      kCondition},
   1173     {{pl, r0, r0},
   1174      "pl r0 r0",
   1175      "Condition_pl_r0_r0",
   1176      ARRAY_SIZE(kCondition),
   1177      kCondition},
   1178     {{vs, r0, r0},
   1179      "vs r0 r0",
   1180      "Condition_vs_r0_r0",
   1181      ARRAY_SIZE(kCondition),
   1182      kCondition},
   1183     {{vc, r0, r0},
   1184      "vc r0 r0",
   1185      "Condition_vc_r0_r0",
   1186      ARRAY_SIZE(kCondition),
   1187      kCondition},
   1188     {{hi, r0, r0},
   1189      "hi r0 r0",
   1190      "Condition_hi_r0_r0",
   1191      ARRAY_SIZE(kCondition),
   1192      kCondition},
   1193     {{ls, r0, r0},
   1194      "ls r0 r0",
   1195      "Condition_ls_r0_r0",
   1196      ARRAY_SIZE(kCondition),
   1197      kCondition},
   1198     {{ge, r0, r0},
   1199      "ge r0 r0",
   1200      "Condition_ge_r0_r0",
   1201      ARRAY_SIZE(kCondition),
   1202      kCondition},
   1203     {{lt, r0, r0},
   1204      "lt r0 r0",
   1205      "Condition_lt_r0_r0",
   1206      ARRAY_SIZE(kCondition),
   1207      kCondition},
   1208     {{gt, r0, r0},
   1209      "gt r0 r0",
   1210      "Condition_gt_r0_r0",
   1211      ARRAY_SIZE(kCondition),
   1212      kCondition},
   1213     {{le, r0, r0},
   1214      "le r0 r0",
   1215      "Condition_le_r0_r0",
   1216      ARRAY_SIZE(kCondition),
   1217      kCondition},
   1218     {{al, r0, r0},
   1219      "al r0 r0",
   1220      "Condition_al_r0_r0",
   1221      ARRAY_SIZE(kCondition),
   1222      kCondition},
   1223     {{al, r0, r0}, "al r0 r0", "RdIsRn_al_r0_r0", ARRAY_SIZE(kRdIsRn), kRdIsRn},
   1224     {{al, r1, r1}, "al r1 r1", "RdIsRn_al_r1_r1", ARRAY_SIZE(kRdIsRn), kRdIsRn},
   1225     {{al, r2, r2}, "al r2 r2", "RdIsRn_al_r2_r2", ARRAY_SIZE(kRdIsRn), kRdIsRn},
   1226     {{al, r3, r3}, "al r3 r3", "RdIsRn_al_r3_r3", ARRAY_SIZE(kRdIsRn), kRdIsRn},
   1227     {{al, r4, r4}, "al r4 r4", "RdIsRn_al_r4_r4", ARRAY_SIZE(kRdIsRn), kRdIsRn},
   1228     {{al, r5, r5}, "al r5 r5", "RdIsRn_al_r5_r5", ARRAY_SIZE(kRdIsRn), kRdIsRn},
   1229     {{al, r6, r6}, "al r6 r6", "RdIsRn_al_r6_r6", ARRAY_SIZE(kRdIsRn), kRdIsRn},
   1230     {{al, r7, r7}, "al r7 r7", "RdIsRn_al_r7_r7", ARRAY_SIZE(kRdIsRn), kRdIsRn},
   1231     {{al, r8, r8}, "al r8 r8", "RdIsRn_al_r8_r8", ARRAY_SIZE(kRdIsRn), kRdIsRn},
   1232     {{al, r9, r9}, "al r9 r9", "RdIsRn_al_r9_r9", ARRAY_SIZE(kRdIsRn), kRdIsRn},
   1233     {{al, r10, r10},
   1234      "al r10 r10",
   1235      "RdIsRn_al_r10_r10",
   1236      ARRAY_SIZE(kRdIsRn),
   1237      kRdIsRn},
   1238     {{al, r11, r11},
   1239      "al r11 r11",
   1240      "RdIsRn_al_r11_r11",
   1241      ARRAY_SIZE(kRdIsRn),
   1242      kRdIsRn},
   1243     {{al, r12, r12},
   1244      "al r12 r12",
   1245      "RdIsRn_al_r12_r12",
   1246      ARRAY_SIZE(kRdIsRn),
   1247      kRdIsRn},
   1248     {{al, r14, r14},
   1249      "al r14 r14",
   1250      "RdIsRn_al_r14_r14",
   1251      ARRAY_SIZE(kRdIsRn),
   1252      kRdIsRn},
   1253     {{al, r12, r3},
   1254      "al r12 r3",
   1255      "RdIsNotRn_al_r12_r3",
   1256      ARRAY_SIZE(kRdIsNotRn),
   1257      kRdIsNotRn},
   1258     {{al, r5, r11},
   1259      "al r5 r11",
   1260      "RdIsNotRn_al_r5_r11",
   1261      ARRAY_SIZE(kRdIsNotRn),
   1262      kRdIsNotRn},
   1263     {{al, r3, r0},
   1264      "al r3 r0",
   1265      "RdIsNotRn_al_r3_r0",
   1266      ARRAY_SIZE(kRdIsNotRn),
   1267      kRdIsNotRn},
   1268     {{al, r0, r14},
   1269      "al r0 r14",
   1270      "RdIsNotRn_al_r0_r14",
   1271      ARRAY_SIZE(kRdIsNotRn),
   1272      kRdIsNotRn},
   1273     {{al, r8, r11},
   1274      "al r8 r11",
   1275      "RdIsNotRn_al_r8_r11",
   1276      ARRAY_SIZE(kRdIsNotRn),
   1277      kRdIsNotRn},
   1278     {{al, r5, r0},
   1279      "al r5 r0",
   1280      "RdIsNotRn_al_r5_r0",
   1281      ARRAY_SIZE(kRdIsNotRn),
   1282      kRdIsNotRn},
   1283     {{al, r2, r7},
   1284      "al r2 r7",
   1285      "RdIsNotRn_al_r2_r7",
   1286      ARRAY_SIZE(kRdIsNotRn),
   1287      kRdIsNotRn},
   1288     {{al, r12, r1},
   1289      "al r12 r1",
   1290      "RdIsNotRn_al_r12_r1",
   1291      ARRAY_SIZE(kRdIsNotRn),
   1292      kRdIsNotRn},
   1293     {{al, r4, r10},
   1294      "al r4 r10",
   1295      "RdIsNotRn_al_r4_r10",
   1296      ARRAY_SIZE(kRdIsNotRn),
   1297      kRdIsNotRn},
   1298     {{al, r6, r5},
   1299      "al r6 r5",
   1300      "RdIsNotRn_al_r6_r5",
   1301      ARRAY_SIZE(kRdIsNotRn),
   1302      kRdIsNotRn}};
   1303 
   1304 // We record all inputs to the instructions as outputs. This way, we also check
   1305 // that what shouldn't change didn't change.
   1306 struct TestResult {
   1307   size_t output_size;
   1308   const Inputs* outputs;
   1309 };
   1310 
   1311 // These headers each contain an array of `TestResult` with the reference output
   1312 // values. The reference arrays are names `kReference{mnemonic}`.
   1313 #include "aarch32/traces/simulator-cond-rd-rn-t32-clz.h"
   1314 #include "aarch32/traces/simulator-cond-rd-rn-t32-rbit.h"
   1315 #include "aarch32/traces/simulator-cond-rd-rn-t32-rev.h"
   1316 #include "aarch32/traces/simulator-cond-rd-rn-t32-rev16.h"
   1317 #include "aarch32/traces/simulator-cond-rd-rn-t32-revsh.h"
   1318 #include "aarch32/traces/simulator-cond-rd-rn-t32-rrx.h"
   1319 #include "aarch32/traces/simulator-cond-rd-rn-t32-rrxs.h"
   1320 
   1321 
   1322 // The maximum number of errors to report in detail for each test.
   1323 const unsigned kErrorReportLimit = 8;
   1324 
   1325 typedef void (MacroAssembler::*Fn)(Condition cond, Register rd, Register rn);
   1326 
   1327 void TestHelper(Fn instruction,
   1328                 const char* mnemonic,
   1329                 const TestResult reference[]) {
   1330   SETUP();
   1331   masm.UseT32();
   1332   START();
   1333 
   1334   // Data to compare to `reference`.
   1335   TestResult* results[ARRAY_SIZE(kTests)];
   1336 
   1337   // Test cases for memory bound instructions may allocate a buffer and save its
   1338   // address in this array.
   1339   byte* scratch_memory_buffers[ARRAY_SIZE(kTests)];
   1340 
   1341   // Generate a loop for each element in `kTests`. Each loop tests one specific
   1342   // instruction.
   1343   for (unsigned i = 0; i < ARRAY_SIZE(kTests); i++) {
   1344     // Allocate results on the heap for this test.
   1345     results[i] = new TestResult;
   1346     results[i]->outputs = new Inputs[kTests[i].input_size];
   1347     results[i]->output_size = kTests[i].input_size;
   1348 
   1349     size_t input_stride = sizeof(kTests[i].inputs[0]) * kTests[i].input_size;
   1350     VIXL_ASSERT(IsUint32(input_stride));
   1351 
   1352     scratch_memory_buffers[i] = NULL;
   1353 
   1354     Label loop;
   1355     UseScratchRegisterScope scratch_registers(&masm);
   1356     // Include all registers from r0 ro r12.
   1357     scratch_registers.Include(RegisterList(0x1fff));
   1358 
   1359     // Values to pass to the macro-assembler.
   1360     Condition cond = kTests[i].operands.cond;
   1361     Register rd = kTests[i].operands.rd;
   1362     Register rn = kTests[i].operands.rn;
   1363     scratch_registers.Exclude(rd);
   1364     scratch_registers.Exclude(rn);
   1365 
   1366     // Allocate reserved registers for our own use.
   1367     Register input_ptr = scratch_registers.Acquire();
   1368     Register input_end = scratch_registers.Acquire();
   1369     Register result_ptr = scratch_registers.Acquire();
   1370 
   1371     // Initialize `input_ptr` to the first element and `input_end` the address
   1372     // after the array.
   1373     __ Mov(input_ptr, Operand::From(kTests[i].inputs));
   1374     __ Add(input_end, input_ptr, static_cast<uint32_t>(input_stride));
   1375     __ Mov(result_ptr, Operand::From(results[i]->outputs));
   1376     __ Bind(&loop);
   1377 
   1378     {
   1379       UseScratchRegisterScope temp_registers(&masm);
   1380       Register nzcv_bits = temp_registers.Acquire();
   1381       Register saved_q_bit = temp_registers.Acquire();
   1382       // Save the `Q` bit flag.
   1383       __ Mrs(saved_q_bit, APSR);
   1384       __ And(saved_q_bit, saved_q_bit, QFlag);
   1385       // Set the `NZCV` and `Q` flags together.
   1386       __ Ldr(nzcv_bits, MemOperand(input_ptr, offsetof(Inputs, apsr)));
   1387       __ Orr(nzcv_bits, nzcv_bits, saved_q_bit);
   1388       __ Msr(APSR_nzcvq, nzcv_bits);
   1389     }
   1390     __ Ldr(rd, MemOperand(input_ptr, offsetof(Inputs, rd)));
   1391     __ Ldr(rn, MemOperand(input_ptr, offsetof(Inputs, rn)));
   1392 
   1393     (masm.*instruction)(cond, rd, rn);
   1394 
   1395     {
   1396       UseScratchRegisterScope temp_registers(&masm);
   1397       Register nzcv_bits = temp_registers.Acquire();
   1398       __ Mrs(nzcv_bits, APSR);
   1399       // Only record the NZCV bits.
   1400       __ And(nzcv_bits, nzcv_bits, NZCVFlag);
   1401       __ Str(nzcv_bits, MemOperand(result_ptr, offsetof(Inputs, apsr)));
   1402     }
   1403     __ Str(rd, MemOperand(result_ptr, offsetof(Inputs, rd)));
   1404     __ Str(rn, MemOperand(result_ptr, offsetof(Inputs, rn)));
   1405 
   1406     // Advance the result pointer.
   1407     __ Add(result_ptr, result_ptr, Operand::From(sizeof(kTests[i].inputs[0])));
   1408     // Loop back until `input_ptr` is lower than `input_base`.
   1409     __ Add(input_ptr, input_ptr, Operand::From(sizeof(kTests[i].inputs[0])));
   1410     __ Cmp(input_ptr, input_end);
   1411     __ B(ne, &loop);
   1412   }
   1413 
   1414   END();
   1415 
   1416   RUN();
   1417 
   1418   if (Test::generate_test_trace()) {
   1419     // Print the results.
   1420     for (size_t i = 0; i < ARRAY_SIZE(kTests); i++) {
   1421       printf("const Inputs kOutputs_%s_%s[] = {\n",
   1422              mnemonic,
   1423              kTests[i].identifier);
   1424       for (size_t j = 0; j < results[i]->output_size; j++) {
   1425         printf("  { ");
   1426         printf("0x%08" PRIx32, results[i]->outputs[j].apsr);
   1427         printf(", ");
   1428         printf("0x%08" PRIx32, results[i]->outputs[j].rd);
   1429         printf(", ");
   1430         printf("0x%08" PRIx32, results[i]->outputs[j].rn);
   1431         printf(" },\n");
   1432       }
   1433       printf("};\n");
   1434     }
   1435     printf("const TestResult kReference%s[] = {\n", mnemonic);
   1436     for (size_t i = 0; i < ARRAY_SIZE(kTests); i++) {
   1437       printf("  {\n");
   1438       printf("    ARRAY_SIZE(kOutputs_%s_%s),\n",
   1439              mnemonic,
   1440              kTests[i].identifier);
   1441       printf("    kOutputs_%s_%s,\n", mnemonic, kTests[i].identifier);
   1442       printf("  },\n");
   1443     }
   1444     printf("};\n");
   1445   } else if (kCheckSimulatorTestResults) {
   1446     // Check the results.
   1447     unsigned total_error_count = 0;
   1448     for (size_t i = 0; i < ARRAY_SIZE(kTests); i++) {
   1449       bool instruction_has_errors = false;
   1450       for (size_t j = 0; j < kTests[i].input_size; j++) {
   1451         uint32_t apsr = results[i]->outputs[j].apsr;
   1452         uint32_t rd = results[i]->outputs[j].rd;
   1453         uint32_t rn = results[i]->outputs[j].rn;
   1454         uint32_t apsr_input = kTests[i].inputs[j].apsr;
   1455         uint32_t rd_input = kTests[i].inputs[j].rd;
   1456         uint32_t rn_input = kTests[i].inputs[j].rn;
   1457         uint32_t apsr_ref = reference[i].outputs[j].apsr;
   1458         uint32_t rd_ref = reference[i].outputs[j].rd;
   1459         uint32_t rn_ref = reference[i].outputs[j].rn;
   1460 
   1461         if (((apsr != apsr_ref) || (rd != rd_ref) || (rn != rn_ref)) &&
   1462             (++total_error_count <= kErrorReportLimit)) {
   1463           // Print the instruction once even if it triggered multiple failures.
   1464           if (!instruction_has_errors) {
   1465             printf("Error(s) when testing \"%s %s\":\n",
   1466                    mnemonic,
   1467                    kTests[i].operands_description);
   1468             instruction_has_errors = true;
   1469           }
   1470           // Print subsequent errors.
   1471           printf("  Input:    ");
   1472           printf("0x%08" PRIx32, apsr_input);
   1473           printf(", ");
   1474           printf("0x%08" PRIx32, rd_input);
   1475           printf(", ");
   1476           printf("0x%08" PRIx32, rn_input);
   1477           printf("\n");
   1478           printf("  Expected: ");
   1479           printf("0x%08" PRIx32, apsr_ref);
   1480           printf(", ");
   1481           printf("0x%08" PRIx32, rd_ref);
   1482           printf(", ");
   1483           printf("0x%08" PRIx32, rn_ref);
   1484           printf("\n");
   1485           printf("  Found:    ");
   1486           printf("0x%08" PRIx32, apsr);
   1487           printf(", ");
   1488           printf("0x%08" PRIx32, rd);
   1489           printf(", ");
   1490           printf("0x%08" PRIx32, rn);
   1491           printf("\n\n");
   1492         }
   1493       }
   1494     }
   1495 
   1496     if (total_error_count > kErrorReportLimit) {
   1497       printf("%u other errors follow.\n",
   1498              total_error_count - kErrorReportLimit);
   1499     }
   1500     VIXL_CHECK(total_error_count == 0);
   1501   } else {
   1502     VIXL_WARNING("Assembled the code, but did not run anything.\n");
   1503   }
   1504 
   1505   for (size_t i = 0; i < ARRAY_SIZE(kTests); i++) {
   1506     delete[] results[i]->outputs;
   1507     delete results[i];
   1508     delete[] scratch_memory_buffers[i];
   1509   }
   1510 
   1511   TEARDOWN();
   1512 }
   1513 
   1514 // Instantiate tests for each instruction in the list.
   1515 // TODO: Remove this limitation by having a sandboxing mechanism.
   1516 #if defined(VIXL_HOST_POINTER_32)
   1517 #define TEST(mnemonic)                                                      \
   1518   void Test_##mnemonic() {                                                  \
   1519     TestHelper(&MacroAssembler::mnemonic, #mnemonic, kReference##mnemonic); \
   1520   }                                                                         \
   1521   Test test_##mnemonic("AARCH32_SIMULATOR_COND_RD_RN_T32_" #mnemonic,       \
   1522                        &Test_##mnemonic);
   1523 #else
   1524 #define TEST(mnemonic)                                                \
   1525   void Test_##mnemonic() {                                            \
   1526     VIXL_WARNING("This test can only run on a 32-bit host.\n");       \
   1527     USE(TestHelper);                                                  \
   1528   }                                                                   \
   1529   Test test_##mnemonic("AARCH32_SIMULATOR_COND_RD_RN_T32_" #mnemonic, \
   1530                        &Test_##mnemonic);
   1531 #endif
   1532 
   1533 FOREACH_INSTRUCTION(TEST)
   1534 #undef TEST
   1535 
   1536 }  // namespace
   1537 #endif
   1538 
   1539 }  // namespace aarch32
   1540 }  // namespace vixl
   1541