misc.isa revision 7233
12SN/A// -*- mode:c++ -*- 21762SN/A 35502Snate@binkert.org// Copyright (c) 2010 ARM Limited 42SN/A// All rights reserved 52SN/A// 62SN/A// The license below extends only to copyright in the software and shall 72SN/A// not be construed as granting a license to any other intellectual 82SN/A// property including but not limited to intellectual property relating 92SN/A// to a hardware implementation of the functionality of the software 102SN/A// licensed hereunder. You may use the software subject to the license 112SN/A// terms below provided that you ensure that this notice is replicated 122SN/A// unmodified and in its entirety in all distributions of the software, 132SN/A// modified or unmodified, in source code or in binary form. 142SN/A// 152SN/A// Redistribution and use in source and binary forms, with or without 162SN/A// modification, are permitted provided that the following conditions are 172SN/A// met: redistributions of source code must retain the above copyright 182SN/A// notice, this list of conditions and the following disclaimer; 192SN/A// redistributions in binary form must reproduce the above copyright 202SN/A// notice, this list of conditions and the following disclaimer in the 212SN/A// documentation and/or other materials provided with the distribution; 222SN/A// neither the name of the copyright holders nor the names of its 232SN/A// contributors may be used to endorse or promote products derived from 242SN/A// this software without specific prior written permission. 252SN/A// 262SN/A// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 272SN/A// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 282665Ssaidi@eecs.umich.edu// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 292665Ssaidi@eecs.umich.edu// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 302665Ssaidi@eecs.umich.edu// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 312665Ssaidi@eecs.umich.edu// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 322SN/A// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 332SN/A// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 345501Snate@binkert.org// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 352SN/A// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 362SN/A// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 372SN/A// 382SN/A// Authors: Gabe Black 395502Snate@binkert.org 405501Snate@binkert.orgdef template MrsDeclare {{ 415501Snate@binkert.orgclass %(class_name)s : public %(base_class)s 421717SN/A{ 435501Snate@binkert.org protected: 4456SN/A public: 452SN/A // Constructor 462SN/A %(class_name)s(ExtMachInst machInst, IntRegIndex _dest); 472SN/A %(BasicExecDeclare)s 482SN/A}; 492SN/A}}; 502SN/A 512SN/Adef template MrsConstructor {{ 522SN/A inline %(class_name)s::%(class_name)s(ExtMachInst machInst, 532SN/A IntRegIndex _dest) 545605Snate@binkert.org : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s, _dest) 552SN/A { 564017Sstever@eecs.umich.edu %(constructor)s; 574016Sstever@eecs.umich.edu } 584017Sstever@eecs.umich.edu}}; 594016Sstever@eecs.umich.edu 605768Snate@binkert.orgdef template MsrRegDeclare {{ 615768Snate@binkert.orgclass %(class_name)s : public %(base_class)s 625774Snate@binkert.org{ 635768Snate@binkert.org protected: 645768Snate@binkert.org public: 655768Snate@binkert.org // Constructor 665768Snate@binkert.org %(class_name)s(ExtMachInst machInst, IntRegIndex _op1, uint8_t mask); 675768Snate@binkert.org %(BasicExecDeclare)s 685768Snate@binkert.org}; 695768Snate@binkert.org}}; 705768Snate@binkert.org 715768Snate@binkert.orgdef template MsrRegConstructor {{ 725768Snate@binkert.org inline %(class_name)s::%(class_name)s(ExtMachInst machInst, 735768Snate@binkert.org IntRegIndex _op1, 745768Snate@binkert.org uint8_t mask) 755768Snate@binkert.org : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s, _op1, mask) 765602Snate@binkert.org { 775602Snate@binkert.org %(constructor)s; 785502Snate@binkert.org } 795503Snate@binkert.org}}; 805502Snate@binkert.org 815502Snate@binkert.orgdef template MsrImmDeclare {{ 825502Snate@binkert.orgclass %(class_name)s : public %(base_class)s 835502Snate@binkert.org{ 845502Snate@binkert.org protected: 855503Snate@binkert.org public: 865502Snate@binkert.org // Constructor 875502Snate@binkert.org %(class_name)s(ExtMachInst machInst, uint32_t imm, uint8_t mask); 885502Snate@binkert.org %(BasicExecDeclare)s 895502Snate@binkert.org}; 905503Snate@binkert.org}}; 915503Snate@binkert.org 925503Snate@binkert.orgdef template MsrImmConstructor {{ 935502Snate@binkert.org inline %(class_name)s::%(class_name)s(ExtMachInst machInst, 945503Snate@binkert.org uint32_t imm, 955502Snate@binkert.org uint8_t mask) 965502Snate@binkert.org : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s, imm, mask) 972SN/A { 982SN/A %(constructor)s; 992SN/A } 1005502Snate@binkert.org}}; 1015502Snate@binkert.org 1025602Snate@binkert.orgdef template RevOpDeclare {{ 1035502Snate@binkert.orgclass %(class_name)s : public %(base_class)s 1045502Snate@binkert.org{ 1052SN/A protected: 1065502Snate@binkert.org public: 1075502Snate@binkert.org // Constructor 1085503Snate@binkert.org %(class_name)s(ExtMachInst machInst, 1095503Snate@binkert.org IntRegIndex _dest, IntRegIndex _op1); 1105503Snate@binkert.org %(BasicExecDeclare)s 1115503Snate@binkert.org}; 1125503Snate@binkert.org}}; 1135502Snate@binkert.org 1142SN/Adef template RevOpConstructor {{ 1155503Snate@binkert.org inline %(class_name)s::%(class_name)s(ExtMachInst machInst, 1165503Snate@binkert.org IntRegIndex _dest, IntRegIndex _op1) 1175602Snate@binkert.org : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s, _dest, _op1) 1185502Snate@binkert.org { 1192SN/A %(constructor)s; 1205602Snate@binkert.org } 1215602Snate@binkert.org}}; 1225502Snate@binkert.org 1235503Snate@binkert.orgdef template RegRegRegImmOpDeclare {{ 1245503Snate@binkert.orgclass %(class_name)s : public %(base_class)s 1255502Snate@binkert.org{ 1265503Snate@binkert.org protected: 1275503Snate@binkert.org public: 1285503Snate@binkert.org // Constructor 1295503Snate@binkert.org %(class_name)s(ExtMachInst machInst, 1305503Snate@binkert.org IntRegIndex _dest, IntRegIndex _op1, IntRegIndex _op2, 1315503Snate@binkert.org uint32_t _imm); 1325503Snate@binkert.org %(BasicExecDeclare)s 1335503Snate@binkert.org}; 1345503Snate@binkert.org}}; 1355503Snate@binkert.org 1365503Snate@binkert.orgdef template RegRegRegImmOpConstructor {{ 1375503Snate@binkert.org inline %(class_name)s::%(class_name)s(ExtMachInst machInst, 1385503Snate@binkert.org IntRegIndex _dest, 1395503Snate@binkert.org IntRegIndex _op1, 1405502Snate@binkert.org IntRegIndex _op2, 1415502Snate@binkert.org uint32_t _imm) 1425503Snate@binkert.org : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s, 1435503Snate@binkert.org _dest, _op1, _op2, _imm) 1442SN/A { 1455502Snate@binkert.org %(constructor)s; 1465503Snate@binkert.org } 1475503Snate@binkert.org}}; 1485503Snate@binkert.org 1492SN/Adef template RegImmRegOpDeclare {{ 1502SN/Aclass %(class_name)s : public %(base_class)s 1512SN/A{ 1522SN/A protected: 1532SN/A public: 1542SN/A // Constructor 1555502Snate@binkert.org %(class_name)s(ExtMachInst machInst, 1562SN/A IntRegIndex _dest, uint32_t _imm, IntRegIndex _op1); 1575502Snate@binkert.org %(BasicExecDeclare)s 1585502Snate@binkert.org}; 1595502Snate@binkert.org}}; 1605602Snate@binkert.org 1612SN/Adef template RegImmRegOpConstructor {{ 1622SN/A inline %(class_name)s::%(class_name)s(ExtMachInst machInst, 1632SN/A IntRegIndex _dest, 1645502Snate@binkert.org uint32_t _imm, 1652SN/A IntRegIndex _op1) 1665502Snate@binkert.org : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s, 1675502Snate@binkert.org _dest, _imm, _op1) 1682SN/A { 1695502Snate@binkert.org %(constructor)s; 1702SN/A } 1712SN/A}}; 1725502Snate@binkert.org 1735502Snate@binkert.orgdef template RegImmRegShiftOpDeclare {{ 1745502Snate@binkert.orgclass %(class_name)s : public %(base_class)s 1755503Snate@binkert.org{ 1765503Snate@binkert.org protected: 1775502Snate@binkert.org public: 1785602Snate@binkert.org // Constructor 1792SN/A %(class_name)s(ExtMachInst machInst, 1802SN/A IntRegIndex _dest, uint32_t _imm, IntRegIndex _op1, 1812667Sstever@eecs.umich.edu int32_t _shiftAmt, ArmShiftType _shiftType); 1822SN/A %(BasicExecDeclare)s 1832SN/A}; 1845503Snate@binkert.org}}; 1855503Snate@binkert.org 1865769Snate@binkert.orgdef template RegImmRegShiftOpConstructor {{ 1875502Snate@binkert.org inline %(class_name)s::%(class_name)s(ExtMachInst machInst, 1885503Snate@binkert.org IntRegIndex _dest, 1895503Snate@binkert.org uint32_t _imm, 1905503Snate@binkert.org IntRegIndex _op1, 1915503Snate@binkert.org int32_t _shiftAmt, 1925503Snate@binkert.org ArmShiftType _shiftType) 1935503Snate@binkert.org : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s, 1945503Snate@binkert.org _dest, _imm, _op1, _shiftAmt, _shiftType) 1955502Snate@binkert.org { 1965502Snate@binkert.org %(constructor)s; 1975503Snate@binkert.org } 1985502Snate@binkert.org}}; 1992SN/A