// 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 of the following form: // MNEMONIC{}.W , , // // 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{}{} , , {} ; T2 "Qadd16", // QADD16{}{} {}, , ; T1 "Qadd8", // QADD8{}{} {}, , ; T1 "Qasx", // QASX{}{} {}, , ; T1 "Qsax", // QSAX{}{} {}, , ; T1 "Qsub16", // QSUB16{}{} {}, , ; T1 "Qsub8", // QSUB8{}{} {}, , ; T1 "Sdiv", // SDIV{}{} {}, , ; T1 "Shadd16", // SHADD16{}{} {}, , ; T1 "Shadd8", // SHADD8{}{} {}, , ; T1 "Shasx", // SHASX{}{} {}, , ; T1 "Shsax", // SHSAX{}{} {}, , ; T1 "Shsub16", // SHSUB16{}{} {}, , ; T1 "Shsub8", // SHSUB8{}{} {}, , ; T1 "Smmul", // SMMUL{}{} {}, , ; T1 "Smmulr", // SMMULR{}{} {}, , ; T1 "Smuad", // SMUAD{}{} {}, , ; T1 "Smuadx", // SMUADX{}{} {}, , ; T1 "Smulbb", // SMULBB{}{} {}, , ; T1 "Smulbt", // SMULBT{}{} {}, , ; T1 "Smultb", // SMULTB{}{} {}, , ; T1 "Smultt", // SMULTT{}{} {}, , ; T1 "Smulwb", // SMULWB{}{} {}, , ; T1 "Smulwt", // SMULWT{}{} {}, , ; T1 "Smusd", // SMUSD{}{} {}, , ; T1 "Smusdx", // SMUSDX{}{} {}, , ; T1 "Udiv", // UDIV{}{} {}, , ; T1 "Uhadd16", // UHADD16{}{} {}, , ; T1 "Uhadd8", // UHADD8{}{} {}, , ; T1 "Uhasx", // UHASX{}{} {}, , ; T1 "Uhsax", // UHSAX{}{} {}, , ; T1 "Uhsub16", // UHSUB16{}{} {}, , ; T1 "Uhsub8", // UHSUB8{}{} {}, , ; T1 "Uqadd16", // UQADD16{}{} {}, , ; T1 "Uqadd8", // UQADD8{}{} {}, , ; T1 "Uqasx", // UQASX{}{} {}, , ; T1 "Uqsax", // UQSAX{}{} {}, , ; T1 "Uqsub16", // UQSUB16{}{} {}, , ; T1 "Uqsub8", // UQSUB8{}{} {}, , ; T1 "Usad8", // USAD8{}{} {}, , ; T1 // Instructions affecting the GE bits. "Sadd16", // SADD16{}{} {}, , ; T1 "Sadd8", // SADD8{}{} {}, , ; T1 "Sasx", // SASX{}{} {}, , ; T1 "Sel", // SEL{}{} {}, , ; T1 "Ssax", // SSAX{}{} {}, , ; T1 "Ssub16", // SSUB16{}{} {}, , ; T1 "Ssub8", // SSUB8{}{} {}, , ; T1 "Uadd16", // UADD16{}{} {}, , ; T1 "Uadd8", // UADD8{}{} {}, , ; T1 "Uasx", // UASX{}{} {}, , ; T1 "Usax", // USAX{}{} {}, , ; T1 "Usub16", // USUB16{}{} {}, , ; T1 "Usub8", // USUB8{}{} {}, , ; T1 // Instructions affecting the Q bit. "Qadd", // QADD{}{} {}, , ; T1 "Qdadd", // QDADD{}{} {}, , ; T1 "Qdsub", // QDSUB{}{} {}, , ; T1 "Qsub" // QSUB{}{} {}, , ; T1 ], "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": "Unconditional", "operands": [ "cond", "rd", "rn", "rm" ], "operand-filter": "cond == 'al'", "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 } ] } ] }