misc.hh revision 7208:589ddde61a77
17087Snate@binkert.org/*
27087Snate@binkert.org * Copyright (c) 2010 ARM Limited
37087Snate@binkert.org * All rights reserved
47087Snate@binkert.org *
57087Snate@binkert.org * The license below extends only to copyright in the software and shall
67087Snate@binkert.org * not be construed as granting a license to any other intellectual
77087Snate@binkert.org * property including but not limited to intellectual property relating
87087Snate@binkert.org * to a hardware implementation of the functionality of the software
97087Snate@binkert.org * licensed hereunder.  You may use the software subject to the license
107087Snate@binkert.org * terms below provided that you ensure that this notice is replicated
117087Snate@binkert.org * unmodified and in its entirety in all distributions of the software,
127087Snate@binkert.org * modified or unmodified, in source code or in binary form.
135331Sgblack@eecs.umich.edu *
145331Sgblack@eecs.umich.edu * Redistribution and use in source and binary forms, with or without
155331Sgblack@eecs.umich.edu * modification, are permitted provided that the following conditions are
165331Sgblack@eecs.umich.edu * met: redistributions of source code must retain the above copyright
175331Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer;
185331Sgblack@eecs.umich.edu * redistributions in binary form must reproduce the above copyright
195331Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer in the
205331Sgblack@eecs.umich.edu * documentation and/or other materials provided with the distribution;
215331Sgblack@eecs.umich.edu * neither the name of the copyright holders nor the names of its
225331Sgblack@eecs.umich.edu * contributors may be used to endorse or promote products derived from
235331Sgblack@eecs.umich.edu * this software without specific prior written permission.
245331Sgblack@eecs.umich.edu *
255331Sgblack@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
265331Sgblack@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
275331Sgblack@eecs.umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
285331Sgblack@eecs.umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
295331Sgblack@eecs.umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
305331Sgblack@eecs.umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
315331Sgblack@eecs.umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
325331Sgblack@eecs.umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
335331Sgblack@eecs.umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
345331Sgblack@eecs.umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
355331Sgblack@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
365331Sgblack@eecs.umich.edu *
375331Sgblack@eecs.umich.edu * Authors: Gabe Black
385331Sgblack@eecs.umich.edu */
395331Sgblack@eecs.umich.edu
405331Sgblack@eecs.umich.edu#ifndef __ARCH_ARM_INSTS_MISC_HH__
414276Sgblack@eecs.umich.edu#define __ARCH_ARM_INSTS_MISC_HH__
424276Sgblack@eecs.umich.edu
434276Sgblack@eecs.umich.edu#include "arch/arm/insts/pred_inst.hh"
444276Sgblack@eecs.umich.edu
4510593Sgabeblack@google.comclass MrsOp : public PredOp
4610593Sgabeblack@google.com{
4710593Sgabeblack@google.com  protected:
4810593Sgabeblack@google.com    IntRegIndex dest;
4910593Sgabeblack@google.com
5010593Sgabeblack@google.com    MrsOp(const char *mnem, ExtMachInst _machInst, OpClass __opClass,
5110593Sgabeblack@google.com            IntRegIndex _dest) :
5210593Sgabeblack@google.com        PredOp(mnem, _machInst, __opClass), dest(_dest)
5310593Sgabeblack@google.com    {}
5410593Sgabeblack@google.com
5510593Sgabeblack@google.com    std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
5610593Sgabeblack@google.com};
5710593Sgabeblack@google.com
5810593Sgabeblack@google.comclass MsrBase : public PredOp
5910593Sgabeblack@google.com{
6010593Sgabeblack@google.com  protected:
6110593Sgabeblack@google.com    uint8_t byteMask;
6210593Sgabeblack@google.com
6310593Sgabeblack@google.com    MsrBase(const char *mnem, ExtMachInst _machInst, OpClass __opClass,
6410593Sgabeblack@google.com            uint8_t _byteMask) :
6510593Sgabeblack@google.com        PredOp(mnem, _machInst, __opClass), byteMask(_byteMask)
6610593Sgabeblack@google.com    {}
6710593Sgabeblack@google.com
6810593Sgabeblack@google.com    void printMsrBase(std::ostream &os) const;
6910593Sgabeblack@google.com};
705238Sgblack@eecs.umich.edu
7110593Sgabeblack@google.comclass MsrImmOp : public MsrBase
7210593Sgabeblack@google.com{
7310593Sgabeblack@google.com  protected:
7410593Sgabeblack@google.com    uint32_t imm;
7510593Sgabeblack@google.com
7610593Sgabeblack@google.com    MsrImmOp(const char *mnem, ExtMachInst _machInst, OpClass __opClass,
7710593Sgabeblack@google.com             uint32_t _imm, uint8_t _byteMask) :
7810593Sgabeblack@google.com        MsrBase(mnem, _machInst, __opClass, _byteMask), imm(_imm)
7910593Sgabeblack@google.com    {}
8010593Sgabeblack@google.com
8110593Sgabeblack@google.com    std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
8210593Sgabeblack@google.com};
8310593Sgabeblack@google.com
8410593Sgabeblack@google.comclass MsrRegOp : public MsrBase
8510593Sgabeblack@google.com{
8610593Sgabeblack@google.com  protected:
8710593Sgabeblack@google.com    IntRegIndex op1;
886611Sgblack@eecs.umich.edu
8910593Sgabeblack@google.com    MsrRegOp(const char *mnem, ExtMachInst _machInst, OpClass __opClass,
9010593Sgabeblack@google.com             IntRegIndex _op1, uint8_t _byteMask) :
9110593Sgabeblack@google.com        MsrBase(mnem, _machInst, __opClass, _byteMask), op1(_op1)
9210593Sgabeblack@google.com    {}
9310593Sgabeblack@google.com
9410593Sgabeblack@google.com    std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
956611Sgblack@eecs.umich.edu};
9610593Sgabeblack@google.com
9710593Sgabeblack@google.comclass RevOp : public PredOp
9810593Sgabeblack@google.com{
9910593Sgabeblack@google.com  protected:
10010593Sgabeblack@google.com    IntRegIndex dest;
10110593Sgabeblack@google.com    IntRegIndex op1;
10210593Sgabeblack@google.com
1036611Sgblack@eecs.umich.edu    RevOp(const char *mnem, ExtMachInst _machInst, OpClass __opClass,
1046611Sgblack@eecs.umich.edu          IntRegIndex _dest, IntRegIndex _op1) :
10510593Sgabeblack@google.com        PredOp(mnem, _machInst, __opClass), dest(_dest), op1(_op1)
10610593Sgabeblack@google.com    {}
10710593Sgabeblack@google.com
10810593Sgabeblack@google.com    std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
10910593Sgabeblack@google.com};
11010593Sgabeblack@google.com
11110593Sgabeblack@google.com#endif
11210593Sgabeblack@google.com