LCOV - code coverage report
Current view: top level - build-llvm/lib/Target/Lanai - LanaiGenSubtargetInfo.inc (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 7 9 77.8 %
Date: 2018-02-17 17:14:17 Functions: 3 6 50.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
       2             : |*                                                                            *|
       3             : |* Subtarget Enumeration Source Fragment                                      *|
       4             : |*                                                                            *|
       5             : |* Automatically generated file, do not edit!                                 *|
       6             : |*                                                                            *|
       7             : \*===----------------------------------------------------------------------===*/
       8             : 
       9             : 
      10             : #ifdef GET_SUBTARGETINFO_ENUM
      11             : #undef GET_SUBTARGETINFO_ENUM
      12             : 
      13             : namespace llvm {
      14             : } // end namespace llvm
      15             : 
      16             : #endif // GET_SUBTARGETINFO_ENUM
      17             : 
      18             : 
      19             : #ifdef GET_SUBTARGETINFO_MC_DESC
      20             : #undef GET_SUBTARGETINFO_MC_DESC
      21             : 
      22             : namespace llvm {
      23             : 
      24             : // Sorted (by key) array of values for CPU subtype.
      25             : extern const llvm::SubtargetFeatureKV LanaiSubTypeKV[] = {
      26             :   { "generic", "Select the generic processor", { }, { } },
      27             :   { "v11", "Select the v11 processor", { }, { } },
      28             : };
      29             : 
      30             : #ifdef DBGFIELD
      31             : #error "<target>GenSubtargetInfo.inc requires a DBGFIELD macro"
      32             : #endif
      33             : #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
      34             : #define DBGFIELD(x) x,
      35             : #else
      36             : #define DBGFIELD(x)
      37             : #endif
      38             : 
      39             : // Functional units for "LanaiItinerary"
      40             : namespace LanaiItineraryFU {
      41             :   const unsigned ALU_FU = 1 << 0;
      42             :   const unsigned LDST_FU = 1 << 1;
      43             : } // end namespace LanaiItineraryFU
      44             : 
      45             : extern const llvm::InstrStage LanaiStages[] = {
      46             :   { 0, 0, 0, llvm::InstrStage::Required }, // No itinerary
      47             :   { 1, LanaiItineraryFU::ALU_FU, -1, (llvm::InstrStage::ReservationKinds)0 }, // 1
      48             :   { 1, LanaiItineraryFU::LDST_FU, -1, (llvm::InstrStage::ReservationKinds)0 }, // 2
      49             :   { 2, LanaiItineraryFU::LDST_FU, -1, (llvm::InstrStage::ReservationKinds)0 }, // 3
      50             :   { 0, 0, 0, llvm::InstrStage::Required } // End stages
      51             : };
      52             : extern const unsigned LanaiOperandCycles[] = {
      53             :   0, // No itinerary
      54             :   0 // End operand cycles
      55             : };
      56             : extern const unsigned LanaiForwardingPaths[] = {
      57             :  0, // No itinerary
      58             :  0 // End bypass tables
      59             : };
      60             : 
      61             : static const llvm::InstrItinerary LanaiItinerary[] = {
      62             :   { 0, 0, 0, 0, 0 }, // 0 NoInstrModel
      63             :   { 1, 1, 2, 0, 0 }, // 1 IIC_ALU_WriteALU
      64             :   { 1, 1, 2, 0, 0 }, // 2 IIC_ALU
      65             :   { 1, 2, 3, 0, 0 }, // 3 IIC_LD_WriteLD
      66             :   { 1, 3, 4, 0, 0 }, // 4 IIC_LDSW_WriteLDSW
      67             :   { 0, 0, 0, 0, 0 }, // 5 WriteLD
      68             :   { 1, 2, 3, 0, 0 }, // 6 IIC_ST_WriteST
      69             :   { 1, 3, 4, 0, 0 }, // 7 IIC_STSW_WriteSTSW
      70             :   { 0, ~0U, ~0U, ~0U, ~0U } // end marker
      71             : };
      72             : 
      73             : // ===============================================================
      74             : // Data tables for the new per-operand machine model.
      75             : 
      76             : // {ProcResourceIdx, Cycles}
      77             : extern const llvm::MCWriteProcResEntry LanaiWriteProcResTable[] = {
      78             :   { 0,  0}, // Invalid
      79             :   { 1,  1}, // #1
      80             :   { 2,  1} // #2
      81             : }; // LanaiWriteProcResTable
      82             : 
      83             : // {Cycles, WriteResourceID}
      84             : extern const llvm::MCWriteLatencyEntry LanaiWriteLatencyTable[] = {
      85             :   { 0,  0}, // Invalid
      86             :   { 1,  0}, // #1 WriteALU
      87             :   { 2,  0}, // #2 WriteLD_WriteLDSW_WriteST
      88             :   { 4,  0} // #3 WriteSTSW
      89             : }; // LanaiWriteLatencyTable
      90             : 
      91             : // {UseIdx, WriteResourceID, Cycles}
      92             : extern const llvm::MCReadAdvanceEntry LanaiReadAdvanceTable[] = {
      93             :   {0,  0,  0}, // Invalid
      94             : }; // LanaiReadAdvanceTable
      95             : 
      96             : // {Name, NumMicroOps, BeginGroup, EndGroup, WriteProcResIdx,#, WriteLatencyIdx,#, ReadAdvanceIdx,#}
      97             : static const llvm::MCSchedClassDesc LanaiSchedModelSchedClasses[] = {
      98             :   {DBGFIELD("InvalidSchedClass")  65535, false, false,  0, 0,  0, 0,  0, 0},
      99             :   {DBGFIELD("IIC_ALU_WriteALU")   1, false, false,  1, 1,  1, 1,  0, 0}, // #1
     100             :   {DBGFIELD("IIC_ALU")            0, false, false,  0, 0,  0, 0,  0, 0}, // #2
     101             :   {DBGFIELD("IIC_LD_WriteLD")     1, false, false,  2, 1,  2, 1,  0, 0}, // #3
     102             :   {DBGFIELD("IIC_LDSW_WriteLDSW") 1, false, false,  2, 1,  2, 1,  0, 0}, // #4
     103             :   {DBGFIELD("WriteLD")            1, false, false,  2, 1,  2, 1,  0, 0}, // #5
     104             :   {DBGFIELD("IIC_ST_WriteST")     1, false, false,  2, 1,  2, 1,  0, 0}, // #6
     105             :   {DBGFIELD("IIC_STSW_WriteSTSW") 1, false, false,  2, 1,  3, 1,  0, 0}, // #7
     106             : }; // LanaiSchedModelSchedClasses
     107             : 
     108             : static const llvm::MCSchedModel NoSchedModel = {
     109             :   MCSchedModel::DefaultIssueWidth,
     110             :   MCSchedModel::DefaultMicroOpBufferSize,
     111             :   MCSchedModel::DefaultLoopMicroOpBufferSize,
     112             :   MCSchedModel::DefaultLoadLatency,
     113             :   MCSchedModel::DefaultHighLatency,
     114             :   MCSchedModel::DefaultMispredictPenalty,
     115             :   false, // PostRAScheduler
     116             :   false, // CompleteModel
     117             :   0, // Processor ID
     118             :   nullptr, nullptr, 0, 0, // No instruction-level machine model.
     119             :   nullptr // No Itinerary
     120             : };
     121             : 
     122             : static const unsigned LanaiSchedModelProcResourceSubUnits[] = {
     123             :   0,  // Invalid
     124             : };
     125             : 
     126             : // {Name, NumUnits, SuperIdx, IsBuffered, SubUnitsIdxBegin}
     127             : static const llvm::MCProcResourceDesc LanaiSchedModelProcResources[] = {
     128             :   {DBGFIELD("InvalidUnit")     0, 0, 0, 0},
     129             :   {DBGFIELD("ALU")             1, 0, 0, nullptr}, // #1
     130             :   {DBGFIELD("LdSt")            1, 0, 0, nullptr}, // #2
     131             : };
     132             : 
     133             : static const llvm::MCSchedModel LanaiSchedModel = {
     134             :   1, // IssueWidth
     135             :   0, // MicroOpBufferSize
     136             :   0, // LoopMicroOpBufferSize
     137             :   2, // LoadLatency
     138             :   MCSchedModel::DefaultHighLatency,
     139             :   10, // MispredictPenalty
     140             :   false, // PostRAScheduler
     141             :   false, // CompleteModel
     142             :   1, // Processor ID
     143             :   LanaiSchedModelProcResources,
     144             :   LanaiSchedModelSchedClasses,
     145             :   3,
     146             :   8,
     147             :   LanaiItinerary
     148             : };
     149             : 
     150             : // Sorted (by key) array of itineraries for CPU subtype.
     151             : extern const llvm::SubtargetInfoKV LanaiProcSchedKV[] = {
     152             :   { "generic", (const void *)&LanaiSchedModel },
     153             :   { "v11", (const void *)&LanaiSchedModel },
     154             : };
     155             : 
     156             : #undef DBGFIELD
     157             : 
     158          31 : static inline MCSubtargetInfo *createLanaiMCSubtargetInfoImpl(const Triple &TT, StringRef CPU, StringRef FS) {
     159             :   return new MCSubtargetInfo(TT, CPU, FS, None, LanaiSubTypeKV, 
     160             :                       LanaiProcSchedKV, LanaiWriteProcResTable, LanaiWriteLatencyTable, LanaiReadAdvanceTable, 
     161          62 :                       LanaiStages, LanaiOperandCycles, LanaiForwardingPaths);
     162             : }
     163             : 
     164             : } // end namespace llvm
     165             : 
     166             : #endif // GET_SUBTARGETINFO_MC_DESC
     167             : 
     168             : 
     169             : #ifdef GET_SUBTARGETINFO_TARGET_DESC
     170             : #undef GET_SUBTARGETINFO_TARGET_DESC
     171             : 
     172             : #include "llvm/Support/Debug.h"
     173             : #include "llvm/Support/raw_ostream.h"
     174             : 
     175             : // ParseSubtargetFeatures - Parses features string setting specified
     176             : // subtarget options.
     177          26 : void llvm::LanaiSubtarget::ParseSubtargetFeatures(StringRef CPU, StringRef FS) {
     178             :   DEBUG(dbgs() << "\nFeatures:" << FS);
     179             :   DEBUG(dbgs() << "\nCPU:" << CPU << "\n\n");
     180          26 : }
     181             : #endif // GET_SUBTARGETINFO_TARGET_DESC
     182             : 
     183             : 
     184             : #ifdef GET_SUBTARGETINFO_HEADER
     185             : #undef GET_SUBTARGETINFO_HEADER
     186             : 
     187             : namespace llvm {
     188             : class DFAPacketizer;
     189          25 : struct LanaiGenSubtargetInfo : public TargetSubtargetInfo {
     190             :   explicit LanaiGenSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS);
     191             : public:
     192             :   unsigned resolveSchedClass(unsigned SchedClass,  const MachineInstr *DefMI, const TargetSchedModel *SchedModel) const override;
     193             :   DFAPacketizer *createDFAPacketizer(const InstrItineraryData *IID) const;
     194             : };
     195             : } // end namespace llvm
     196             : 
     197             : #endif // GET_SUBTARGETINFO_HEADER
     198             : 
     199             : 
     200             : #ifdef GET_SUBTARGETINFO_CTOR
     201             : #undef GET_SUBTARGETINFO_CTOR
     202             : 
     203             : #include "llvm/CodeGen/TargetSchedule.h"
     204             : 
     205             : namespace llvm {
     206             : extern const llvm::SubtargetFeatureKV LanaiFeatureKV[];
     207             : extern const llvm::SubtargetFeatureKV LanaiSubTypeKV[];
     208             : extern const llvm::SubtargetInfoKV LanaiProcSchedKV[];
     209             : extern const llvm::MCWriteProcResEntry LanaiWriteProcResTable[];
     210             : extern const llvm::MCWriteLatencyEntry LanaiWriteLatencyTable[];
     211             : extern const llvm::MCReadAdvanceEntry LanaiReadAdvanceTable[];
     212             : extern const llvm::InstrStage LanaiStages[];
     213             : extern const unsigned LanaiOperandCycles[];
     214             : extern const unsigned LanaiForwardingPaths[];
     215          26 : LanaiGenSubtargetInfo::LanaiGenSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS)
     216             :   : TargetSubtargetInfo(TT, CPU, FS, None, makeArrayRef(LanaiSubTypeKV, 2), 
     217             :                         LanaiProcSchedKV, LanaiWriteProcResTable, LanaiWriteLatencyTable, LanaiReadAdvanceTable, 
     218          52 :                         LanaiStages, LanaiOperandCycles, LanaiForwardingPaths) {}
     219             : 
     220           0 : unsigned LanaiGenSubtargetInfo
     221             : ::resolveSchedClass(unsigned SchedClass, const MachineInstr *MI, const TargetSchedModel *SchedModel) const {
     222           0 :   report_fatal_error("Expected a variant SchedClass");
     223             : } // LanaiGenSubtargetInfo::resolveSchedClass
     224             : } // end namespace llvm
     225             : 
     226             : #endif // GET_SUBTARGETINFO_CTOR
     227             : 

Generated by: LCOV version 1.13