registers.hh revision 7811
16019SN/A/* 27649Sminkyu.jeong@arm.com * Copyright (c) 2010 ARM Limited 37649Sminkyu.jeong@arm.com * All rights reserved 47649Sminkyu.jeong@arm.com * 57649Sminkyu.jeong@arm.com * The license below extends only to copyright in the software and shall 67649Sminkyu.jeong@arm.com * not be construed as granting a license to any other intellectual 77649Sminkyu.jeong@arm.com * property including but not limited to intellectual property relating 87649Sminkyu.jeong@arm.com * to a hardware implementation of the functionality of the software 97649Sminkyu.jeong@arm.com * licensed hereunder. You may use the software subject to the license 107649Sminkyu.jeong@arm.com * terms below provided that you ensure that this notice is replicated 117649Sminkyu.jeong@arm.com * unmodified and in its entirety in all distributions of the software, 127649Sminkyu.jeong@arm.com * modified or unmodified, in source code or in binary form. 137649Sminkyu.jeong@arm.com * 146019SN/A * Copyright (c) 2007-2008 The Florida State University 156019SN/A * All rights reserved. 166019SN/A * 176019SN/A * Redistribution and use in source and binary forms, with or without 186019SN/A * modification, are permitted provided that the following conditions are 196019SN/A * met: redistributions of source code must retain the above copyright 206019SN/A * notice, this list of conditions and the following disclaimer; 216019SN/A * redistributions in binary form must reproduce the above copyright 226019SN/A * notice, this list of conditions and the following disclaimer in the 236019SN/A * documentation and/or other materials provided with the distribution; 246019SN/A * neither the name of the copyright holders nor the names of its 256019SN/A * contributors may be used to endorse or promote products derived from 266019SN/A * this software without specific prior written permission. 276019SN/A * 286019SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 296019SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 306019SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 316019SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 326019SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 336019SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 346019SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 356019SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 366019SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 376019SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 386019SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 396019SN/A * 406019SN/A * Authors: Stephen Hines 416019SN/A */ 426019SN/A 436329Sgblack@eecs.umich.edu#ifndef __ARCH_ARM_REGISTERS_HH__ 446329Sgblack@eecs.umich.edu#define __ARCH_ARM_REGISTERS_HH__ 456019SN/A 466329Sgblack@eecs.umich.edu#include "arch/arm/max_inst_regs.hh" 476717Sgblack@eecs.umich.edu#include "arch/arm/intregs.hh" 486329Sgblack@eecs.umich.edu#include "arch/arm/miscregs.hh" 496328SN/A 506329Sgblack@eecs.umich.edunamespace ArmISA { 516328SN/A 526329Sgblack@eecs.umich.eduusing ArmISAInst::MaxInstSrcRegs; 536329Sgblack@eecs.umich.eduusing ArmISAInst::MaxInstDestRegs; 546328SN/A 557310Sgblack@eecs.umich.edutypedef uint16_t RegIndex; 566328SN/A 576329Sgblack@eecs.umich.edutypedef uint64_t IntReg; 586328SN/A 596329Sgblack@eecs.umich.edu// floating point register file entry type 606329Sgblack@eecs.umich.edutypedef uint32_t FloatRegBits; 616329Sgblack@eecs.umich.edutypedef float FloatReg; 626328SN/A 636329Sgblack@eecs.umich.edu// cop-0/cop-1 system control register 646329Sgblack@eecs.umich.edutypedef uint64_t MiscReg; 656328SN/A 666329Sgblack@eecs.umich.edu// Constants Related to the number of registers 676717Sgblack@eecs.umich.educonst int NumIntArchRegs = NUM_ARCH_INTREGS; 687177Sgblack@eecs.umich.edu// The number of single precision floating point registers 697177Sgblack@eecs.umich.educonst int NumFloatArchRegs = 64; 707592SAli.Saidi@ARM.comconst int NumFloatSpecialRegs = 8; 716328SN/A 726717Sgblack@eecs.umich.educonst int NumIntRegs = NUM_INTREGS; 736329Sgblack@eecs.umich.educonst int NumFloatRegs = NumFloatArchRegs + NumFloatSpecialRegs; 746329Sgblack@eecs.umich.educonst int NumMiscRegs = NUM_MISCREGS; 756328SN/A 767649Sminkyu.jeong@arm.comconst int TotalNumRegs = NumIntRegs + NumFloatRegs + NumMiscRegs; 776328SN/A 786329Sgblack@eecs.umich.edu// semantically meaningful register indices 796329Sgblack@eecs.umich.educonst int ReturnValueReg = 0; 806329Sgblack@eecs.umich.educonst int ReturnValueReg1 = 1; 816329Sgblack@eecs.umich.educonst int ReturnValueReg2 = 2; 827650SAli.Saidi@ARM.comconst int NumArgumentRegs = 4; 836329Sgblack@eecs.umich.educonst int ArgumentReg0 = 0; 846329Sgblack@eecs.umich.educonst int ArgumentReg1 = 1; 856329Sgblack@eecs.umich.educonst int ArgumentReg2 = 2; 866329Sgblack@eecs.umich.educonst int ArgumentReg3 = 3; 876329Sgblack@eecs.umich.educonst int FramePointerReg = 11; 886717Sgblack@eecs.umich.educonst int StackPointerReg = INTREG_SP; 896717Sgblack@eecs.umich.educonst int ReturnAddressReg = INTREG_LR; 906717Sgblack@eecs.umich.educonst int PCReg = INTREG_PC; 916328SN/A 926717Sgblack@eecs.umich.educonst int ZeroReg = INTREG_ZERO; 936328SN/A 946329Sgblack@eecs.umich.educonst int SyscallNumReg = ReturnValueReg; 956329Sgblack@eecs.umich.educonst int SyscallPseudoReturnReg = ReturnValueReg; 966329Sgblack@eecs.umich.educonst int SyscallSuccessReg = ReturnValueReg; 976328SN/A 986329Sgblack@eecs.umich.edu// These help enumerate all the registers for dependence tracking. 997498Sgblack@eecs.umich.educonst int FP_Base_DepTag = NumIntRegs * (MODE_MAXMODE + 1); 1006329Sgblack@eecs.umich.educonst int Ctrl_Base_DepTag = FP_Base_DepTag + NumFloatRegs; 1017649Sminkyu.jeong@arm.comconst int Max_DepTag = Ctrl_Base_DepTag + NumMiscRegs; 1026329Sgblack@eecs.umich.edu 1036329Sgblack@eecs.umich.edutypedef union { 1046329Sgblack@eecs.umich.edu IntReg intreg; 1056329Sgblack@eecs.umich.edu FloatReg fpreg; 1066329Sgblack@eecs.umich.edu MiscReg ctrlreg; 1076329Sgblack@eecs.umich.edu} AnyReg; 1086329Sgblack@eecs.umich.edu 1096328SN/A} // namespace ArmISA 1106019SN/A 1116019SN/A#endif 112