// Copyright 2016, VIXL authors // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // * Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // * Neither the name of ARM Limited nor the names of its contributors may be // used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Test description for instructions with the following operands: // MNEMONIC , , // // The instructions covered in this test do not write to the `Q` and `GE` flags, // these are covered in other description files. { "mnemonics": [ "Mul", // MUL{}{} , , {} ; A1 "Muls", // MULS{}{} , , {} ; A1 "Qadd16", // QADD16{}{} {}, , ; A1 "Qadd8", // QADD8{}{} {}, , ; A1 "Qasx", // QASX{}{} {}, , ; A1 "Qsax", // QSAX{}{} {}, , ; A1 "Qsub16", // QSUB16{}{} {}, , ; A1 "Qsub8", // QSUB8{}{} {}, , ; A1 "Sdiv", // SDIV{}{} {}, , ; A1 "Shadd16", // SHADD16{}{} {}, , ; A1 "Shadd8", // SHADD8{}{} {}, , ; A1 "Shasx", // SHASX{}{} {}, , ; A1 "Shsax", // SHSAX{}{} {}, , ; A1 "Shsub16", // SHSUB16{}{} {}, , ; A1 "Shsub8", // SHSUB8{}{} {}, , ; A1 "Smmul", // SMMUL{}{} {}, , ; A1 "Smmulr", // SMMULR{}{} {}, , ; A1 "Smuad", // SMUAD{}{} {}, , ; A1 "Smuadx", // SMUADX{}{} {}, , ; A1 "Smulbb", // SMULBB{}{} {}, , ; A1 "Smulbt", // SMULBT{}{} {}, , ; A1 "Smultb", // SMULTB{}{} {}, , ; A1 "Smultt", // SMULTT{}{} {}, , ; A1 "Smulwb", // SMULWB{}{} {}, , ; A1 "Smulwt", // SMULWT{}{} {}, , ; A1 "Smusd", // SMUSD{}{} {}, , ; A1 "Smusdx", // SMUSDX{}{} {}, , ; A1 "Udiv", // UDIV{}{} {}, , ; A1 "Uhadd16", // UHADD16{}{} {}, , ; A1 "Uhadd8", // UHADD8{}{} {}, , ; A1 "Uhasx", // UHASX{}{} {}, , ; A1 "Uhsax", // UHSAX{}{} {}, , ; A1 "Uhsub16", // UHSUB16{}{} {}, , ; A1 "Uhsub8", // UHSUB8{}{} {}, , ; A1 "Uqadd16", // UQADD16{}{} {}, , ; A1 "Uqadd8", // UQADD8{}{} {}, , ; A1 "Uqasx", // UQASX{}{} {}, , ; A1 "Uqsax", // UQSAX{}{} {}, , ; A1 "Uqsub16", // UQSUB16{}{} {}, , ; A1 "Uqsub8", // UQSUB8{}{} {}, , ; A1 "Usad8", // USAD8{}{} {}, , ; A1 // Instructions affecting the GE bits. "Sadd16", // SADD16{}{} {}, , ; A1 "Sadd8", // SADD8{}{} {}, , ; A1 "Sasx", // SASX{}{} {}, , ; A1 "Sel", // SEL{}{} {}, , ; A1 "Ssax", // SSAX{}{} {}, , ; A1 "Ssub16", // SSUB16{}{} {}, , ; A1 "Ssub8", // SSUB8{}{} {}, , ; A1 "Uadd16", // UADD16{}{} {}, , ; A1 "Uadd8", // UADD8{}{} {}, , ; A1 "Uasx", // UASX{}{} {}, , ; A1 "Usax", // USAX{}{} {}, , ; A1 "Usub16", // USUB16{}{} {}, , ; A1 "Usub8", // USUB8{}{} {}, , ; A1 // Instructions affecting the Q bit. "Qadd", // QADD{}{} {}, , ; A1 "Qdadd", // QDADD{}{} {}, , ; A1 "Qdsub", // QDSUB{}{} {}, , ; A1 "Qsub" // QSUB{}{} {}, , ; A1 ], "description": { "operands": [ { "name": "cond", "type": "Condition" }, { "name": "rd", "type": "AllRegistersButPC" }, { "name": "rn", "type": "AllRegistersButPC" }, { "name": "rm", "type": "AllRegistersButPC" } ], "inputs": [ { "name": "apsr", "type": "NZCV" }, { "name": "qbit", "type": "Q" }, { "name": "ge", "type": "GE" }, { "name": "rd", "type": "Register" }, { "name": "rn", "type": "Register" }, { "name": "rm", "type": "Register" } ] }, "test-files": [ { "type": "assembler", "test-cases": [ { "name": "Operands", "operands": [ "cond", "rd", "rn", "rm" ], "operand-limit": 300 } ] }, { "type": "simulator", "test-cases": [ { "name": "Condition", "operands": [ "cond" ], "inputs": [ "apsr" ] }, { "name": "RdIsRnIsRm", "operands": [ "rd", "rn", "rm" ], "inputs": [ "rd", "rn", "rm" ], "operand-filter": "(rd == rn) and (rd == rm)", "input-filter": "(rd == rn) and (rd == rm)" }, { "name": "RdIsRn", "operands": [ "rd", "rn", "rm" ], "inputs": [ "rd", "rn", "rm" ], "operand-filter": "(rd == rn) and (rn != rm)", "operand-limit": 10, "input-filter": "rd == rn", "input-limit": 200 }, { "name": "RdIsRm", "operands": [ "rd", "rn", "rm" ], "inputs": [ "rd", "rn", "rm" ], "operand-filter": "(rd == rm) and (rn != rm)", "operand-limit": 10, "input-filter": "rd == rm", "input-limit": 200 }, { "name": "RnIsRm", "operands": [ "rd", "rn", "rm" ], "inputs": [ "rd", "rn", "rm" ], "operand-filter": "(rn == rm) and (rm != rd)", "operand-limit": 10, "input-filter": "rn == rm", "input-limit": 200 }, { "name": "RdIsNotRnIsNotRm", "operands": [ "rd", "rn", "rm" ], "inputs": [ "rd", "rn", "rm" ], "operand-filter": "(rd != rn) and (rd != rm)", "operand-limit": 10, "input-limit": 200 } ] }, { "name": "ge", "type": "simulator", "mnemonics": [ "Sadd16", "Sadd8", "Sasx", "Ssax", "Ssub16", "Ssub8", "Uadd16", "Uadd8", "Uasx", "Usax", "Usub16", "Usub8" ], "test-cases": [ { "name": "GE", "operands": [ "rd", "rn", "rm" ], "inputs": [ "ge", "rn", "rm" ], "operand-filter": "(rd != rn) and (rn != rm)", "operand-limit": 1, // Only use "all set" and "all cleared" as inputs. "input-filter": "ge == 'NoFlag' or ge == 'GE0123Flag'", "input-limit": 200 } ] }, { "name": "sel", "type": "simulator", "mnemonics": [ "Sel" ], "test-cases": [ { "name": "GE", "operands": [ "rd", "rn", "rm" ], "inputs": [ "ge", "rn", "rm" ], "operand-filter": "(rd != rn) and (rn != rm)", "operand-limit": 1, "input-limit": 200 } ] }, { "name": "q", "type": "simulator", "mnemonics": [ "Qadd", "Qdadd", "Qdsub", "Qsub" ], "test-cases": [ { "name": "QOutput", "operands": [ "rn", "rm" ], "inputs": [ "qbit", "rn", "rm" ], "operand-limit": 1, "operand-filter": "rn != rm", "input-limit": 200 } ] } ] }