16019SN/A/*
214238Sciro.santilli@arm.com * Copyright (c) 2010-2011, 2014, 2016-2019 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
4612109SRekai.GonzalezAlberquilla@arm.com#include "arch/arm/ccregs.hh"
478961Sgblack@eecs.umich.edu#include "arch/arm/generated/max_inst_regs.hh"
488229Snate@binkert.org#include "arch/arm/intregs.hh"
496329Sgblack@eecs.umich.edu#include "arch/arm/miscregs.hh"
5013610Sgiacomo.gabrielli@arm.com#include "arch/arm/types.hh"
5113610Sgiacomo.gabrielli@arm.com#include "arch/generic/vec_pred_reg.hh"
5212109SRekai.GonzalezAlberquilla@arm.com#include "arch/generic/vec_reg.hh"
536328SN/A
546329Sgblack@eecs.umich.edunamespace ArmISA {
556328SN/A
567848SAli.Saidi@ARM.com
577848SAli.Saidi@ARM.com// For a predicated instruction, we need all the
587848SAli.Saidi@ARM.com// destination registers to also be sources
597848SAli.Saidi@ARM.comconst int MaxInstSrcRegs = ArmISAInst::MaxInstDestRegs +
607848SAli.Saidi@ARM.com    ArmISAInst::MaxInstSrcRegs;
616329Sgblack@eecs.umich.eduusing ArmISAInst::MaxInstDestRegs;
629046SAli.Saidi@ARM.comusing ArmISAInst::MaxMiscDestRegs;
636328SN/A
6414238Sciro.santilli@arm.com// Number of VecElem per Vector Register considering only pre-SVE
6514238Sciro.santilli@arm.com// Advanced SIMD registers.
6614238Sciro.santilli@arm.comconstexpr unsigned NumVecElemPerNeonVecReg = 4;
6712109SRekai.GonzalezAlberquilla@arm.com// Number of VecElem per Vector Register, computed based on the vector length
6813759Sgiacomo.gabrielli@arm.comconstexpr unsigned NumVecElemPerVecReg = MaxSveVecLenInWords;
6913759Sgiacomo.gabrielli@arm.com
7012109SRekai.GonzalezAlberquilla@arm.comusing VecElem = uint32_t;
7112109SRekai.GonzalezAlberquilla@arm.comusing VecReg = ::VecRegT<VecElem, NumVecElemPerVecReg, false>;
7212109SRekai.GonzalezAlberquilla@arm.comusing ConstVecReg = ::VecRegT<VecElem, NumVecElemPerVecReg, true>;
7312109SRekai.GonzalezAlberquilla@arm.comusing VecRegContainer = VecReg::Container;
7412109SRekai.GonzalezAlberquilla@arm.com
7513759Sgiacomo.gabrielli@arm.comusing VecPredReg = ::VecPredRegT<VecElem, NumVecElemPerVecReg,
7613759Sgiacomo.gabrielli@arm.com                                 VecPredRegHasPackedRepr, false>;
7713759Sgiacomo.gabrielli@arm.comusing ConstVecPredReg = ::VecPredRegT<VecElem, NumVecElemPerVecReg,
7813759Sgiacomo.gabrielli@arm.com                                      VecPredRegHasPackedRepr, true>;
7913759Sgiacomo.gabrielli@arm.comusing VecPredRegContainer = VecPredReg::Container;
8013610Sgiacomo.gabrielli@arm.com
816329Sgblack@eecs.umich.edu// Constants Related to the number of registers
826717Sgblack@eecs.umich.educonst int NumIntArchRegs = NUM_ARCH_INTREGS;
837177Sgblack@eecs.umich.edu// The number of single precision floating point registers
8410037SARM gem5 Developersconst int NumFloatV7ArchRegs  = 64;
8510037SARM gem5 Developersconst int NumFloatV8ArchRegs  = 128;
8610037SARM gem5 Developersconst int NumFloatSpecialRegs = 32;
8712109SRekai.GonzalezAlberquilla@arm.comconst int NumVecV7ArchRegs  = 64;
8812109SRekai.GonzalezAlberquilla@arm.comconst int NumVecV8ArchRegs  = 32;
8912109SRekai.GonzalezAlberquilla@arm.comconst int NumVecSpecialRegs = 8;
906328SN/A
9114106Sjavier.setoain@arm.comconst int NumVecIntrlvRegs = 4;
926717Sgblack@eecs.umich.educonst int NumIntRegs = NUM_INTREGS;
9310037SARM gem5 Developersconst int NumFloatRegs = NumFloatV8ArchRegs + NumFloatSpecialRegs;
9414106Sjavier.setoain@arm.comconst int NumVecRegs = NumVecV8ArchRegs + NumVecSpecialRegs + NumVecIntrlvRegs;
9514028Sgiacomo.gabrielli@arm.comconst int VECREG_UREG0 = 32;
9614091Sgabor.dozsa@arm.comconst int NumVecPredRegs = 18;  // P0-P15, FFR, UREG0
9713759Sgiacomo.gabrielli@arm.comconst int PREDREG_FFR = 16;
9814091Sgabor.dozsa@arm.comconst int PREDREG_UREG0 = 17;
9910338SCurtis.Dunham@arm.comconst int NumCCRegs = NUM_CCREGS;
1006329Sgblack@eecs.umich.educonst int NumMiscRegs = NUM_MISCREGS;
10114106Sjavier.setoain@arm.comconst int INTRLVREG0 = NumVecV8ArchRegs + NumVecSpecialRegs;
10214106Sjavier.setoain@arm.comconst int INTRLVREG1 = INTRLVREG0 + 1;
10314106Sjavier.setoain@arm.comconst int INTRLVREG2 = INTRLVREG0 + 2;
10414106Sjavier.setoain@arm.comconst int INTRLVREG3 = INTRLVREG0 + 3;
1056328SN/A
10610338SCurtis.Dunham@arm.com#define ISA_HAS_CC_REGS
10710338SCurtis.Dunham@arm.com
10813610Sgiacomo.gabrielli@arm.comconst int TotalNumRegs = NumIntRegs + NumFloatRegs + NumVecRegs +
10913610Sgiacomo.gabrielli@arm.com    NumVecPredRegs + NumMiscRegs;
1106328SN/A
1116329Sgblack@eecs.umich.edu// semantically meaningful register indices
1126329Sgblack@eecs.umich.educonst int ReturnValueReg = 0;
1136329Sgblack@eecs.umich.educonst int ReturnValueReg1 = 1;
1146329Sgblack@eecs.umich.educonst int ReturnValueReg2 = 2;
1157650SAli.Saidi@ARM.comconst int NumArgumentRegs = 4;
11610037SARM gem5 Developersconst int NumArgumentRegs64 = 8;
1176329Sgblack@eecs.umich.educonst int ArgumentReg0 = 0;
1186329Sgblack@eecs.umich.educonst int ArgumentReg1 = 1;
1196329Sgblack@eecs.umich.educonst int ArgumentReg2 = 2;
1206329Sgblack@eecs.umich.educonst int ArgumentReg3 = 3;
1216329Sgblack@eecs.umich.educonst int FramePointerReg = 11;
1226717Sgblack@eecs.umich.educonst int StackPointerReg = INTREG_SP;
1236717Sgblack@eecs.umich.educonst int ReturnAddressReg = INTREG_LR;
1246717Sgblack@eecs.umich.educonst int PCReg = INTREG_PC;
1256328SN/A
1266717Sgblack@eecs.umich.educonst int ZeroReg = INTREG_ZERO;
1276328SN/A
1286329Sgblack@eecs.umich.educonst int SyscallNumReg = ReturnValueReg;
1296329Sgblack@eecs.umich.educonst int SyscallPseudoReturnReg = ReturnValueReg;
1306329Sgblack@eecs.umich.educonst int SyscallSuccessReg = ReturnValueReg;
1316328SN/A
1326328SN/A} // namespace ArmISA
1336019SN/A
1346019SN/A#endif
135