2005-10-16 05:39:50 +00:00
|
|
|
//=====-- PPCSubtarget.h - Define Subtarget for the PPC -------*- C++ -*--====//
|
2005-08-04 07:12:09 +00:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file was developed by Nate Begeman and is distributed under the
|
|
|
|
// University of Illinois Open Source License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2005-09-29 21:11:57 +00:00
|
|
|
// This file declares the PowerPC specific subclass of TargetSubtarget.
|
2005-08-04 07:12:09 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef POWERPCSUBTARGET_H
|
|
|
|
#define POWERPCSUBTARGET_H
|
|
|
|
|
2005-11-01 20:06:59 +00:00
|
|
|
#include "llvm/Target/TargetInstrItineraries.h"
|
2005-08-04 07:12:09 +00:00
|
|
|
#include "llvm/Target/TargetSubtarget.h"
|
|
|
|
|
2005-09-01 21:38:21 +00:00
|
|
|
#include <string>
|
|
|
|
|
2005-08-04 07:12:09 +00:00
|
|
|
namespace llvm {
|
|
|
|
class Module;
|
|
|
|
|
|
|
|
class PPCSubtarget : public TargetSubtarget {
|
|
|
|
protected:
|
|
|
|
/// stackAlignment - The minimum alignment known to hold of the stack frame on
|
|
|
|
/// entry to the function and which must be maintained by every function.
|
2005-08-05 22:05:03 +00:00
|
|
|
unsigned StackAlignment;
|
2005-11-01 20:06:59 +00:00
|
|
|
|
|
|
|
/// Selected instruction itineraries (one entry per itinerary class.)
|
|
|
|
InstrItineraryData InstrItins;
|
2005-08-04 07:12:09 +00:00
|
|
|
|
|
|
|
/// Used by the ISel to turn in optimizations for POWER4-derived architectures
|
2005-08-05 22:05:03 +00:00
|
|
|
bool IsGigaProcessor;
|
2005-09-06 15:30:12 +00:00
|
|
|
bool Is64Bit;
|
2005-10-18 00:56:42 +00:00
|
|
|
bool Has64BitRegs;
|
2005-10-26 17:30:34 +00:00
|
|
|
bool HasAltivec;
|
2005-09-02 18:33:05 +00:00
|
|
|
bool HasFSQRT;
|
2006-02-28 07:08:22 +00:00
|
|
|
bool HasSTFIWX;
|
2005-08-05 22:05:03 +00:00
|
|
|
bool IsAIX;
|
|
|
|
bool IsDarwin;
|
2005-08-04 07:12:09 +00:00
|
|
|
public:
|
|
|
|
/// This constructor initializes the data members to match that
|
|
|
|
/// of the specified module.
|
|
|
|
///
|
2005-09-01 21:38:21 +00:00
|
|
|
PPCSubtarget(const Module &M, const std::string &FS);
|
2005-10-26 17:30:34 +00:00
|
|
|
|
|
|
|
/// ParseSubtargetFeatures - Parses features string setting specified
|
2005-10-26 18:07:50 +00:00
|
|
|
/// subtarget options. Definition of function is auto generated by tblgen.
|
2005-10-26 17:30:34 +00:00
|
|
|
void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU);
|
2005-08-04 07:12:09 +00:00
|
|
|
|
|
|
|
/// getStackAlignment - Returns the minimum alignment known to hold of the
|
|
|
|
/// stack frame on entry to the function and which must be maintained by every
|
|
|
|
/// function for this subtarget.
|
2005-08-05 22:05:03 +00:00
|
|
|
unsigned getStackAlignment() const { return StackAlignment; }
|
2005-11-01 20:06:59 +00:00
|
|
|
|
|
|
|
/// getInstrItins - Return the instruction itineraies based on subtarget
|
|
|
|
/// selection.
|
|
|
|
const InstrItineraryData getInstrItineraryData() const { return InstrItins; }
|
|
|
|
|
2005-08-04 07:12:09 +00:00
|
|
|
|
2005-09-02 18:33:05 +00:00
|
|
|
bool hasFSQRT() const { return HasFSQRT; }
|
2006-02-28 07:08:22 +00:00
|
|
|
bool hasSTFIWX() const { return HasSTFIWX; }
|
2005-10-26 17:30:34 +00:00
|
|
|
bool has64BitRegs() const { return Has64BitRegs; }
|
|
|
|
bool hasAltivec() const { return HasAltivec; }
|
2005-09-02 18:33:05 +00:00
|
|
|
|
2005-08-05 22:05:03 +00:00
|
|
|
bool isAIX() const { return IsAIX; }
|
|
|
|
bool isDarwin() const { return IsDarwin; }
|
2005-09-06 15:30:12 +00:00
|
|
|
bool is64Bit() const { return Is64Bit; }
|
2005-08-05 22:05:03 +00:00
|
|
|
bool isGigaProcessor() const { return IsGigaProcessor; }
|
2005-08-04 07:12:09 +00:00
|
|
|
};
|
|
|
|
} // End llvm namespace
|
|
|
|
|
|
|
|
#endif
|