1b78f13911bfe6eda303e91ef215c87a165aae8aeAlexandre Rames// Copyright 2016, VIXL authors 288c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// All rights reserved. 388c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// 488c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// Redistribution and use in source and binary forms, with or without 588c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// modification, are permitted provided that the following conditions are met: 688c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// 788c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// * Redistributions of source code must retain the above copyright notice, 888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// this list of conditions and the following disclaimer. 988c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// * Redistributions in binary form must reproduce the above copyright notice, 1088c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// this list of conditions and the following disclaimer in the documentation 1188c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// and/or other materials provided with the distribution. 1288c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// * Neither the name of ARM Limited nor the names of its contributors may be 1388c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// used to endorse or promote products derived from this software without 1488c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// specific prior written permission. 1588c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// 1688c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS CONTRIBUTORS "AS IS" AND 1788c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 1888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 1988c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 2088c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2188c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 2288c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 2388c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 2488c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 2588c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2688c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 2719c0535d3c9c0bec6eeecce0ae704a7fd527a9d8Pierre Langlois 2888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// ----------------------------------------------------------------------------- 2988c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// This file is auto generated from the 30d3832965c62a8ad461b9ea9eb0994ca6b0a3da2cAlexandre Rames// test/aarch32/config/template-simulator-aarch32.cc.in template file using 3188c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// tools/generate_tests.py. 3288c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// 3388c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// PLEASE DO NOT EDIT. 3488c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// ----------------------------------------------------------------------------- 3588c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 3619c0535d3c9c0bec6eeecce0ae704a7fd527a9d8Pierre Langlois 3788c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois#include "test-runner.h" 3888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 3988c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois#include "test-utils.h" 40d3832965c62a8ad461b9ea9eb0994ca6b0a3da2cAlexandre Rames#include "test-utils-aarch32.h" 4188c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 42d3832965c62a8ad461b9ea9eb0994ca6b0a3da2cAlexandre Rames#include "aarch32/assembler-aarch32.h" 43d3832965c62a8ad461b9ea9eb0994ca6b0a3da2cAlexandre Rames#include "aarch32/disasm-aarch32.h" 441bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois#include "aarch32/macro-assembler-aarch32.h" 4588c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 4688c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois#define __ masm. 4788c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois#define BUF_SIZE (4096) 4888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 491e85b7f2e8ad2bfb233de29405aade635ed207cePierre Langlois#ifdef VIXL_INCLUDE_SIMULATOR_AARCH32 5088c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// Run tests with the simulator. 5188c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 5288c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois#define SETUP() MacroAssembler masm(BUF_SIZE) 5388c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 54919e3fe28a5024c53ede42922092bbc32e89dcb8Alexandre Rames#define START() masm.GetBuffer()->Reset() 5588c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 5688c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois#define END() \ 5788c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois __ Hlt(0); \ 5888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois __ FinalizeCode(); 5988c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 6088c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// TODO: Run the tests in the simulator. 6188c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois#define RUN() 6288c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 631e85b7f2e8ad2bfb233de29405aade635ed207cePierre Langlois#else // ifdef VIXL_INCLUDE_SIMULATOR_AARCH32. 6488c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 6574d4ef31746fbfd90118858857502c7006e3e925Pierre Langlois#define SETUP() \ 6674d4ef31746fbfd90118858857502c7006e3e925Pierre Langlois MacroAssembler masm(BUF_SIZE); \ 6774d4ef31746fbfd90118858857502c7006e3e925Pierre Langlois UseScratchRegisterScope harness_scratch; 6874d4ef31746fbfd90118858857502c7006e3e925Pierre Langlois 6974d4ef31746fbfd90118858857502c7006e3e925Pierre Langlois#define START() \ 7074d4ef31746fbfd90118858857502c7006e3e925Pierre Langlois harness_scratch.Open(&masm); \ 7174d4ef31746fbfd90118858857502c7006e3e925Pierre Langlois harness_scratch.ExcludeAll(); \ 7274d4ef31746fbfd90118858857502c7006e3e925Pierre Langlois masm.GetBuffer()->Reset(); \ 7374d4ef31746fbfd90118858857502c7006e3e925Pierre Langlois __ Push(r4); \ 7474d4ef31746fbfd90118858857502c7006e3e925Pierre Langlois __ Push(r5); \ 7574d4ef31746fbfd90118858857502c7006e3e925Pierre Langlois __ Push(r6); \ 7674d4ef31746fbfd90118858857502c7006e3e925Pierre Langlois __ Push(r7); \ 7774d4ef31746fbfd90118858857502c7006e3e925Pierre Langlois __ Push(r8); \ 7874d4ef31746fbfd90118858857502c7006e3e925Pierre Langlois __ Push(r9); \ 7974d4ef31746fbfd90118858857502c7006e3e925Pierre Langlois __ Push(r10); \ 8074d4ef31746fbfd90118858857502c7006e3e925Pierre Langlois __ Push(r11); \ 8174d4ef31746fbfd90118858857502c7006e3e925Pierre Langlois __ Push(lr); \ 824cb13e841305b38acbd8195b1c511d59c91ec8d9Georgia Kouveli harness_scratch.Include(ip); 834cb13e841305b38acbd8195b1c511d59c91ec8d9Georgia Kouveli 844cb13e841305b38acbd8195b1c511d59c91ec8d9Georgia Kouveli#define END() \ 854cb13e841305b38acbd8195b1c511d59c91ec8d9Georgia Kouveli harness_scratch.Exclude(ip); \ 864cb13e841305b38acbd8195b1c511d59c91ec8d9Georgia Kouveli __ Pop(lr); \ 874cb13e841305b38acbd8195b1c511d59c91ec8d9Georgia Kouveli __ Pop(r11); \ 884cb13e841305b38acbd8195b1c511d59c91ec8d9Georgia Kouveli __ Pop(r10); \ 894cb13e841305b38acbd8195b1c511d59c91ec8d9Georgia Kouveli __ Pop(r9); \ 904cb13e841305b38acbd8195b1c511d59c91ec8d9Georgia Kouveli __ Pop(r8); \ 914cb13e841305b38acbd8195b1c511d59c91ec8d9Georgia Kouveli __ Pop(r7); \ 924cb13e841305b38acbd8195b1c511d59c91ec8d9Georgia Kouveli __ Pop(r6); \ 934cb13e841305b38acbd8195b1c511d59c91ec8d9Georgia Kouveli __ Pop(r5); \ 944cb13e841305b38acbd8195b1c511d59c91ec8d9Georgia Kouveli __ Pop(r4); \ 954cb13e841305b38acbd8195b1c511d59c91ec8d9Georgia Kouveli __ Bx(lr); \ 9674d4ef31746fbfd90118858857502c7006e3e925Pierre Langlois __ FinalizeCode(); \ 9774d4ef31746fbfd90118858857502c7006e3e925Pierre Langlois harness_scratch.Close(); 9888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 99919e3fe28a5024c53ede42922092bbc32e89dcb8Alexandre Rames#define RUN() \ 100919e3fe28a5024c53ede42922092bbc32e89dcb8Alexandre Rames { \ 101919e3fe28a5024c53ede42922092bbc32e89dcb8Alexandre Rames int pcs_offset = masm.IsUsingT32() ? 1 : 0; \ 1026a049f97861bd71c69d81f643e42308d28c5de31Alexandre Rames masm.GetBuffer()->SetExecutable(); \ 103919e3fe28a5024c53ede42922092bbc32e89dcb8Alexandre Rames ExecuteMemory(masm.GetBuffer()->GetStartAddress<byte*>(), \ 104919e3fe28a5024c53ede42922092bbc32e89dcb8Alexandre Rames masm.GetSizeOfCodeGenerated(), \ 105919e3fe28a5024c53ede42922092bbc32e89dcb8Alexandre Rames pcs_offset); \ 1066a049f97861bd71c69d81f643e42308d28c5de31Alexandre Rames masm.GetBuffer()->SetWritable(); \ 10788c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois } 10888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 1091e85b7f2e8ad2bfb233de29405aade635ed207cePierre Langlois#endif // ifdef VIXL_INCLUDE_SIMULATOR_AARCH32 11088c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 11188c46b84df005638546de5e4e965bdcc31352f48Pierre Langloisnamespace vixl { 11288c46b84df005638546de5e4e965bdcc31352f48Pierre Langloisnamespace aarch32 { 11388c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 11488c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// List of instruction encodings: 11588c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois#define FOREACH_INSTRUCTION(M) \ 11688c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois M(Crc32b) \ 11788c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois M(Crc32cb) \ 11888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois M(Crc32ch) \ 11988c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois M(Crc32cw) \ 12088c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois M(Crc32h) \ 12188c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois M(Crc32w) 12288c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 12319c0535d3c9c0bec6eeecce0ae704a7fd527a9d8Pierre Langlois 1241d451fce2580f360ef249893135526156985a85cPierre Langlois// The following definitions are defined again in each generated test, therefore 1251d451fce2580f360ef249893135526156985a85cPierre Langlois// we need to place them in an anomymous namespace. It expresses that they are 1261d451fce2580f360ef249893135526156985a85cPierre Langlois// local to this file only, and the compiler is not allowed to share these types 1271d451fce2580f360ef249893135526156985a85cPierre Langlois// across test files during template instantiation. Specifically, `Operands` and 1281d451fce2580f360ef249893135526156985a85cPierre Langlois// `Inputs` have various layouts across generated tests so they absolutely 1291d451fce2580f360ef249893135526156985a85cPierre Langlois// cannot be shared. 1301d451fce2580f360ef249893135526156985a85cPierre Langlois 1319a9331faeba996d6c85e6e2a6355ccfc22c6cab6Rodolph Perfetta#ifdef VIXL_INCLUDE_TARGET_T32 1321d451fce2580f360ef249893135526156985a85cPierre Langloisnamespace { 1331d451fce2580f360ef249893135526156985a85cPierre Langlois 13488c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// Values to be passed to the assembler to produce the instruction under test. 13588c46b84df005638546de5e4e965bdcc31352f48Pierre Langloisstruct Operands { 13688c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois Register rd; 13788c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois Register rn; 13888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois Register rm; 13988c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois}; 14088c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 14188c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// Input data to feed to the instruction. 14288c46b84df005638546de5e4e965bdcc31352f48Pierre Langloisstruct Inputs { 14388c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois uint32_t rd; 14488c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois uint32_t rn; 14588c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois uint32_t rm; 14688c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois}; 14788c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 14888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// This structure contains all input data needed to test one specific encoding. 14988c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// It used to generate a loop over an instruction. 15088c46b84df005638546de5e4e965bdcc31352f48Pierre Langloisstruct TestLoopData { 15188c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois // The `operands` fields represents the values to pass to the assembler to 15288c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois // produce the instruction. 15388c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois Operands operands; 15488c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois // Description of the operands, used for error reporting. 15588c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois const char* operands_description; 15688c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois // Unique identifier, used for generating traces. 15788c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois const char* identifier; 15888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois // Array of values to be fed to the instruction. 15988c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois size_t input_size; 16088c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois const Inputs* inputs; 16188c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois}; 16288c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 1631bce007699e07bd855b7d194ca93fa5504a73edaPierre Langloisstatic const Inputs kRnIsRm[] = { 1641bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffffffe0, 0x00007fff, 0x00007fff}, {0xaaaaaaaa, 0x00007fff, 0x00007fff}, 1651bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffffff82, 0x7ffffffe, 0x7ffffffe}, {0x7ffffffd, 0x33333333, 0x33333333}, 1661bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00007ffd, 0x00000002, 0x00000002}, {0xffffff80, 0xfffffffd, 0xfffffffd}, 1671bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffffff82, 0x33333333, 0x33333333}, {0xcccccccc, 0xffff8002, 0xffff8002}, 1681bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x55555555, 0xffffffe0, 0xffffffe0}, {0x00007fff, 0xffffffff, 0xffffffff}, 1691bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x55555555, 0x33333333, 0x33333333}, {0x7ffffffd, 0xffff8002, 0xffff8002}, 1701bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00000020, 0xffffff83, 0xffffff83}, {0x0000007e, 0x00007fff, 0x00007fff}, 1711bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xfffffffe, 0xffffff82, 0xffffff82}, {0xffffff82, 0x00007fff, 0x00007fff}, 1721bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffffff82, 0xfffffffd, 0xfffffffd}, {0x80000000, 0x7fffffff, 0x7fffffff}, 1731bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x55555555, 0x00000002, 0x00000002}, {0xfffffffe, 0xffffff80, 0xffffff80}, 1741bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xfffffffe, 0x00000002, 0x00000002}, {0xfffffffe, 0x00000020, 0x00000020}, 1751bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xfffffffe, 0x00007ffd, 0x00007ffd}, {0x0000007f, 0x33333333, 0x33333333}, 1761bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xfffffffd, 0xfffffffe, 0xfffffffe}, {0x80000001, 0x7ffffffd, 0x7ffffffd}, 1771bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x7ffffffe, 0xffffff83, 0xffffff83}, {0xffffffe0, 0x00000002, 0x00000002}, 1781bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00007ffe, 0xffffff83, 0xffffff83}, {0xffffff82, 0xffffff80, 0xffffff80}, 1791bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x0000007e, 0x33333333, 0x33333333}, {0xffff8001, 0xfffffffe, 0xfffffffe}, 1801bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xfffffffe, 0xffffff81, 0xffffff81}, {0x00000001, 0xffffff83, 0xffffff83}, 1811bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xfffffffe, 0xaaaaaaaa, 0xaaaaaaaa}, {0xcccccccc, 0xffffff80, 0xffffff80}, 1821bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffffff83, 0x0000007f, 0x0000007f}, {0x00007ffd, 0x00000020, 0x00000020}, 1831bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x0000007d, 0xfffffffd, 0xfffffffd}, {0x7ffffffe, 0xaaaaaaaa, 0xaaaaaaaa}, 1841bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffffff83, 0x00000001, 0x00000001}, {0x0000007d, 0xffff8000, 0xffff8000}, 1851bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffffffe0, 0x00000020, 0x00000020}, {0xffff8003, 0xffffff80, 0xffffff80}, 1861bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00000000, 0xaaaaaaaa, 0xaaaaaaaa}, {0x00007fff, 0x00000020, 0x00000020}, 1871bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x80000000, 0x0000007d, 0x0000007d}, {0xffffff81, 0x0000007e, 0x0000007e}, 1881bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xcccccccc, 0x00000020, 0x00000020}, {0xffffff81, 0x33333333, 0x33333333}, 1891bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffff8002, 0xffffffe0, 0xffffffe0}, {0xffffffe0, 0x00007ffe, 0x00007ffe}, 1901bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffff8002, 0xaaaaaaaa, 0xaaaaaaaa}, {0xffff8001, 0x00007ffe, 0x00007ffe}, 1911bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x80000000, 0xcccccccc, 0xcccccccc}, {0x7ffffffd, 0x00000002, 0x00000002}, 1921bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xcccccccc, 0x0000007f, 0x0000007f}, {0x7ffffffe, 0xffffff82, 0xffffff82}, 1931bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00000001, 0x0000007e, 0x0000007e}, {0x00007ffd, 0x00007ffe, 0x00007ffe}, 1941bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x7ffffffd, 0xfffffffe, 0xfffffffe}, {0x00000001, 0x80000001, 0x80000001}, 1951bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00007ffe, 0x7fffffff, 0x7fffffff}, {0xffff8001, 0xffff8002, 0xffff8002}, 1961bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00000001, 0xffff8003, 0xffff8003}, {0x00000002, 0xfffffffe, 0xfffffffe}, 1971bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00000002, 0x00007ffd, 0x00007ffd}, {0x7ffffffe, 0xfffffffd, 0xfffffffd}, 1981bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffff8001, 0x7ffffffd, 0x7ffffffd}, {0x7ffffffd, 0x55555555, 0x55555555}, 1991bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x80000000, 0xffffff80, 0xffffff80}, {0xffff8002, 0xffff8003, 0xffff8003}, 2001bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffffffff, 0x00000020, 0x00000020}, {0xfffffffe, 0x00000001, 0x00000001}, 2011bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00007fff, 0x00007fff, 0x00007fff}, {0x00000000, 0xffffff83, 0xffffff83}, 2021bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x33333333, 0xaaaaaaaa, 0xaaaaaaaa}, {0x0000007d, 0x7ffffffe, 0x7ffffffe}, 2031bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffff8003, 0xffff8001, 0xffff8001}, {0xfffffffd, 0xcccccccc, 0xcccccccc}, 2041bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x80000000, 0x80000001, 0x80000001}, {0xffff8002, 0x00000002, 0x00000002}, 2051bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xfffffffd, 0xffffffe0, 0xffffffe0}, {0xffffffe0, 0xffffff82, 0xffffff82}, 2061bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x33333333, 0x00007ffe, 0x00007ffe}, {0xffff8002, 0xffffff80, 0xffffff80}, 2071bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffffff81, 0x80000000, 0x80000000}, {0x00000000, 0x80000000, 0x80000000}, 2081bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00000000, 0xcccccccc, 0xcccccccc}, {0x00000020, 0xffffffe0, 0xffffffe0}, 2091bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00007ffe, 0xffffffe0, 0xffffffe0}, {0xffffff81, 0xfffffffe, 0xfffffffe}, 2101bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00000002, 0x00007ffe, 0x00007ffe}, {0xffff8000, 0x7fffffff, 0x7fffffff}, 2111bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00000002, 0x55555555, 0x55555555}, {0xffff8000, 0x55555555, 0x55555555}, 2121bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffff8001, 0x00000020, 0x00000020}, {0xffffffff, 0x55555555, 0x55555555}, 2131bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x33333333, 0x00000020, 0x00000020}, {0xfffffffd, 0x7fffffff, 0x7fffffff}, 2141bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x7ffffffd, 0x7fffffff, 0x7fffffff}, {0xaaaaaaaa, 0xffffff81, 0xffffff81}, 2151bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00007ffd, 0x80000001, 0x80000001}, {0x7ffffffe, 0xffffffff, 0xffffffff}, 2161bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00007ffe, 0x7ffffffe, 0x7ffffffe}, {0xffff8001, 0x55555555, 0x55555555}, 2171bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffffff80, 0xfffffffe, 0xfffffffe}, {0x0000007e, 0x7ffffffd, 0x7ffffffd}, 2181bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00000000, 0x00007ffd, 0x00007ffd}, {0x00000020, 0x80000001, 0x80000001}, 2191bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffffff83, 0xffffffe0, 0xffffffe0}, {0x55555555, 0xffff8000, 0xffff8000}, 2201bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x33333333, 0xffff8002, 0xffff8002}, {0x7ffffffd, 0x0000007f, 0x0000007f}, 2211bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00000002, 0xffffff82, 0xffffff82}, {0xfffffffe, 0xcccccccc, 0xcccccccc}, 2221bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x33333333, 0xffffff82, 0xffffff82}, {0x7ffffffd, 0x00007ffd, 0x00007ffd}, 2231bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00000002, 0xffffff80, 0xffffff80}, {0xffff8001, 0x00000000, 0x00000000}, 2241bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x7ffffffe, 0x0000007d, 0x0000007d}, {0x00000001, 0x00000020, 0x00000020}, 2251bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xaaaaaaaa, 0xffffff82, 0xffffff82}, {0x00000001, 0xfffffffd, 0xfffffffd}, 2261bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x80000001, 0xfffffffe, 0xfffffffe}, {0xffffff80, 0x80000000, 0x80000000}, 2271bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x80000000, 0xffffffff, 0xffffffff}, {0x00000001, 0x00000001, 0x00000001}, 2281bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x80000001, 0xffff8003, 0xffff8003}, {0xffffffff, 0xffffff83, 0xffffff83}, 2291bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00007ffe, 0x00007ffe, 0x00007ffe}, {0x7ffffffd, 0xcccccccc, 0xcccccccc}, 2301bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffff8003, 0xcccccccc, 0xcccccccc}, {0xcccccccc, 0x00007fff, 0x00007fff}, 2311bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00000002, 0x7ffffffd, 0x7ffffffd}, {0x00000002, 0xffff8002, 0xffff8002}, 2321bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffffff80, 0x33333333, 0x33333333}, {0x55555555, 0xffffff82, 0xffffff82}, 2331bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x7fffffff, 0x00007fff, 0x00007fff}, {0x33333333, 0x00000001, 0x00000001}, 2341bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x33333333, 0xffffffe0, 0xffffffe0}, {0xffffff83, 0x0000007e, 0x0000007e}, 2351bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00000002, 0xffff8001, 0xffff8001}, {0xcccccccc, 0xffffffe0, 0xffffffe0}, 2361bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffff8000, 0x7ffffffe, 0x7ffffffe}, {0x00007ffe, 0xffffff81, 0xffffff81}, 2371bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x7ffffffd, 0xffffffe0, 0xffffffe0}, {0x00007fff, 0xffffff81, 0xffffff81}, 2381bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffffffff, 0x00007ffd, 0x00007ffd}, {0x00007fff, 0x80000001, 0x80000001}, 2391bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffffffff, 0xcccccccc, 0xcccccccc}, {0x00007ffd, 0x0000007d, 0x0000007d}, 2401bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x0000007e, 0x00000000, 0x00000000}, {0x0000007f, 0x7ffffffe, 0x7ffffffe}, 2411bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00000020, 0xffffff82, 0xffffff82}, {0xcccccccc, 0x80000001, 0x80000001}, 2421bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffff8002, 0x00007ffd, 0x00007ffd}, {0xffff8000, 0x00000001, 0x00000001}, 2431bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffffff83, 0xffffff83, 0xffffff83}, {0x00000002, 0xffffffe0, 0xffffffe0}, 2441bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xfffffffe, 0xffff8000, 0xffff8000}, {0x7ffffffe, 0xffffff80, 0xffffff80}, 2451bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x0000007f, 0xffffff81, 0xffffff81}, {0xffffffff, 0x0000007f, 0x0000007f}, 2461bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x7ffffffe, 0x0000007e, 0x0000007e}, {0x80000000, 0xfffffffd, 0xfffffffd}, 2471bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x33333333, 0x0000007d, 0x0000007d}, {0x80000001, 0xcccccccc, 0xcccccccc}, 2481bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xaaaaaaaa, 0x7ffffffd, 0x7ffffffd}, {0x7fffffff, 0x0000007f, 0x0000007f}, 2491bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x0000007e, 0xffff8001, 0xffff8001}, {0x0000007d, 0xaaaaaaaa, 0xaaaaaaaa}, 2501bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffffff82, 0x55555555, 0x55555555}, {0x55555555, 0xffffff81, 0xffffff81}, 2511bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xcccccccc, 0xffffff82, 0xffffff82}, {0x0000007d, 0x0000007d, 0x0000007d}, 2521bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xfffffffd, 0xfffffffd, 0xfffffffd}, {0xffffff82, 0xffff8002, 0xffff8002}, 2531bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffffffe0, 0x00000001, 0x00000001}, {0x0000007d, 0x00007ffe, 0x00007ffe}, 2541bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xfffffffe, 0xffff8003, 0xffff8003}, {0x00000001, 0xffff8001, 0xffff8001}, 2551bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffff8003, 0x00007ffe, 0x00007ffe}, {0x7ffffffd, 0x00000020, 0x00000020}, 2561bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xfffffffd, 0x00007ffe, 0x00007ffe}, {0x7fffffff, 0xfffffffd, 0xfffffffd}, 2571bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x7fffffff, 0xffff8001, 0xffff8001}, {0xffff8003, 0xffffffff, 0xffffffff}, 2581bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x0000007d, 0x33333333, 0x33333333}, {0xffffffff, 0x00000000, 0x00000000}, 2591bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffffffe0, 0xffffff81, 0xffffff81}, {0xffffffe0, 0xffffffff, 0xffffffff}, 2601bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00007ffd, 0x00007ffd, 0x00007ffd}, {0x00000002, 0x33333333, 0x33333333}, 2611bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x0000007f, 0x00000002, 0x00000002}, {0xffff8000, 0x0000007e, 0x0000007e}, 2621bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x80000000, 0x00007fff, 0x00007fff}, {0xffff8000, 0xfffffffd, 0xfffffffd}, 2631bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffff8002, 0xcccccccc, 0xcccccccc}, {0xffff8003, 0xffffff82, 0xffffff82}}; 26488c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 2651bce007699e07bd855b7d194ca93fa5504a73edaPierre Langloisstatic const Inputs kRnIsNotRm[] = { 2661bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00007ffe, 0x00007ffe, 0x80000000}, {0x80000001, 0xcccccccc, 0x00000001}, 2671bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x0000007d, 0x00000020, 0xcccccccc}, {0x7ffffffd, 0x55555555, 0x0000007f}, 2681bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00000020, 0xffff8001, 0x80000001}, {0xffffffe0, 0xffffff81, 0xffffff83}, 2691bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00000002, 0xffffff80, 0xaaaaaaaa}, {0x00000002, 0x00000001, 0x0000007d}, 2701bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffffff83, 0x00007ffd, 0x00000002}, {0xffff8000, 0x00000020, 0x55555555}, 2711bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00007ffd, 0x0000007f, 0x7ffffffd}, {0xfffffffd, 0x80000000, 0x00000000}, 2721bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x0000007f, 0x33333333, 0x7fffffff}, {0x00000000, 0x33333333, 0x55555555}, 2731bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffffff81, 0x00007fff, 0xaaaaaaaa}, {0x33333333, 0x00000000, 0x7ffffffe}, 2741bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xfffffffe, 0x00000001, 0xffffffff}, {0xaaaaaaaa, 0xffffffe0, 0xffffff80}, 2751bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x33333333, 0xffffffe0, 0x7fffffff}, {0x55555555, 0x7ffffffd, 0xffffff81}, 2761bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xaaaaaaaa, 0xffffffe0, 0x0000007f}, {0x00007fff, 0xfffffffd, 0xcccccccc}, 2771bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x7fffffff, 0xffff8002, 0x00000001}, {0x0000007d, 0x00000002, 0x7fffffff}, 2781bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00000002, 0x55555555, 0x00007ffe}, {0x00007ffd, 0x0000007d, 0xfffffffe}, 2791bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x7ffffffd, 0x55555555, 0xffffff83}, {0x7ffffffe, 0x80000001, 0x00000001}, 2801bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xfffffffd, 0x80000001, 0x80000000}, {0xffff8002, 0x00000000, 0x80000001}, 2811bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x0000007d, 0x00000020, 0x0000007e}, {0x00000020, 0x0000007f, 0x80000001}, 2821bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x7ffffffe, 0x80000001, 0xffff8002}, {0xffffff81, 0xffffff80, 0xffffff81}, 2831bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x7ffffffe, 0xffffff80, 0x0000007d}, {0x00007ffd, 0x00000000, 0x55555555}, 2841bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xcccccccc, 0xcccccccc, 0x7ffffffe}, {0xffff8002, 0x00000001, 0xffff8000}, 2851bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00007ffe, 0x0000007d, 0xffffffe0}, {0x00007ffd, 0x7ffffffe, 0xffffffe0}, 2861bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x80000001, 0x7ffffffe, 0xffff8001}, {0x55555555, 0xffffff80, 0xffff8003}, 2871bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xfffffffd, 0xffff8002, 0x55555555}, {0x33333333, 0xffff8000, 0xffff8003}, 2881bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x7ffffffd, 0xffff8002, 0x0000007e}, {0x7fffffff, 0xffffff80, 0xfffffffd}, 2891bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffff8002, 0x00000001, 0xaaaaaaaa}, {0xffffff83, 0xffff8001, 0x33333333}, 2901bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00000000, 0xfffffffe, 0x0000007e}, {0x80000000, 0xffffffe0, 0x0000007d}, 2911bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffff8000, 0x33333333, 0x00000002}, {0xfffffffe, 0x00000002, 0xffffffe0}, 2921bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00007ffd, 0x0000007e, 0x7ffffffe}, {0xffffff81, 0xffffffff, 0x00000000}, 2931bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x0000007e, 0x7ffffffe, 0x33333333}, {0x00000002, 0x80000001, 0xffffff80}, 2941bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x7ffffffd, 0xffffff82, 0x7ffffffe}, {0xffffff81, 0x0000007e, 0xffffff81}, 2951bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffff8002, 0x00007fff, 0x0000007f}, {0xcccccccc, 0xcccccccc, 0x0000007d}, 2961bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x7ffffffd, 0xffffff80, 0x00007ffe}, {0x55555555, 0x55555555, 0xfffffffe}, 2971bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00000001, 0x00000020, 0x00000001}, {0x0000007f, 0x7ffffffd, 0x80000001}, 2981bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x55555555, 0xaaaaaaaa, 0xfffffffd}, {0x00000020, 0x00007fff, 0xffffff81}, 2991bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffffff80, 0x33333333, 0xffffff81}, {0x00000000, 0xffff8001, 0xffffff83}, 3001bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x0000007e, 0x33333333, 0x7ffffffd}, {0xaaaaaaaa, 0x55555555, 0xffffffff}, 3011bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xfffffffd, 0xffff8000, 0x00000000}, {0xffff8000, 0xfffffffe, 0x7fffffff}, 3021bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffff8001, 0xcccccccc, 0x33333333}, {0x00007ffd, 0xffff8001, 0x0000007f}, 3031bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffffff83, 0x7ffffffd, 0x7fffffff}, {0xffffff81, 0xffffffe0, 0x00007fff}, 3041bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffffffff, 0x00000002, 0xffffff82}, {0xffff8001, 0xffffff81, 0x55555555}, 3051bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00007fff, 0xffffff83, 0x00007ffe}, {0x00007fff, 0xcccccccc, 0x00000020}, 3061bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x7fffffff, 0x7ffffffd, 0xffff8000}, {0x0000007f, 0x80000000, 0x7ffffffd}, 3071bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x0000007e, 0x0000007e, 0x0000007d}, {0xfffffffe, 0x00000020, 0xffffff80}, 3081bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00007ffd, 0x00007ffe, 0xffffff82}, {0x00000020, 0x80000000, 0x0000007e}, 3091bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00000020, 0x00000002, 0xffffffff}, {0x00007fff, 0xffff8000, 0x00007fff}, 3101bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xcccccccc, 0x7ffffffd, 0x80000000}, {0xffffff80, 0x00000002, 0xffffff81}, 3111bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xfffffffe, 0xffffff83, 0x33333333}, {0xffff8000, 0x7ffffffe, 0x55555555}, 3121bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00007fff, 0x0000007e, 0xffffff81}, {0xaaaaaaaa, 0xcccccccc, 0xffffffe0}, 3131bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x7ffffffd, 0xffffffff, 0xffff8003}, {0xffffff81, 0xffff8002, 0xffffff82}, 3141bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00000002, 0xffffffe0, 0x80000001}, {0x7ffffffe, 0x33333333, 0xaaaaaaaa}, 3151bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00007fff, 0x00000020, 0xfffffffe}, {0xcccccccc, 0xfffffffe, 0x00000000}, 3161bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x7ffffffe, 0x80000001, 0xfffffffd}, {0xffffffe0, 0x00000000, 0xaaaaaaaa}, 3171bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x80000000, 0xffffff83, 0xffff8000}, {0xffffff81, 0xfffffffe, 0xffffff83}, 3181bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x80000000, 0x0000007e, 0xffff8002}, {0x80000001, 0x00000020, 0x00007ffe}, 3191bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00000000, 0x00000020, 0x0000007e}, {0x80000001, 0xffffffff, 0x7ffffffe}, 3201bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffffff83, 0x33333333, 0x00000001}, {0x00000020, 0xffffff80, 0xffffff81}, 3211bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xcccccccc, 0xffff8000, 0x00007ffd}, {0xffff8003, 0x00000000, 0x0000007f}, 3221bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffff8003, 0x00000001, 0x0000007d}, {0x0000007e, 0x00000020, 0x55555555}, 3231bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffffffff, 0xfffffffe, 0xffffff83}, {0xffffff80, 0x80000000, 0xfffffffe}, 3241bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x0000007e, 0x0000007e, 0x00000000}, {0xaaaaaaaa, 0x00000002, 0xffffffe0}, 3251bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffff8001, 0x00007ffe, 0x00000020}, {0x7ffffffe, 0xffff8000, 0x00007ffe}, 3261bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffffff80, 0x33333333, 0x00007fff}, {0x33333333, 0xffffff81, 0x00000001}, 3271bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00000000, 0x33333333, 0x00000020}, {0x00007fff, 0x00000020, 0x0000007e}, 3281bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xcccccccc, 0x55555555, 0xffffffe0}, {0xffffff80, 0x0000007e, 0x33333333}, 3291bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x0000007e, 0xffff8002, 0x00000000}, {0xffffff83, 0xffffffe0, 0xfffffffd}, 3301bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00000001, 0x0000007f, 0xffff8001}, {0xffffffff, 0x00000020, 0xcccccccc}, 3311bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x7ffffffd, 0xfffffffd, 0xffff8000}, {0xffffffff, 0x80000000, 0x00007fff}, 3321bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00000020, 0xffffffe0, 0xfffffffd}, {0x55555555, 0xffff8002, 0x0000007f}, 3331bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffff8002, 0x55555555, 0x0000007f}, {0xffff8003, 0xffff8000, 0x0000007d}, 3341bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00007fff, 0x00007ffe, 0x00000000}, {0xcccccccc, 0xffffff81, 0x00007fff}, 3351bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x7ffffffd, 0xcccccccc, 0xffff8000}, {0x7ffffffe, 0xffff8001, 0x80000000}, 3361bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x0000007f, 0xffffffe0, 0x80000001}, {0xffff8000, 0x00007ffd, 0xffff8003}, 3371bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffff8001, 0xffffff80, 0x00000001}, {0x33333333, 0x00000000, 0x80000000}, 3381bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xfffffffe, 0x7ffffffd, 0x80000001}, {0x00000000, 0xffffffe0, 0x80000001}, 3391bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffff8002, 0x7ffffffe, 0x33333333}, {0xffffffe0, 0x0000007e, 0x00000001}, 3401bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffffff80, 0xffffffe0, 0x00007ffe}, {0xffff8000, 0x0000007f, 0x80000001}, 3411bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffffff80, 0xffffff80, 0xffff8002}, {0x7fffffff, 0x0000007f, 0xfffffffd}, 3421bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00000001, 0xffffffe0, 0xffffffff}, {0x55555555, 0x0000007f, 0xffff8002}, 3431bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffff8001, 0xfffffffd, 0x00000020}, {0x00007ffd, 0xfffffffd, 0x0000007e}, 3441bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xfffffffd, 0xffff8003, 0x55555555}, {0xfffffffe, 0xffffff80, 0x0000007f}, 3451bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x0000007f, 0x0000007f, 0xfffffffe}, {0x33333333, 0x55555555, 0xffff8003}, 3461bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x0000007d, 0x00000020, 0x55555555}, {0xffff8003, 0x33333333, 0xffffff83}, 3471bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffffffe0, 0x00007fff, 0xffffff80}, {0x00000020, 0x00000001, 0x0000007d}, 3481bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffffff83, 0x00007fff, 0xaaaaaaaa}, {0xfffffffd, 0xffffff83, 0x55555555}, 3491bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffff8002, 0x00007fff, 0xffffffe0}, {0x80000001, 0xffffff82, 0x00007ffd}, 3501bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffff8000, 0x00000002, 0xffffffe0}, {0xfffffffd, 0xffffff80, 0x7ffffffe}, 3511bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffffffff, 0xaaaaaaaa, 0xffff8000}, {0x7ffffffd, 0x00000002, 0xffff8002}, 3521bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffff8001, 0x00007ffe, 0xffffffff}, {0xffff8001, 0x00000001, 0x00000000}, 3531bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x80000001, 0xffffff80, 0x7ffffffd}, {0xffffff80, 0x0000007d, 0xffffff81}, 3541bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffffff81, 0xcccccccc, 0xffffff81}, {0xaaaaaaaa, 0x00000000, 0xffffff81}, 3551bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00000002, 0x00000020, 0xffffff81}, {0x7ffffffd, 0x7ffffffe, 0xffffff83}, 3561bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x7fffffff, 0x55555555, 0x0000007f}, {0xfffffffd, 0xffffff82, 0xfffffffd}, 3571bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00000020, 0x00007ffd, 0xffffff81}, {0x0000007e, 0xffffff83, 0x33333333}, 3581bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffffff83, 0x00007fff, 0x00000002}, {0xffffffe0, 0xffffff80, 0xffff8001}, 3591bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x00000000, 0x00000000, 0x00000002}, {0xfffffffd, 0x7ffffffe, 0x00000001}, 3601bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xfffffffd, 0xfffffffd, 0xffffff80}, {0xffffff83, 0x00000000, 0x00007ffe}, 3611bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffff8002, 0xcccccccc, 0x33333333}, {0xffffff80, 0xffffff81, 0x0000007d}, 3621bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x0000007e, 0xffff8000, 0x00007ffe}, {0x0000007e, 0x80000000, 0x80000001}, 3631bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffffff83, 0x00007fff, 0xffffffe0}, {0xcccccccc, 0x00007fff, 0xffffff80}, 3641bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0x0000007f, 0x0000007e, 0xfffffffd}, {0xcccccccc, 0xffffffff, 0x00000001}, 3651bce007699e07bd855b7d194ca93fa5504a73edaPierre Langlois {0xffffffff, 0xffff8000, 0xffffff82}, {0xfffffffe, 0x00000002, 0xffffffff}}; 36688c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 36719c0535d3c9c0bec6eeecce0ae704a7fd527a9d8Pierre Langlois 36888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// A loop will be generated for each element of this array. 3691d451fce2580f360ef249893135526156985a85cPierre Langloisconst TestLoopData kTests[] = { 37088c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois {{r9, r8, r8}, "r9 r8 r8", "RnIsRm_r9_r8_r8", ARRAY_SIZE(kRnIsRm), kRnIsRm}, 37188c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois {{r6, r11, r11}, 37288c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois "r6 r11 r11", 37388c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois "RnIsRm_r6_r11_r11", 37488c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois ARRAY_SIZE(kRnIsRm), 37588c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois kRnIsRm}, 37688c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois {{r3, r12, r12}, 37788c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois "r3 r12 r12", 37888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois "RnIsRm_r3_r12_r12", 37988c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois ARRAY_SIZE(kRnIsRm), 38088c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois kRnIsRm}, 38188c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois {{r14, r3, r3}, 38288c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois "r14 r3 r3", 38388c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois "RnIsRm_r14_r3_r3", 38488c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois ARRAY_SIZE(kRnIsRm), 38588c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois kRnIsRm}, 38688c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois {{r10, r4, r4}, 38788c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois "r10 r4 r4", 38888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois "RnIsRm_r10_r4_r4", 38988c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois ARRAY_SIZE(kRnIsRm), 39088c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois kRnIsRm}, 39188c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois {{r6, r8, r8}, "r6 r8 r8", "RnIsRm_r6_r8_r8", ARRAY_SIZE(kRnIsRm), kRnIsRm}, 39288c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois {{r5, r7, r7}, "r5 r7 r7", "RnIsRm_r5_r7_r7", ARRAY_SIZE(kRnIsRm), kRnIsRm}, 39388c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois {{r6, r3, r3}, "r6 r3 r3", "RnIsRm_r6_r3_r3", ARRAY_SIZE(kRnIsRm), kRnIsRm}, 39488c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois {{r7, r0, r0}, "r7 r0 r0", "RnIsRm_r7_r0_r0", ARRAY_SIZE(kRnIsRm), kRnIsRm}, 39588c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois {{r2, r1, r1}, "r2 r1 r1", "RnIsRm_r2_r1_r1", ARRAY_SIZE(kRnIsRm), kRnIsRm}, 39688c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois {{r5, r3, r14}, 39788c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois "r5 r3 r14", 39888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois "RnIsNotRm_r5_r3_r14", 39988c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois ARRAY_SIZE(kRnIsNotRm), 40088c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois kRnIsNotRm}, 40188c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois {{r10, r8, r3}, 40288c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois "r10 r8 r3", 40388c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois "RnIsNotRm_r10_r8_r3", 40488c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois ARRAY_SIZE(kRnIsNotRm), 40588c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois kRnIsNotRm}, 40688c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois {{r2, r8, r11}, 40788c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois "r2 r8 r11", 40888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois "RnIsNotRm_r2_r8_r11", 40988c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois ARRAY_SIZE(kRnIsNotRm), 41088c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois kRnIsNotRm}, 41188c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois {{r7, r12, r7}, 41288c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois "r7 r12 r7", 41388c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois "RnIsNotRm_r7_r12_r7", 41488c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois ARRAY_SIZE(kRnIsNotRm), 41588c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois kRnIsNotRm}, 41688c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois {{r2, r4, r10}, 41788c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois "r2 r4 r10", 41888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois "RnIsNotRm_r2_r4_r10", 41988c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois ARRAY_SIZE(kRnIsNotRm), 42088c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois kRnIsNotRm}, 42188c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois {{r1, r10, r8}, 42288c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois "r1 r10 r8", 42388c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois "RnIsNotRm_r1_r10_r8", 42488c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois ARRAY_SIZE(kRnIsNotRm), 42588c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois kRnIsNotRm}, 42688c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois {{r1, r4, r2}, 42788c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois "r1 r4 r2", 42888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois "RnIsNotRm_r1_r4_r2", 42988c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois ARRAY_SIZE(kRnIsNotRm), 43088c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois kRnIsNotRm}, 43188c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois {{r12, r2, r12}, 43288c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois "r12 r2 r12", 43388c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois "RnIsNotRm_r12_r2_r12", 43488c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois ARRAY_SIZE(kRnIsNotRm), 43588c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois kRnIsNotRm}, 43688c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois {{r4, r8, r5}, 43788c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois "r4 r8 r5", 43888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois "RnIsNotRm_r4_r8_r5", 43988c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois ARRAY_SIZE(kRnIsNotRm), 44088c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois kRnIsNotRm}, 44188c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois {{r4, r0, r9}, 44288c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois "r4 r0 r9", 44388c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois "RnIsNotRm_r4_r0_r9", 44488c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois ARRAY_SIZE(kRnIsNotRm), 44588c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois kRnIsNotRm}}; 44688c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 44788c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// We record all inputs to the instructions as outputs. This way, we also check 44888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// that what shouldn't change didn't change. 44988c46b84df005638546de5e4e965bdcc31352f48Pierre Langloisstruct TestResult { 45088c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois size_t output_size; 45188c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois const Inputs* outputs; 45288c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois}; 45388c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 45488c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// These headers each contain an array of `TestResult` with the reference output 45588c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// values. The reference arrays are names `kReference{mnemonic}`. 456d1bf2784420717dcd20888a6eaecb18ab7f01d56Pierre Langlois#include "aarch32/traces/simulator-rd-rn-rm-crc32b-t32.h" 457d1bf2784420717dcd20888a6eaecb18ab7f01d56Pierre Langlois#include "aarch32/traces/simulator-rd-rn-rm-crc32cb-t32.h" 458d1bf2784420717dcd20888a6eaecb18ab7f01d56Pierre Langlois#include "aarch32/traces/simulator-rd-rn-rm-crc32ch-t32.h" 459d1bf2784420717dcd20888a6eaecb18ab7f01d56Pierre Langlois#include "aarch32/traces/simulator-rd-rn-rm-crc32cw-t32.h" 460d1bf2784420717dcd20888a6eaecb18ab7f01d56Pierre Langlois#include "aarch32/traces/simulator-rd-rn-rm-crc32h-t32.h" 461d1bf2784420717dcd20888a6eaecb18ab7f01d56Pierre Langlois#include "aarch32/traces/simulator-rd-rn-rm-crc32w-t32.h" 46288c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 46319c0535d3c9c0bec6eeecce0ae704a7fd527a9d8Pierre Langlois 46488c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// The maximum number of errors to report in detail for each test. 4651d451fce2580f360ef249893135526156985a85cPierre Langloisconst unsigned kErrorReportLimit = 8; 46688c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 46788c46b84df005638546de5e4e965bdcc31352f48Pierre Langloistypedef void (MacroAssembler::*Fn)(Register rd, Register rn, Register rm); 46888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 46928ee02e59261f0aaa4824953fa3db5dd8f7f8dcfPierre Langloisvoid TestHelper(Fn instruction, 47028ee02e59261f0aaa4824953fa3db5dd8f7f8dcfPierre Langlois const char* mnemonic, 47128ee02e59261f0aaa4824953fa3db5dd8f7f8dcfPierre Langlois const TestResult reference[]) { 47288c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois SETUP(); 47310dae1a549308bddc1931f29754d6a4459f70c9bJacob Bramley masm.UseT32(); 47488c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois START(); 47588c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 47688c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois // Data to compare to `reference`. 47788c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois TestResult* results[ARRAY_SIZE(kTests)]; 47888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 47988c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois // Test cases for memory bound instructions may allocate a buffer and save its 48088c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois // address in this array. 48188c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois byte* scratch_memory_buffers[ARRAY_SIZE(kTests)]; 48288c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 48388c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois // Generate a loop for each element in `kTests`. Each loop tests one specific 48488c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois // instruction. 48588c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois for (unsigned i = 0; i < ARRAY_SIZE(kTests); i++) { 48688c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois // Allocate results on the heap for this test. 48788c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois results[i] = new TestResult; 48888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois results[i]->outputs = new Inputs[kTests[i].input_size]; 48988c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois results[i]->output_size = kTests[i].input_size; 49088c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 491f5348cedd702124c90fc75e75d0195e2e485c620Pierre Langlois size_t input_stride = sizeof(kTests[i].inputs[0]) * kTests[i].input_size; 492f5348cedd702124c90fc75e75d0195e2e485c620Pierre Langlois VIXL_ASSERT(IsUint32(input_stride)); 49388c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 49488c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois scratch_memory_buffers[i] = NULL; 49588c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 49688c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois Label loop; 49788c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois UseScratchRegisterScope scratch_registers(&masm); 49888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois // Include all registers from r0 ro r12. 49988c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois scratch_registers.Include(RegisterList(0x1fff)); 50088c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 50188c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois // Values to pass to the macro-assembler. 50288c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois Register rd = kTests[i].operands.rd; 50388c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois Register rn = kTests[i].operands.rn; 50488c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois Register rm = kTests[i].operands.rm; 50588c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois scratch_registers.Exclude(rd); 50688c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois scratch_registers.Exclude(rn); 50788c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois scratch_registers.Exclude(rm); 50888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 50988c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois // Allocate reserved registers for our own use. 51088c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois Register input_ptr = scratch_registers.Acquire(); 51188c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois Register input_end = scratch_registers.Acquire(); 51288c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois Register result_ptr = scratch_registers.Acquire(); 51388c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 51488c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois // Initialize `input_ptr` to the first element and `input_end` the address 51588c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois // after the array. 516f5348cedd702124c90fc75e75d0195e2e485c620Pierre Langlois __ Mov(input_ptr, Operand::From(kTests[i].inputs)); 517f5348cedd702124c90fc75e75d0195e2e485c620Pierre Langlois __ Add(input_end, input_ptr, static_cast<uint32_t>(input_stride)); 518f5348cedd702124c90fc75e75d0195e2e485c620Pierre Langlois __ Mov(result_ptr, Operand::From(results[i]->outputs)); 51988c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois __ Bind(&loop); 52088c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 52188c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois __ Ldr(rd, MemOperand(input_ptr, offsetof(Inputs, rd))); 52288c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois __ Ldr(rn, MemOperand(input_ptr, offsetof(Inputs, rn))); 52388c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois __ Ldr(rm, MemOperand(input_ptr, offsetof(Inputs, rm))); 52488c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 52588c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois (masm.*instruction)(rd, rn, rm); 52688c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 52788c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois __ Str(rd, MemOperand(result_ptr, offsetof(Inputs, rd))); 52888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois __ Str(rn, MemOperand(result_ptr, offsetof(Inputs, rn))); 52988c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois __ Str(rm, MemOperand(result_ptr, offsetof(Inputs, rm))); 53088c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 53188c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois // Advance the result pointer. 532f5348cedd702124c90fc75e75d0195e2e485c620Pierre Langlois __ Add(result_ptr, result_ptr, Operand::From(sizeof(kTests[i].inputs[0]))); 53388c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois // Loop back until `input_ptr` is lower than `input_base`. 534f5348cedd702124c90fc75e75d0195e2e485c620Pierre Langlois __ Add(input_ptr, input_ptr, Operand::From(sizeof(kTests[i].inputs[0]))); 53588c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois __ Cmp(input_ptr, input_end); 53688c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois __ B(ne, &loop); 53788c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois } 53888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 53988c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois END(); 54088c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 54188c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois RUN(); 54288c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 54388c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois if (Test::generate_test_trace()) { 54488c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois // Print the results. 54588c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois for (size_t i = 0; i < ARRAY_SIZE(kTests); i++) { 5461d451fce2580f360ef249893135526156985a85cPierre Langlois printf("const Inputs kOutputs_%s_%s[] = {\n", 54719c0535d3c9c0bec6eeecce0ae704a7fd527a9d8Pierre Langlois mnemonic, 54888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois kTests[i].identifier); 54988c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois for (size_t j = 0; j < results[i]->output_size; j++) { 55088c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois printf(" { "); 55188c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois printf("0x%08" PRIx32, results[i]->outputs[j].rd); 55288c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois printf(", "); 55388c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois printf("0x%08" PRIx32, results[i]->outputs[j].rn); 55488c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois printf(", "); 55588c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois printf("0x%08" PRIx32, results[i]->outputs[j].rm); 55688c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois printf(" },\n"); 55788c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois } 55888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois printf("};\n"); 55988c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois } 5601d451fce2580f360ef249893135526156985a85cPierre Langlois printf("const TestResult kReference%s[] = {\n", mnemonic); 56188c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois for (size_t i = 0; i < ARRAY_SIZE(kTests); i++) { 56288c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois printf(" {\n"); 56319c0535d3c9c0bec6eeecce0ae704a7fd527a9d8Pierre Langlois printf(" ARRAY_SIZE(kOutputs_%s_%s),\n", 56419c0535d3c9c0bec6eeecce0ae704a7fd527a9d8Pierre Langlois mnemonic, 56588c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois kTests[i].identifier); 56688c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois printf(" kOutputs_%s_%s,\n", mnemonic, kTests[i].identifier); 56788c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois printf(" },\n"); 56888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois } 56988c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois printf("};\n"); 57054fce717d9371fa2e8fc46e1d811bdb4ab74f279Alexandre Rames } else if (kCheckSimulatorTestResults) { 57188c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois // Check the results. 57288c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois unsigned total_error_count = 0; 57388c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois for (size_t i = 0; i < ARRAY_SIZE(kTests); i++) { 57488c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois bool instruction_has_errors = false; 57588c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois for (size_t j = 0; j < kTests[i].input_size; j++) { 57688c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois uint32_t rd = results[i]->outputs[j].rd; 57788c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois uint32_t rn = results[i]->outputs[j].rn; 57888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois uint32_t rm = results[i]->outputs[j].rm; 57988c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois uint32_t rd_input = kTests[i].inputs[j].rd; 58088c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois uint32_t rn_input = kTests[i].inputs[j].rn; 58188c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois uint32_t rm_input = kTests[i].inputs[j].rm; 58288c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois uint32_t rd_ref = reference[i].outputs[j].rd; 58388c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois uint32_t rn_ref = reference[i].outputs[j].rn; 58488c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois uint32_t rm_ref = reference[i].outputs[j].rm; 58588c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 58688c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois if (((rd != rd_ref) || (rn != rn_ref) || (rm != rm_ref)) && 58788c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois (++total_error_count <= kErrorReportLimit)) { 58888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois // Print the instruction once even if it triggered multiple failures. 58988c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois if (!instruction_has_errors) { 59019c0535d3c9c0bec6eeecce0ae704a7fd527a9d8Pierre Langlois printf("Error(s) when testing \"%s %s\":\n", 59119c0535d3c9c0bec6eeecce0ae704a7fd527a9d8Pierre Langlois mnemonic, 59288c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois kTests[i].operands_description); 59388c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois instruction_has_errors = true; 59488c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois } 59588c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois // Print subsequent errors. 59688c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois printf(" Input: "); 59788c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois printf("0x%08" PRIx32, rd_input); 59888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois printf(", "); 59988c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois printf("0x%08" PRIx32, rn_input); 60088c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois printf(", "); 60188c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois printf("0x%08" PRIx32, rm_input); 60288c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois printf("\n"); 60388c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois printf(" Expected: "); 60488c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois printf("0x%08" PRIx32, rd_ref); 60588c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois printf(", "); 60688c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois printf("0x%08" PRIx32, rn_ref); 60788c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois printf(", "); 60888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois printf("0x%08" PRIx32, rm_ref); 60988c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois printf("\n"); 61088c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois printf(" Found: "); 61188c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois printf("0x%08" PRIx32, rd); 61288c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois printf(", "); 61388c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois printf("0x%08" PRIx32, rn); 61488c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois printf(", "); 61588c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois printf("0x%08" PRIx32, rm); 61688c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois printf("\n\n"); 61788c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois } 61888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois } 61988c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois } 62088c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 62188c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois if (total_error_count > kErrorReportLimit) { 62288c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois printf("%u other errors follow.\n", 62388c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois total_error_count - kErrorReportLimit); 62488c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois } 62588c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois VIXL_CHECK(total_error_count == 0); 62654fce717d9371fa2e8fc46e1d811bdb4ab74f279Alexandre Rames } else { 62754fce717d9371fa2e8fc46e1d811bdb4ab74f279Alexandre Rames VIXL_WARNING("Assembled the code, but did not run anything.\n"); 62888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois } 62988c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 63088c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois for (size_t i = 0; i < ARRAY_SIZE(kTests); i++) { 63188c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois delete[] results[i]->outputs; 63288c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois delete results[i]; 633ec4fdd22abecf1b8f52ee9dbff596ebdded9b5d6Serban Constantinescu delete[] scratch_memory_buffers[i]; 63488c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois } 63588c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois} 63688c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 63788c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois// Instantiate tests for each instruction in the list. 63828ee02e59261f0aaa4824953fa3db5dd8f7f8dcfPierre Langlois// TODO: Remove this limitation by having a sandboxing mechanism. 63928ee02e59261f0aaa4824953fa3db5dd8f7f8dcfPierre Langlois#if defined(VIXL_HOST_POINTER_32) 64088c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois#define TEST(mnemonic) \ 6411d451fce2580f360ef249893135526156985a85cPierre Langlois void Test_##mnemonic() { \ 64288c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois TestHelper(&MacroAssembler::mnemonic, #mnemonic, kReference##mnemonic); \ 64388c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois } \ 644d1bf2784420717dcd20888a6eaecb18ab7f01d56Pierre Langlois Test test_##mnemonic("AARCH32_SIMULATOR_RD_RN_RM_" #mnemonic "_T32", \ 6451d451fce2580f360ef249893135526156985a85cPierre Langlois &Test_##mnemonic); 64628ee02e59261f0aaa4824953fa3db5dd8f7f8dcfPierre Langlois#else 647d1bf2784420717dcd20888a6eaecb18ab7f01d56Pierre Langlois#define TEST(mnemonic) \ 648d1bf2784420717dcd20888a6eaecb18ab7f01d56Pierre Langlois void Test_##mnemonic() { \ 649d1bf2784420717dcd20888a6eaecb18ab7f01d56Pierre Langlois VIXL_WARNING("This test can only run on a 32-bit host.\n"); \ 650d1bf2784420717dcd20888a6eaecb18ab7f01d56Pierre Langlois USE(TestHelper); \ 651d1bf2784420717dcd20888a6eaecb18ab7f01d56Pierre Langlois } \ 652d1bf2784420717dcd20888a6eaecb18ab7f01d56Pierre Langlois Test test_##mnemonic("AARCH32_SIMULATOR_RD_RN_RM_" #mnemonic "_T32", \ 65328ee02e59261f0aaa4824953fa3db5dd8f7f8dcfPierre Langlois &Test_##mnemonic); 65428ee02e59261f0aaa4824953fa3db5dd8f7f8dcfPierre Langlois#endif 65528ee02e59261f0aaa4824953fa3db5dd8f7f8dcfPierre Langlois 65688c46b84df005638546de5e4e965bdcc31352f48Pierre LangloisFOREACH_INSTRUCTION(TEST) 65788c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois#undef TEST 65888c46b84df005638546de5e4e965bdcc31352f48Pierre Langlois 6591d451fce2580f360ef249893135526156985a85cPierre Langlois} // namespace 6609a9331faeba996d6c85e6e2a6355ccfc22c6cab6Rodolph Perfetta#endif 6611d451fce2580f360ef249893135526156985a85cPierre Langlois 6621d451fce2580f360ef249893135526156985a85cPierre Langlois} // namespace aarch32 6631d451fce2580f360ef249893135526156985a85cPierre Langlois} // namespace vixl 664