isa_traits.hh revision 9329
17584SN/A/* 28869SAli.Saidi@ARM.com * Copyright (c) 2007 The Hewlett-Packard Development Company 37584SN/A * All rights reserved. 47584SN/A * 57584SN/A * The license below extends only to copyright in the software and shall 67584SN/A * not be construed as granting a license to any other intellectual 77584SN/A * property including but not limited to intellectual property relating 87584SN/A * to a hardware implementation of the functionality of the software 97584SN/A * licensed hereunder. You may use the software subject to the license 107584SN/A * terms below provided that you ensure that this notice is replicated 117584SN/A * unmodified and in its entirety in all distributions of the software, 127584SN/A * modified or unmodified, in source code or in binary form. 137584SN/A * 147584SN/A * Redistribution and use in source and binary forms, with or without 157584SN/A * modification, are permitted provided that the following conditions are 167584SN/A * met: redistributions of source code must retain the above copyright 177584SN/A * notice, this list of conditions and the following disclaimer; 187584SN/A * redistributions in binary form must reproduce the above copyright 197584SN/A * notice, this list of conditions and the following disclaimer in the 207584SN/A * documentation and/or other materials provided with the distribution; 217584SN/A * neither the name of the copyright holders nor the names of its 227584SN/A * contributors may be used to endorse or promote products derived from 237584SN/A * this software without specific prior written permission. 247584SN/A * 257584SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 267584SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 277584SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 287584SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 297584SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 307584SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 317584SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 327584SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 337584SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 347584SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 357584SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 367584SN/A * 377584SN/A * Authors: Gabe Black 387584SN/A */ 397584SN/A 408869SAli.Saidi@ARM.com#ifndef __ARCH_X86_ISATRAITS_HH__ 418869SAli.Saidi@ARM.com#define __ARCH_X86_ISATRAITS_HH__ 427584SN/A 437584SN/A#include "arch/x86/types.hh" 448869SAli.Saidi@ARM.com#include "arch/x86/x86_traits.hh" 457584SN/A#include "base/types.hh" 467584SN/A 478869SAli.Saidi@ARM.comnamespace LittleEndianGuest {} 487584SN/A 497584SN/Anamespace X86ISA 508869SAli.Saidi@ARM.com{ 517584SN/A //This makes sure the little endian version of certain functions 527584SN/A //are used. 538869SAli.Saidi@ARM.com using namespace LittleEndianGuest; 548869SAli.Saidi@ARM.com 558869SAli.Saidi@ARM.com // X86 does not have a delay slot 568869SAli.Saidi@ARM.com#define ISA_HAS_DELAY_SLOT 0 578869SAli.Saidi@ARM.com 588869SAli.Saidi@ARM.com // X86 NOP (XCHG rAX, rAX) 598869SAli.Saidi@ARM.com //XXX This needs to be set to an intermediate instruction struct 608869SAli.Saidi@ARM.com //which encodes this instruction 618869SAli.Saidi@ARM.com 627584SN/A //4k. This value is not constant on x86. 637584SN/A const int LogVMPageSize = 12; 648869SAli.Saidi@ARM.com const int VMPageSize = (1 << LogVMPageSize); 658869SAli.Saidi@ARM.com 668869SAli.Saidi@ARM.com const int PageShift = 12; 677584SN/A const int PageBytes = 1ULL << PageShift; 688869SAli.Saidi@ARM.com 698869SAli.Saidi@ARM.com const int BranchPredAddrShiftAmt = 0; 708869SAli.Saidi@ARM.com 718869SAli.Saidi@ARM.com // Memory accesses can be unaligned 728869SAli.Saidi@ARM.com const bool HasUnalignedMemAcc = true; 738869SAli.Saidi@ARM.com 748869SAli.Saidi@ARM.com const bool CurThreadInfoImplemented = false; 758869SAli.Saidi@ARM.com const int CurThreadInfoReg = -1; 768869SAli.Saidi@ARM.com 778869SAli.Saidi@ARM.com const ExtMachInst NoopMachInst = { 788869SAli.Saidi@ARM.com 0x0, // No legacy prefixes. 798869SAli.Saidi@ARM.com 0x0, // No rex prefix. 808869SAli.Saidi@ARM.com { 1, 0x0, 0x0, 0x90 }, // One opcode byte, 0x90. 818869SAli.Saidi@ARM.com 0x0, 0x0, // No modrm or sib. 828869SAli.Saidi@ARM.com 0, 0, // No immediate or displacement. 838869SAli.Saidi@ARM.com 8, 8, 8, // All sizes are 8. 848869SAli.Saidi@ARM.com 0, // Displacement size is 0. 858869SAli.Saidi@ARM.com SixtyFourBitMode // Behave as if we're in 64 bit 868869SAli.Saidi@ARM.com // mode (this doesn't actually matter). 878869SAli.Saidi@ARM.com }; 888869SAli.Saidi@ARM.com} 898869SAli.Saidi@ARM.com 908869SAli.Saidi@ARM.com#endif // __ARCH_X86_ISATRAITS_HH__ 918869SAli.Saidi@ARM.com