Typo made worse x 2 - take 2.
[oota-llvm.git] / lib / Target / PowerPC / PPCSubtarget.h
1 //=====-- PPCSubtarget.h - Define Subtarget for the PPC -------*- C++ -*--====//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
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.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file declares the PowerPC specific subclass of TargetSubtarget.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef POWERPCSUBTARGET_H
15 #define POWERPCSUBTARGET_H
16
17 #include "llvm/Target/TargetSubtarget.h"
18
19 #include <string>
20
21 namespace llvm {
22 class Module;
23
24 class PPCSubtarget : public TargetSubtarget {
25 protected:
26   /// stackAlignment - The minimum alignment known to hold of the stack frame on
27   /// entry to the function and which must be maintained by every function.
28   unsigned StackAlignment;
29
30   /// Used by the ISel to turn in optimizations for POWER4-derived architectures
31   bool IsGigaProcessor;
32   bool Is64Bit;
33   bool Has64BitRegs;
34   bool HasAltivec;
35   bool HasFSQRT;
36   bool IsAIX;
37   bool IsDarwin;
38 public:
39   /// This constructor initializes the data members to match that
40   /// of the specified module.
41   ///
42   PPCSubtarget(const Module &M, const std::string &FS);
43   
44   /// ParseSubtargetFeatures - Parses features string setting specified 
45   /// subtarget options.  Definition of function is auto generated by tblgen.
46   void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU);
47
48   /// getStackAlignment - Returns the minimum alignment known to hold of the
49   /// stack frame on entry to the function and which must be maintained by every
50   /// function for this subtarget.
51   unsigned getStackAlignment() const { return StackAlignment; }
52
53   bool hasFSQRT() const { return HasFSQRT; }
54   bool has64BitRegs() const { return Has64BitRegs; }
55   bool hasAltivec() const { return HasAltivec; }
56   
57   bool isAIX() const { return IsAIX; }
58   bool isDarwin() const { return IsDarwin; }
59   bool is64Bit() const { return Is64Bit; }
60   bool isGigaProcessor() const { return IsGigaProcessor; }
61 };
62 } // End llvm namespace
63
64 #endif