mem.hh revision 12104
17118Sgblack@eecs.umich.edu/*
27118Sgblack@eecs.umich.edu * Copyright (c) 2010 ARM Limited
37118Sgblack@eecs.umich.edu * All rights reserved
47118Sgblack@eecs.umich.edu *
57118Sgblack@eecs.umich.edu * The license below extends only to copyright in the software and shall
67118Sgblack@eecs.umich.edu * not be construed as granting a license to any other intellectual
77118Sgblack@eecs.umich.edu * property including but not limited to intellectual property relating
87118Sgblack@eecs.umich.edu * to a hardware implementation of the functionality of the software
97118Sgblack@eecs.umich.edu * licensed hereunder.  You may use the software subject to the license
107118Sgblack@eecs.umich.edu * terms below provided that you ensure that this notice is replicated
117118Sgblack@eecs.umich.edu * unmodified and in its entirety in all distributions of the software,
127118Sgblack@eecs.umich.edu * modified or unmodified, in source code or in binary form.
137118Sgblack@eecs.umich.edu *
147118Sgblack@eecs.umich.edu * Copyright (c) 2007-2008 The Florida State University
156253Sgblack@eecs.umich.edu * All rights reserved.
166253Sgblack@eecs.umich.edu *
176253Sgblack@eecs.umich.edu * Redistribution and use in source and binary forms, with or without
186253Sgblack@eecs.umich.edu * modification, are permitted provided that the following conditions are
196253Sgblack@eecs.umich.edu * met: redistributions of source code must retain the above copyright
206253Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer;
216253Sgblack@eecs.umich.edu * redistributions in binary form must reproduce the above copyright
226253Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer in the
236253Sgblack@eecs.umich.edu * documentation and/or other materials provided with the distribution;
246253Sgblack@eecs.umich.edu * neither the name of the copyright holders nor the names of its
256253Sgblack@eecs.umich.edu * contributors may be used to endorse or promote products derived from
266253Sgblack@eecs.umich.edu * this software without specific prior written permission.
276253Sgblack@eecs.umich.edu *
286253Sgblack@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
296253Sgblack@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
306253Sgblack@eecs.umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
316253Sgblack@eecs.umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
326253Sgblack@eecs.umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
336253Sgblack@eecs.umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
346253Sgblack@eecs.umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
356253Sgblack@eecs.umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
366253Sgblack@eecs.umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
376253Sgblack@eecs.umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
386253Sgblack@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
396253Sgblack@eecs.umich.edu *
406253Sgblack@eecs.umich.edu * Authors: Stephen Hines
416253Sgblack@eecs.umich.edu */
426253Sgblack@eecs.umich.edu#ifndef __ARCH_ARM_MEM_HH__
436253Sgblack@eecs.umich.edu#define __ARCH_ARM_MEM_HH__
446253Sgblack@eecs.umich.edu
456253Sgblack@eecs.umich.edu#include "arch/arm/insts/pred_inst.hh"
466253Sgblack@eecs.umich.edu
476253Sgblack@eecs.umich.edunamespace ArmISA
486253Sgblack@eecs.umich.edu{
497118Sgblack@eecs.umich.edu
507205Sgblack@eecs.umich.educlass Swap : public PredOp
517205Sgblack@eecs.umich.edu{
527205Sgblack@eecs.umich.edu  protected:
537205Sgblack@eecs.umich.edu    IntRegIndex dest;
547205Sgblack@eecs.umich.edu    IntRegIndex op1;
557205Sgblack@eecs.umich.edu    IntRegIndex base;
567205Sgblack@eecs.umich.edu
577205Sgblack@eecs.umich.edu    Swap(const char *mnem, ExtMachInst _machInst, OpClass __opClass,
587205Sgblack@eecs.umich.edu         IntRegIndex _dest, IntRegIndex _op1, IntRegIndex _base)
597205Sgblack@eecs.umich.edu        : PredOp(mnem, _machInst, __opClass),
607205Sgblack@eecs.umich.edu          dest(_dest), op1(_op1), base(_base)
617205Sgblack@eecs.umich.edu    {}
627205Sgblack@eecs.umich.edu
637205Sgblack@eecs.umich.edu    std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
647205Sgblack@eecs.umich.edu};
657205Sgblack@eecs.umich.edu
667720Sgblack@eecs.umich.educlass MightBeMicro : public PredOp
677720Sgblack@eecs.umich.edu{
687720Sgblack@eecs.umich.edu  protected:
697720Sgblack@eecs.umich.edu    MightBeMicro(const char *mnem, ExtMachInst _machInst, OpClass __opClass)
707720Sgblack@eecs.umich.edu        : PredOp(mnem, _machInst, __opClass)
717720Sgblack@eecs.umich.edu    {}
727720Sgblack@eecs.umich.edu
737720Sgblack@eecs.umich.edu    void
747720Sgblack@eecs.umich.edu    advancePC(PCState &pcState) const
757720Sgblack@eecs.umich.edu    {
767720Sgblack@eecs.umich.edu        if (flags[IsLastMicroop]) {
777720Sgblack@eecs.umich.edu            pcState.uEnd();
787720Sgblack@eecs.umich.edu        } else if (flags[IsMicroop]) {
797720Sgblack@eecs.umich.edu            pcState.uAdvance();
807720Sgblack@eecs.umich.edu        } else {
817720Sgblack@eecs.umich.edu            pcState.advance();
827720Sgblack@eecs.umich.edu        }
837720Sgblack@eecs.umich.edu    }
847720Sgblack@eecs.umich.edu};
857720Sgblack@eecs.umich.edu
867291Sgblack@eecs.umich.edu// The address is a base register plus an immediate.
877720Sgblack@eecs.umich.educlass RfeOp : public MightBeMicro
887291Sgblack@eecs.umich.edu{
897291Sgblack@eecs.umich.edu  public:
907291Sgblack@eecs.umich.edu    enum AddrMode {
917291Sgblack@eecs.umich.edu        DecrementAfter,
927291Sgblack@eecs.umich.edu        DecrementBefore,
937291Sgblack@eecs.umich.edu        IncrementAfter,
947291Sgblack@eecs.umich.edu        IncrementBefore
957291Sgblack@eecs.umich.edu    };
967291Sgblack@eecs.umich.edu  protected:
977291Sgblack@eecs.umich.edu    IntRegIndex base;
987291Sgblack@eecs.umich.edu    AddrMode mode;
997291Sgblack@eecs.umich.edu    bool wb;
1008140SMatt.Horsnell@arm.com    IntRegIndex ura, urb, urc;
1018140SMatt.Horsnell@arm.com    static const unsigned numMicroops = 3;
1027646Sgene.wu@arm.com
1037646Sgene.wu@arm.com    StaticInstPtr *uops;
1047291Sgblack@eecs.umich.edu
1057291Sgblack@eecs.umich.edu    RfeOp(const char *mnem, ExtMachInst _machInst, OpClass __opClass,
1067291Sgblack@eecs.umich.edu          IntRegIndex _base, AddrMode _mode, bool _wb)
1077720Sgblack@eecs.umich.edu        : MightBeMicro(mnem, _machInst, __opClass),
1088140SMatt.Horsnell@arm.com          base(_base), mode(_mode), wb(_wb),
1098140SMatt.Horsnell@arm.com          ura(INTREG_UREG0), urb(INTREG_UREG1),
1108140SMatt.Horsnell@arm.com          urc(INTREG_UREG2),
1118140SMatt.Horsnell@arm.com          uops(NULL)
1127291Sgblack@eecs.umich.edu    {}
1137291Sgblack@eecs.umich.edu
1147646Sgene.wu@arm.com    virtual
1157646Sgene.wu@arm.com    ~RfeOp()
1167646Sgene.wu@arm.com    {
1177747SAli.Saidi@ARM.com        delete [] uops;
1187646Sgene.wu@arm.com    }
1197646Sgene.wu@arm.com
1207646Sgene.wu@arm.com    StaticInstPtr
1217720Sgblack@eecs.umich.edu    fetchMicroop(MicroPC microPC) const
1227646Sgene.wu@arm.com    {
1237646Sgene.wu@arm.com        assert(uops != NULL && microPC < numMicroops);
1247646Sgene.wu@arm.com        return uops[microPC];
1257646Sgene.wu@arm.com    }
1267646Sgene.wu@arm.com
1277291Sgblack@eecs.umich.edu    std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
1287291Sgblack@eecs.umich.edu};
1297291Sgblack@eecs.umich.edu
1307312Sgblack@eecs.umich.edu// The address is a base register plus an immediate.
1317720Sgblack@eecs.umich.educlass SrsOp : public MightBeMicro
1327312Sgblack@eecs.umich.edu{
1337312Sgblack@eecs.umich.edu  public:
1347312Sgblack@eecs.umich.edu    enum AddrMode {
1357312Sgblack@eecs.umich.edu        DecrementAfter,
1367312Sgblack@eecs.umich.edu        DecrementBefore,
1377312Sgblack@eecs.umich.edu        IncrementAfter,
1387312Sgblack@eecs.umich.edu        IncrementBefore
1397312Sgblack@eecs.umich.edu    };
1407312Sgblack@eecs.umich.edu  protected:
1417312Sgblack@eecs.umich.edu    uint32_t regMode;
1427312Sgblack@eecs.umich.edu    AddrMode mode;
1437312Sgblack@eecs.umich.edu    bool wb;
1447646Sgene.wu@arm.com    static const unsigned numMicroops = 2;
1457646Sgene.wu@arm.com
1467646Sgene.wu@arm.com    StaticInstPtr *uops;
1477312Sgblack@eecs.umich.edu
1487312Sgblack@eecs.umich.edu    SrsOp(const char *mnem, ExtMachInst _machInst, OpClass __opClass,
1497312Sgblack@eecs.umich.edu          uint32_t _regMode, AddrMode _mode, bool _wb)
1507720Sgblack@eecs.umich.edu        : MightBeMicro(mnem, _machInst, __opClass),
1517646Sgene.wu@arm.com          regMode(_regMode), mode(_mode), wb(_wb), uops(NULL)
1527312Sgblack@eecs.umich.edu    {}
1537312Sgblack@eecs.umich.edu
1547646Sgene.wu@arm.com    virtual
1557646Sgene.wu@arm.com    ~SrsOp()
1567646Sgene.wu@arm.com    {
1577845SAli.Saidi@ARM.com        delete [] uops;
1587646Sgene.wu@arm.com    }
1597646Sgene.wu@arm.com
1607646Sgene.wu@arm.com    StaticInstPtr
1617720Sgblack@eecs.umich.edu    fetchMicroop(MicroPC microPC) const
1627646Sgene.wu@arm.com    {
1637646Sgene.wu@arm.com        assert(uops != NULL && microPC < numMicroops);
1647646Sgene.wu@arm.com        return uops[microPC];
1657646Sgene.wu@arm.com    }
1667646Sgene.wu@arm.com
1677312Sgblack@eecs.umich.edu    std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
1687312Sgblack@eecs.umich.edu};
1697312Sgblack@eecs.umich.edu
1707720Sgblack@eecs.umich.educlass Memory : public MightBeMicro
1717118Sgblack@eecs.umich.edu{
1727118Sgblack@eecs.umich.edu  public:
1737118Sgblack@eecs.umich.edu    enum AddrMode {
1747118Sgblack@eecs.umich.edu        AddrMd_Offset,
1757118Sgblack@eecs.umich.edu        AddrMd_PreIndex,
1767118Sgblack@eecs.umich.edu        AddrMd_PostIndex
1777118Sgblack@eecs.umich.edu    };
1787118Sgblack@eecs.umich.edu
1797118Sgblack@eecs.umich.edu  protected:
1807118Sgblack@eecs.umich.edu
1817118Sgblack@eecs.umich.edu    IntRegIndex dest;
1827118Sgblack@eecs.umich.edu    IntRegIndex base;
1837118Sgblack@eecs.umich.edu    bool add;
1847646Sgene.wu@arm.com    static const unsigned numMicroops = 3;
1857646Sgene.wu@arm.com
1867646Sgene.wu@arm.com    StaticInstPtr *uops;
1877118Sgblack@eecs.umich.edu
1887132Sgblack@eecs.umich.edu    Memory(const char *mnem, ExtMachInst _machInst, OpClass __opClass,
1897132Sgblack@eecs.umich.edu           IntRegIndex _dest, IntRegIndex _base, bool _add)
1907720Sgblack@eecs.umich.edu        : MightBeMicro(mnem, _machInst, __opClass),
1917646Sgene.wu@arm.com          dest(_dest), base(_base), add(_add), uops(NULL)
1927118Sgblack@eecs.umich.edu    {}
1937118Sgblack@eecs.umich.edu
1947646Sgene.wu@arm.com    virtual
1957646Sgene.wu@arm.com    ~Memory()
1967646Sgene.wu@arm.com    {
1977646Sgene.wu@arm.com        delete [] uops;
1987646Sgene.wu@arm.com    }
1997646Sgene.wu@arm.com
2007646Sgene.wu@arm.com    StaticInstPtr
2017720Sgblack@eecs.umich.edu    fetchMicroop(MicroPC microPC) const
2027646Sgene.wu@arm.com    {
2037646Sgene.wu@arm.com        assert(uops != NULL && microPC < numMicroops);
2047646Sgene.wu@arm.com        return uops[microPC];
2057646Sgene.wu@arm.com    }
2067646Sgene.wu@arm.com
2077118Sgblack@eecs.umich.edu    virtual void
2087118Sgblack@eecs.umich.edu    printOffset(std::ostream &os) const
2097118Sgblack@eecs.umich.edu    {}
2107118Sgblack@eecs.umich.edu
2117279Sgblack@eecs.umich.edu    virtual void
2127279Sgblack@eecs.umich.edu    printDest(std::ostream &os) const
2137279Sgblack@eecs.umich.edu    {
21412104Snathanael.premillieu@arm.com        printIntReg(os, dest);
2157279Sgblack@eecs.umich.edu    }
2167279Sgblack@eecs.umich.edu
2177118Sgblack@eecs.umich.edu    void printInst(std::ostream &os, AddrMode addrMode) const;
2187118Sgblack@eecs.umich.edu};
2197118Sgblack@eecs.umich.edu
2207118Sgblack@eecs.umich.edu// The address is a base register plus an immediate.
2217132Sgblack@eecs.umich.educlass MemoryImm : public Memory
2227118Sgblack@eecs.umich.edu{
2237118Sgblack@eecs.umich.edu  protected:
2247118Sgblack@eecs.umich.edu    int32_t imm;
2257118Sgblack@eecs.umich.edu
2267132Sgblack@eecs.umich.edu    MemoryImm(const char *mnem, ExtMachInst _machInst, OpClass __opClass,
2277132Sgblack@eecs.umich.edu              IntRegIndex _dest, IntRegIndex _base, bool _add, int32_t _imm)
2287132Sgblack@eecs.umich.edu        : Memory(mnem, _machInst, __opClass, _dest, _base, _add), imm(_imm)
2297118Sgblack@eecs.umich.edu    {}
2307118Sgblack@eecs.umich.edu
2317118Sgblack@eecs.umich.edu    void
2327118Sgblack@eecs.umich.edu    printOffset(std::ostream &os) const
2337118Sgblack@eecs.umich.edu    {
2347118Sgblack@eecs.umich.edu        int32_t pImm = imm;
2357118Sgblack@eecs.umich.edu        if (!add)
2367118Sgblack@eecs.umich.edu            pImm = -pImm;
2377118Sgblack@eecs.umich.edu        ccprintf(os, "#%d", pImm);
2387118Sgblack@eecs.umich.edu    }
2397118Sgblack@eecs.umich.edu};
2407118Sgblack@eecs.umich.edu
2417303Sgblack@eecs.umich.educlass MemoryExImm : public MemoryImm
2427303Sgblack@eecs.umich.edu{
2437303Sgblack@eecs.umich.edu  protected:
2447303Sgblack@eecs.umich.edu    IntRegIndex result;
2457303Sgblack@eecs.umich.edu
2467303Sgblack@eecs.umich.edu    MemoryExImm(const char *mnem, ExtMachInst _machInst, OpClass __opClass,
2477303Sgblack@eecs.umich.edu                IntRegIndex _result, IntRegIndex _dest, IntRegIndex _base,
2487303Sgblack@eecs.umich.edu                bool _add, int32_t _imm)
2497303Sgblack@eecs.umich.edu        : MemoryImm(mnem, _machInst, __opClass, _dest, _base, _add, _imm),
2507303Sgblack@eecs.umich.edu                    result(_result)
2517303Sgblack@eecs.umich.edu    {}
2527303Sgblack@eecs.umich.edu
2537303Sgblack@eecs.umich.edu    void
2547303Sgblack@eecs.umich.edu    printDest(std::ostream &os) const
2557303Sgblack@eecs.umich.edu    {
25612104Snathanael.premillieu@arm.com        printIntReg(os, result);
2577303Sgblack@eecs.umich.edu        os << ", ";
2587303Sgblack@eecs.umich.edu        MemoryImm::printDest(os);
2597303Sgblack@eecs.umich.edu    }
2607303Sgblack@eecs.umich.edu};
2617303Sgblack@eecs.umich.edu
2627279Sgblack@eecs.umich.edu// The address is a base register plus an immediate.
2637279Sgblack@eecs.umich.educlass MemoryDImm : public MemoryImm
2647279Sgblack@eecs.umich.edu{
2657279Sgblack@eecs.umich.edu  protected:
2667279Sgblack@eecs.umich.edu    IntRegIndex dest2;
2677279Sgblack@eecs.umich.edu
2687279Sgblack@eecs.umich.edu    MemoryDImm(const char *mnem, ExtMachInst _machInst, OpClass __opClass,
2697279Sgblack@eecs.umich.edu              IntRegIndex _dest, IntRegIndex _dest2,
2707279Sgblack@eecs.umich.edu              IntRegIndex _base, bool _add, int32_t _imm)
2717279Sgblack@eecs.umich.edu        : MemoryImm(mnem, _machInst, __opClass, _dest, _base, _add, _imm),
2727279Sgblack@eecs.umich.edu          dest2(_dest2)
2737279Sgblack@eecs.umich.edu    {}
2747279Sgblack@eecs.umich.edu
2757279Sgblack@eecs.umich.edu    void
2767279Sgblack@eecs.umich.edu    printDest(std::ostream &os) const
2777279Sgblack@eecs.umich.edu    {
2787279Sgblack@eecs.umich.edu        MemoryImm::printDest(os);
2797279Sgblack@eecs.umich.edu        os << ", ";
28012104Snathanael.premillieu@arm.com        printIntReg(os, dest2);
2817279Sgblack@eecs.umich.edu    }
2827279Sgblack@eecs.umich.edu};
2837279Sgblack@eecs.umich.edu
2847303Sgblack@eecs.umich.educlass MemoryExDImm : public MemoryDImm
2857303Sgblack@eecs.umich.edu{
2867303Sgblack@eecs.umich.edu  protected:
2877303Sgblack@eecs.umich.edu    IntRegIndex result;
2887303Sgblack@eecs.umich.edu
2897303Sgblack@eecs.umich.edu    MemoryExDImm(const char *mnem, ExtMachInst _machInst, OpClass __opClass,
2907303Sgblack@eecs.umich.edu                 IntRegIndex _result, IntRegIndex _dest, IntRegIndex _dest2,
2917303Sgblack@eecs.umich.edu                 IntRegIndex _base, bool _add, int32_t _imm)
2927303Sgblack@eecs.umich.edu        : MemoryDImm(mnem, _machInst, __opClass, _dest, _dest2,
2937303Sgblack@eecs.umich.edu                     _base, _add, _imm), result(_result)
2947303Sgblack@eecs.umich.edu    {}
2957303Sgblack@eecs.umich.edu
2967303Sgblack@eecs.umich.edu    void
2977303Sgblack@eecs.umich.edu    printDest(std::ostream &os) const
2987303Sgblack@eecs.umich.edu    {
29912104Snathanael.premillieu@arm.com        printIntReg(os, result);
3007303Sgblack@eecs.umich.edu        os << ", ";
3017303Sgblack@eecs.umich.edu        MemoryDImm::printDest(os);
3027303Sgblack@eecs.umich.edu    }
3037303Sgblack@eecs.umich.edu};
3047303Sgblack@eecs.umich.edu
3057118Sgblack@eecs.umich.edu// The address is a shifted register plus an immediate
3067132Sgblack@eecs.umich.educlass MemoryReg : public Memory
3077118Sgblack@eecs.umich.edu{
3087118Sgblack@eecs.umich.edu  protected:
3097118Sgblack@eecs.umich.edu    int32_t shiftAmt;
3107118Sgblack@eecs.umich.edu    ArmShiftType shiftType;
3117118Sgblack@eecs.umich.edu    IntRegIndex index;
3127118Sgblack@eecs.umich.edu
3137132Sgblack@eecs.umich.edu    MemoryReg(const char *mnem, ExtMachInst _machInst, OpClass __opClass,
3147132Sgblack@eecs.umich.edu              IntRegIndex _dest, IntRegIndex _base, bool _add,
3157132Sgblack@eecs.umich.edu              int32_t _shiftAmt, ArmShiftType _shiftType,
3167132Sgblack@eecs.umich.edu              IntRegIndex _index)
3177132Sgblack@eecs.umich.edu        : Memory(mnem, _machInst, __opClass, _dest, _base, _add),
3187118Sgblack@eecs.umich.edu          shiftAmt(_shiftAmt), shiftType(_shiftType), index(_index)
3197118Sgblack@eecs.umich.edu    {}
3207118Sgblack@eecs.umich.edu
3217428Sgblack@eecs.umich.edu    void printOffset(std::ostream &os) const;
3227118Sgblack@eecs.umich.edu};
3237118Sgblack@eecs.umich.edu
3247279Sgblack@eecs.umich.educlass MemoryDReg : public MemoryReg
3257279Sgblack@eecs.umich.edu{
3267279Sgblack@eecs.umich.edu  protected:
3277279Sgblack@eecs.umich.edu    IntRegIndex dest2;
3287279Sgblack@eecs.umich.edu
3297279Sgblack@eecs.umich.edu    MemoryDReg(const char *mnem, ExtMachInst _machInst, OpClass __opClass,
3307279Sgblack@eecs.umich.edu               IntRegIndex _dest, IntRegIndex _dest2,
3317279Sgblack@eecs.umich.edu               IntRegIndex _base, bool _add,
3327279Sgblack@eecs.umich.edu               int32_t _shiftAmt, ArmShiftType _shiftType,
3337279Sgblack@eecs.umich.edu               IntRegIndex _index)
3347279Sgblack@eecs.umich.edu        : MemoryReg(mnem, _machInst, __opClass, _dest, _base, _add,
3357279Sgblack@eecs.umich.edu                    _shiftAmt, _shiftType, _index),
3367279Sgblack@eecs.umich.edu          dest2(_dest2)
3377279Sgblack@eecs.umich.edu    {}
3387279Sgblack@eecs.umich.edu
3397279Sgblack@eecs.umich.edu    void
3407279Sgblack@eecs.umich.edu    printDest(std::ostream &os) const
3417279Sgblack@eecs.umich.edu    {
3427279Sgblack@eecs.umich.edu        MemoryReg::printDest(os);
3437279Sgblack@eecs.umich.edu        os << ", ";
34412104Snathanael.premillieu@arm.com        printIntReg(os, dest2);
3457279Sgblack@eecs.umich.edu    }
3467279Sgblack@eecs.umich.edu};
3477279Sgblack@eecs.umich.edu
3487118Sgblack@eecs.umich.edutemplate<class Base>
3497132Sgblack@eecs.umich.educlass MemoryOffset : public Base
3507118Sgblack@eecs.umich.edu{
3517118Sgblack@eecs.umich.edu  protected:
3527132Sgblack@eecs.umich.edu    MemoryOffset(const char *mnem, ExtMachInst _machInst,
3537132Sgblack@eecs.umich.edu                 OpClass __opClass, IntRegIndex _dest, IntRegIndex _base,
3547132Sgblack@eecs.umich.edu                 bool _add, int32_t _imm)
3557132Sgblack@eecs.umich.edu        : Base(mnem, _machInst, __opClass, _dest, _base, _add, _imm)
3567132Sgblack@eecs.umich.edu    {}
3577132Sgblack@eecs.umich.edu
3587132Sgblack@eecs.umich.edu    MemoryOffset(const char *mnem, ExtMachInst _machInst,
3597132Sgblack@eecs.umich.edu                 OpClass __opClass, IntRegIndex _dest, IntRegIndex _base,
3607132Sgblack@eecs.umich.edu                 bool _add, int32_t _shiftAmt, ArmShiftType _shiftType,
3617132Sgblack@eecs.umich.edu                 IntRegIndex _index)
3627132Sgblack@eecs.umich.edu        : Base(mnem, _machInst, __opClass, _dest, _base, _add,
3637132Sgblack@eecs.umich.edu                _shiftAmt, _shiftType, _index)
3647132Sgblack@eecs.umich.edu    {}
3657132Sgblack@eecs.umich.edu
3667279Sgblack@eecs.umich.edu    MemoryOffset(const char *mnem, ExtMachInst _machInst,
3677279Sgblack@eecs.umich.edu                 OpClass __opClass, IntRegIndex _dest, IntRegIndex _dest2,
3687279Sgblack@eecs.umich.edu                 IntRegIndex _base, bool _add, int32_t _imm)
3697279Sgblack@eecs.umich.edu        : Base(mnem, _machInst, __opClass, _dest, _dest2, _base, _add, _imm)
3707279Sgblack@eecs.umich.edu    {}
3717279Sgblack@eecs.umich.edu
3727279Sgblack@eecs.umich.edu    MemoryOffset(const char *mnem, ExtMachInst _machInst,
3737303Sgblack@eecs.umich.edu                 OpClass __opClass, IntRegIndex _result,
3747303Sgblack@eecs.umich.edu                 IntRegIndex _dest, IntRegIndex _dest2,
3757303Sgblack@eecs.umich.edu                 IntRegIndex _base, bool _add, int32_t _imm)
3767303Sgblack@eecs.umich.edu        : Base(mnem, _machInst, __opClass, _result,
3777303Sgblack@eecs.umich.edu                _dest, _dest2, _base, _add, _imm)
3787303Sgblack@eecs.umich.edu    {}
3797303Sgblack@eecs.umich.edu
3807303Sgblack@eecs.umich.edu    MemoryOffset(const char *mnem, ExtMachInst _machInst,
3817279Sgblack@eecs.umich.edu                 OpClass __opClass, IntRegIndex _dest, IntRegIndex _dest2,
3827279Sgblack@eecs.umich.edu                 IntRegIndex _base, bool _add,
3837279Sgblack@eecs.umich.edu                 int32_t _shiftAmt, ArmShiftType _shiftType,
3847279Sgblack@eecs.umich.edu                 IntRegIndex _index)
3857279Sgblack@eecs.umich.edu        : Base(mnem, _machInst, __opClass, _dest, _dest2, _base, _add,
3867279Sgblack@eecs.umich.edu                _shiftAmt, _shiftType, _index)
3877279Sgblack@eecs.umich.edu    {}
3887279Sgblack@eecs.umich.edu
3897132Sgblack@eecs.umich.edu    std::string
3907132Sgblack@eecs.umich.edu    generateDisassembly(Addr pc, const SymbolTable *symtab) const
3917132Sgblack@eecs.umich.edu    {
3927132Sgblack@eecs.umich.edu        std::stringstream ss;
3937132Sgblack@eecs.umich.edu        this->printInst(ss, Memory::AddrMd_Offset);
3947132Sgblack@eecs.umich.edu        return ss.str();
3957132Sgblack@eecs.umich.edu    }
3967132Sgblack@eecs.umich.edu};
3977132Sgblack@eecs.umich.edu
3987132Sgblack@eecs.umich.edutemplate<class Base>
3997132Sgblack@eecs.umich.educlass MemoryPreIndex : public Base
4007132Sgblack@eecs.umich.edu{
4017132Sgblack@eecs.umich.edu  protected:
4027132Sgblack@eecs.umich.edu    MemoryPreIndex(const char *mnem, ExtMachInst _machInst,
4037132Sgblack@eecs.umich.edu                   OpClass __opClass, IntRegIndex _dest, IntRegIndex _base,
4047132Sgblack@eecs.umich.edu                   bool _add, int32_t _imm)
4057132Sgblack@eecs.umich.edu        : Base(mnem, _machInst, __opClass, _dest, _base, _add, _imm)
4067132Sgblack@eecs.umich.edu    {}
4077132Sgblack@eecs.umich.edu
4087132Sgblack@eecs.umich.edu    MemoryPreIndex(const char *mnem, ExtMachInst _machInst,
4097132Sgblack@eecs.umich.edu                   OpClass __opClass, IntRegIndex _dest, IntRegIndex _base,
4107132Sgblack@eecs.umich.edu                   bool _add, int32_t _shiftAmt, ArmShiftType _shiftType,
4117132Sgblack@eecs.umich.edu                   IntRegIndex _index)
4127132Sgblack@eecs.umich.edu        : Base(mnem, _machInst, __opClass, _dest, _base, _add,
4137132Sgblack@eecs.umich.edu                _shiftAmt, _shiftType, _index)
4147132Sgblack@eecs.umich.edu    {}
4157132Sgblack@eecs.umich.edu
4167279Sgblack@eecs.umich.edu    MemoryPreIndex(const char *mnem, ExtMachInst _machInst,
4177279Sgblack@eecs.umich.edu                   OpClass __opClass, IntRegIndex _dest, IntRegIndex _dest2,
4187279Sgblack@eecs.umich.edu                   IntRegIndex _base, bool _add, int32_t _imm)
4197279Sgblack@eecs.umich.edu        : Base(mnem, _machInst, __opClass, _dest, _dest2, _base, _add, _imm)
4207279Sgblack@eecs.umich.edu    {}
4217279Sgblack@eecs.umich.edu
4227279Sgblack@eecs.umich.edu    MemoryPreIndex(const char *mnem, ExtMachInst _machInst,
4237303Sgblack@eecs.umich.edu                   OpClass __opClass, IntRegIndex _result,
4247303Sgblack@eecs.umich.edu                   IntRegIndex _dest, IntRegIndex _dest2,
4257303Sgblack@eecs.umich.edu                   IntRegIndex _base, bool _add, int32_t _imm)
4267303Sgblack@eecs.umich.edu        : Base(mnem, _machInst, __opClass, _result,
4277303Sgblack@eecs.umich.edu                _dest, _dest2, _base, _add, _imm)
4287303Sgblack@eecs.umich.edu    {}
4297303Sgblack@eecs.umich.edu
4307303Sgblack@eecs.umich.edu    MemoryPreIndex(const char *mnem, ExtMachInst _machInst,
4317279Sgblack@eecs.umich.edu                   OpClass __opClass, IntRegIndex _dest, IntRegIndex _dest2,
4327279Sgblack@eecs.umich.edu                   IntRegIndex _base, bool _add,
4337279Sgblack@eecs.umich.edu                   int32_t _shiftAmt, ArmShiftType _shiftType,
4347279Sgblack@eecs.umich.edu                   IntRegIndex _index)
4357279Sgblack@eecs.umich.edu        : Base(mnem, _machInst, __opClass, _dest, _dest2, _base, _add,
4367279Sgblack@eecs.umich.edu                _shiftAmt, _shiftType, _index)
4377279Sgblack@eecs.umich.edu    {}
4387279Sgblack@eecs.umich.edu
4397132Sgblack@eecs.umich.edu    std::string
4407132Sgblack@eecs.umich.edu    generateDisassembly(Addr pc, const SymbolTable *symtab) const
4417132Sgblack@eecs.umich.edu    {
4427132Sgblack@eecs.umich.edu        std::stringstream ss;
4437132Sgblack@eecs.umich.edu        this->printInst(ss, Memory::AddrMd_PreIndex);
4447132Sgblack@eecs.umich.edu        return ss.str();
4457132Sgblack@eecs.umich.edu    }
4467132Sgblack@eecs.umich.edu};
4477132Sgblack@eecs.umich.edu
4487132Sgblack@eecs.umich.edutemplate<class Base>
4497132Sgblack@eecs.umich.educlass MemoryPostIndex : public Base
4507132Sgblack@eecs.umich.edu{
4517132Sgblack@eecs.umich.edu  protected:
4527132Sgblack@eecs.umich.edu    MemoryPostIndex(const char *mnem, ExtMachInst _machInst,
4537118Sgblack@eecs.umich.edu                    OpClass __opClass, IntRegIndex _dest, IntRegIndex _base,
4547118Sgblack@eecs.umich.edu                    bool _add, int32_t _imm)
4557118Sgblack@eecs.umich.edu        : Base(mnem, _machInst, __opClass, _dest, _base, _add, _imm)
4567118Sgblack@eecs.umich.edu    {}
4577118Sgblack@eecs.umich.edu
4587132Sgblack@eecs.umich.edu    MemoryPostIndex(const char *mnem, ExtMachInst _machInst,
4597118Sgblack@eecs.umich.edu                    OpClass __opClass, IntRegIndex _dest, IntRegIndex _base,
4607118Sgblack@eecs.umich.edu                    bool _add, int32_t _shiftAmt, ArmShiftType _shiftType,
4617118Sgblack@eecs.umich.edu                    IntRegIndex _index)
4627118Sgblack@eecs.umich.edu        : Base(mnem, _machInst, __opClass, _dest, _base, _add,
4637118Sgblack@eecs.umich.edu                _shiftAmt, _shiftType, _index)
4647118Sgblack@eecs.umich.edu    {}
4657118Sgblack@eecs.umich.edu
4667279Sgblack@eecs.umich.edu    MemoryPostIndex(const char *mnem, ExtMachInst _machInst,
4677279Sgblack@eecs.umich.edu                    OpClass __opClass, IntRegIndex _dest, IntRegIndex _dest2,
4687279Sgblack@eecs.umich.edu                    IntRegIndex _base, bool _add, int32_t _imm)
4697279Sgblack@eecs.umich.edu        : Base(mnem, _machInst, __opClass, _dest, _dest2, _base, _add, _imm)
4707279Sgblack@eecs.umich.edu    {}
4717279Sgblack@eecs.umich.edu
4727279Sgblack@eecs.umich.edu    MemoryPostIndex(const char *mnem, ExtMachInst _machInst,
4737303Sgblack@eecs.umich.edu                    OpClass __opClass, IntRegIndex _result,
4747303Sgblack@eecs.umich.edu                    IntRegIndex _dest, IntRegIndex _dest2,
4757303Sgblack@eecs.umich.edu                    IntRegIndex _base, bool _add, int32_t _imm)
4767303Sgblack@eecs.umich.edu        : Base(mnem, _machInst, __opClass, _result,
4777303Sgblack@eecs.umich.edu                _dest, _dest2, _base, _add, _imm)
4787303Sgblack@eecs.umich.edu    {}
4797303Sgblack@eecs.umich.edu
4807303Sgblack@eecs.umich.edu    MemoryPostIndex(const char *mnem, ExtMachInst _machInst,
4817279Sgblack@eecs.umich.edu                    OpClass __opClass, IntRegIndex _dest, IntRegIndex _dest2,
4827279Sgblack@eecs.umich.edu                    IntRegIndex _base, bool _add,
4837279Sgblack@eecs.umich.edu                    int32_t _shiftAmt, ArmShiftType _shiftType,
4847279Sgblack@eecs.umich.edu                    IntRegIndex _index)
4857279Sgblack@eecs.umich.edu        : Base(mnem, _machInst, __opClass, _dest, _dest2, _base, _add,
4867279Sgblack@eecs.umich.edu                _shiftAmt, _shiftType, _index)
4877279Sgblack@eecs.umich.edu    {}
4887279Sgblack@eecs.umich.edu
4897118Sgblack@eecs.umich.edu    std::string
4907118Sgblack@eecs.umich.edu    generateDisassembly(Addr pc, const SymbolTable *symtab) const
4917118Sgblack@eecs.umich.edu    {
4927118Sgblack@eecs.umich.edu        std::stringstream ss;
4937132Sgblack@eecs.umich.edu        this->printInst(ss, Memory::AddrMd_PostIndex);
4947118Sgblack@eecs.umich.edu        return ss.str();
4957118Sgblack@eecs.umich.edu    }
4967118Sgblack@eecs.umich.edu};
4976253Sgblack@eecs.umich.edu}
4986253Sgblack@eecs.umich.edu
4996253Sgblack@eecs.umich.edu#endif //__ARCH_ARM_INSTS_MEM_HH__
500