registers.hh revision 6329
114184Sgabeblack@google.com/*
214184Sgabeblack@google.com * Copyright (c) 2007-2008 The Florida State University
314184Sgabeblack@google.com * All rights reserved.
414184Sgabeblack@google.com *
514184Sgabeblack@google.com * Redistribution and use in source and binary forms, with or without
614184Sgabeblack@google.com * modification, are permitted provided that the following conditions are
714184Sgabeblack@google.com * met: redistributions of source code must retain the above copyright
814184Sgabeblack@google.com * notice, this list of conditions and the following disclaimer;
914184Sgabeblack@google.com * redistributions in binary form must reproduce the above copyright
1014184Sgabeblack@google.com * notice, this list of conditions and the following disclaimer in the
1114184Sgabeblack@google.com * documentation and/or other materials provided with the distribution;
1214184Sgabeblack@google.com * neither the name of the copyright holders nor the names of its
1314184Sgabeblack@google.com * contributors may be used to endorse or promote products derived from
1414184Sgabeblack@google.com * this software without specific prior written permission.
1514184Sgabeblack@google.com *
1614184Sgabeblack@google.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1714184Sgabeblack@google.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1814184Sgabeblack@google.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1914184Sgabeblack@google.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2014184Sgabeblack@google.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2114184Sgabeblack@google.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2214184Sgabeblack@google.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2314184Sgabeblack@google.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2414184Sgabeblack@google.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2514184Sgabeblack@google.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2614184Sgabeblack@google.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2714184Sgabeblack@google.com *
2814184Sgabeblack@google.com * Authors: Stephen Hines
2914184Sgabeblack@google.com */
3014184Sgabeblack@google.com
3114184Sgabeblack@google.com#ifndef __ARCH_ARM_REGISTERS_HH__
3214184Sgabeblack@google.com#define __ARCH_ARM_REGISTERS_HH__
3314184Sgabeblack@google.com
3414184Sgabeblack@google.com#include "arch/arm/max_inst_regs.hh"
3514184Sgabeblack@google.com#include "arch/arm/miscregs.hh"
3614184Sgabeblack@google.com
3714184Sgabeblack@google.comnamespace ArmISA {
3814184Sgabeblack@google.com
3914184Sgabeblack@google.comusing ArmISAInst::MaxInstSrcRegs;
4014184Sgabeblack@google.comusing ArmISAInst::MaxInstDestRegs;
4114184Sgabeblack@google.com
4214184Sgabeblack@google.comtypedef uint8_t  RegIndex;
4314184Sgabeblack@google.com
4414184Sgabeblack@google.comtypedef uint64_t IntReg;
4514184Sgabeblack@google.com
4614184Sgabeblack@google.com// floating point register file entry type
4714184Sgabeblack@google.comtypedef uint32_t FloatRegBits;
4814184Sgabeblack@google.comtypedef float FloatReg;
4914184Sgabeblack@google.com
5014184Sgabeblack@google.com// cop-0/cop-1 system control register
5114184Sgabeblack@google.comtypedef uint64_t MiscReg;
5214184Sgabeblack@google.com
5314184Sgabeblack@google.com// Constants Related to the number of registers
5414184Sgabeblack@google.comconst int NumIntArchRegs = 16;
5514184Sgabeblack@google.comconst int NumIntSpecialRegs = 19;
5614184Sgabeblack@google.comconst int NumFloatArchRegs = 16;
5714184Sgabeblack@google.comconst int NumFloatSpecialRegs = 5;
5814184Sgabeblack@google.comconst int NumInternalProcRegs = 0;
5914184Sgabeblack@google.com
6014184Sgabeblack@google.comconst int NumIntRegs = NumIntArchRegs + NumIntSpecialRegs;
6114184Sgabeblack@google.comconst int NumFloatRegs = NumFloatArchRegs + NumFloatSpecialRegs;
6214184Sgabeblack@google.com
6314184Sgabeblack@google.comconst int NumMiscRegs = NUM_MISCREGS;
6414184Sgabeblack@google.com
6514184Sgabeblack@google.com
6614184Sgabeblack@google.com// semantically meaningful register indices
6714184Sgabeblack@google.comconst int ReturnValueReg = 0;
6814184Sgabeblack@google.comconst int ReturnValueReg1 = 1;
6914184Sgabeblack@google.comconst int ReturnValueReg2 = 2;
7014184Sgabeblack@google.comconst int ArgumentReg0 = 0;
7114184Sgabeblack@google.comconst int ArgumentReg1 = 1;
7214184Sgabeblack@google.comconst int ArgumentReg2 = 2;
7314184Sgabeblack@google.comconst int ArgumentReg3 = 3;
7414184Sgabeblack@google.comconst int FramePointerReg = 11;
7514184Sgabeblack@google.comconst int StackPointerReg = 13;
7614184Sgabeblack@google.comconst int ReturnAddressReg = 14;
7714184Sgabeblack@google.comconst int PCReg = 15;
7814184Sgabeblack@google.com
7914184Sgabeblack@google.comconst int ZeroReg = NumIntArchRegs;
8014184Sgabeblack@google.comconst int AddrReg = ZeroReg + 1; // Used to generate address for uops
8114184Sgabeblack@google.com
8214184Sgabeblack@google.comconst int SyscallNumReg = ReturnValueReg;
8314184Sgabeblack@google.comconst int SyscallPseudoReturnReg = ReturnValueReg;
8414184Sgabeblack@google.comconst int SyscallSuccessReg = ReturnValueReg;
8514184Sgabeblack@google.com
8614184Sgabeblack@google.com// These help enumerate all the registers for dependence tracking.
8714184Sgabeblack@google.comconst int FP_Base_DepTag = NumIntRegs;
8814184Sgabeblack@google.comconst int Ctrl_Base_DepTag = FP_Base_DepTag + NumFloatRegs;
8914184Sgabeblack@google.com
9014184Sgabeblack@google.comtypedef union {
9114184Sgabeblack@google.com    IntReg   intreg;
9214184Sgabeblack@google.com    FloatReg fpreg;
9314184Sgabeblack@google.com    MiscReg  ctrlreg;
9414184Sgabeblack@google.com} AnyReg;
9514184Sgabeblack@google.com
9614184Sgabeblack@google.comenum FPControlRegNums {
9714184Sgabeblack@google.com   FIR = NumFloatArchRegs,
9814184Sgabeblack@google.com   FCCR,
9914184Sgabeblack@google.com   FEXR,
10014184Sgabeblack@google.com   FENR,
10114184Sgabeblack@google.com   FCSR
10214184Sgabeblack@google.com};
10314184Sgabeblack@google.com
10414184Sgabeblack@google.comenum FCSRBits {
10514184Sgabeblack@google.com    Inexact = 1,
10614184Sgabeblack@google.com    Underflow,
10714184Sgabeblack@google.com    Overflow,
10814184Sgabeblack@google.com    DivideByZero,
10914184Sgabeblack@google.com    Invalid,
11014184Sgabeblack@google.com    Unimplemented
11114184Sgabeblack@google.com};
11214184Sgabeblack@google.com
11314184Sgabeblack@google.comenum FCSRFields {
11414184Sgabeblack@google.com    Flag_Field = 1,
11514184Sgabeblack@google.com    Enable_Field = 6,
11614184Sgabeblack@google.com    Cause_Field = 11
11714184Sgabeblack@google.com};
11814184Sgabeblack@google.com
11914184Sgabeblack@google.comenum MiscIntRegNums {
12014184Sgabeblack@google.com    zero_reg = NumIntArchRegs,
12114184Sgabeblack@google.com    addr_reg,
12214184Sgabeblack@google.com
12314184Sgabeblack@google.com    rhi,
12414184Sgabeblack@google.com    rlo,
12514184Sgabeblack@google.com
12614184Sgabeblack@google.com    r8_fiq,    /* FIQ mode register bank */
12714184Sgabeblack@google.com    r9_fiq,
12814184Sgabeblack@google.com    r10_fiq,
12914184Sgabeblack@google.com    r11_fiq,
13014184Sgabeblack@google.com    r12_fiq,
13114184Sgabeblack@google.com
13214184Sgabeblack@google.com    r13_fiq,   /* FIQ mode SP and LR */
13314184Sgabeblack@google.com    r14_fiq,
13414184Sgabeblack@google.com
13514184Sgabeblack@google.com    r13_irq,   /* IRQ mode SP and LR */
13614184Sgabeblack@google.com    r14_irq,
13714184Sgabeblack@google.com
13814184Sgabeblack@google.com    r13_svc,   /* SVC mode SP and LR */
13914184Sgabeblack@google.com    r14_svc,
14014184Sgabeblack@google.com
14114184Sgabeblack@google.com    r13_undef, /* UNDEF mode SP and LR */
14214184Sgabeblack@google.com    r14_undef,
14314184Sgabeblack@google.com
14414184Sgabeblack@google.com    r13_abt,   /* ABT mode SP and LR */
14514184Sgabeblack@google.com    r14_abt
14614184Sgabeblack@google.com};
14714184Sgabeblack@google.com
14814184Sgabeblack@google.com} // namespace ArmISA
14914184Sgabeblack@google.com
15014184Sgabeblack@google.com#endif
15114184Sgabeblack@google.com