registers.hh revision 13759
12SN/A/*
21762SN/A * Copyright (c) 2010-2011, 2014, 2016-2017 ARM Limited
32SN/A * All rights reserved
42SN/A *
52SN/A * The license below extends only to copyright in the software and shall
62SN/A * not be construed as granting a license to any other intellectual
72SN/A * property including but not limited to intellectual property relating
82SN/A * to a hardware implementation of the functionality of the software
92SN/A * licensed hereunder.  You may use the software subject to the license
102SN/A * terms below provided that you ensure that this notice is replicated
112SN/A * unmodified and in its entirety in all distributions of the software,
122SN/A * modified or unmodified, in source code or in binary form.
132SN/A *
142SN/A * Copyright (c) 2007-2008 The Florida State University
152SN/A * All rights reserved.
162SN/A *
172SN/A * Redistribution and use in source and binary forms, with or without
182SN/A * modification, are permitted provided that the following conditions are
192SN/A * met: redistributions of source code must retain the above copyright
202SN/A * notice, this list of conditions and the following disclaimer;
212SN/A * redistributions in binary form must reproduce the above copyright
222SN/A * notice, this list of conditions and the following disclaimer in the
232SN/A * documentation and/or other materials provided with the distribution;
242SN/A * neither the name of the copyright holders nor the names of its
252SN/A * contributors may be used to endorse or promote products derived from
262SN/A * this software without specific prior written permission.
272665Ssaidi@eecs.umich.edu *
282665Ssaidi@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
292665Ssaidi@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
302665Ssaidi@eecs.umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
312SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
322SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
332623SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
342623SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
352SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
364182Sgblack@eecs.umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
371354SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
381858SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
396658Snate@binkert.org *
401717SN/A * Authors: Stephen Hines
418541Sgblack@eecs.umich.edu */
428229Snate@binkert.org
432683Sktlim@umich.edu#ifndef __ARCH_ARM_REGISTERS_HH__
441354SN/A#define __ARCH_ARM_REGISTERS_HH__
452387SN/A
462387SN/A#include "arch/arm/ccregs.hh"
472387SN/A#include "arch/arm/generated/max_inst_regs.hh"
4856SN/A#include "arch/arm/intregs.hh"
495348Ssaidi@eecs.umich.edu#include "arch/arm/miscregs.hh"
502SN/A#include "arch/arm/types.hh"
512SN/A#include "arch/generic/vec_pred_reg.hh"
521858SN/A#include "arch/generic/vec_reg.hh"
532SN/A
543453Sgblack@eecs.umich.edunamespace ArmISA {
553453Sgblack@eecs.umich.edu
563453Sgblack@eecs.umich.edu
573453Sgblack@eecs.umich.edu// For a predicated instruction, we need all the
583453Sgblack@eecs.umich.edu// destination registers to also be sources
592462SN/Aconst int MaxInstSrcRegs = ArmISAInst::MaxInstDestRegs +
602SN/A    ArmISAInst::MaxInstSrcRegs;
61715SN/Ausing ArmISAInst::MaxInstDestRegs;
62715SN/Ausing ArmISAInst::MaxMiscDestRegs;
63715SN/A
64715SN/A// Number of VecElem per Vector Register, computed based on the vector length
652SN/Aconstexpr unsigned NumVecElemPerVecReg = MaxSveVecLenInWords;
662SN/A
674182Sgblack@eecs.umich.eduusing VecElem = uint32_t;
684182Sgblack@eecs.umich.eduusing VecReg = ::VecRegT<VecElem, NumVecElemPerVecReg, false>;
694182Sgblack@eecs.umich.eduusing ConstVecReg = ::VecRegT<VecElem, NumVecElemPerVecReg, true>;
704182Sgblack@eecs.umich.eduusing VecRegContainer = VecReg::Container;
712680Sktlim@umich.edu
72237SN/Ausing VecPredReg = ::VecPredRegT<VecElem, NumVecElemPerVecReg,
732SN/A                                 VecPredRegHasPackedRepr, false>;
742SN/Ausing ConstVecPredReg = ::VecPredRegT<VecElem, NumVecElemPerVecReg,
752SN/A                                      VecPredRegHasPackedRepr, true>;
762SN/Ausing VecPredRegContainer = VecPredReg::Container;
772SN/A
785529Snate@binkert.org// Constants Related to the number of registers
795529Snate@binkert.orgconst int NumIntArchRegs = NUM_ARCH_INTREGS;
802420SN/A// The number of single precision floating point registers
812623SN/Aconst int NumFloatV7ArchRegs  = 64;
822SN/Aconst int NumFloatV8ArchRegs  = 128;
832107SN/Aconst int NumFloatSpecialRegs = 32;
842159SN/Aconst int NumVecV7ArchRegs  = 64;
852455SN/Aconst int NumVecV8ArchRegs  = 32;
862455SN/Aconst int NumVecSpecialRegs = 8;
872386SN/A
882623SN/Aconst int NumIntRegs = NUM_INTREGS;
892SN/Aconst int NumFloatRegs = NumFloatV8ArchRegs + NumFloatSpecialRegs;
901371SN/Aconst int NumVecRegs = NumVecV8ArchRegs + NumVecSpecialRegs;
915348Ssaidi@eecs.umich.educonst int NumVecPredRegs = 17;  // P0-P15, FFR
927720Sgblack@eecs.umich.educonst int PREDREG_FFR = 16;
935348Ssaidi@eecs.umich.educonst int NumCCRegs = NUM_CCREGS;
947720Sgblack@eecs.umich.educonst int NumMiscRegs = NUM_MISCREGS;
955348Ssaidi@eecs.umich.edu
967720Sgblack@eecs.umich.edu#define ISA_HAS_CC_REGS
977720Sgblack@eecs.umich.edu
985348Ssaidi@eecs.umich.educonst int TotalNumRegs = NumIntRegs + NumFloatRegs + NumVecRegs +
995348Ssaidi@eecs.umich.edu    NumVecPredRegs + NumMiscRegs;
1002SN/A
1015807Snate@binkert.org// semantically meaningful register indices
1022SN/Aconst int ReturnValueReg = 0;
1032SN/Aconst int ReturnValueReg1 = 1;
1042SN/Aconst int ReturnValueReg2 = 2;
1052SN/Aconst int NumArgumentRegs = 4;
1062SN/Aconst int NumArgumentRegs64 = 8;
1072SN/Aconst int ArgumentReg0 = 0;
1082SN/Aconst int ArgumentReg1 = 1;
1092SN/Aconst int ArgumentReg2 = 2;
1102SN/Aconst int ArgumentReg3 = 3;
1111400SN/Aconst int FramePointerReg = 11;
1125529Snate@binkert.orgconst int StackPointerReg = INTREG_SP;
1132623SN/Aconst int ReturnAddressReg = INTREG_LR;
1142SN/Aconst int PCReg = INTREG_PC;
1151400SN/A
1162683Sktlim@umich.educonst int ZeroReg = INTREG_ZERO;
1172683Sktlim@umich.edu
1182190SN/Aconst int SyscallNumReg = ReturnValueReg;
1192683Sktlim@umich.educonst int SyscallPseudoReturnReg = ReturnValueReg;
1202683Sktlim@umich.educonst int SyscallSuccessReg = ReturnValueReg;
1212683Sktlim@umich.edu
1222680Sktlim@umich.edu} // namespace ArmISA
1235169Ssaidi@eecs.umich.edu
1245169Ssaidi@eecs.umich.edu#endif
1255496Ssaidi@eecs.umich.edu