microop.hh revision 4679
14679Sgblack@eecs.umich.edu/* 24679Sgblack@eecs.umich.edu * Copyright (c) 2007 The Hewlett-Packard Development Company 34679Sgblack@eecs.umich.edu * All rights reserved. 44679Sgblack@eecs.umich.edu * 54679Sgblack@eecs.umich.edu * Redistribution and use of this software in source and binary forms, 64679Sgblack@eecs.umich.edu * with or without modification, are permitted provided that the 74679Sgblack@eecs.umich.edu * following conditions are met: 84679Sgblack@eecs.umich.edu * 94679Sgblack@eecs.umich.edu * The software must be used only for Non-Commercial Use which means any 104679Sgblack@eecs.umich.edu * use which is NOT directed to receiving any direct monetary 114679Sgblack@eecs.umich.edu * compensation for, or commercial advantage from such use. Illustrative 124679Sgblack@eecs.umich.edu * examples of non-commercial use are academic research, personal study, 134679Sgblack@eecs.umich.edu * teaching, education and corporate research & development. 144679Sgblack@eecs.umich.edu * Illustrative examples of commercial use are distributing products for 154679Sgblack@eecs.umich.edu * commercial advantage and providing services using the software for 164679Sgblack@eecs.umich.edu * commercial advantage. 174679Sgblack@eecs.umich.edu * 184679Sgblack@eecs.umich.edu * If you wish to use this software or functionality therein that may be 194679Sgblack@eecs.umich.edu * covered by patents for commercial use, please contact: 204679Sgblack@eecs.umich.edu * Director of Intellectual Property Licensing 214679Sgblack@eecs.umich.edu * Office of Strategy and Technology 224679Sgblack@eecs.umich.edu * Hewlett-Packard Company 234679Sgblack@eecs.umich.edu * 1501 Page Mill Road 244679Sgblack@eecs.umich.edu * Palo Alto, California 94304 254679Sgblack@eecs.umich.edu * 264679Sgblack@eecs.umich.edu * Redistributions of source code must retain the above copyright notice, 274679Sgblack@eecs.umich.edu * this list of conditions and the following disclaimer. Redistributions 284679Sgblack@eecs.umich.edu * in binary form must reproduce the above copyright notice, this list of 294679Sgblack@eecs.umich.edu * conditions and the following disclaimer in the documentation and/or 304679Sgblack@eecs.umich.edu * other materials provided with the distribution. Neither the name of 314679Sgblack@eecs.umich.edu * the COPYRIGHT HOLDER(s), HEWLETT-PACKARD COMPANY, nor the names of its 324679Sgblack@eecs.umich.edu * contributors may be used to endorse or promote products derived from 334679Sgblack@eecs.umich.edu * this software without specific prior written permission. No right of 344679Sgblack@eecs.umich.edu * sublicense is granted herewith. Derivatives of the software and 354679Sgblack@eecs.umich.edu * output created using the software may be prepared, but only for 364679Sgblack@eecs.umich.edu * Non-Commercial Uses. Derivatives of the software may be shared with 374679Sgblack@eecs.umich.edu * others provided: (i) the others agree to abide by the list of 384679Sgblack@eecs.umich.edu * conditions herein which includes the Non-Commercial Use restrictions; 394679Sgblack@eecs.umich.edu * and (ii) such Derivatives of the software include the above copyright 404679Sgblack@eecs.umich.edu * notice to acknowledge the contribution from this software where 414679Sgblack@eecs.umich.edu * applicable, this list of conditions and the disclaimer below. 424679Sgblack@eecs.umich.edu * 434679Sgblack@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 444679Sgblack@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 454679Sgblack@eecs.umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 464679Sgblack@eecs.umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 474679Sgblack@eecs.umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 484679Sgblack@eecs.umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 494679Sgblack@eecs.umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 504679Sgblack@eecs.umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 514679Sgblack@eecs.umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 524679Sgblack@eecs.umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 534679Sgblack@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 544679Sgblack@eecs.umich.edu * 554679Sgblack@eecs.umich.edu * Authors: Gabe Black 564679Sgblack@eecs.umich.edu */ 574679Sgblack@eecs.umich.edu 584679Sgblack@eecs.umich.edu#ifndef __ARCH_X86_INSTS_MICROOP_HH__ 594679Sgblack@eecs.umich.edu#define __ARCH_X86_INSTS_MICROOP_HH__ 604679Sgblack@eecs.umich.edu 614679Sgblack@eecs.umich.edu#include "arch/x86/insts/static_inst.hh" 624679Sgblack@eecs.umich.edu 634679Sgblack@eecs.umich.edunamespace X86ISA 644679Sgblack@eecs.umich.edu{ 654679Sgblack@eecs.umich.edu //A class which is the base of all x86 micro ops. It provides a function to 664679Sgblack@eecs.umich.edu //set necessary flags appropriately. 674679Sgblack@eecs.umich.edu class X86MicroopBase : public X86StaticInst 684679Sgblack@eecs.umich.edu { 694679Sgblack@eecs.umich.edu protected: 704679Sgblack@eecs.umich.edu const char * instMnem; 714679Sgblack@eecs.umich.edu uint8_t opSize; 724679Sgblack@eecs.umich.edu uint8_t addrSize; 734679Sgblack@eecs.umich.edu 744679Sgblack@eecs.umich.edu X86MicroopBase(ExtMachInst _machInst, 754679Sgblack@eecs.umich.edu const char *mnem, const char *_instMnem, 764679Sgblack@eecs.umich.edu bool isMicro, bool isDelayed, 774679Sgblack@eecs.umich.edu bool isFirst, bool isLast, 784679Sgblack@eecs.umich.edu OpClass __opClass) : 794679Sgblack@eecs.umich.edu X86ISA::X86StaticInst(mnem, _machInst, __opClass), 804679Sgblack@eecs.umich.edu instMnem(_instMnem) 814679Sgblack@eecs.umich.edu { 824679Sgblack@eecs.umich.edu flags[IsMicroop] = isMicro; 834679Sgblack@eecs.umich.edu flags[IsDelayedCommit] = isDelayed; 844679Sgblack@eecs.umich.edu flags[IsFirstMicroop] = isFirst; 854679Sgblack@eecs.umich.edu flags[IsLastMicroop] = isLast; 864679Sgblack@eecs.umich.edu } 874679Sgblack@eecs.umich.edu 884679Sgblack@eecs.umich.edu std::string generateDisassembly(Addr pc, 894679Sgblack@eecs.umich.edu const SymbolTable *symtab) const 904679Sgblack@eecs.umich.edu { 914679Sgblack@eecs.umich.edu std::stringstream ss; 924679Sgblack@eecs.umich.edu 934679Sgblack@eecs.umich.edu ccprintf(ss, "\t%s.%s", instMnem, mnemonic); 944679Sgblack@eecs.umich.edu 954679Sgblack@eecs.umich.edu return ss.str(); 964679Sgblack@eecs.umich.edu } 974679Sgblack@eecs.umich.edu }; 984679Sgblack@eecs.umich.edu} 994679Sgblack@eecs.umich.edu 1004679Sgblack@eecs.umich.edu#endif //__ARCH_X86_INSTS_MICROOP_HH__ 101