2012-12-11 21:25:42 +00:00
|
|
|
//=====-- AMDGPUSubtarget.h - Define Subtarget for the AMDIL ---*- C++ -*-====//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//==-----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
/// \file
|
|
|
|
/// \brief AMDGPU specific subclass of TargetSubtarget.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef AMDGPUSUBTARGET_H
|
|
|
|
#define AMDGPUSUBTARGET_H
|
2013-06-07 20:37:48 +00:00
|
|
|
#include "AMDGPU.h"
|
2012-12-11 21:25:42 +00:00
|
|
|
#include "llvm/ADT/StringExtras.h"
|
|
|
|
#include "llvm/ADT/StringRef.h"
|
|
|
|
#include "llvm/Target/TargetSubtargetInfo.h"
|
|
|
|
|
|
|
|
#define GET_SUBTARGETINFO_HEADER
|
|
|
|
#include "AMDGPUGenSubtargetInfo.inc"
|
|
|
|
|
|
|
|
#define MAX_CB_SIZE (1 << 16)
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
class AMDGPUSubtarget : public AMDGPUGenSubtargetInfo {
|
2013-06-07 20:37:48 +00:00
|
|
|
public:
|
|
|
|
enum Generation {
|
|
|
|
R600 = 0,
|
|
|
|
R700,
|
|
|
|
EVERGREEN,
|
|
|
|
NORTHERN_ISLANDS,
|
2013-10-29 16:37:28 +00:00
|
|
|
SOUTHERN_ISLANDS,
|
|
|
|
SEA_ISLANDS
|
2013-06-07 20:37:48 +00:00
|
|
|
};
|
|
|
|
|
2012-12-11 21:25:42 +00:00
|
|
|
private:
|
|
|
|
size_t DefaultSize[3];
|
|
|
|
std::string DevName;
|
|
|
|
bool Is64bit;
|
|
|
|
bool Is32on64bit;
|
|
|
|
bool DumpCode;
|
|
|
|
bool R600ALUInst;
|
2013-04-30 00:13:39 +00:00
|
|
|
bool HasVertexCache;
|
2013-05-17 16:49:55 +00:00
|
|
|
short TexVTXClauseSize;
|
2013-06-07 20:37:48 +00:00
|
|
|
enum Generation Gen;
|
|
|
|
bool FP64;
|
|
|
|
bool CaymanISA;
|
2013-10-10 17:11:12 +00:00
|
|
|
bool EnableIRStructurizer;
|
2013-11-18 19:43:33 +00:00
|
|
|
bool EnableIfCvt;
|
2012-12-11 21:25:42 +00:00
|
|
|
|
|
|
|
InstrItineraryData InstrItins;
|
|
|
|
|
|
|
|
public:
|
|
|
|
AMDGPUSubtarget(StringRef TT, StringRef CPU, StringRef FS);
|
|
|
|
|
|
|
|
const InstrItineraryData &getInstrItineraryData() const { return InstrItins; }
|
2013-01-13 16:01:15 +00:00
|
|
|
virtual void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
|
2012-12-11 21:25:42 +00:00
|
|
|
|
|
|
|
bool is64bit() const;
|
2013-04-30 00:13:39 +00:00
|
|
|
bool hasVertexCache() const;
|
2013-05-17 16:49:55 +00:00
|
|
|
short getTexVTXClauseSize() const;
|
2013-06-07 20:37:48 +00:00
|
|
|
enum Generation getGeneration() const;
|
|
|
|
bool hasHWFP64() const;
|
|
|
|
bool hasCaymanISA() const;
|
2013-10-10 17:11:12 +00:00
|
|
|
bool IsIRStructurizerEnabled() const;
|
2013-11-18 19:43:33 +00:00
|
|
|
bool isIfCvtEnabled() const;
|
2012-12-11 21:25:42 +00:00
|
|
|
|
2013-09-20 05:14:41 +00:00
|
|
|
virtual bool enableMachineScheduler() const {
|
|
|
|
return getGeneration() <= NORTHERN_ISLANDS;
|
|
|
|
}
|
|
|
|
|
2012-12-11 21:25:42 +00:00
|
|
|
// Helper functions to simplify if statements
|
|
|
|
bool isTargetELF() const;
|
|
|
|
std::string getDataLayout() const;
|
|
|
|
std::string getDeviceName() const;
|
|
|
|
virtual size_t getDefaultSize(uint32_t dim) const;
|
|
|
|
bool dumpCode() const { return DumpCode; }
|
|
|
|
bool r600ALUEncoding() const { return R600ALUInst; }
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // End namespace llvm
|
|
|
|
|
|
|
|
#endif // AMDGPUSUBTARGET_H
|