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-02-18 16:14:26 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       97323 : };
      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       97323 : };
      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             : };
      86             : 
      87             : // Sorted (by key) array of itineraries for CPU subtype.
      88             : extern const llvm::SubtargetInfoKV MSP430ProcSchedKV[] = {
      89             :   { "generic", (const void *)&NoSchedModel },
      90             :   { "msp430", (const void *)&NoSchedModel },
      91             :   { "msp430x", (const void *)&NoSchedModel },
      92             : };
      93             : 
      94             : #undef DBGFIELD
      95             : 
      96          64 : static inline MCSubtargetInfo *createMSP430MCSubtargetInfoImpl(const Triple &TT, StringRef CPU, StringRef FS) {
      97             :   return new MCSubtargetInfo(TT, CPU, FS, MSP430FeatureKV, MSP430SubTypeKV, 
      98             :                       MSP430ProcSchedKV, MSP430WriteProcResTable, MSP430WriteLatencyTable, MSP430ReadAdvanceTable, 
      99         128 :                       nullptr, nullptr, nullptr);
     100             : }
     101             : 
     102             : } // end namespace llvm
     103             : 
     104             : #endif // GET_SUBTARGETINFO_MC_DESC
     105             : 
     106             : 
     107             : #ifdef GET_SUBTARGETINFO_TARGET_DESC
     108             : #undef GET_SUBTARGETINFO_TARGET_DESC
     109             : 
     110             : #include "llvm/Support/Debug.h"
     111             : #include "llvm/Support/raw_ostream.h"
     112             : 
     113             : // ParseSubtargetFeatures - Parses features string setting specified
     114             : // subtarget options.
     115          64 : void llvm::MSP430Subtarget::ParseSubtargetFeatures(StringRef CPU, StringRef FS) {
     116             :   DEBUG(dbgs() << "\nFeatures:" << FS);
     117             :   DEBUG(dbgs() << "\nCPU:" << CPU << "\n\n");
     118          64 :   InitMCProcessorInfo(CPU, FS);
     119             :   const FeatureBitset& Bits = getFeatureBits();
     120          64 :   if (Bits[MSP430::FeatureHWMult16] && HWMultMode < HWMult16) HWMultMode = HWMult16;
     121          64 :   if (Bits[MSP430::FeatureHWMult32] && HWMultMode < HWMult32) HWMultMode = HWMult32;
     122          64 :   if (Bits[MSP430::FeatureHWMultF5] && HWMultMode < HWMultF5) HWMultMode = HWMultF5;
     123          64 :   if (Bits[MSP430::FeatureX]) ExtendedInsts = true;
     124          64 : }
     125             : #endif // GET_SUBTARGETINFO_TARGET_DESC
     126             : 
     127             : 
     128             : #ifdef GET_SUBTARGETINFO_HEADER
     129             : #undef GET_SUBTARGETINFO_HEADER
     130             : 
     131             : namespace llvm {
     132             : class DFAPacketizer;
     133          64 : struct MSP430GenSubtargetInfo : public TargetSubtargetInfo {
     134             :   explicit MSP430GenSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS);
     135             : public:
     136             :   unsigned resolveSchedClass(unsigned SchedClass,  const MachineInstr *DefMI, const TargetSchedModel *SchedModel) const override;
     137             :   DFAPacketizer *createDFAPacketizer(const InstrItineraryData *IID) const;
     138             : };
     139             : } // end namespace llvm
     140             : 
     141             : #endif // GET_SUBTARGETINFO_HEADER
     142             : 
     143             : 
     144             : #ifdef GET_SUBTARGETINFO_CTOR
     145             : #undef GET_SUBTARGETINFO_CTOR
     146             : 
     147             : #include "llvm/CodeGen/TargetSchedule.h"
     148             : 
     149             : namespace llvm {
     150             : extern const llvm::SubtargetFeatureKV MSP430FeatureKV[];
     151             : extern const llvm::SubtargetFeatureKV MSP430SubTypeKV[];
     152             : extern const llvm::SubtargetInfoKV MSP430ProcSchedKV[];
     153             : extern const llvm::MCWriteProcResEntry MSP430WriteProcResTable[];
     154             : extern const llvm::MCWriteLatencyEntry MSP430WriteLatencyTable[];
     155             : extern const llvm::MCReadAdvanceEntry MSP430ReadAdvanceTable[];
     156          64 : MSP430GenSubtargetInfo::MSP430GenSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS)
     157             :   : TargetSubtargetInfo(TT, CPU, FS, makeArrayRef(MSP430FeatureKV, 4), makeArrayRef(MSP430SubTypeKV, 3), 
     158             :                         MSP430ProcSchedKV, MSP430WriteProcResTable, MSP430WriteLatencyTable, MSP430ReadAdvanceTable, 
     159          64 :                         nullptr, nullptr, nullptr) {}
     160             : 
     161           0 : unsigned MSP430GenSubtargetInfo
     162             : ::resolveSchedClass(unsigned SchedClass, const MachineInstr *MI, const TargetSchedModel *SchedModel) const {
     163           0 :   report_fatal_error("Expected a variant SchedClass");
     164             : } // MSP430GenSubtargetInfo::resolveSchedClass
     165             : } // end namespace llvm
     166             : 
     167             : #endif // GET_SUBTARGETINFO_CTOR
     168             : 

Generated by: LCOV version 1.13