1b8021494Sopenharmony_ci// Copyright 2016, VIXL authors 2b8021494Sopenharmony_ci// All rights reserved. 3b8021494Sopenharmony_ci// 4b8021494Sopenharmony_ci// Redistribution and use in source and binary forms, with or without 5b8021494Sopenharmony_ci// modification, are permitted provided that the following conditions are met: 6b8021494Sopenharmony_ci// 7b8021494Sopenharmony_ci// * Redistributions of source code must retain the above copyright notice, 8b8021494Sopenharmony_ci// this list of conditions and the following disclaimer. 9b8021494Sopenharmony_ci// * Redistributions in binary form must reproduce the above copyright notice, 10b8021494Sopenharmony_ci// this list of conditions and the following disclaimer in the documentation 11b8021494Sopenharmony_ci// and/or other materials provided with the distribution. 12b8021494Sopenharmony_ci// * Neither the name of ARM Limited nor the names of its contributors may be 13b8021494Sopenharmony_ci// used to endorse or promote products derived from this software without 14b8021494Sopenharmony_ci// specific prior written permission. 15b8021494Sopenharmony_ci// 16b8021494Sopenharmony_ci// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS CONTRIBUTORS "AS IS" AND 17b8021494Sopenharmony_ci// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18b8021494Sopenharmony_ci// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19b8021494Sopenharmony_ci// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20b8021494Sopenharmony_ci// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21b8021494Sopenharmony_ci// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22b8021494Sopenharmony_ci// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23b8021494Sopenharmony_ci// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24b8021494Sopenharmony_ci// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25b8021494Sopenharmony_ci// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26b8021494Sopenharmony_ci 27b8021494Sopenharmony_ci// Test description for instructions of the following forms: 28b8021494Sopenharmony_ci// MNEMONIC{<c>}{<q>} {<Rd>}, <Rm>, <Rs> 29b8021494Sopenharmony_ci// MNEMONIC{<c>}{<q>} {<Rd>}, <Rn>, <Rm> {, <shift> #<amount> } 30b8021494Sopenharmony_ci// MNEMONIC{<c>}{<q>} {<Rd>}, <Rn>, <Rm> {, ROR #<amount> } 31b8021494Sopenharmony_ci// 32b8021494Sopenharmony_ci// Note that this test only covers the cases where the optional shift 33b8021494Sopenharmony_ci// operand is not provided. The shift operands are tested in 34b8021494Sopenharmony_ci// "cond-rd-rn-operand-rm-shift-amount-*-a32.json". 35b8021494Sopenharmony_ci 36b8021494Sopenharmony_ci{ 37b8021494Sopenharmony_ci "mnemonics": [ 38b8021494Sopenharmony_ci "Adc", // ADC{<c>}{<q>} {<Rd>}, <Rn>, <Rm> {, <shift> #<amount> } ; A1 39b8021494Sopenharmony_ci "Adcs", // ADCS{<c>}{<q>} {<Rd>}, <Rn>, <Rm> {, <shift> #<amount> } ; A1 40b8021494Sopenharmony_ci "Add", // ADD{<c>}{<q>} {<Rd>}, <Rn>, <Rm> {, <shift> #<amount> } ; A1 41b8021494Sopenharmony_ci // ADD{<c>}{<q>} {<Rd>}, SP, <Rm> {, <shift> #<amount> } ; A1 42b8021494Sopenharmony_ci "Adds", // ADDS{<c>}{<q>} {<Rd>}, <Rn>, <Rm> {, <shift> #<amount> } ; A1 43b8021494Sopenharmony_ci // ADDS{<c>}{<q>} {<Rd>}, SP, <Rm> {, <shift> #<amount> } ; A1 44b8021494Sopenharmony_ci "And", // AND{<c>}{<q>} {<Rd>}, <Rn>, <Rm> {, <shift> #<amount> } ; A1 45b8021494Sopenharmony_ci "Ands", // ANDS{<c>}{<q>} {<Rd>}, <Rn>, <Rm> {, <shift> #<amount> } ; A1 46b8021494Sopenharmony_ci "Bic", // BIC{<c>}{<q>} {<Rd>}, <Rn>, <Rm> {, <shift> #<amount> } ; A1 47b8021494Sopenharmony_ci "Bics", // BICS{<c>}{<q>} {<Rd>}, <Rn>, <Rm> {, <shift> #<amount> } ; A1 48b8021494Sopenharmony_ci "Eor", // EOR{<c>}{<q>} {<Rd>}, <Rn>, <Rm> {, <shift> #<amount> } ; A1 49b8021494Sopenharmony_ci "Eors", // EORS{<c>}{<q>} {<Rd>}, <Rn>, <Rm> {, <shift> #<amount> } ; A1 50b8021494Sopenharmony_ci "Orr", // ORR{<c>}{<q>} {<Rd>}, <Rn>, <Rm> {, <shift> #<amount> } ; A1 51b8021494Sopenharmony_ci "Orrs", // ORRS{<c>}{<q>} {<Rd>}, <Rn>, <Rm> {, <shift> #<amount> } ; A1 52b8021494Sopenharmony_ci "Rsb", // RSB{<c>}{<q>} {<Rd>}, <Rn>, <Rm> {, <shift> #<amount> } ; A1 53b8021494Sopenharmony_ci "Rsbs", // RSBS{<c>}{<q>} {<Rd>}, <Rn>, <Rm> {, <shift> #<amount> } ; A1 54b8021494Sopenharmony_ci "Rsc", // RSC{<c>}{<q>} {<Rd>}, <Rn>, <Rm> {, <shift> #<amount> } ; A1 55b8021494Sopenharmony_ci "Rscs", // RSCS{<c>}{<q>} {<Rd>}, <Rn>, <Rm> {, <shift> #<amount> } ; A1 56b8021494Sopenharmony_ci "Sbc", // SBC{<c>}{<q>} {<Rd>}, <Rn>, <Rm> {, <shift> #<amount> } ; A1 57b8021494Sopenharmony_ci "Sbcs", // SBCS{<c>}{<q>} {<Rd>}, <Rn>, <Rm> {, <shift> #<amount> } ; A1 58b8021494Sopenharmony_ci "Sub", // SUB{<c>}{<q>} {<Rd>}, <Rn>, <Rm> {, <shift> #<amount> } ; A1 59b8021494Sopenharmony_ci // SUB{<c>}{<q>} {<Rd>}, SP, <Rm> {, <shift> #<amount> } ; A1 60b8021494Sopenharmony_ci "Subs", // SUBS{<c>}{<q>} {<Rd>}, <Rn>, <Rm> {, <shift> #<amount> } ; A1 61b8021494Sopenharmony_ci // SUBS{<c>}{<q>} {<Rd>}, SP, <Rm> {, <shift> #<amount> } ; A1 62b8021494Sopenharmony_ci 63b8021494Sopenharmony_ci "Sxtab", // SXTAB{<c>}{<q>} {<Rd>}, <Rn>, <Rm> {, ROR #<amount> } ; A1 64b8021494Sopenharmony_ci "Sxtab16", // SXTAB16{<c>}{<q>} {<Rd>}, <Rn>, <Rm> {, ROR #<amount> } ; A1 65b8021494Sopenharmony_ci "Sxtah", // SXTAH{<c>}{<q>} {<Rd>}, <Rn>, <Rm> {, ROR #<amount> } ; A1 66b8021494Sopenharmony_ci "Uxtab", // UXTAB{<c>}{<q>} {<Rd>}, <Rn>, <Rm> {, ROR #<amount> } ; A1 67b8021494Sopenharmony_ci "Uxtab16", // UXTAB16{<c>}{<q>} {<Rd>}, <Rn>, <Rm> {, ROR #<amount> } ; A1 68b8021494Sopenharmony_ci "Uxtah", // UXTAH{<c>}{<q>} {<Rd>}, <Rn>, <Rm> {, ROR #<amount> } ; A1 69b8021494Sopenharmony_ci 70b8021494Sopenharmony_ci // Shift instructions that alias to MOV. 71b8021494Sopenharmony_ci // Note that we are not giving them a different input for their 72b8021494Sopenharmony_ci // last operand since they are already tested in 73b8021494Sopenharmony_ci // "cond-rd-operand-rn-shift-rs-a32.json". 74b8021494Sopenharmony_ci "Asr", // ASR{<c>}{<q>} {<Rd>}, <Rm>, <Rs> ; A1 75b8021494Sopenharmony_ci "Asrs", // ASRS{<c>}{<q>} {<Rd>}, <Rm>, <Rs> ; A1 76b8021494Sopenharmony_ci "Lsl", // LSL{<c>}{<q>} {<Rd>}, <Rm>, <Rs> ; A1 77b8021494Sopenharmony_ci "Lsls", // LSLS{<c>}{<q>} {<Rd>}, <Rm>, <Rs> ; A1 78b8021494Sopenharmony_ci "Lsr", // LSR{<c>}{<q>} {<Rd>}, <Rm>, <Rs> ; A1 79b8021494Sopenharmony_ci "Lsrs", // LSRS{<c>}{<q>} {<Rd>}, <Rm>, <Rs> ; A1 80b8021494Sopenharmony_ci "Ror", // ROR{<c>}{<q>} {<Rd>}, <Rm>, <Rs> ; A1 81b8021494Sopenharmony_ci "Rors" // RORS{<c>}{<q>} {<Rd>}, <Rm>, <Rs> ; A1 82b8021494Sopenharmony_ci ], 83b8021494Sopenharmony_ci "description": { 84b8021494Sopenharmony_ci "operands": [ 85b8021494Sopenharmony_ci { 86b8021494Sopenharmony_ci "name": "cond", 87b8021494Sopenharmony_ci "type": "Condition" 88b8021494Sopenharmony_ci }, 89b8021494Sopenharmony_ci { 90b8021494Sopenharmony_ci "name": "rd", 91b8021494Sopenharmony_ci "type": "AllRegistersButPC" 92b8021494Sopenharmony_ci }, 93b8021494Sopenharmony_ci { 94b8021494Sopenharmony_ci "name": "rn", 95b8021494Sopenharmony_ci "type": "AllRegistersButPC" 96b8021494Sopenharmony_ci }, 97b8021494Sopenharmony_ci { 98b8021494Sopenharmony_ci "name": "op", 99b8021494Sopenharmony_ci "wrapper": "Operand", 100b8021494Sopenharmony_ci "operands": [ 101b8021494Sopenharmony_ci { 102b8021494Sopenharmony_ci "name": "rm", 103b8021494Sopenharmony_ci "type": "AllRegistersButPC" 104b8021494Sopenharmony_ci } 105b8021494Sopenharmony_ci ] 106b8021494Sopenharmony_ci } 107b8021494Sopenharmony_ci ], 108b8021494Sopenharmony_ci "inputs": [ 109b8021494Sopenharmony_ci { 110b8021494Sopenharmony_ci "name": "apsr", 111b8021494Sopenharmony_ci "type": "NZCV" 112b8021494Sopenharmony_ci }, 113b8021494Sopenharmony_ci { 114b8021494Sopenharmony_ci "name": "rd", 115b8021494Sopenharmony_ci "type": "Register" 116b8021494Sopenharmony_ci }, 117b8021494Sopenharmony_ci { 118b8021494Sopenharmony_ci "name": "rn", 119b8021494Sopenharmony_ci "type": "Register" 120b8021494Sopenharmony_ci }, 121b8021494Sopenharmony_ci { 122b8021494Sopenharmony_ci "name": "rm", 123b8021494Sopenharmony_ci "type": "Register" 124b8021494Sopenharmony_ci } 125b8021494Sopenharmony_ci ] 126b8021494Sopenharmony_ci }, 127b8021494Sopenharmony_ci "test-files": [ 128b8021494Sopenharmony_ci { 129b8021494Sopenharmony_ci "type": "assembler", 130b8021494Sopenharmony_ci "test-cases": [ 131b8021494Sopenharmony_ci { 132b8021494Sopenharmony_ci "name": "Operands", 133b8021494Sopenharmony_ci "operands": [ 134b8021494Sopenharmony_ci "cond", "rd", "rn", "rm" 135b8021494Sopenharmony_ci ], 136b8021494Sopenharmony_ci "operand-limit": 500 137b8021494Sopenharmony_ci } 138b8021494Sopenharmony_ci ] 139b8021494Sopenharmony_ci }, 140b8021494Sopenharmony_ci { 141b8021494Sopenharmony_ci "type": "simulator", 142b8021494Sopenharmony_ci "test-cases": [ 143b8021494Sopenharmony_ci { 144b8021494Sopenharmony_ci "name": "Condition", 145b8021494Sopenharmony_ci "operands": [ 146b8021494Sopenharmony_ci "cond" 147b8021494Sopenharmony_ci ], 148b8021494Sopenharmony_ci "inputs": [ 149b8021494Sopenharmony_ci "apsr" 150b8021494Sopenharmony_ci ] 151b8021494Sopenharmony_ci }, 152b8021494Sopenharmony_ci // Test combinations of registers values with rd == rn. 153b8021494Sopenharmony_ci { 154b8021494Sopenharmony_ci "name": "RdIsRn", 155b8021494Sopenharmony_ci "operands": [ 156b8021494Sopenharmony_ci "rd", "rn", "rm" 157b8021494Sopenharmony_ci ], 158b8021494Sopenharmony_ci "inputs": [ 159b8021494Sopenharmony_ci "rd", "rn", "rm" 160b8021494Sopenharmony_ci ], 161b8021494Sopenharmony_ci "operand-filter": "rd == rn and rn != rm", 162b8021494Sopenharmony_ci "operand-limit": 10, 163b8021494Sopenharmony_ci "input-filter": "rd == rn", 164b8021494Sopenharmony_ci "input-limit": 200 165b8021494Sopenharmony_ci }, 166b8021494Sopenharmony_ci // Test combinations of registers values with rd == rm. 167b8021494Sopenharmony_ci { 168b8021494Sopenharmony_ci "name": "RdIsRm", 169b8021494Sopenharmony_ci "operands": [ 170b8021494Sopenharmony_ci "rd", "rn", "rm" 171b8021494Sopenharmony_ci ], 172b8021494Sopenharmony_ci "inputs": [ 173b8021494Sopenharmony_ci "rd", "rn", "rm" 174b8021494Sopenharmony_ci ], 175b8021494Sopenharmony_ci "operand-filter": "rd == rm and rn != rm", 176b8021494Sopenharmony_ci "operand-limit": 10, 177b8021494Sopenharmony_ci "input-filter": "rd == rm", 178b8021494Sopenharmony_ci "input-limit": 200 179b8021494Sopenharmony_ci }, 180b8021494Sopenharmony_ci // Test combinations of registers values. 181b8021494Sopenharmony_ci { 182b8021494Sopenharmony_ci "name": "RdIsNotRnIsNotRm", 183b8021494Sopenharmony_ci "operands": [ 184b8021494Sopenharmony_ci "rd", "rn", "rm" 185b8021494Sopenharmony_ci ], 186b8021494Sopenharmony_ci "inputs": [ 187b8021494Sopenharmony_ci "rd", "rn", "rm" 188b8021494Sopenharmony_ci ], 189b8021494Sopenharmony_ci "operand-filter": "rd != rn != rm", 190b8021494Sopenharmony_ci "operand-limit": 10, 191b8021494Sopenharmony_ci "input-limit": 200 192b8021494Sopenharmony_ci } 193b8021494Sopenharmony_ci ] 194b8021494Sopenharmony_ci } 195b8021494Sopenharmony_ci ] 196b8021494Sopenharmony_ci} 197