types.cc revision 4147
16157Snate@binkert.org/*
26157Snate@binkert.org * Copyright (c) 2007 The Hewlett-Packard Development Company
36157Snate@binkert.org * All rights reserved.
46157Snate@binkert.org *
56157Snate@binkert.org * Redistribution and use of this software in source and binary forms,
66157Snate@binkert.org * with or without modification, are permitted provided that the
76157Snate@binkert.org * following conditions are met:
86157Snate@binkert.org *
96157Snate@binkert.org * The software must be used only for Non-Commercial Use which means any
106157Snate@binkert.org * use which is NOT directed to receiving any direct monetary
116157Snate@binkert.org * compensation for, or commercial advantage from such use.  Illustrative
126157Snate@binkert.org * examples of non-commercial use are academic research, personal study,
136157Snate@binkert.org * teaching, education and corporate research & development.
146157Snate@binkert.org * Illustrative examples of commercial use are distributing products for
156157Snate@binkert.org * commercial advantage and providing services using the software for
166157Snate@binkert.org * commercial advantage.
176157Snate@binkert.org *
186157Snate@binkert.org * If you wish to use this software or functionality therein that may be
196157Snate@binkert.org * covered by patents for commercial use, please contact:
206157Snate@binkert.org *     Director of Intellectual Property Licensing
216157Snate@binkert.org *     Office of Strategy and Technology
226157Snate@binkert.org *     Hewlett-Packard Company
236157Snate@binkert.org *     1501 Page Mill Road
246157Snate@binkert.org *     Palo Alto, California  94304
256157Snate@binkert.org *
266157Snate@binkert.org * Redistributions of source code must retain the above copyright notice,
276157Snate@binkert.org * this list of conditions and the following disclaimer.  Redistributions
286157Snate@binkert.org * in binary form must reproduce the above copyright notice, this list of
296157Snate@binkert.org * conditions and the following disclaimer in the documentation and/or
306157Snate@binkert.org * other materials provided with the distribution.  Neither the name of
3112563Sgabeblack@google.com * the COPYRIGHT HOLDER(s), HEWLETT-PACKARD COMPANY, nor the names of its
3212563Sgabeblack@google.com * contributors may be used to endorse or promote products derived from
336157Snate@binkert.org * this software without specific prior written permission.  No right of
346157Snate@binkert.org * sublicense is granted herewith.  Derivatives of the software and
356157Snate@binkert.org * output created using the software may be prepared, but only for
366157Snate@binkert.org * Non-Commercial Uses.  Derivatives of the software may be shared with
376157Snate@binkert.org * others provided: (i) the others agree to abide by the list of
386157Snate@binkert.org * conditions herein which includes the Non-Commercial Use restrictions;
396157Snate@binkert.org * and (ii) such Derivatives of the software include the above copyright
4012246Sgabeblack@google.com * notice to acknowledge the contribution from this software where
4112246Sgabeblack@google.com * applicable, this list of conditions and the disclaimer below.
426157Snate@binkert.org *
436157Snate@binkert.org * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4412892Sbrandon.potter@amd.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
4512892Sbrandon.potter@amd.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
4612892Sbrandon.potter@amd.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
4710133Sandreas.hansson@arm.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
4810133Sandreas.hansson@arm.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
4910133Sandreas.hansson@arm.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
5010133Sandreas.hansson@arm.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
5110133Sandreas.hansson@arm.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
5210133Sandreas.hansson@arm.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
5310133Sandreas.hansson@arm.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5410133Sandreas.hansson@arm.com *
5510133Sandreas.hansson@arm.com * Authors: Gabe Black
5610133Sandreas.hansson@arm.com */
5710133Sandreas.hansson@arm.com
5810133Sandreas.hansson@arm.com#ifndef __ARCH_X86_TYPES_HH__
5910133Sandreas.hansson@arm.com#define __ARCH_X86_TYPES_HH__
6010133Sandreas.hansson@arm.com
6110133Sandreas.hansson@arm.com#include <inttypes.h>
6210133Sandreas.hansson@arm.com
6310133Sandreas.hansson@arm.comnamespace X86ISA
6410133Sandreas.hansson@arm.com{
6511755Sandreas.hansson@arm.com    //XXX This won't work
6610133Sandreas.hansson@arm.com    typedef uint32_t MachInst;
6710133Sandreas.hansson@arm.com    //XXX This won't work either
686157Snate@binkert.org    typedef uint64_t ExtMachInst;
696157Snate@binkert.org
706157Snate@binkert.org    typedef uint64_t IntReg;
716157Snate@binkert.org    typedef uint64_t MiscReg;
726157Snate@binkert.org
736157Snate@binkert.org    //These floating point types are correct for mmx, but not
746157Snate@binkert.org    //technically for x87 (80 bits) or at all for xmm (128 bits)
756157Snate@binkert.org    typedef double FloatReg;
766157Snate@binkert.org    typedef uint64_t FloatRegBits;
776157Snate@binkert.org    typedef union
786157Snate@binkert.org    {
796157Snate@binkert.org        IntReg intReg;
806157Snate@binkert.org        FloatReg fpReg;
816157Snate@binkert.org        MiscReg ctrlReg;
826157Snate@binkert.org    } AnyReg;
836157Snate@binkert.org
846157Snate@binkert.org    //XXX This is very hypothetical. X87 instructions would need to
856157Snate@binkert.org    //change their "context" constantly. It's also not clear how
866157Snate@binkert.org    //this would be handled as far as out of order execution.
876157Snate@binkert.org    //Maybe x87 instructions are in order?
886157Snate@binkert.org    enum RegContextParam
896157Snate@binkert.org    {
906157Snate@binkert.org        CONTEXT_X87_TOP
916157Snate@binkert.org    };
926157Snate@binkert.org
936157Snate@binkert.org    typedef int RegContextVal;
946157Snate@binkert.org
956157Snate@binkert.org    typedef uint8_t RegIndex;
966157Snate@binkert.org};
976157Snate@binkert.org
986157Snate@binkert.org#endif // __ARCH_X86_TYPES_HH__
996157Snate@binkert.org