LCOV - code coverage report
Current view: top level - build-llvm/lib/Target/MSP430 - MSP430GenSubtargetInfo.inc (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 14 16 87.5 %
Date: 2018-05-20 00:06:23 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             : namespace MSP430 {
      15             : enum {
      16             :   FeatureHWMult16 = 0,
      17             :   FeatureHWMult32 = 1,
      18             :   FeatureHWMultF5 = 2,
      19             :   FeatureX = 3,
      20             : };
      21             : } // end namespace MSP430
      22             : } // end namespace llvm
      23             : 
      24             : #endif // GET_SUBTARGETINFO_ENUM
      25             : 
      26             : 
      27             : #ifdef GET_SUBTARGETINFO_MC_DESC
      28             : #undef GET_SUBTARGETINFO_MC_DESC
      29             : 
      30             : namespace llvm {
      31             : // Sorted (by key) array of values for CPU features.
      32             : extern const llvm::SubtargetFeatureKV MSP430FeatureKV[] = {
      33             :   { "ext", "Enable MSP430-X extensions", { MSP430::FeatureX }, { } },
      34             :   { "hwmult16", "Enable 16-bit hardware multiplier", { MSP430::FeatureHWMult16 }, { } },
      35             :   { "hwmult32", "Enable 32-bit hardware multiplier", { MSP430::FeatureHWMult32 }, { } },
      36             :   { "hwmultf5", "Enable F5 series hardware multiplier", { MSP430::FeatureHWMultF5 }, { } },
      37       99237 : };
      38             : 
      39             : // Sorted (by key) array of values for CPU subtype.
      40             : extern const llvm::SubtargetFeatureKV MSP430SubTypeKV[] = {
      41             :   { "generic", "Select the generic processor", { }, { } },
      42             :   { "msp430", "Select the msp430 processor", { }, { } },
      43             :   { "msp430x", "Select the msp430x processor", { MSP430::FeatureX }, { } },
      44       99237 : };
      45             : 
      46             : #ifdef DBGFIELD
      47             : #error "<target>GenSubtargetInfo.inc requires a DBGFIELD macro"
      48             : #endif
      49             : #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
      50             : #define DBGFIELD(x) x,
      51             : #else
      52             : #define DBGFIELD(x)
      53             : #endif
      54             : 
      55             : // ===============================================================
      56             : // Data tables for the new per-operand machine model.
      57             : 
      58             : // {ProcResourceIdx, Cycles}
      59             : extern const llvm::MCWriteProcResEntry MSP430WriteProcResTable[] = {
      60             :   { 0,  0}, // Invalid
      61             : }; // MSP430WriteProcResTable
      62             : 
      63             : // {Cycles, WriteResourceID}
      64             : extern const llvm::MCWriteLatencyEntry MSP430WriteLatencyTable[] = {
      65             :   { 0,  0}, // Invalid
      66             : }; // MSP430WriteLatencyTable
      67             : 
      68             : // {UseIdx, WriteResourceID, Cycles}
      69             : extern const llvm::MCReadAdvanceEntry MSP430ReadAdvanceTable[] = {
      70             :   {0,  0,  0}, // Invalid
      71             : }; // MSP430ReadAdvanceTable
      72             : 
      73             : static const llvm::MCSchedModel NoSchedModel = {
      74             :   MCSchedModel::DefaultIssueWidth,
      75             :   MCSchedModel::DefaultMicroOpBufferSize,
      76             :   MCSchedModel::DefaultLoopMicroOpBufferSize,
      77             :   MCSchedModel::DefaultLoadLatency,
      78             :   MCSchedModel::DefaultHighLatency,
      79             :   MCSchedModel::DefaultMispredictPenalty,
      80             :   false, // PostRAScheduler
      81             :   false, // CompleteModel
      82             :   0, // Processor ID
      83             :   nullptr, nullptr, 0, 0, // No instruction-level machine model.
      84             :   nullptr, // No Itinerary
      85             :   nullptr // No extra processor descriptor
      86             : };
      87             : 
      88             : // Sorted (by key) array of itineraries for CPU subtype.
      89             : extern const llvm::SubtargetInfoKV MSP430ProcSchedKV[] = {
      90             :   { "generic", (const void *)&NoSchedModel },
      91             :   { "msp430", (const void *)&NoSchedModel },
      92             :   { "msp430x", (const void *)&NoSchedModel },
      93             : };
      94             : 
      95             : #undef DBGFIELD
      96             : 
      97          64 : static inline MCSubtargetInfo *createMSP430MCSubtargetInfoImpl(const Triple &TT, StringRef CPU, StringRef FS) {
      98             :   return new MCSubtargetInfo(TT, CPU, FS, MSP430FeatureKV, MSP430SubTypeKV, 
      99             :                       MSP430ProcSchedKV, MSP430WriteProcResTable, MSP430WriteLatencyTable, MSP430ReadAdvanceTable, 
     100         128 :                       nullptr, nullptr, nullptr);
     101             : }
     102             : 
     103             : } // end namespace llvm
     104             : 
     105             : #endif // GET_SUBTARGETINFO_MC_DESC
     106             : 
     107             : 
     108             : #ifdef GET_SUBTARGETINFO_TARGET_DESC
     109             : #undef GET_SUBTARGETINFO_TARGET_DESC
     110             : 
     111             : #include "llvm/Support/Debug.h"
     112             : #include "llvm/Support/raw_ostream.h"
     113             : 
     114             : // ParseSubtargetFeatures - Parses features string setting specified
     115             : // subtarget options.
     116          64 : void llvm::MSP430Subtarget::ParseSubtargetFeatures(StringRef CPU, StringRef FS) {
     117             :   LLVM_DEBUG(dbgs() << "\nFeatures:" << FS);
     118             :   LLVM_DEBUG(dbgs() << "\nCPU:" << CPU << "\n\n");
     119          64 :   InitMCProcessorInfo(CPU, FS);
     120             :   const FeatureBitset& Bits = getFeatureBits();
     121          64 :   if (Bits[MSP430::FeatureHWMult16] && HWMultMode < HWMult16) HWMultMode = HWMult16;
     122          64 :   if (Bits[MSP430::FeatureHWMult32] && HWMultMode < HWMult32) HWMultMode = HWMult32;
     123          64 :   if (Bits[MSP430::FeatureHWMultF5] && HWMultMode < HWMultF5) HWMultMode = HWMultF5;
     124          64 :   if (Bits[MSP430::FeatureX]) ExtendedInsts = true;
     125          64 : }
     126             : #endif // GET_SUBTARGETINFO_TARGET_DESC
     127             : 
     128             : 
     129             : #ifdef GET_SUBTARGETINFO_HEADER
     130             : #undef GET_SUBTARGETINFO_HEADER
     131             : 
     132             : namespace llvm {
     133             : class DFAPacketizer;
     134          64 : struct MSP430GenSubtargetInfo : public TargetSubtargetInfo {
     135             :   explicit MSP430GenSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS);
     136             : public:
     137             :   unsigned resolveSchedClass(unsigned SchedClass,  const MachineInstr *DefMI, const TargetSchedModel *SchedModel) const override;
     138             :   DFAPacketizer *createDFAPacketizer(const InstrItineraryData *IID) const;
     139             : };
     140             : } // end namespace llvm
     141             : 
     142             : #endif // GET_SUBTARGETINFO_HEADER
     143             : 
     144             : 
     145             : #ifdef GET_SUBTARGETINFO_CTOR
     146             : #undef GET_SUBTARGETINFO_CTOR
     147             : 
     148             : #include "llvm/CodeGen/TargetSchedule.h"
     149             : 
     150             : namespace llvm {
     151             : extern const llvm::SubtargetFeatureKV MSP430FeatureKV[];
     152             : extern const llvm::SubtargetFeatureKV MSP430SubTypeKV[];
     153             : extern const llvm::SubtargetInfoKV MSP430ProcSchedKV[];
     154             : extern const llvm::MCWriteProcResEntry MSP430WriteProcResTable[];
     155             : extern const llvm::MCWriteLatencyEntry MSP430WriteLatencyTable[];
     156             : extern const llvm::MCReadAdvanceEntry MSP430ReadAdvanceTable[];
     157          64 : MSP430GenSubtargetInfo::MSP430GenSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS)
     158             :   : TargetSubtargetInfo(TT, CPU, FS, makeArrayRef(MSP430FeatureKV, 4), makeArrayRef(MSP430SubTypeKV, 3), 
     159             :                         MSP430ProcSchedKV, MSP430WriteProcResTable, MSP430WriteLatencyTable, MSP430ReadAdvanceTable, 
     160          64 :                         nullptr, nullptr, nullptr) {}
     161             : 
     162           0 : unsigned MSP430GenSubtargetInfo
     163             : ::resolveSchedClass(unsigned SchedClass, const MachineInstr *MI, const TargetSchedModel *SchedModel) const {
     164           0 :   report_fatal_error("Expected a variant SchedClass");
     165             : } // MSP430GenSubtargetInfo::resolveSchedClass
     166             : } // end namespace llvm
     167             : 
     168             : #endif // GET_SUBTARGETINFO_CTOR
     169             : 

Generated by: LCOV version 1.13