misc.isa revision 7238:f68fa944baee
12623SN/A// -*- mode:c++ -*-
22623SN/A
32623SN/A// Copyright (c) 2010 ARM Limited
42623SN/A// All rights reserved
52623SN/A//
62623SN/A// The license below extends only to copyright in the software and shall
72623SN/A// not be construed as granting a license to any other intellectual
82623SN/A// property including but not limited to intellectual property relating
92623SN/A// to a hardware implementation of the functionality of the software
102623SN/A// licensed hereunder.  You may use the software subject to the license
112623SN/A// terms below provided that you ensure that this notice is replicated
122623SN/A// unmodified and in its entirety in all distributions of the software,
132623SN/A// modified or unmodified, in source code or in binary form.
142623SN/A//
152623SN/A// Redistribution and use in source and binary forms, with or without
162623SN/A// modification, are permitted provided that the following conditions are
172623SN/A// met: redistributions of source code must retain the above copyright
182623SN/A// notice, this list of conditions and the following disclaimer;
192623SN/A// redistributions in binary form must reproduce the above copyright
202623SN/A// notice, this list of conditions and the following disclaimer in the
212623SN/A// documentation and/or other materials provided with the distribution;
222623SN/A// neither the name of the copyright holders nor the names of its
232623SN/A// contributors may be used to endorse or promote products derived from
242623SN/A// this software without specific prior written permission.
252623SN/A//
262623SN/A// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
272665Ssaidi@eecs.umich.edu// "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
292623SN/A// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
302623SN/A// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
312623SN/A// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
322623SN/A// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
332623SN/A// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
342623SN/A// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
352623SN/A// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
362623SN/A// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
372623SN/A//
382623SN/A// Authors: Gabe Black
392623SN/A
402623SN/Adef template MrsDeclare {{
412623SN/Aclass %(class_name)s : public %(base_class)s
422623SN/A{
432623SN/A  protected:
442623SN/A    public:
452623SN/A        // Constructor
462623SN/A        %(class_name)s(ExtMachInst machInst, IntRegIndex _dest);
472623SN/A        %(BasicExecDeclare)s
482623SN/A};
492623SN/A}};
502623SN/A
512623SN/Adef template MrsConstructor {{
522623SN/A    inline %(class_name)s::%(class_name)s(ExtMachInst machInst,
532623SN/A                                          IntRegIndex _dest)
542623SN/A        : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s, _dest)
552623SN/A    {
562623SN/A        %(constructor)s;
572623SN/A    }
582623SN/A}};
592623SN/A
602623SN/Adef template MsrRegDeclare {{
612623SN/Aclass %(class_name)s : public %(base_class)s
622623SN/A{
632623SN/A  protected:
642623SN/A    public:
652623SN/A        // Constructor
662623SN/A        %(class_name)s(ExtMachInst machInst, IntRegIndex _op1, uint8_t mask);
672839Sktlim@umich.edu        %(BasicExecDeclare)s
682798Sktlim@umich.edu};
692867Sktlim@umich.edu}};
702867Sktlim@umich.edu
712623SN/Adef template MsrRegConstructor {{
722623SN/A    inline %(class_name)s::%(class_name)s(ExtMachInst machInst,
732623SN/A                                          IntRegIndex _op1,
742623SN/A                                          uint8_t mask)
752623SN/A        : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s, _op1, mask)
762623SN/A    {
772623SN/A        %(constructor)s;
782623SN/A    }
792623SN/A}};
802640Sstever@eecs.umich.edu
812640Sstever@eecs.umich.edudef template MsrImmDeclare {{
822623SN/Aclass %(class_name)s : public %(base_class)s
832623SN/A{
842623SN/A  protected:
852623SN/A    public:
862630SN/A        // Constructor
872623SN/A        %(class_name)s(ExtMachInst machInst, uint32_t imm, uint8_t mask);
882630SN/A        %(BasicExecDeclare)s
892623SN/A};
902623SN/A}};
912623SN/A
922623SN/Adef template MsrImmConstructor {{
932623SN/A    inline %(class_name)s::%(class_name)s(ExtMachInst machInst,
942623SN/A                                          uint32_t imm,
952623SN/A                                          uint8_t mask)
962623SN/A        : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s, imm, mask)
972623SN/A    {
982623SN/A        %(constructor)s;
992623SN/A    }
1002623SN/A}};
1012623SN/A
1022640Sstever@eecs.umich.edudef template RevOpDeclare {{
1032623SN/Aclass %(class_name)s : public %(base_class)s
1042623SN/A{
1052623SN/A  protected:
1062623SN/A    public:
1072630SN/A        // Constructor
1082623SN/A        %(class_name)s(ExtMachInst machInst,
1092657Ssaidi@eecs.umich.edu                       IntRegIndex _dest, IntRegIndex _op1);
1102623SN/A        %(BasicExecDeclare)s
1112623SN/A};
1122623SN/A}};
1132623SN/A
1142623SN/Adef template RevOpConstructor {{
1152623SN/A    inline %(class_name)s::%(class_name)s(ExtMachInst machInst,
1162623SN/A                                          IntRegIndex _dest, IntRegIndex _op1)
1172640Sstever@eecs.umich.edu        : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s, _dest, _op1)
1182623SN/A    {
1192623SN/A        %(constructor)s;
1202623SN/A    }
1212623SN/A}};
1222630SN/A
1232623SN/Adef template RegRegRegImmOpDeclare {{
1242657Ssaidi@eecs.umich.educlass %(class_name)s : public %(base_class)s
1252623SN/A{
1262623SN/A  protected:
1272623SN/A    public:
1282623SN/A        // Constructor
1292623SN/A        %(class_name)s(ExtMachInst machInst,
1302623SN/A                       IntRegIndex _dest, IntRegIndex _op1, IntRegIndex _op2,
1312623SN/A                       uint32_t _imm);
1322623SN/A        %(BasicExecDeclare)s
1332623SN/A};
1342623SN/A}};
1352623SN/A
1362623SN/Adef template RegRegRegImmOpConstructor {{
1372623SN/A    inline %(class_name)s::%(class_name)s(ExtMachInst machInst,
1382839Sktlim@umich.edu                                          IntRegIndex _dest,
1392798Sktlim@umich.edu                                          IntRegIndex _op1,
1402798Sktlim@umich.edu                                          IntRegIndex _op2,
1412798Sktlim@umich.edu                                          uint32_t _imm)
1422798Sktlim@umich.edu        : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s,
1432623SN/A                         _dest, _op1, _op2, _imm)
1442623SN/A    {
1452623SN/A        %(constructor)s;
1462623SN/A    }
1472623SN/A}};
1482623SN/A
1492623SN/Adef template RegRegRegOpDeclare {{
1502623SN/Aclass %(class_name)s : public %(base_class)s
1512623SN/A{
1522623SN/A  protected:
1532623SN/A    public:
1542623SN/A        // Constructor
1552644Sstever@eecs.umich.edu        %(class_name)s(ExtMachInst machInst,
1562623SN/A                       IntRegIndex _dest, IntRegIndex _op1, IntRegIndex _op2);
1572644Sstever@eecs.umich.edu        %(BasicExecDeclare)s
1582798Sktlim@umich.edu};
1592839Sktlim@umich.edu}};
1602623SN/A
1612623SN/Adef template RegRegRegOpConstructor {{
1622623SN/A    inline %(class_name)s::%(class_name)s(ExtMachInst machInst,
163                                          IntRegIndex _dest,
164                                          IntRegIndex _op1,
165                                          IntRegIndex _op2)
166        : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s,
167                         _dest, _op1, _op2)
168    {
169        %(constructor)s;
170    }
171}};
172
173def template RegImmRegOpDeclare {{
174class %(class_name)s : public %(base_class)s
175{
176  protected:
177    public:
178        // Constructor
179        %(class_name)s(ExtMachInst machInst,
180                       IntRegIndex _dest, uint32_t _imm, IntRegIndex _op1);
181        %(BasicExecDeclare)s
182};
183}};
184
185def template RegImmRegOpConstructor {{
186    inline %(class_name)s::%(class_name)s(ExtMachInst machInst,
187                                          IntRegIndex _dest,
188                                          uint32_t _imm,
189                                          IntRegIndex _op1)
190        : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s,
191                         _dest, _imm, _op1)
192    {
193        %(constructor)s;
194    }
195}};
196
197def template RegImmRegShiftOpDeclare {{
198class %(class_name)s : public %(base_class)s
199{
200  protected:
201    public:
202        // Constructor
203        %(class_name)s(ExtMachInst machInst,
204                       IntRegIndex _dest, uint32_t _imm, IntRegIndex _op1,
205                       int32_t _shiftAmt, ArmShiftType _shiftType);
206        %(BasicExecDeclare)s
207};
208}};
209
210def template RegImmRegShiftOpConstructor {{
211    inline %(class_name)s::%(class_name)s(ExtMachInst machInst,
212                                          IntRegIndex _dest,
213                                          uint32_t _imm,
214                                          IntRegIndex _op1,
215                                          int32_t _shiftAmt,
216                                          ArmShiftType _shiftType)
217        : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s,
218                         _dest, _imm, _op1, _shiftAmt, _shiftType)
219    {
220        %(constructor)s;
221    }
222}};
223