1 //==-- llvm/MC/MCSubtargetInfo.h - Subtarget Information ---------*- C++ -*-==//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file describes the subtarget options of a Target machine.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_MC_MCSUBTARGET_H
15 #define LLVM_MC_MCSUBTARGET_H
17 #include "llvm/MC/SubtargetFeature.h"
18 #include "llvm/MC/MCInstrItineraries.h"
24 //===----------------------------------------------------------------------===//
26 /// MCSubtargetInfo - Generic base class for all target subtargets.
28 class MCSubtargetInfo {
29 const SubtargetFeatureKV *ProcFeatures; // Processor feature list
30 const SubtargetFeatureKV *ProcDesc; // Processor descriptions
31 const SubtargetInfoKV *ProcItins; // Scheduling itineraries
32 const InstrStage *Stages; // Instruction stages
33 const unsigned *OperandCycles; // Operand cycles
34 const unsigned *ForwardingPathes; // Forwarding pathes
35 unsigned NumFeatures; // Number of processor features
36 unsigned NumProcs; // Number of processors
39 void InitMCSubtargetInfo(const SubtargetFeatureKV *PF,
40 const SubtargetFeatureKV *PD,
41 const SubtargetInfoKV *PI, const InstrStage *IS,
42 const unsigned *OC, const unsigned *FP,
43 unsigned NF, unsigned NP) {
49 ForwardingPathes = FP;
54 /// getInstrItineraryForCPU - Get scheduling itinerary of a CPU.
56 InstrItineraryData getInstrItineraryForCPU(StringRef CPU) const;
58 /// getFeatureBits - Get the feature bits for a CPU (optionally supplemented
59 /// with feature string).
60 uint64_t getFeatureBits(StringRef CPU, StringRef FS) const;
63 } // End llvm namespace