misc.isa revision 7332
12623SN/A// -*- mode:c++ -*-
210596Sgabeblack@google.com
311147Smitch.hayenga@arm.com// Copyright (c) 2010 ARM Limited
48926Sandreas.hansson@arm.com// All rights reserved
58926Sandreas.hansson@arm.com//
68926Sandreas.hansson@arm.com// The license below extends only to copyright in the software and shall
78926Sandreas.hansson@arm.com// not be construed as granting a license to any other intellectual
88926Sandreas.hansson@arm.com// property including but not limited to intellectual property relating
98926Sandreas.hansson@arm.com// to a hardware implementation of the functionality of the software
108926Sandreas.hansson@arm.com// licensed hereunder.  You may use the software subject to the license
118926Sandreas.hansson@arm.com// terms below provided that you ensure that this notice is replicated
128926Sandreas.hansson@arm.com// unmodified and in its entirety in all distributions of the software,
138926Sandreas.hansson@arm.com// modified or unmodified, in source code or in binary form.
148926Sandreas.hansson@arm.com//
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
272623SN/A// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
282623SN/A// 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
402665Ssaidi@eecs.umich.edudef template MrsDeclare {{
412665Ssaidi@eecs.umich.educlass %(class_name)s : public %(base_class)s
422623SN/A{
432623SN/A  protected:
443170Sstever@eecs.umich.edu    public:
458105Sgblack@eecs.umich.edu        // Constructor
462623SN/A        %(class_name)s(ExtMachInst machInst, IntRegIndex _dest);
474040Ssaidi@eecs.umich.edu        %(BasicExecDeclare)s
489647Sdam.sunwoo@arm.com};
496658Snate@binkert.org}};
508229Snate@binkert.org
512623SN/Adef template MrsConstructor {{
529443SAndreas.Sandberg@ARM.com    inline %(class_name)s::%(class_name)s(ExtMachInst machInst,
538232Snate@binkert.org                                          IntRegIndex _dest)
548232Snate@binkert.org        : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s, _dest)
553348Sbinkertn@umich.edu    {
563348Sbinkertn@umich.edu        %(constructor)s;
578926Sandreas.hansson@arm.com    }
584762Snate@binkert.org}};
597678Sgblack@eecs.umich.edu
602901Ssaidi@eecs.umich.edudef template MsrRegDeclare {{
618779Sgblack@eecs.umich.educlass %(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);
675606Snate@binkert.org        %(BasicExecDeclare)s
682623SN/A};
692623SN/A}};
702623SN/A
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    }
795336Shines@cs.fsu.edu}};
802623SN/A
814873Sstever@eecs.umich.edudef template MsrImmDeclare {{
822623SN/Aclass %(class_name)s : public %(base_class)s
832623SN/A{
842623SN/A  protected:
852623SN/A    public:
862623SN/A        // Constructor
8711147Smitch.hayenga@arm.com        %(class_name)s(ExtMachInst machInst, uint32_t imm, uint8_t mask);
888921Sandreas.hansson@arm.com        %(BasicExecDeclare)s
8911148Smitch.hayenga@arm.com};
9011435Smitch.hayenga@arm.com}};
9111435Smitch.hayenga@arm.com
9211435Smitch.hayenga@arm.comdef template MsrImmConstructor {{
932623SN/A    inline %(class_name)s::%(class_name)s(ExtMachInst machInst,
942623SN/A                                          uint32_t imm,
955529Snate@binkert.org                                          uint8_t mask)
966078Sgblack@eecs.umich.edu        : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s, imm, mask)
975487Snate@binkert.org    {
985487Snate@binkert.org        %(constructor)s;
999095Sandreas.hansson@arm.com    }
1009095Sandreas.hansson@arm.com}};
10110537Sandreas.hansson@arm.com
10210537Sandreas.hansson@arm.comdef template ImmOpDeclare {{
1032623SN/Aclass %(class_name)s : public %(base_class)s
1042623SN/A{
1052623SN/A  protected:
1062623SN/A    public:
1072623SN/A        // Constructor
1082623SN/A        %(class_name)s(ExtMachInst machInst, uint64_t _imm);
1092623SN/A        %(BasicExecDeclare)s
1106775SBrad.Beckmann@amd.com};
1116775SBrad.Beckmann@amd.com}};
1126775SBrad.Beckmann@amd.com
1132623SN/Adef template ImmOpConstructor {{
1142623SN/A    inline %(class_name)s::%(class_name)s(ExtMachInst machInst, uint64_t _imm)
11510913Sandreas.sandberg@arm.com        : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s, _imm)
11610913Sandreas.sandberg@arm.com    {
1172623SN/A        %(constructor)s;
1189448SAndreas.Sandberg@ARM.com    }
11910913Sandreas.sandberg@arm.com}};
1202623SN/A
1219443SAndreas.Sandberg@ARM.comdef template RegImmOpDeclare {{
12211147Smitch.hayenga@arm.comclass %(class_name)s : public %(base_class)s
12310913Sandreas.sandberg@arm.com{
1249443SAndreas.Sandberg@ARM.com  protected:
1259443SAndreas.Sandberg@ARM.com    public:
1269443SAndreas.Sandberg@ARM.com        // Constructor
1272915Sktlim@umich.edu        %(class_name)s(ExtMachInst machInst, IntRegIndex _dest, uint64_t _imm);
12811147Smitch.hayenga@arm.com        %(BasicExecDeclare)s
1299443SAndreas.Sandberg@ARM.com};
13010913Sandreas.sandberg@arm.com}};
1319443SAndreas.Sandberg@ARM.com
1329342SAndreas.Sandberg@arm.comdef template RegImmOpConstructor {{
1339342SAndreas.Sandberg@arm.com    inline %(class_name)s::%(class_name)s(ExtMachInst machInst,
1342915Sktlim@umich.edu            IntRegIndex _dest, uint64_t _imm)
13511148Smitch.hayenga@arm.com        : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s, _dest, _imm)
13611148Smitch.hayenga@arm.com    {
13711148Smitch.hayenga@arm.com        %(constructor)s;
13811148Smitch.hayenga@arm.com    }
13911148Smitch.hayenga@arm.com}};
14011148Smitch.hayenga@arm.com
14111148Smitch.hayenga@arm.comdef template RegRegOpDeclare {{
14211321Ssteve.reinhardt@amd.comclass %(class_name)s : public %(base_class)s
14311151Smitch.hayenga@arm.com{
14411148Smitch.hayenga@arm.com  protected:
14511148Smitch.hayenga@arm.com    public:
14611148Smitch.hayenga@arm.com        // Constructor
14711148Smitch.hayenga@arm.com        %(class_name)s(ExtMachInst machInst,
14811148Smitch.hayenga@arm.com                       IntRegIndex _dest, IntRegIndex _op1);
14911148Smitch.hayenga@arm.com        %(BasicExecDeclare)s
15011148Smitch.hayenga@arm.com};
15111148Smitch.hayenga@arm.com}};
15211148Smitch.hayenga@arm.com
1539342SAndreas.Sandberg@arm.comdef template RegRegOpConstructor {{
1542915Sktlim@umich.edu    inline %(class_name)s::%(class_name)s(ExtMachInst machInst,
1559448SAndreas.Sandberg@ARM.com                                          IntRegIndex _dest, IntRegIndex _op1)
1569448SAndreas.Sandberg@ARM.com        : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s, _dest, _op1)
1575220Ssaidi@eecs.umich.edu    {
1585220Ssaidi@eecs.umich.edu        %(constructor)s;
1594940Snate@binkert.org    }
1609523SAndreas.Sandberg@ARM.com}};
1613324Shsul@eecs.umich.edu
1629448SAndreas.Sandberg@ARM.comdef template RegRegRegImmOpDeclare {{
1639448SAndreas.Sandberg@ARM.comclass %(class_name)s : public %(base_class)s
16411147Smitch.hayenga@arm.com{
16511147Smitch.hayenga@arm.com  protected:
16611147Smitch.hayenga@arm.com    public:
16711147Smitch.hayenga@arm.com        // Constructor
16811147Smitch.hayenga@arm.com        %(class_name)s(ExtMachInst machInst,
16911147Smitch.hayenga@arm.com                       IntRegIndex _dest, IntRegIndex _op1, IntRegIndex _op2,
17011147Smitch.hayenga@arm.com                       uint64_t _imm);
17111147Smitch.hayenga@arm.com        %(BasicExecDeclare)s
17211147Smitch.hayenga@arm.com};
17311147Smitch.hayenga@arm.com}};
17411147Smitch.hayenga@arm.com
17511147Smitch.hayenga@arm.comdef template RegRegRegImmOpConstructor {{
17611147Smitch.hayenga@arm.com    inline %(class_name)s::%(class_name)s(ExtMachInst machInst,
17711147Smitch.hayenga@arm.com                                          IntRegIndex _dest,
17811147Smitch.hayenga@arm.com                                          IntRegIndex _op1,
1799448SAndreas.Sandberg@ARM.com                                          IntRegIndex _op2,
1802623SN/A                                          uint64_t _imm)
1812623SN/A        : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s,
1829443SAndreas.Sandberg@ARM.com                         _dest, _op1, _op2, _imm)
1839443SAndreas.Sandberg@ARM.com    {
1849443SAndreas.Sandberg@ARM.com        %(constructor)s;
18510913Sandreas.sandberg@arm.com    }
1869443SAndreas.Sandberg@ARM.com}};
1879443SAndreas.Sandberg@ARM.com
18811147Smitch.hayenga@arm.comdef template RegRegRegRegOpDeclare {{
1899443SAndreas.Sandberg@ARM.comclass %(class_name)s : public %(base_class)s
1909443SAndreas.Sandberg@ARM.com{
1919443SAndreas.Sandberg@ARM.com  protected:
1929443SAndreas.Sandberg@ARM.com    public:
19310913Sandreas.sandberg@arm.com        // Constructor
1949443SAndreas.Sandberg@ARM.com        %(class_name)s(ExtMachInst machInst,
1959443SAndreas.Sandberg@ARM.com                       IntRegIndex _dest, IntRegIndex _op1,
1969443SAndreas.Sandberg@ARM.com                       IntRegIndex _op2, IntRegIndex _op3);
1979443SAndreas.Sandberg@ARM.com        %(BasicExecDeclare)s
1989443SAndreas.Sandberg@ARM.com};
1992623SN/A}};
2002798Sktlim@umich.edu
2012623SN/Adef template RegRegRegRegOpConstructor {{
2029429SAndreas.Sandberg@ARM.com    inline %(class_name)s::%(class_name)s(ExtMachInst machInst,
2039429SAndreas.Sandberg@ARM.com                                          IntRegIndex _dest,
2049443SAndreas.Sandberg@ARM.com                                          IntRegIndex _op1,
2059342SAndreas.Sandberg@arm.com                                          IntRegIndex _op2,
2069443SAndreas.Sandberg@ARM.com                                          IntRegIndex _op3)
2072623SN/A        : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s,
2082623SN/A                         _dest, _op1, _op2, _op3)
2092623SN/A    {
2102623SN/A        %(constructor)s;
2112623SN/A    }
2122623SN/A}};
2139429SAndreas.Sandberg@ARM.com
2142623SN/Adef template RegRegRegOpDeclare {{
2159443SAndreas.Sandberg@ARM.comclass %(class_name)s : public %(base_class)s
2162623SN/A{
2172623SN/A  protected:
2182623SN/A    public:
2199523SAndreas.Sandberg@ARM.com        // Constructor
2209523SAndreas.Sandberg@ARM.com        %(class_name)s(ExtMachInst machInst,
2219523SAndreas.Sandberg@ARM.com                       IntRegIndex _dest, IntRegIndex _op1, IntRegIndex _op2);
2229524SAndreas.Sandberg@ARM.com        %(BasicExecDeclare)s
2239523SAndreas.Sandberg@ARM.com};
2249523SAndreas.Sandberg@ARM.com}};
2259523SAndreas.Sandberg@ARM.com
2269523SAndreas.Sandberg@ARM.comdef template RegRegRegOpConstructor {{
2272623SN/A    inline %(class_name)s::%(class_name)s(ExtMachInst machInst,
2282623SN/A                                          IntRegIndex _dest,
22910407Smitch.hayenga@arm.com                                          IntRegIndex _op1,
2302623SN/A                                          IntRegIndex _op2)
23110407Smitch.hayenga@arm.com        : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s,
2324940Snate@binkert.org                         _dest, _op1, _op2)
23311147Smitch.hayenga@arm.com    {
2342623SN/A        %(constructor)s;
23511147Smitch.hayenga@arm.com    }
23611147Smitch.hayenga@arm.com}};
23711147Smitch.hayenga@arm.com
23810464SAndreas.Sandberg@ARM.comdef template RegRegImmOpDeclare {{
23910464SAndreas.Sandberg@ARM.comclass %(class_name)s : public %(base_class)s
2403686Sktlim@umich.edu{
24111147Smitch.hayenga@arm.com  protected:
24211147Smitch.hayenga@arm.com    public:
24311147Smitch.hayenga@arm.com        // Constructor
24411147Smitch.hayenga@arm.com        %(class_name)s(ExtMachInst machInst,
2459342SAndreas.Sandberg@arm.com                       IntRegIndex _dest, IntRegIndex _op1,
24611147Smitch.hayenga@arm.com                       uint64_t _imm);
24711147Smitch.hayenga@arm.com        %(BasicExecDeclare)s
24811147Smitch.hayenga@arm.com};
24911147Smitch.hayenga@arm.com}};
25011526Sdavid.guillen@arm.com
25111526Sdavid.guillen@arm.comdef template RegRegImmOpConstructor {{
2522623SN/A    inline %(class_name)s::%(class_name)s(ExtMachInst machInst,
2532623SN/A                                          IntRegIndex _dest,
2542623SN/A                                          IntRegIndex _op1,
2552623SN/A                                          uint64_t _imm)
2568737Skoansin.tan@gmail.com        : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s,
2572623SN/A                         _dest, _op1, _imm)
2584940Snate@binkert.org    {
2594940Snate@binkert.org        %(constructor)s;
26011147Smitch.hayenga@arm.com    }
26111147Smitch.hayenga@arm.com}};
2622623SN/A
2636043Sgblack@eecs.umich.edudef template RegRegImmImmOpDeclare {{
2646043Sgblack@eecs.umich.educlass %(class_name)s : public %(base_class)s
2656043Sgblack@eecs.umich.edu{
2669342SAndreas.Sandberg@arm.com  protected:
2672626SN/A    public:
26811147Smitch.hayenga@arm.com        // Constructor
2692623SN/A        %(class_name)s(ExtMachInst machInst,
27011147Smitch.hayenga@arm.com                       IntRegIndex _dest, IntRegIndex _op1,
27111147Smitch.hayenga@arm.com                       uint64_t _imm1, uint64_t _imm2);
27211147Smitch.hayenga@arm.com        %(BasicExecDeclare)s
27311147Smitch.hayenga@arm.com};
27411147Smitch.hayenga@arm.com}};
27511147Smitch.hayenga@arm.com
27611147Smitch.hayenga@arm.comdef template RegRegImmImmOpConstructor {{
27711147Smitch.hayenga@arm.com    inline %(class_name)s::%(class_name)s(ExtMachInst machInst,
27811526Sdavid.guillen@arm.com                                          IntRegIndex _dest,
2792623SN/A                                          IntRegIndex _op1,
2802623SN/A                                          uint64_t _imm1,
2812623SN/A                                          uint64_t _imm2)
28210030SAli.Saidi@ARM.com        : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s,
28310030SAli.Saidi@ARM.com                         _dest, _op1, _imm1, _imm2)
28410030SAli.Saidi@ARM.com    {
28510030SAli.Saidi@ARM.com        %(constructor)s;
28610030SAli.Saidi@ARM.com    }
28710030SAli.Saidi@ARM.com}};
28810529Smorr@cs.wisc.edu
28910529Smorr@cs.wisc.edudef template RegImmRegOpDeclare {{
29011148Smitch.hayenga@arm.comclass %(class_name)s : public %(base_class)s
29111148Smitch.hayenga@arm.com{
29211148Smitch.hayenga@arm.com  protected:
29311151Smitch.hayenga@arm.com    public:
29411148Smitch.hayenga@arm.com        // Constructor
29510529Smorr@cs.wisc.edu        %(class_name)s(ExtMachInst machInst,
29610529Smorr@cs.wisc.edu                       IntRegIndex _dest, uint64_t _imm, IntRegIndex _op1);
29710030SAli.Saidi@ARM.com        %(BasicExecDeclare)s
29811356Skrinat01@arm.com};
29911356Skrinat01@arm.com}};
30011356Skrinat01@arm.com
30111356Skrinat01@arm.comdef template RegImmRegOpConstructor {{
30210030SAli.Saidi@ARM.com    inline %(class_name)s::%(class_name)s(ExtMachInst machInst,
30310030SAli.Saidi@ARM.com                                          IntRegIndex _dest,
30411147Smitch.hayenga@arm.com                                          uint64_t _imm,
30511147Smitch.hayenga@arm.com                                          IntRegIndex _op1)
30611147Smitch.hayenga@arm.com        : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s,
30710030SAli.Saidi@ARM.com                         _dest, _imm, _op1)
30810030SAli.Saidi@ARM.com    {
30910030SAli.Saidi@ARM.com        %(constructor)s;
31010030SAli.Saidi@ARM.com    }
31110030SAli.Saidi@ARM.com}};
31210030SAli.Saidi@ARM.com
31310030SAli.Saidi@ARM.comdef template RegImmRegShiftOpDeclare {{
31410030SAli.Saidi@ARM.comclass %(class_name)s : public %(base_class)s
31510030SAli.Saidi@ARM.com{
31610030SAli.Saidi@ARM.com  protected:
31710030SAli.Saidi@ARM.com    public:
31810529Smorr@cs.wisc.edu        // Constructor
31910529Smorr@cs.wisc.edu        %(class_name)s(ExtMachInst machInst,
32011148Smitch.hayenga@arm.com                       IntRegIndex _dest, uint64_t _imm, IntRegIndex _op1,
32111321Ssteve.reinhardt@amd.com                       int32_t _shiftAmt, ArmShiftType _shiftType);
32211151Smitch.hayenga@arm.com        %(BasicExecDeclare)s
32311148Smitch.hayenga@arm.com};
32410529Smorr@cs.wisc.edu}};
32510529Smorr@cs.wisc.edu
32610030SAli.Saidi@ARM.comdef template RegImmRegShiftOpConstructor {{
32710030SAli.Saidi@ARM.com    inline %(class_name)s::%(class_name)s(ExtMachInst machInst,
32810030SAli.Saidi@ARM.com                                          IntRegIndex _dest,
32910030SAli.Saidi@ARM.com                                          uint64_t _imm,
33011147Smitch.hayenga@arm.com                                          IntRegIndex _op1,
33111147Smitch.hayenga@arm.com                                          int32_t _shiftAmt,
33211147Smitch.hayenga@arm.com                                          ArmShiftType _shiftType)
33310030SAli.Saidi@ARM.com        : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s,
33410030SAli.Saidi@ARM.com                         _dest, _imm, _op1, _shiftAmt, _shiftType)
33510030SAli.Saidi@ARM.com    {
3362623SN/A        %(constructor)s;
3378444Sgblack@eecs.umich.edu    }
3388444Sgblack@eecs.umich.edu}};
3392623SN/A