misc.isa revision 7225:bf41a07cc7c0
13005Sstever@eecs.umich.edu// -*- mode:c++ -*- 23005Sstever@eecs.umich.edu 33005Sstever@eecs.umich.edu// Copyright (c) 2010 ARM Limited 43005Sstever@eecs.umich.edu// All rights reserved 53005Sstever@eecs.umich.edu// 63005Sstever@eecs.umich.edu// The license below extends only to copyright in the software and shall 73005Sstever@eecs.umich.edu// not be construed as granting a license to any other intellectual 83005Sstever@eecs.umich.edu// property including but not limited to intellectual property relating 93005Sstever@eecs.umich.edu// to a hardware implementation of the functionality of the software 103005Sstever@eecs.umich.edu// licensed hereunder. You may use the software subject to the license 113005Sstever@eecs.umich.edu// terms below provided that you ensure that this notice is replicated 123005Sstever@eecs.umich.edu// unmodified and in its entirety in all distributions of the software, 133005Sstever@eecs.umich.edu// modified or unmodified, in source code or in binary form. 143005Sstever@eecs.umich.edu// 153005Sstever@eecs.umich.edu// Redistribution and use in source and binary forms, with or without 163005Sstever@eecs.umich.edu// modification, are permitted provided that the following conditions are 173005Sstever@eecs.umich.edu// met: redistributions of source code must retain the above copyright 183005Sstever@eecs.umich.edu// notice, this list of conditions and the following disclaimer; 193005Sstever@eecs.umich.edu// redistributions in binary form must reproduce the above copyright 203005Sstever@eecs.umich.edu// notice, this list of conditions and the following disclaimer in the 213005Sstever@eecs.umich.edu// documentation and/or other materials provided with the distribution; 223005Sstever@eecs.umich.edu// neither the name of the copyright holders nor the names of its 233005Sstever@eecs.umich.edu// contributors may be used to endorse or promote products derived from 243005Sstever@eecs.umich.edu// this software without specific prior written permission. 253005Sstever@eecs.umich.edu// 263005Sstever@eecs.umich.edu// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 273005Sstever@eecs.umich.edu// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 283005Sstever@eecs.umich.edu// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 292889SN/A// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 302889SN/A// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 312710SN/A// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 322710SN/A// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 332934SN/A// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 342934SN/A// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 352549SN/A// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 362995SN/A// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 372549SN/A// 383088Sstever@eecs.umich.edu// Authors: Gabe Black 393088Sstever@eecs.umich.edu 403088Sstever@eecs.umich.edudef template MrsDeclare {{ 412889SN/Aclass %(class_name)s : public %(base_class)s 422710SN/A{ 432917SN/A protected: 442710SN/A public: 452917SN/A // Constructor 462948SN/A %(class_name)s(ExtMachInst machInst, IntRegIndex _dest); 472995SN/A %(BasicExecDeclare)s 482995SN/A}; 492995SN/A}}; 502995SN/A 512995SN/Adef template MrsConstructor {{ 522995SN/A inline %(class_name)s::%(class_name)s(ExtMachInst machInst, 533025Ssaidi@eecs.umich.edu IntRegIndex _dest) 543025Ssaidi@eecs.umich.edu : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s, _dest) 553025Ssaidi@eecs.umich.edu { 562710SN/A %(constructor)s; 572710SN/A } 582710SN/A}}; 592710SN/A 602710SN/Adef template MsrRegDeclare {{ 612710SN/Aclass %(class_name)s : public %(base_class)s 622710SN/A{ 632934SN/A protected: 642934SN/A public: 652934SN/A // Constructor 662953SN/A %(class_name)s(ExtMachInst machInst, IntRegIndex _op1, uint8_t mask); 672934SN/A %(BasicExecDeclare)s 682934SN/A}; 692934SN/A}}; 702953SN/A 712934SN/Adef template MsrRegConstructor {{ 722934SN/A inline %(class_name)s::%(class_name)s(ExtMachInst machInst, 732934SN/A IntRegIndex _op1, 742953SN/A uint8_t mask) 752566SN/A : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s, _op1, mask) 763005Sstever@eecs.umich.edu { 773005Sstever@eecs.umich.edu %(constructor)s; 782995SN/A } 792995SN/A}}; 802995SN/A 812995SN/Adef template MsrImmDeclare {{ 822995SN/Aclass %(class_name)s : public %(base_class)s 832995SN/A{ 842995SN/A protected: 852995SN/A public: 862917SN/A // Constructor 872995SN/A %(class_name)s(ExtMachInst machInst, uint32_t imm, uint8_t mask); 883005Sstever@eecs.umich.edu %(BasicExecDeclare)s 892995SN/A}; 903005Sstever@eecs.umich.edu}}; 913005Sstever@eecs.umich.edu 923005Sstever@eecs.umich.edudef template MsrImmConstructor {{ 933005Sstever@eecs.umich.edu inline %(class_name)s::%(class_name)s(ExtMachInst machInst, 943005Sstever@eecs.umich.edu uint32_t imm, 953005Sstever@eecs.umich.edu uint8_t mask) 963050Sstever@eecs.umich.edu : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s, imm, mask) 973005Sstever@eecs.umich.edu { 983005Sstever@eecs.umich.edu %(constructor)s; 993005Sstever@eecs.umich.edu } 1003050Sstever@eecs.umich.edu}}; 1013025Ssaidi@eecs.umich.edu 1023005Sstever@eecs.umich.edudef template RevOpDeclare {{ 1033005Sstever@eecs.umich.educlass %(class_name)s : public %(base_class)s 1043005Sstever@eecs.umich.edu{ 1053005Sstever@eecs.umich.edu protected: 1063005Sstever@eecs.umich.edu public: 1073050Sstever@eecs.umich.edu // Constructor 1083005Sstever@eecs.umich.edu %(class_name)s(ExtMachInst machInst, 1093005Sstever@eecs.umich.edu IntRegIndex _dest, IntRegIndex _op1); 1103005Sstever@eecs.umich.edu %(BasicExecDeclare)s 1112566SN/A}; 1122710SN/A}}; 1132710SN/A 1142917SN/Adef template RevOpConstructor {{ 1153046Sstever@eecs.umich.edu inline %(class_name)s::%(class_name)s(ExtMachInst machInst, 1162948SN/A IntRegIndex _dest, IntRegIndex _op1) 1172948SN/A : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s, _dest, _op1) 1182948SN/A { 1193046Sstever@eecs.umich.edu %(constructor)s; 1202917SN/A } 1213046Sstever@eecs.umich.edu}}; 1223022Shsul@eecs.umich.edu 1233046Sstever@eecs.umich.edudef template SatOpDeclare {{ 1243022Shsul@eecs.umich.educlass %(class_name)s : public %(base_class)s 1253022Shsul@eecs.umich.edu{ 1263046Sstever@eecs.umich.edu protected: 1273046Sstever@eecs.umich.edu public: 1282710SN/A // Constructor 1292740SN/A %(class_name)s(ExtMachInst machInst, 130 IntRegIndex _dest, uint32_t _satImm, IntRegIndex _op1); 131 %(BasicExecDeclare)s 132}; 133}}; 134 135def template SatOpConstructor {{ 136 inline %(class_name)s::%(class_name)s(ExtMachInst machInst, 137 IntRegIndex _dest, 138 uint32_t _satImm, 139 IntRegIndex _op1) 140 : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s, 141 _dest, _satImm, _op1) 142 { 143 %(constructor)s; 144 } 145}}; 146 147def template SatShiftOpDeclare {{ 148class %(class_name)s : public %(base_class)s 149{ 150 protected: 151 public: 152 // Constructor 153 %(class_name)s(ExtMachInst machInst, 154 IntRegIndex _dest, uint32_t _satImm, IntRegIndex _op1, 155 int32_t _shiftAmt, ArmShiftType _shiftType); 156 %(BasicExecDeclare)s 157}; 158}}; 159 160def template SatShiftOpConstructor {{ 161 inline %(class_name)s::%(class_name)s(ExtMachInst machInst, 162 IntRegIndex _dest, 163 uint32_t _satImm, 164 IntRegIndex _op1, 165 int32_t _shiftAmt, 166 ArmShiftType _shiftType) 167 : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s, 168 _dest, _satImm, _op1, _shiftAmt, _shiftType) 169 { 170 %(constructor)s; 171 } 172}}; 173