112294Sgabeblack@google.com/* 212294Sgabeblack@google.com * Copyright (c) 2006-2007 The Regents of The University of Michigan 312294Sgabeblack@google.com * All rights reserved. 412294Sgabeblack@google.com * 512294Sgabeblack@google.com * Redistribution and use in source and binary forms, with or without 612294Sgabeblack@google.com * modification, are permitted provided that the following conditions are 712294Sgabeblack@google.com * met: redistributions of source code must retain the above copyright 812294Sgabeblack@google.com * notice, this list of conditions and the following disclaimer; 912294Sgabeblack@google.com * redistributions in binary form must reproduce the above copyright 1012294Sgabeblack@google.com * notice, this list of conditions and the following disclaimer in the 1112294Sgabeblack@google.com * documentation and/or other materials provided with the distribution; 1212294Sgabeblack@google.com * neither the name of the copyright holders nor the names of its 1312294Sgabeblack@google.com * contributors may be used to endorse or promote products derived from 1412294Sgabeblack@google.com * this software without specific prior written permission. 1512294Sgabeblack@google.com * 1612294Sgabeblack@google.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1712294Sgabeblack@google.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1812294Sgabeblack@google.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 1912294Sgabeblack@google.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 2012294Sgabeblack@google.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2112294Sgabeblack@google.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 2212294Sgabeblack@google.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2312294Sgabeblack@google.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2412294Sgabeblack@google.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2512294Sgabeblack@google.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 2612294Sgabeblack@google.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2712294Sgabeblack@google.com * 2812294Sgabeblack@google.com * Authors: Ali Saidi 2912294Sgabeblack@google.com * Gabe Black 3012294Sgabeblack@google.com */ 3112294Sgabeblack@google.com 3212294Sgabeblack@google.com#ifndef __ARCH_SPARC_INSTS_BLOCKMEM_HH__ 3312294Sgabeblack@google.com#define __ARCH_SPARC_INSTS_BLOCKMEM_HH__ 3412294Sgabeblack@google.com 3512294Sgabeblack@google.com#include "arch/sparc/insts/micro.hh" 3612294Sgabeblack@google.com 3712294Sgabeblack@google.comnamespace SparcISA 3812294Sgabeblack@google.com{ 3912294Sgabeblack@google.com 4012294Sgabeblack@google.com//////////////////////////////////////////////////////////////////// 4112294Sgabeblack@google.com// 4212294Sgabeblack@google.com// Block Memory instructions 4312294Sgabeblack@google.com// 4412294Sgabeblack@google.com 4512294Sgabeblack@google.comclass BlockMem : public SparcMacroInst 4612294Sgabeblack@google.com{ 4712294Sgabeblack@google.com protected: 4812294Sgabeblack@google.com // We make the assumption that all block memory operations will take 4912294Sgabeblack@google.com // 8 instructions to execute. 5012294Sgabeblack@google.com BlockMem(const char *mnem, ExtMachInst _machInst) : 5112294Sgabeblack@google.com SparcMacroInst(mnem, _machInst, No_OpClass, 8) 5212294Sgabeblack@google.com {} 5312294Sgabeblack@google.com}; 5412294Sgabeblack@google.com 5512294Sgabeblack@google.comclass BlockMemImm : public BlockMem 5612294Sgabeblack@google.com{ 5712294Sgabeblack@google.com protected: 5812294Sgabeblack@google.com using BlockMem::BlockMem; 5912294Sgabeblack@google.com}; 6012294Sgabeblack@google.com 6112294Sgabeblack@google.comclass BlockMemMicro : public SparcMicroInst 6212294Sgabeblack@google.com{ 6312294Sgabeblack@google.com protected: 6412294Sgabeblack@google.com BlockMemMicro(const char *mnem, ExtMachInst _machInst, 6512294Sgabeblack@google.com OpClass __opClass, int8_t _offset) : 6612294Sgabeblack@google.com SparcMicroInst(mnem, _machInst, __opClass), offset(_offset) 6712294Sgabeblack@google.com {} 6812294Sgabeblack@google.com 6912294Sgabeblack@google.com std::string generateDisassembly( 7012294Sgabeblack@google.com Addr pc, const SymbolTable *symtab) const override; 7112294Sgabeblack@google.com 7212294Sgabeblack@google.com const int8_t offset; 7312294Sgabeblack@google.com}; 7412294Sgabeblack@google.com 7512294Sgabeblack@google.comclass BlockMemImmMicro : public BlockMemMicro 7612294Sgabeblack@google.com{ 7712294Sgabeblack@google.com protected: 7812294Sgabeblack@google.com BlockMemImmMicro(const char *mnem, ExtMachInst _machInst, 7912294Sgabeblack@google.com OpClass __opClass, int8_t _offset) : 8012294Sgabeblack@google.com BlockMemMicro(mnem, _machInst, __opClass, _offset), 8112294Sgabeblack@google.com imm(sext<13>(bits(_machInst, 12, 0))) 8212294Sgabeblack@google.com {} 8312294Sgabeblack@google.com 8412294Sgabeblack@google.com std::string generateDisassembly( 8512294Sgabeblack@google.com Addr pc, const SymbolTable *symtab) const override; 8612294Sgabeblack@google.com 8712294Sgabeblack@google.com const int32_t imm; 8812294Sgabeblack@google.com}; 8912294Sgabeblack@google.com 9012294Sgabeblack@google.com} 9112294Sgabeblack@google.com 9212294Sgabeblack@google.com#endif // __ARCH_SPARC_INSTS_BLOCKMEM_HH__ 93