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
37 uint64_t FeatureBits; // Feature bits for current CPU
40 void InitMCSubtargetInfo(StringRef CPU, StringRef FS,
41 const SubtargetFeatureKV *PF,
42 const SubtargetFeatureKV *PD,
43 const SubtargetInfoKV *PI, const InstrStage *IS,
44 const unsigned *OC, const unsigned *FP,
45 unsigned NF, unsigned NP);
47 /// getFeatureBits - Get the feature bits.
49 uint64_t getFeatureBits() const {
53 /// ReInitMCSubtargetInfo - Change CPU (and optionally supplemented with
54 /// feature string), recompute and return feature bits.
55 uint64_t ReInitMCSubtargetInfo(StringRef CPU, StringRef FS);
57 /// getInstrItineraryForCPU - Get scheduling itinerary of a CPU.
59 InstrItineraryData getInstrItineraryForCPU(StringRef CPU) const;
62 } // End llvm namespace