1 //=====-- PPCSubtarget.h - Define Subtarget for the PPC -------*- C++ -*--====//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by Nate Begeman and is distributed under the
6 // University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file declares the PowerPC specific subclass of TargetSubtarget.
12 //===----------------------------------------------------------------------===//
14 #ifndef POWERPCSUBTARGET_H
15 #define POWERPCSUBTARGET_H
17 #include "llvm/Target/TargetInstrItineraries.h"
18 #include "llvm/Target/TargetSubtarget.h"
25 class PPCSubtarget : public TargetSubtarget {
27 /// stackAlignment - The minimum alignment known to hold of the stack frame on
28 /// entry to the function and which must be maintained by every function.
29 unsigned StackAlignment;
31 /// Selected instruction itineraries (one entry per itinerary class.)
32 InstrItineraryData InstrItins;
34 /// Used by the ISel to turn in optimizations for POWER4-derived architectures
43 /// This constructor initializes the data members to match that
44 /// of the specified module.
46 PPCSubtarget(const Module &M, const std::string &FS);
48 /// ParseSubtargetFeatures - Parses features string setting specified
49 /// subtarget options. Definition of function is auto generated by tblgen.
50 void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU);
52 /// getStackAlignment - Returns the minimum alignment known to hold of the
53 /// stack frame on entry to the function and which must be maintained by every
54 /// function for this subtarget.
55 unsigned getStackAlignment() const { return StackAlignment; }
57 /// getInstrItins - Return the instruction itineraies based on subtarget
59 const InstrItineraryData getInstrItineraryData() const { return InstrItins; }
62 bool hasFSQRT() const { return HasFSQRT; }
63 bool has64BitRegs() const { return Has64BitRegs; }
64 bool hasAltivec() const { return HasAltivec; }
66 bool isAIX() const { return IsAIX; }
67 bool isDarwin() const { return IsDarwin; }
68 bool is64Bit() const { return Is64Bit; }
69 bool isGigaProcessor() const { return IsGigaProcessor; }
71 } // End llvm namespace