LCOV - code coverage report
Current view: top level - build-llvm/lib/Target/MSP430 - MSP430GenRegisterInfo.inc (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 21 45 46.7 %
Date: 2018-10-20 13:21:21 Functions: 8 16 50.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
       2             : |*                                                                            *|
       3             : |* Target Register Enum Values                                                *|
       4             : |*                                                                            *|
       5             : |* Automatically generated file, do not edit!                                 *|
       6             : |*                                                                            *|
       7             : \*===----------------------------------------------------------------------===*/
       8             : 
       9             : 
      10             : #ifdef GET_REGINFO_ENUM
      11             : #undef GET_REGINFO_ENUM
      12             : 
      13             : namespace llvm {
      14             : 
      15             : class MCRegisterClass;
      16             : extern const MCRegisterClass MSP430MCRegisterClasses[];
      17             : 
      18             : namespace MSP430 {
      19             : enum {
      20             :   NoRegister,
      21             :   CG = 1,
      22             :   CGB = 2,
      23             :   FP = 3,
      24             :   FPB = 4,
      25             :   PC = 5,
      26             :   PCB = 6,
      27             :   SP = 7,
      28             :   SPB = 8,
      29             :   SR = 9,
      30             :   SRB = 10,
      31             :   R5 = 11,
      32             :   R6 = 12,
      33             :   R7 = 13,
      34             :   R8 = 14,
      35             :   R9 = 15,
      36             :   R10 = 16,
      37             :   R11 = 17,
      38             :   R12 = 18,
      39             :   R13 = 19,
      40             :   R14 = 20,
      41             :   R15 = 21,
      42             :   R5B = 22,
      43             :   R6B = 23,
      44             :   R7B = 24,
      45             :   R8B = 25,
      46             :   R9B = 26,
      47             :   R10B = 27,
      48             :   R11B = 28,
      49             :   R12B = 29,
      50             :   R13B = 30,
      51             :   R14B = 31,
      52             :   R15B = 32,
      53             :   NUM_TARGET_REGS       // 33
      54             : };
      55             : } // end namespace MSP430
      56             : 
      57             : // Register classes
      58             : 
      59             : namespace MSP430 {
      60             : enum {
      61             :   GR8RegClassID = 0,
      62             :   GR16RegClassID = 1,
      63             : 
      64             :   };
      65             : } // end namespace MSP430
      66             : 
      67             : 
      68             : // Subregister indices
      69             : 
      70             : namespace MSP430 {
      71             : enum {
      72             :   NoSubRegister,
      73             :   subreg_8bit,  // 1
      74             :   NUM_TARGET_SUBREGS
      75             : };
      76             : } // end namespace MSP430
      77             : 
      78             : } // end namespace llvm
      79             : 
      80             : #endif // GET_REGINFO_ENUM
      81             : 
      82             : /*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
      83             : |*                                                                            *|
      84             : |* MC Register Information                                                    *|
      85             : |*                                                                            *|
      86             : |* Automatically generated file, do not edit!                                 *|
      87             : |*                                                                            *|
      88             : \*===----------------------------------------------------------------------===*/
      89             : 
      90             : 
      91             : #ifdef GET_REGINFO_MC_DESC
      92             : #undef GET_REGINFO_MC_DESC
      93             : 
      94             : namespace llvm {
      95             : 
      96             : extern const MCPhysReg MSP430RegDiffLists[] = {
      97             :   /* 0 */ 0, 0,
      98             :   /* 2 */ 1, 0,
      99             :   /* 4 */ 2, 0,
     100             :   /* 6 */ 3, 0,
     101             :   /* 8 */ 4, 0,
     102             :   /* 10 */ 11, 0,
     103             :   /* 12 */ 65519, 0,
     104             :   /* 14 */ 65525, 0,
     105             :   /* 16 */ 65530, 0,
     106             :   /* 18 */ 65535, 0,
     107             : };
     108             : 
     109             : extern const LaneBitmask MSP430LaneMaskLists[] = {
     110             :   /* 0 */ LaneBitmask(0x00000000), LaneBitmask::getAll(),
     111             :   /* 2 */ LaneBitmask(0x00000001), LaneBitmask::getAll(),
     112             : };
     113             : 
     114             : extern const uint16_t MSP430SubRegIdxLists[] = {
     115             :   /* 0 */ 1, 0,
     116             : };
     117             : 
     118             : extern const MCRegisterInfo::SubRegCoveredBits MSP430SubRegIdxRanges[] = {
     119             :   { 65535, 65535 },
     120             :   { 0, 8 },     // subreg_8bit
     121             : };
     122             : 
     123             : extern const char MSP430RegStrings[] = {
     124             :   /* 0 */ 'R', '1', '0', 0,
     125             :   /* 4 */ 'R', '1', '1', 0,
     126             :   /* 8 */ 'R', '1', '2', 0,
     127             :   /* 12 */ 'R', '1', '3', 0,
     128             :   /* 16 */ 'R', '1', '4', 0,
     129             :   /* 20 */ 'R', '1', '5', 0,
     130             :   /* 24 */ 'R', '5', 0,
     131             :   /* 27 */ 'R', '6', 0,
     132             :   /* 30 */ 'R', '7', 0,
     133             :   /* 33 */ 'R', '8', 0,
     134             :   /* 36 */ 'R', '9', 0,
     135             :   /* 39 */ 'R', '1', '0', 'B', 0,
     136             :   /* 44 */ 'R', '1', '1', 'B', 0,
     137             :   /* 49 */ 'R', '1', '2', 'B', 0,
     138             :   /* 54 */ 'R', '1', '3', 'B', 0,
     139             :   /* 59 */ 'R', '1', '4', 'B', 0,
     140             :   /* 64 */ 'R', '1', '5', 'B', 0,
     141             :   /* 69 */ 'R', '5', 'B', 0,
     142             :   /* 73 */ 'R', '6', 'B', 0,
     143             :   /* 77 */ 'R', '7', 'B', 0,
     144             :   /* 81 */ 'R', '8', 'B', 0,
     145             :   /* 85 */ 'R', '9', 'B', 0,
     146             :   /* 89 */ 'P', 'C', 'B', 0,
     147             :   /* 93 */ 'C', 'G', 'B', 0,
     148             :   /* 97 */ 'F', 'P', 'B', 0,
     149             :   /* 101 */ 'S', 'P', 'B', 0,
     150             :   /* 105 */ 'S', 'R', 'B', 0,
     151             :   /* 109 */ 'P', 'C', 0,
     152             :   /* 112 */ 'C', 'G', 0,
     153             :   /* 115 */ 'F', 'P', 0,
     154             :   /* 118 */ 'S', 'P', 0,
     155             :   /* 121 */ 'S', 'R', 0,
     156             : };
     157             : 
     158             : extern const MCRegisterDesc MSP430RegDesc[] = { // Descriptors
     159             :   { 3, 0, 0, 0, 0, 0 },
     160             :   { 112, 2, 1, 0, 0, 2 },
     161             :   { 93, 1, 18, 1, 0, 0 },
     162             :   { 115, 2, 1, 0, 32, 2 },
     163             :   { 97, 1, 18, 1, 32, 0 },
     164             :   { 109, 2, 1, 0, 64, 2 },
     165             :   { 89, 1, 18, 1, 64, 0 },
     166             :   { 118, 2, 1, 0, 96, 2 },
     167             :   { 101, 1, 18, 1, 96, 0 },
     168             :   { 121, 2, 1, 0, 128, 2 },
     169             :   { 105, 1, 18, 1, 128, 0 },
     170             :   { 24, 10, 1, 0, 257, 2 },
     171             :   { 27, 10, 1, 0, 257, 2 },
     172             :   { 30, 10, 1, 0, 257, 2 },
     173             :   { 33, 10, 1, 0, 257, 2 },
     174             :   { 36, 10, 1, 0, 257, 2 },
     175             :   { 0, 10, 1, 0, 257, 2 },
     176             :   { 4, 10, 1, 0, 257, 2 },
     177             :   { 8, 10, 1, 0, 257, 2 },
     178             :   { 12, 10, 1, 0, 257, 2 },
     179             :   { 16, 10, 1, 0, 257, 2 },
     180             :   { 20, 10, 1, 0, 257, 2 },
     181             :   { 69, 1, 14, 1, 193, 0 },
     182             :   { 73, 1, 14, 1, 193, 0 },
     183             :   { 77, 1, 14, 1, 193, 0 },
     184             :   { 81, 1, 14, 1, 193, 0 },
     185             :   { 85, 1, 14, 1, 193, 0 },
     186             :   { 39, 1, 14, 1, 193, 0 },
     187             :   { 44, 1, 14, 1, 193, 0 },
     188             :   { 49, 1, 14, 1, 193, 0 },
     189             :   { 54, 1, 14, 1, 193, 0 },
     190             :   { 59, 1, 14, 1, 193, 0 },
     191             :   { 64, 1, 14, 1, 193, 0 },
     192             : };
     193             : 
     194             : extern const MCPhysReg MSP430RegUnitRoots[][2] = {
     195             :   { MSP430::CGB },
     196             :   { MSP430::FPB },
     197             :   { MSP430::PCB },
     198             :   { MSP430::SPB },
     199             :   { MSP430::SRB },
     200             :   { MSP430::R5B },
     201             :   { MSP430::R6B },
     202             :   { MSP430::R7B },
     203             :   { MSP430::R8B },
     204             :   { MSP430::R9B },
     205             :   { MSP430::R10B },
     206             :   { MSP430::R11B },
     207             :   { MSP430::R12B },
     208             :   { MSP430::R13B },
     209             :   { MSP430::R14B },
     210             :   { MSP430::R15B },
     211             : };
     212             : 
     213             : namespace {     // Register classes...
     214             :   // GR8 Register Class...
     215             :   const MCPhysReg GR8[] = {
     216             :     MSP430::R12B, MSP430::R13B, MSP430::R14B, MSP430::R15B, MSP430::R11B, MSP430::R10B, MSP430::R9B, MSP430::R8B, MSP430::R7B, MSP430::R6B, MSP430::R5B, MSP430::FPB, MSP430::PCB, MSP430::SPB, MSP430::SRB, MSP430::CGB, 
     217             :   };
     218             : 
     219             :   // GR8 Bit set.
     220             :   const uint8_t GR8Bits[] = {
     221             :     0x54, 0x05, 0xc0, 0xff, 0x01, 
     222             :   };
     223             : 
     224             :   // GR16 Register Class...
     225             :   const MCPhysReg GR16[] = {
     226             :     MSP430::R12, MSP430::R13, MSP430::R14, MSP430::R15, MSP430::R11, MSP430::R10, MSP430::R9, MSP430::R8, MSP430::R7, MSP430::R6, MSP430::R5, MSP430::FP, MSP430::PC, MSP430::SP, MSP430::SR, MSP430::CG, 
     227             :   };
     228             : 
     229             :   // GR16 Bit set.
     230             :   const uint8_t GR16Bits[] = {
     231             :     0xaa, 0xfa, 0x3f, 
     232             :   };
     233             : 
     234             : } // end anonymous namespace
     235             : 
     236             : extern const char MSP430RegClassStrings[] = {
     237             :   /* 0 */ 'G', 'R', '1', '6', 0,
     238             :   /* 5 */ 'G', 'R', '8', 0,
     239             : };
     240             : 
     241             : extern const MCRegisterClass MSP430MCRegisterClasses[] = {
     242             :   { GR8, GR8Bits, 5, 16, sizeof(GR8Bits), MSP430::GR8RegClassID, 1, true },
     243             :   { GR16, GR16Bits, 0, 16, sizeof(GR16Bits), MSP430::GR16RegClassID, 1, true },
     244             : };
     245             : 
     246             : extern const uint16_t MSP430RegEncodingTable[] = {
     247             :   0,
     248             :   0,
     249             :   0,
     250             :   0,
     251             :   0,
     252             :   0,
     253             :   0,
     254             :   0,
     255             :   0,
     256             :   0,
     257             :   0,
     258             :   0,
     259             :   0,
     260             :   0,
     261             :   0,
     262             :   0,
     263             :   0,
     264             :   0,
     265             :   0,
     266             :   0,
     267             :   0,
     268             :   0,
     269             :   0,
     270             :   0,
     271             :   0,
     272             :   0,
     273             :   0,
     274             :   0,
     275             :   0,
     276             :   0,
     277             :   0,
     278             :   0,
     279             :   0,
     280             : };
     281           0 : static inline void InitMSP430MCRegisterInfo(MCRegisterInfo *RI, unsigned RA, unsigned DwarfFlavour = 0, unsigned EHFlavour = 0, unsigned PC = 0) {
     282             :   RI->InitMCRegisterInfo(MSP430RegDesc, 33, RA, PC, MSP430MCRegisterClasses, 2, MSP430RegUnitRoots, 16, MSP430RegDiffLists, MSP430LaneMaskLists, MSP430RegStrings, MSP430RegClassStrings, MSP430SubRegIdxLists, 2,
     283             : MSP430SubRegIdxRanges, MSP430RegEncodingTable);
     284             : 
     285           0 : }
     286             : 
     287             : } // end namespace llvm
     288             : 
     289             : #endif // GET_REGINFO_MC_DESC
     290             : 
     291             : /*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
     292             : |*                                                                            *|
     293             : |* Register Information Header Fragment                                       *|
     294             : |*                                                                            *|
     295             : |* Automatically generated file, do not edit!                                 *|
     296             : |*                                                                            *|
     297             : \*===----------------------------------------------------------------------===*/
     298             : 
     299             : 
     300             : #ifdef GET_REGINFO_HEADER
     301             : #undef GET_REGINFO_HEADER
     302             : 
     303             : #include "llvm/CodeGen/TargetRegisterInfo.h"
     304             : 
     305             : namespace llvm {
     306             : 
     307             : class MSP430FrameLowering;
     308             : 
     309             : struct MSP430GenRegisterInfo : public TargetRegisterInfo {
     310             :   explicit MSP430GenRegisterInfo(unsigned RA, unsigned D = 0, unsigned E = 0,
     311             :       unsigned PC = 0, unsigned HwMode = 0);
     312             :   unsigned composeSubRegIndicesImpl(unsigned, unsigned) const override;
     313             :   LaneBitmask composeSubRegIndexLaneMaskImpl(unsigned, LaneBitmask) const override;
     314             :   LaneBitmask reverseComposeSubRegIndexLaneMaskImpl(unsigned, LaneBitmask) const override;
     315             :   const TargetRegisterClass *getSubClassWithSubReg(const TargetRegisterClass*, unsigned) const override;
     316             :   const RegClassWeight &getRegClassWeight(const TargetRegisterClass *RC) const override;
     317             :   unsigned getRegUnitWeight(unsigned RegUnit) const override;
     318             :   unsigned getNumRegPressureSets() const override;
     319             :   const char *getRegPressureSetName(unsigned Idx) const override;
     320             :   unsigned getRegPressureSetLimit(const MachineFunction &MF, unsigned Idx) const override;
     321             :   const int *getRegClassPressureSets(const TargetRegisterClass *RC) const override;
     322             :   const int *getRegUnitPressureSets(unsigned RegUnit) const override;
     323             :   ArrayRef<const char *> getRegMaskNames() const override;
     324             :   ArrayRef<const uint32_t *> getRegMasks() const override;
     325             :   /// Devirtualized TargetFrameLowering.
     326             :   static const MSP430FrameLowering *getFrameLowering(
     327             :       const MachineFunction &MF);
     328             : };
     329             : 
     330             : namespace MSP430 { // Register classes
     331             :   extern const TargetRegisterClass GR8RegClass;
     332             :   extern const TargetRegisterClass GR16RegClass;
     333             : } // end namespace MSP430
     334             : 
     335             : } // end namespace llvm
     336             : 
     337             : #endif // GET_REGINFO_HEADER
     338             : 
     339             : /*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
     340             : |*                                                                            *|
     341             : |* Target Register and Register Classes Information                           *|
     342             : |*                                                                            *|
     343             : |* Automatically generated file, do not edit!                                 *|
     344             : |*                                                                            *|
     345             : \*===----------------------------------------------------------------------===*/
     346             : 
     347             : 
     348             : #ifdef GET_REGINFO_TARGET_DESC
     349             : #undef GET_REGINFO_TARGET_DESC
     350             : 
     351             : namespace llvm {
     352             : 
     353             : extern const MCRegisterClass MSP430MCRegisterClasses[];
     354             : 
     355             : static const MVT::SimpleValueType VTLists[] = {
     356             :   /* 0 */ MVT::i8, MVT::Other,
     357             :   /* 2 */ MVT::i16, MVT::Other,
     358             : };
     359             : 
     360             : static const char *const SubRegIndexNameTable[] = { "subreg_8bit", "" };
     361             : 
     362             : 
     363             : static const LaneBitmask SubRegIndexLaneMaskTable[] = {
     364             :   LaneBitmask::getAll(),
     365             :   LaneBitmask(0x00000001), // subreg_8bit
     366             :  };
     367             : 
     368             : 
     369             : 
     370             : static const TargetRegisterInfo::RegClassInfo RegClassInfos[] = {
     371             :   // Mode = 0 (Default)
     372             :   { 8, 8, 8, VTLists+0 },    // GR8
     373             :   { 16, 16, 16, VTLists+2 },    // GR16
     374             : };
     375             : 
     376             : static const TargetRegisterClass *const NullRegClasses[] = { nullptr };
     377             : 
     378             : static const uint32_t GR8SubClassMask[] = {
     379             :   0x00000001, 
     380             :   0x00000002, // subreg_8bit
     381             : };
     382             : 
     383             : static const uint32_t GR16SubClassMask[] = {
     384             :   0x00000002, 
     385             : };
     386             : 
     387             : static const uint16_t SuperRegIdxSeqs[] = {
     388             :   /* 0 */ 1, 0,
     389             : };
     390             : 
     391             : 
     392             : namespace MSP430 {   // Register class instances
     393             :   extern const TargetRegisterClass GR8RegClass = {
     394             :     &MSP430MCRegisterClasses[GR8RegClassID],
     395             :     GR8SubClassMask,
     396             :     SuperRegIdxSeqs + 0,
     397             :     LaneBitmask(0x00000001),
     398             :     0,
     399             :     false, /* HasDisjunctSubRegs */
     400             :     false, /* CoveredBySubRegs */
     401             :     NullRegClasses,
     402             :     nullptr
     403             :   };
     404             : 
     405             :   extern const TargetRegisterClass GR16RegClass = {
     406             :     &MSP430MCRegisterClasses[GR16RegClassID],
     407             :     GR16SubClassMask,
     408             :     SuperRegIdxSeqs + 1,
     409             :     LaneBitmask(0x00000001),
     410             :     0,
     411             :     false, /* HasDisjunctSubRegs */
     412             :     false, /* CoveredBySubRegs */
     413             :     NullRegClasses,
     414             :     nullptr
     415             :   };
     416             : 
     417             : } // end namespace MSP430
     418             : 
     419             : namespace {
     420             :   const TargetRegisterClass* const RegisterClasses[] = {
     421             :     &MSP430::GR8RegClass,
     422             :     &MSP430::GR16RegClass,
     423             :   };
     424             : } // end anonymous namespace
     425             : 
     426             : static const TargetRegisterInfoDesc MSP430RegInfoDesc[] = { // Extra Descriptors
     427             :   { 0, false },
     428             :   { 0, true },
     429             :   { 0, true },
     430             :   { 0, true },
     431             :   { 0, true },
     432             :   { 0, true },
     433             :   { 0, true },
     434             :   { 0, true },
     435             :   { 0, true },
     436             :   { 0, true },
     437             :   { 0, true },
     438             :   { 0, true },
     439             :   { 0, true },
     440             :   { 0, true },
     441             :   { 0, true },
     442             :   { 0, true },
     443             :   { 0, true },
     444             :   { 0, true },
     445             :   { 0, true },
     446             :   { 0, true },
     447             :   { 0, true },
     448             :   { 0, true },
     449             :   { 0, true },
     450             :   { 0, true },
     451             :   { 0, true },
     452             :   { 0, true },
     453             :   { 0, true },
     454             :   { 0, true },
     455             :   { 0, true },
     456             :   { 0, true },
     457             :   { 0, true },
     458             :   { 0, true },
     459             :   { 0, true },
     460             : };
     461           0 : unsigned MSP430GenRegisterInfo::composeSubRegIndicesImpl(unsigned IdxA, unsigned IdxB) const {
     462             :   static const uint8_t Rows[1][1] = {
     463             :     { 0, },
     464             :   };
     465             : 
     466             :   --IdxA; assert(IdxA < 1);
     467             :   --IdxB; assert(IdxB < 1);
     468           0 :   return Rows[0][IdxB];
     469             : }
     470             : 
     471             :   struct MaskRolOp {
     472             :     LaneBitmask Mask;
     473             :     uint8_t  RotateLeft;
     474             :   };
     475             :   static const MaskRolOp LaneMaskComposeSequences[] = {
     476             :     { LaneBitmask(0xFFFFFFFF),  0 }, { LaneBitmask::getNone(), 0 }  // Sequence 0
     477             :   };
     478             :   static const MaskRolOp *const CompositeSequences[] = {
     479             :     &LaneMaskComposeSequences[0] // to subreg_8bit
     480             :   };
     481             : 
     482           0 : LaneBitmask MSP430GenRegisterInfo::composeSubRegIndexLaneMaskImpl(unsigned IdxA, LaneBitmask LaneMask) const {
     483             :   --IdxA; assert(IdxA < 1 && "Subregister index out of bounds");
     484             :   LaneBitmask Result;
     485           0 :   for (const MaskRolOp *Ops = CompositeSequences[IdxA]; Ops->Mask.any(); ++Ops) {
     486           0 :     LaneBitmask::Type M = LaneMask.getAsInteger() & Ops->Mask.getAsInteger();
     487           0 :     if (unsigned S = Ops->RotateLeft)
     488           0 :       Result |= LaneBitmask((M << S) | (M >> (LaneBitmask::BitWidth - S)));
     489             :     else
     490             :       Result |= LaneBitmask(M);
     491             :   }
     492           0 :   return Result;
     493             : }
     494             : 
     495           0 : LaneBitmask MSP430GenRegisterInfo::reverseComposeSubRegIndexLaneMaskImpl(unsigned IdxA,  LaneBitmask LaneMask) const {
     496           0 :   LaneMask &= getSubRegIndexLaneMask(IdxA);
     497             :   --IdxA; assert(IdxA < 1 && "Subregister index out of bounds");
     498             :   LaneBitmask Result;
     499           0 :   for (const MaskRolOp *Ops = CompositeSequences[IdxA]; Ops->Mask.any(); ++Ops) {
     500             :     LaneBitmask::Type M = LaneMask.getAsInteger();
     501           0 :     if (unsigned S = Ops->RotateLeft)
     502           0 :       Result |= LaneBitmask((M >> S) | (M << (LaneBitmask::BitWidth - S)));
     503             :     else
     504             :       Result |= LaneBitmask(M);
     505             :   }
     506           0 :   return Result;
     507             : }
     508             : 
     509          69 : const TargetRegisterClass *MSP430GenRegisterInfo::getSubClassWithSubReg(const TargetRegisterClass *RC, unsigned Idx) const {
     510             :   static const uint8_t Table[2][1] = {
     511             :     {   // GR8
     512             :       0,        // subreg_8bit
     513             :     },
     514             :     {   // GR16
     515             :       2,        // subreg_8bit -> GR16
     516             :     },
     517             :   };
     518             :   assert(RC && "Missing regclass");
     519          69 :   if (!Idx) return RC;
     520          69 :   --Idx;
     521             :   assert(Idx < 1 && "Bad subreg");
     522          69 :   unsigned TV = Table[RC->getID()][Idx];
     523          69 :   return TV ? getRegClass(TV - 1) : nullptr;
     524             : }
     525             : 
     526             : /// Get the weight in units of pressure for this register class.
     527         156 : const RegClassWeight &MSP430GenRegisterInfo::
     528             : getRegClassWeight(const TargetRegisterClass *RC) const {
     529             :   static const RegClassWeight RCWeightTable[] = {
     530             :     {1, 16},    // GR8
     531             :     {1, 16},    // GR16
     532             :   };
     533         312 :   return RCWeightTable[RC->getID()];
     534             : }
     535             : 
     536             : /// Get the weight in units of pressure for this register unit.
     537           0 : unsigned MSP430GenRegisterInfo::
     538             : getRegUnitWeight(unsigned RegUnit) const {
     539             :   assert(RegUnit < 16 && "invalid register unit");
     540             :   // All register units have unit weight.
     541           0 :   return 1;
     542             : }
     543             : 
     544             : 
     545             : // Get the number of dimensions of register pressure.
     546         445 : unsigned MSP430GenRegisterInfo::getNumRegPressureSets() const {
     547         445 :   return 1;
     548             : }
     549             : 
     550             : // Get the name of this register unit pressure set.
     551           0 : const char *MSP430GenRegisterInfo::
     552             : getRegPressureSetName(unsigned Idx) const {
     553             :   static const char *const PressureNameTable[] = {
     554             :     "GR8",
     555             :   };
     556           0 :   return PressureNameTable[Idx];
     557             : }
     558             : 
     559             : // Get the register unit pressure limit for this dimension.
     560             : // This limit must be adjusted dynamically for reserved registers.
     561         214 : unsigned MSP430GenRegisterInfo::
     562             : getRegPressureSetLimit(const MachineFunction &MF, unsigned Idx) const {
     563             :   static const uint8_t PressureLimitTable[] = {
     564             :     16,         // 0: GR8
     565             :   };
     566         214 :   return PressureLimitTable[Idx];
     567             : }
     568             : 
     569             : /// Table of pressure sets per register class or unit.
     570             : static const int RCSetsTable[] = {
     571             :   /* 0 */ 0, -1,
     572             : };
     573             : 
     574             : /// Get the dimensions of register pressure impacted by this register class.
     575             : /// Returns a -1 terminated array of pressure set IDs
     576         137 : const int* MSP430GenRegisterInfo::
     577             : getRegClassPressureSets(const TargetRegisterClass *RC) const {
     578             :   static const uint8_t RCSetStartTable[] = {
     579             :     0,0,};
     580         274 :   return &RCSetsTable[RCSetStartTable[RC->getID()]];
     581             : }
     582             : 
     583             : /// Get the dimensions of register pressure impacted by this register unit.
     584             : /// Returns a -1 terminated array of pressure set IDs
     585           0 : const int* MSP430GenRegisterInfo::
     586             : getRegUnitPressureSets(unsigned RegUnit) const {
     587             :   assert(RegUnit < 16 && "invalid register unit");
     588             :   static const uint8_t RUSetStartTable[] = {
     589             :     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,};
     590           0 :   return &RCSetsTable[RUSetStartTable[RegUnit]];
     591             : }
     592             : 
     593             : extern const MCRegisterDesc MSP430RegDesc[];
     594             : extern const MCPhysReg MSP430RegDiffLists[];
     595             : extern const LaneBitmask MSP430LaneMaskLists[];
     596             : extern const char MSP430RegStrings[];
     597             : extern const char MSP430RegClassStrings[];
     598             : extern const MCPhysReg MSP430RegUnitRoots[][2];
     599             : extern const uint16_t MSP430SubRegIdxLists[];
     600             : extern const MCRegisterInfo::SubRegCoveredBits MSP430SubRegIdxRanges[];
     601             : extern const uint16_t MSP430RegEncodingTable[];
     602          64 : MSP430GenRegisterInfo::
     603             : MSP430GenRegisterInfo(unsigned RA, unsigned DwarfFlavour, unsigned EHFlavour,
     604          64 :       unsigned PC, unsigned HwMode)
     605             :   : TargetRegisterInfo(MSP430RegInfoDesc, RegisterClasses, RegisterClasses+2,
     606             :              SubRegIndexNameTable, SubRegIndexLaneMaskTable,
     607         128 :              LaneBitmask(0xFFFFFFFE), RegClassInfos, HwMode) {
     608             :   InitMCRegisterInfo(MSP430RegDesc, 33, RA, PC,
     609             :                      MSP430MCRegisterClasses, 2,
     610             :                      MSP430RegUnitRoots,
     611             :                      16,
     612             :                      MSP430RegDiffLists,
     613             :                      MSP430LaneMaskLists,
     614             :                      MSP430RegStrings,
     615             :                      MSP430RegClassStrings,
     616             :                      MSP430SubRegIdxLists,
     617             :                      2,
     618             :                      MSP430SubRegIdxRanges,
     619             :                      MSP430RegEncodingTable);
     620             : 
     621          64 : }
     622             : 
     623             : 
     624             : 
     625           1 : ArrayRef<const uint32_t *> MSP430GenRegisterInfo::getRegMasks() const {
     626           1 :   return None;
     627             : }
     628             : 
     629           0 : ArrayRef<const char *> MSP430GenRegisterInfo::getRegMaskNames() const {
     630           0 :   return None;
     631             : }
     632             : 
     633             : const MSP430FrameLowering *
     634        2442 : MSP430GenRegisterInfo::getFrameLowering(const MachineFunction &MF) {
     635             :   return static_cast<const MSP430FrameLowering *>(
     636        2442 :       MF.getSubtarget().getFrameLowering());
     637             : }
     638             : 
     639             : } // end namespace llvm
     640             : 
     641             : #endif // GET_REGINFO_TARGET_DESC
     642             : 

Generated by: LCOV version 1.13