int.hh revision 5061
110259SAndrew.Bardsley@arm.com/*
210259SAndrew.Bardsley@arm.com * Copyright (c) 2007 The Hewlett-Packard Development Company
310259SAndrew.Bardsley@arm.com * All rights reserved.
410259SAndrew.Bardsley@arm.com *
510259SAndrew.Bardsley@arm.com * Redistribution and use of this software in source and binary forms,
610259SAndrew.Bardsley@arm.com * with or without modification, are permitted provided that the
710259SAndrew.Bardsley@arm.com * following conditions are met:
810259SAndrew.Bardsley@arm.com *
910259SAndrew.Bardsley@arm.com * The software must be used only for Non-Commercial Use which means any
1010259SAndrew.Bardsley@arm.com * use which is NOT directed to receiving any direct monetary
1110259SAndrew.Bardsley@arm.com * compensation for, or commercial advantage from such use.  Illustrative
1210259SAndrew.Bardsley@arm.com * examples of non-commercial use are academic research, personal study,
1310259SAndrew.Bardsley@arm.com * teaching, education and corporate research & development.
1410259SAndrew.Bardsley@arm.com * Illustrative examples of commercial use are distributing products for
1510259SAndrew.Bardsley@arm.com * commercial advantage and providing services using the software for
1610259SAndrew.Bardsley@arm.com * commercial advantage.
1710259SAndrew.Bardsley@arm.com *
1810259SAndrew.Bardsley@arm.com * If you wish to use this software or functionality therein that may be
1910259SAndrew.Bardsley@arm.com * covered by patents for commercial use, please contact:
2010259SAndrew.Bardsley@arm.com *     Director of Intellectual Property Licensing
2110259SAndrew.Bardsley@arm.com *     Office of Strategy and Technology
2210259SAndrew.Bardsley@arm.com *     Hewlett-Packard Company
2310259SAndrew.Bardsley@arm.com *     1501 Page Mill Road
2410259SAndrew.Bardsley@arm.com *     Palo Alto, California  94304
2510259SAndrew.Bardsley@arm.com *
2610259SAndrew.Bardsley@arm.com * Redistributions of source code must retain the above copyright notice,
2710259SAndrew.Bardsley@arm.com * this list of conditions and the following disclaimer.  Redistributions
2810259SAndrew.Bardsley@arm.com * in binary form must reproduce the above copyright notice, this list of
2910259SAndrew.Bardsley@arm.com * conditions and the following disclaimer in the documentation and/or
3010259SAndrew.Bardsley@arm.com * other materials provided with the distribution.  Neither the name of
3110259SAndrew.Bardsley@arm.com * the COPYRIGHT HOLDER(s), HEWLETT-PACKARD COMPANY, nor the names of its
3210259SAndrew.Bardsley@arm.com * contributors may be used to endorse or promote products derived from
3310259SAndrew.Bardsley@arm.com * this software without specific prior written permission.  No right of
3410259SAndrew.Bardsley@arm.com * sublicense is granted herewith.  Derivatives of the software and
3510259SAndrew.Bardsley@arm.com * output created using the software may be prepared, but only for
3610259SAndrew.Bardsley@arm.com * Non-Commercial Uses.  Derivatives of the software may be shared with
3710259SAndrew.Bardsley@arm.com * others provided: (i) the others agree to abide by the list of
3810259SAndrew.Bardsley@arm.com * conditions herein which includes the Non-Commercial Use restrictions;
3910259SAndrew.Bardsley@arm.com * and (ii) such Derivatives of the software include the above copyright
4011793Sbrandon.potter@amd.com * notice to acknowledge the contribution from this software where
4111793Sbrandon.potter@amd.com * applicable, this list of conditions and the disclaimer below.
4210259SAndrew.Bardsley@arm.com *
4310259SAndrew.Bardsley@arm.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4410259SAndrew.Bardsley@arm.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
4510259SAndrew.Bardsley@arm.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
4610259SAndrew.Bardsley@arm.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
4710259SAndrew.Bardsley@arm.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
4810259SAndrew.Bardsley@arm.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
4910259SAndrew.Bardsley@arm.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
5010259SAndrew.Bardsley@arm.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
5110259SAndrew.Bardsley@arm.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
5210259SAndrew.Bardsley@arm.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
5310259SAndrew.Bardsley@arm.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5410259SAndrew.Bardsley@arm.com *
5510259SAndrew.Bardsley@arm.com * Authors: Gabe Black
5610259SAndrew.Bardsley@arm.com */
5710259SAndrew.Bardsley@arm.com
5810259SAndrew.Bardsley@arm.com#ifndef __ARCH_X86_INTREGS_HH__
5910259SAndrew.Bardsley@arm.com#define __ARCH_X86_INTREGS_HH__
6010259SAndrew.Bardsley@arm.com
6110259SAndrew.Bardsley@arm.com#include "base/bitunion.hh"
6210259SAndrew.Bardsley@arm.com
6310259SAndrew.Bardsley@arm.comnamespace X86ISA
6410259SAndrew.Bardsley@arm.com{
6510259SAndrew.Bardsley@arm.com    BitUnion64(X86IntReg)
6610259SAndrew.Bardsley@arm.com        Bitfield<63,0> R;
6710259SAndrew.Bardsley@arm.com        SignedBitfield<63,0> SR;
6810259SAndrew.Bardsley@arm.com        Bitfield<31,0> E;
6910259SAndrew.Bardsley@arm.com        SignedBitfield<31,0> SE;
7010259SAndrew.Bardsley@arm.com        Bitfield<15,0> X;
7110259SAndrew.Bardsley@arm.com        SignedBitfield<15,0> SX;
7210259SAndrew.Bardsley@arm.com        Bitfield<15,8> H;
7310259SAndrew.Bardsley@arm.com        SignedBitfield<15,8> SH;
7410259SAndrew.Bardsley@arm.com        Bitfield<7, 0> L;
7510259SAndrew.Bardsley@arm.com        SignedBitfield<7, 0> SL;
7610259SAndrew.Bardsley@arm.com    EndBitUnion(X86IntReg)
7710259SAndrew.Bardsley@arm.com
7810259SAndrew.Bardsley@arm.com    enum IntRegIndex
7910259SAndrew.Bardsley@arm.com    {
8010259SAndrew.Bardsley@arm.com        INTREG_RAX,
8110259SAndrew.Bardsley@arm.com        INTREG_EAX = INTREG_RAX,
8210259SAndrew.Bardsley@arm.com        INTREG_AX = INTREG_RAX,
8310259SAndrew.Bardsley@arm.com        INTREG_AL = INTREG_RAX,
8410259SAndrew.Bardsley@arm.com
8510259SAndrew.Bardsley@arm.com        INTREG_RCX,
8610259SAndrew.Bardsley@arm.com        INTREG_ECX = INTREG_RCX,
8710259SAndrew.Bardsley@arm.com        INTREG_CX = INTREG_RCX,
8810259SAndrew.Bardsley@arm.com        INTREG_CL = INTREG_RCX,
8910259SAndrew.Bardsley@arm.com
9011567Smitch.hayenga@arm.com        INTREG_RDX,
9111567Smitch.hayenga@arm.com        INTREG_EDX = INTREG_RDX,
9211567Smitch.hayenga@arm.com        INTREG_DX = INTREG_RDX,
9311567Smitch.hayenga@arm.com        INTREG_DL = INTREG_RDX,
9410259SAndrew.Bardsley@arm.com
9510259SAndrew.Bardsley@arm.com        INTREG_RBX,
9610259SAndrew.Bardsley@arm.com        INTREG_EBX = INTREG_RBX,
9710259SAndrew.Bardsley@arm.com        INTREG_BX = INTREG_RBX,
9810259SAndrew.Bardsley@arm.com        INTREG_BL = INTREG_RBX,
9910259SAndrew.Bardsley@arm.com
10010259SAndrew.Bardsley@arm.com        INTREG_RSP,
10110259SAndrew.Bardsley@arm.com        INTREG_ESP = INTREG_RSP,
10210259SAndrew.Bardsley@arm.com        INTREG_SP = INTREG_RSP,
10310259SAndrew.Bardsley@arm.com        INTREG_SPL = INTREG_RSP,
10410259SAndrew.Bardsley@arm.com        INTREG_AH = INTREG_RSP,
10510259SAndrew.Bardsley@arm.com
10610259SAndrew.Bardsley@arm.com        INTREG_RBP,
10710259SAndrew.Bardsley@arm.com        INTREG_EBP = INTREG_RBP,
10810259SAndrew.Bardsley@arm.com        INTREG_BP = INTREG_RBP,
10910259SAndrew.Bardsley@arm.com        INTREG_BPL = INTREG_RBP,
11010259SAndrew.Bardsley@arm.com        INTREG_CH = INTREG_RBP,
11110259SAndrew.Bardsley@arm.com
11210259SAndrew.Bardsley@arm.com        INTREG_RSI,
11310259SAndrew.Bardsley@arm.com        INTREG_ESI = INTREG_RSI,
11410259SAndrew.Bardsley@arm.com        INTREG_SI = INTREG_RSI,
11510259SAndrew.Bardsley@arm.com        INTREG_SIL = INTREG_RSI,
11610259SAndrew.Bardsley@arm.com        INTREG_DH = INTREG_RSI,
11710259SAndrew.Bardsley@arm.com
11810259SAndrew.Bardsley@arm.com        INTREG_RDI,
11910259SAndrew.Bardsley@arm.com        INTREG_EDI = INTREG_RDI,
12010259SAndrew.Bardsley@arm.com        INTREG_DI = INTREG_RDI,
12110259SAndrew.Bardsley@arm.com        INTREG_DIL = INTREG_RDI,
12210259SAndrew.Bardsley@arm.com        INTREG_BH = INTREG_RDI,
12310259SAndrew.Bardsley@arm.com
12410259SAndrew.Bardsley@arm.com        INTREG_R8,
12510259SAndrew.Bardsley@arm.com        INTREG_R8D = INTREG_R8,
12610259SAndrew.Bardsley@arm.com        INTREG_R8W = INTREG_R8,
12710259SAndrew.Bardsley@arm.com        INTREG_R8B = INTREG_R8,
12810259SAndrew.Bardsley@arm.com
12910259SAndrew.Bardsley@arm.com        INTREG_R9,
13010259SAndrew.Bardsley@arm.com        INTREG_R9D = INTREG_R9,
13110259SAndrew.Bardsley@arm.com        INTREG_R9W = INTREG_R9,
13210259SAndrew.Bardsley@arm.com        INTREG_R9B = INTREG_R9,
13310259SAndrew.Bardsley@arm.com
13410259SAndrew.Bardsley@arm.com        INTREG_R10,
13510259SAndrew.Bardsley@arm.com        INTREG_R10D = INTREG_R10,
13610259SAndrew.Bardsley@arm.com        INTREG_R10W = INTREG_R10,
13710259SAndrew.Bardsley@arm.com        INTREG_R10B = INTREG_R10,
13810259SAndrew.Bardsley@arm.com
13910259SAndrew.Bardsley@arm.com        INTREG_R11,
14010259SAndrew.Bardsley@arm.com        INTREG_R11D = INTREG_R11,
14110259SAndrew.Bardsley@arm.com        INTREG_R11W = INTREG_R11,
14210259SAndrew.Bardsley@arm.com        INTREG_R11B = INTREG_R11,
14310259SAndrew.Bardsley@arm.com
14410259SAndrew.Bardsley@arm.com        INTREG_R12,
14510259SAndrew.Bardsley@arm.com        INTREG_R12D = INTREG_R12,
14610259SAndrew.Bardsley@arm.com        INTREG_R12W = INTREG_R12,
14710259SAndrew.Bardsley@arm.com        INTREG_R12B = INTREG_R12,
14810259SAndrew.Bardsley@arm.com
14910814Sandreas.hansson@arm.com        INTREG_R13,
15010259SAndrew.Bardsley@arm.com        INTREG_R13D = INTREG_R13,
15110259SAndrew.Bardsley@arm.com        INTREG_R13W = INTREG_R13,
15210259SAndrew.Bardsley@arm.com        INTREG_R13B = INTREG_R13,
15310259SAndrew.Bardsley@arm.com
15410259SAndrew.Bardsley@arm.com        INTREG_R14,
15510259SAndrew.Bardsley@arm.com        INTREG_R14D = INTREG_R14,
15610259SAndrew.Bardsley@arm.com        INTREG_R14W = INTREG_R14,
15710259SAndrew.Bardsley@arm.com        INTREG_R14B = INTREG_R14,
15810259SAndrew.Bardsley@arm.com
15910259SAndrew.Bardsley@arm.com        INTREG_R15,
16010259SAndrew.Bardsley@arm.com        INTREG_R15D = INTREG_R15,
16110259SAndrew.Bardsley@arm.com        INTREG_R15W = INTREG_R15,
16210259SAndrew.Bardsley@arm.com        INTREG_R15B = INTREG_R15,
16310259SAndrew.Bardsley@arm.com
16410259SAndrew.Bardsley@arm.com        NUM_INTREGS
16510259SAndrew.Bardsley@arm.com    };
16610259SAndrew.Bardsley@arm.com};
16710259SAndrew.Bardsley@arm.com
16810259SAndrew.Bardsley@arm.com#endif // __ARCH_X86_INTREGS_HH__
16911567Smitch.hayenga@arm.com