types.cc revision 4147
17404SAli.Saidi@ARM.com/*
212709Sgiacomo.travaglini@arm.com * Copyright (c) 2007 The Hewlett-Packard Development Company
37404SAli.Saidi@ARM.com * All rights reserved.
47404SAli.Saidi@ARM.com *
57404SAli.Saidi@ARM.com * Redistribution and use of this software in source and binary forms,
67404SAli.Saidi@ARM.com * with or without modification, are permitted provided that the
77404SAli.Saidi@ARM.com * following conditions are met:
87404SAli.Saidi@ARM.com *
97404SAli.Saidi@ARM.com * The software must be used only for Non-Commercial Use which means any
107404SAli.Saidi@ARM.com * use which is NOT directed to receiving any direct monetary
117404SAli.Saidi@ARM.com * compensation for, or commercial advantage from such use.  Illustrative
127404SAli.Saidi@ARM.com * examples of non-commercial use are academic research, personal study,
137404SAli.Saidi@ARM.com * teaching, education and corporate research & development.
147404SAli.Saidi@ARM.com * Illustrative examples of commercial use are distributing products for
157404SAli.Saidi@ARM.com * commercial advantage and providing services using the software for
167404SAli.Saidi@ARM.com * commercial advantage.
177404SAli.Saidi@ARM.com *
187404SAli.Saidi@ARM.com * If you wish to use this software or functionality therein that may be
197404SAli.Saidi@ARM.com * covered by patents for commercial use, please contact:
207404SAli.Saidi@ARM.com *     Director of Intellectual Property Licensing
217404SAli.Saidi@ARM.com *     Office of Strategy and Technology
227404SAli.Saidi@ARM.com *     Hewlett-Packard Company
237404SAli.Saidi@ARM.com *     1501 Page Mill Road
247404SAli.Saidi@ARM.com *     Palo Alto, California  94304
257404SAli.Saidi@ARM.com *
267404SAli.Saidi@ARM.com * Redistributions of source code must retain the above copyright notice,
277404SAli.Saidi@ARM.com * this list of conditions and the following disclaimer.  Redistributions
287404SAli.Saidi@ARM.com * in binary form must reproduce the above copyright notice, this list of
297404SAli.Saidi@ARM.com * conditions and the following disclaimer in the documentation and/or
307404SAli.Saidi@ARM.com * other materials provided with the distribution.  Neither the name of
317404SAli.Saidi@ARM.com * the COPYRIGHT HOLDER(s), HEWLETT-PACKARD COMPANY, nor the names of its
327404SAli.Saidi@ARM.com * contributors may be used to endorse or promote products derived from
337404SAli.Saidi@ARM.com * this software without specific prior written permission.  No right of
347404SAli.Saidi@ARM.com * sublicense is granted herewith.  Derivatives of the software and
357404SAli.Saidi@ARM.com * output created using the software may be prepared, but only for
367404SAli.Saidi@ARM.com * Non-Commercial Uses.  Derivatives of the software may be shared with
377404SAli.Saidi@ARM.com * others provided: (i) the others agree to abide by the list of
3810037SARM gem5 Developers * conditions herein which includes the Non-Commercial Use restrictions;
397404SAli.Saidi@ARM.com * and (ii) such Derivatives of the software include the above copyright
4010873Sandreas.sandberg@arm.com * notice to acknowledge the contribution from this software where
417404SAli.Saidi@ARM.com * applicable, this list of conditions and the disclaimer below.
4210474Sandreas.hansson@arm.com *
4310474Sandreas.hansson@arm.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
447404SAli.Saidi@ARM.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
4510037SARM gem5 Developers * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
4610037SARM gem5 Developers * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
477404SAli.Saidi@ARM.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
487728SAli.Saidi@ARM.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
497404SAli.Saidi@ARM.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
508245Snate@binkert.org * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
519152Satgutier@umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
528245Snate@binkert.org * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
538245Snate@binkert.org * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5410873Sandreas.sandberg@arm.com *
557748SAli.Saidi@ARM.com * Authors: Gabe Black
567404SAli.Saidi@ARM.com */
577404SAli.Saidi@ARM.com
587404SAli.Saidi@ARM.com#ifndef __ARCH_X86_TYPES_HH__
597404SAli.Saidi@ARM.com#define __ARCH_X86_TYPES_HH__
6013892Sgabeblack@google.com
6110717Sandreas.hansson@arm.com#include <inttypes.h>
6210717Sandreas.hansson@arm.com
6310717Sandreas.hansson@arm.comnamespace X86ISA
649258SAli.Saidi@ARM.com{
6510621SCurtis.Dunham@arm.com    //XXX This won't work
6610621SCurtis.Dunham@arm.com    typedef uint32_t MachInst;
6712086Sspwilson2@wisc.edu    //XXX This won't work either
6812086Sspwilson2@wisc.edu    typedef uint64_t ExtMachInst;
6912086Sspwilson2@wisc.edu
7012086Sspwilson2@wisc.edu    typedef uint64_t IntReg;
7112086Sspwilson2@wisc.edu    typedef uint64_t MiscReg;
7212086Sspwilson2@wisc.edu
7311588SCurtis.Dunham@arm.com    //These floating point types are correct for mmx, but not
7411588SCurtis.Dunham@arm.com    //technically for x87 (80 bits) or at all for xmm (128 bits)
7512086Sspwilson2@wisc.edu    typedef double FloatReg;
767439Sdam.sunwoo@arm.com    typedef uint64_t FloatRegBits;
777576SAli.Saidi@ARM.com    typedef union
7810037SARM gem5 Developers    {
7910037SARM gem5 Developers        IntReg intReg;
8010037SARM gem5 Developers        FloatReg fpReg;
8110717Sandreas.hansson@arm.com        MiscReg ctrlReg;
8210037SARM gem5 Developers    } AnyReg;
8310037SARM gem5 Developers
8410037SARM gem5 Developers    //XXX This is very hypothetical. X87 instructions would need to
8510037SARM gem5 Developers    //change their "context" constantly. It's also not clear how
8610037SARM gem5 Developers    //this would be handled as far as out of order execution.
8710037SARM gem5 Developers    //Maybe x87 instructions are in order?
8810037SARM gem5 Developers    enum RegContextParam
8910037SARM gem5 Developers    {
9010037SARM gem5 Developers        CONTEXT_X87_TOP
9110037SARM gem5 Developers    };
9210037SARM gem5 Developers
9310037SARM gem5 Developers    typedef int RegContextVal;
947439Sdam.sunwoo@arm.com
957404SAli.Saidi@ARM.com    typedef uint8_t RegIndex;
967404SAli.Saidi@ARM.com};
977404SAli.Saidi@ARM.com
987404SAli.Saidi@ARM.com#endif // __ARCH_X86_TYPES_HH__
997404SAli.Saidi@ARM.com