blob: 5e94612da7ae91e53dd81a424fe721f42a7e1f33 [file] [log] [blame]
Nate Begeman21e463b2005-10-16 05:39:50 +00001//=====-- PPCSubtarget.h - Define Subtarget for the PPC -------*- C++ -*--====//
Nate Begeman8c00f8c2005-08-04 07:12:09 +00002//
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 Lenharth68fd4862005-09-29 21:11:57 +000010// This file declares the PowerPC specific subclass of TargetSubtarget.
Nate Begeman8c00f8c2005-08-04 07:12:09 +000011//
12//===----------------------------------------------------------------------===//
13
14#ifndef POWERPCSUBTARGET_H
15#define POWERPCSUBTARGET_H
16
17#include "llvm/Target/TargetSubtarget.h"
18
Jim Laskeyb1e11802005-09-01 21:38:21 +000019#include <string>
20
Nate Begeman8c00f8c2005-08-04 07:12:09 +000021namespace llvm {
22class Module;
23
24class PPCSubtarget : public TargetSubtarget {
25protected:
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 Lattner3c304a32005-08-05 22:05:03 +000028 unsigned StackAlignment;
Nate Begeman8c00f8c2005-08-04 07:12:09 +000029
30 /// Used by the ISel to turn in optimizations for POWER4-derived architectures
Chris Lattner3c304a32005-08-05 22:05:03 +000031 bool IsGigaProcessor;
Nate Begemand401dff2005-09-06 15:30:12 +000032 bool Is64Bit;
Nate Begeman9d2b8172005-10-18 00:56:42 +000033 bool Has64BitRegs;
Jim Laskey581a8f72005-10-26 17:30:34 +000034 bool HasAltivec;
Chris Lattner1e9de3e2005-09-02 18:33:05 +000035 bool HasFSQRT;
Chris Lattner3c304a32005-08-05 22:05:03 +000036 bool IsAIX;
37 bool IsDarwin;
Nate Begeman8c00f8c2005-08-04 07:12:09 +000038public:
39 /// This constructor initializes the data members to match that
40 /// of the specified module.
41 ///
Jim Laskeyb1e11802005-09-01 21:38:21 +000042 PPCSubtarget(const Module &M, const std::string &FS);
Jim Laskey581a8f72005-10-26 17:30:34 +000043
44 /// ParseSubtargetFeatures - Parses features string setting specified
45 /// subtarget options. Definition of function is usto generated by tblgen.
46 void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU);
Nate Begeman8c00f8c2005-08-04 07:12:09 +000047
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.
Chris Lattner3c304a32005-08-05 22:05:03 +000051 unsigned getStackAlignment() const { return StackAlignment; }
Nate Begeman8c00f8c2005-08-04 07:12:09 +000052
Chris Lattner1e9de3e2005-09-02 18:33:05 +000053 bool hasFSQRT() const { return HasFSQRT; }
Jim Laskey581a8f72005-10-26 17:30:34 +000054 bool has64BitRegs() const { return Has64BitRegs; }
55 bool hasAltivec() const { return HasAltivec; }
Chris Lattner1e9de3e2005-09-02 18:33:05 +000056
Chris Lattner3c304a32005-08-05 22:05:03 +000057 bool isAIX() const { return IsAIX; }
58 bool isDarwin() const { return IsDarwin; }
Nate Begemand401dff2005-09-06 15:30:12 +000059 bool is64Bit() const { return Is64Bit; }
Chris Lattner3c304a32005-08-05 22:05:03 +000060 bool isGigaProcessor() const { return IsGigaProcessor; }
Nate Begeman8c00f8c2005-08-04 07:12:09 +000061};
62} // End llvm namespace
63
64#endif