Nate Begeman | 21e463b | 2005-10-16 05:39:50 +0000 | [diff] [blame^] | 1 | //=====-- PPCSubtarget.h - Define Subtarget for the PPC -------*- C++ -*--====// |
Nate Begeman | 8c00f8c | 2005-08-04 07:12:09 +0000 | [diff] [blame] | 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 | // |
Andrew Lenharth | 68fd486 | 2005-09-29 21:11:57 +0000 | [diff] [blame] | 10 | // This file declares the PowerPC specific subclass of TargetSubtarget. |
Nate Begeman | 8c00f8c | 2005-08-04 07:12:09 +0000 | [diff] [blame] | 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef POWERPCSUBTARGET_H |
| 15 | #define POWERPCSUBTARGET_H |
| 16 | |
| 17 | #include "llvm/Target/TargetSubtarget.h" |
| 18 | |
Jim Laskey | b1e1180 | 2005-09-01 21:38:21 +0000 | [diff] [blame] | 19 | #include <string> |
| 20 | |
Nate Begeman | 8c00f8c | 2005-08-04 07:12:09 +0000 | [diff] [blame] | 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. |
Chris Lattner | 3c304a3 | 2005-08-05 22:05:03 +0000 | [diff] [blame] | 28 | unsigned StackAlignment; |
Nate Begeman | 8c00f8c | 2005-08-04 07:12:09 +0000 | [diff] [blame] | 29 | |
| 30 | /// Used by the ISel to turn in optimizations for POWER4-derived architectures |
Chris Lattner | 3c304a3 | 2005-08-05 22:05:03 +0000 | [diff] [blame] | 31 | bool IsGigaProcessor; |
Nate Begeman | d401dff | 2005-09-06 15:30:12 +0000 | [diff] [blame] | 32 | bool Is64Bit; |
Chris Lattner | 1e9de3e | 2005-09-02 18:33:05 +0000 | [diff] [blame] | 33 | bool HasFSQRT; |
Chris Lattner | 3c304a3 | 2005-08-05 22:05:03 +0000 | [diff] [blame] | 34 | bool IsAIX; |
| 35 | bool IsDarwin; |
Nate Begeman | 8c00f8c | 2005-08-04 07:12:09 +0000 | [diff] [blame] | 36 | public: |
| 37 | /// This constructor initializes the data members to match that |
| 38 | /// of the specified module. |
| 39 | /// |
Jim Laskey | b1e1180 | 2005-09-01 21:38:21 +0000 | [diff] [blame] | 40 | PPCSubtarget(const Module &M, const std::string &FS); |
Nate Begeman | 8c00f8c | 2005-08-04 07:12:09 +0000 | [diff] [blame] | 41 | |
| 42 | /// getStackAlignment - Returns the minimum alignment known to hold of the |
| 43 | /// stack frame on entry to the function and which must be maintained by every |
| 44 | /// function for this subtarget. |
Chris Lattner | 3c304a3 | 2005-08-05 22:05:03 +0000 | [diff] [blame] | 45 | unsigned getStackAlignment() const { return StackAlignment; } |
Nate Begeman | 8c00f8c | 2005-08-04 07:12:09 +0000 | [diff] [blame] | 46 | |
Chris Lattner | 1e9de3e | 2005-09-02 18:33:05 +0000 | [diff] [blame] | 47 | bool hasFSQRT() const { return HasFSQRT; } |
| 48 | |
Chris Lattner | 3c304a3 | 2005-08-05 22:05:03 +0000 | [diff] [blame] | 49 | bool isAIX() const { return IsAIX; } |
| 50 | bool isDarwin() const { return IsDarwin; } |
Nate Begeman | d401dff | 2005-09-06 15:30:12 +0000 | [diff] [blame] | 51 | bool is64Bit() const { return Is64Bit; } |
Chris Lattner | 3c304a3 | 2005-08-05 22:05:03 +0000 | [diff] [blame] | 52 | bool isGigaProcessor() const { return IsGigaProcessor; } |
Nate Begeman | 8c00f8c | 2005-08-04 07:12:09 +0000 | [diff] [blame] | 53 | }; |
| 54 | } // End llvm namespace |
| 55 | |
| 56 | #endif |