static_inst.hh revision 6263:981fc6fba01a
12131SN/A/* Copyright (c) 2007-2008 The Florida State University 25268Sksewell@umich.edu * All rights reserved. 35224Sksewell@umich.edu * 45224Sksewell@umich.edu * Redistribution and use in source and binary forms, with or without 52131SN/A * modification, are permitted provided that the following conditions are 65224Sksewell@umich.edu * met: redistributions of source code must retain the above copyright 75224Sksewell@umich.edu * notice, this list of conditions and the following disclaimer; 85224Sksewell@umich.edu * redistributions in binary form must reproduce the above copyright 95224Sksewell@umich.edu * notice, this list of conditions and the following disclaimer in the 105224Sksewell@umich.edu * documentation and/or other materials provided with the distribution; 115224Sksewell@umich.edu * neither the name of the copyright holders nor the names of its 125224Sksewell@umich.edu * contributors may be used to endorse or promote products derived from 135224Sksewell@umich.edu * this software without specific prior written permission. 145224Sksewell@umich.edu * 155224Sksewell@umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 162131SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 175224Sksewell@umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 185224Sksewell@umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 195224Sksewell@umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 205224Sksewell@umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 215224Sksewell@umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 225224Sksewell@umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 235224Sksewell@umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 245224Sksewell@umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 255224Sksewell@umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 265224Sksewell@umich.edu * 275224Sksewell@umich.edu * Authors: Stephen Hines 282665Ssaidi@eecs.umich.edu */ 295224Sksewell@umich.edu#ifndef __ARCH_ARM_INSTS_STATICINST_HH__ 305224Sksewell@umich.edu#define __ARCH_ARM_INSTS_STATICINST_HH__ 315222Sksewell@umich.edu 322131SN/A#include "base/trace.hh" 332131SN/A#include "cpu/static_inst.hh" 342239SN/A 352239SN/Anamespace ArmISA 362131SN/A{ 372131SN/Aclass ArmStaticInst : public StaticInst 382447SN/A{ 392447SN/A protected: 402447SN/A int32_t shift_rm_imm(uint32_t base, uint32_t shamt, 412447SN/A uint32_t type, uint32_t cfval) const; 422447SN/A int32_t shift_rm_rs(uint32_t base, uint32_t shamt, 432447SN/A uint32_t type, uint32_t cfval) const; 442131SN/A 452239SN/A bool shift_carry_imm(uint32_t base, uint32_t shamt, 462131SN/A uint32_t type, uint32_t cfval) const; 472447SN/A bool shift_carry_rs(uint32_t base, uint32_t shamt, 482447SN/A uint32_t type, uint32_t cfval) const; 492447SN/A 502131SN/A bool arm_add_carry(int32_t result, int32_t lhs, int32_t rhs) const; 515222Sksewell@umich.edu bool arm_sub_carry(int32_t result, int32_t lhs, int32_t rhs) const; 525222Sksewell@umich.edu 535222Sksewell@umich.edu bool arm_add_overflow(int32_t result, int32_t lhs, int32_t rhs) const; 545222Sksewell@umich.edu bool arm_sub_overflow(int32_t result, int32_t lhs, int32_t rhs) const; 555222Sksewell@umich.edu 562447SN/A // Constructor 575222Sksewell@umich.edu ArmStaticInst(const char *mnem, MachInst _machInst, OpClass __opClass) 585222Sksewell@umich.edu : StaticInst(mnem, _machInst, __opClass) 595222Sksewell@umich.edu { 602447SN/A } 612447SN/A 622447SN/A /// Print a register name for disassembly given the unique 632131SN/A /// dependence tag number (FP or int). 642131SN/A void printReg(std::ostream &os, int reg) const; 652447SN/A void printMnemonic(std::ostream &os, 662131SN/A const std::string &suffix = "", 672447SN/A bool withPred = true) const; 682447SN/A void printMemSymbol(std::ostream &os, const SymbolTable *symtab, 692447SN/A const std::string &prefix, const Addr addr, 702447SN/A const std::string &suffix) const; 712131SN/A 724695Sgblack@eecs.umich.edu 732447SN/A std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const; 742447SN/A}; 755222Sksewell@umich.edu} 765222Sksewell@umich.edu 775222Sksewell@umich.edu#endif //__ARCH_ARM_INSTS_STATICINST_HH__ 785222Sksewell@umich.edu