llvm-6502/lib/Target/PTX/PTXSubtarget.h
Justin Holewinski e1fee48cd0 PTX: Add intrinsics to list of built-in intrinsics, which allows them to be
used by Clang.  To help Clang integration, the PTX target has been split
     into two targets: ptx32 and ptx64, depending on the desired pointer size.

- Add GCCBuiltin class to all intrinsics
- Split PTX target into ptx32 and ptx64

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129851 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-20 15:37:17 +00:00

80 lines
2.3 KiB
C++

//====-- PTXSubtarget.h - Define Subtarget for the PTX ---------*- C++ -*--===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file declares the PTX specific subclass of TargetSubtarget.
//
//===----------------------------------------------------------------------===//
#ifndef PTX_SUBTARGET_H
#define PTX_SUBTARGET_H
#include "llvm/Target/TargetSubtarget.h"
namespace llvm {
class PTXSubtarget : public TargetSubtarget {
private:
/**
* Enumeration of Shader Models supported by the back-end.
*/
enum PTXShaderModelEnum {
PTX_SM_1_0, /*< Shader Model 1.0 */
PTX_SM_1_3, /*< Shader Model 1.3 */
PTX_SM_2_0 /*< Shader Model 2.0 */
};
/**
* Enumeration of PTX versions supported by the back-end.
*
* Currently, PTX 2.0 is the minimum supported version.
*/
enum PTXVersionEnum {
PTX_VERSION_2_0, /*< PTX Version 2.0 */
PTX_VERSION_2_1, /*< PTX Version 2.1 */
PTX_VERSION_2_2 /*< PTX Version 2.2 */
};
/// Shader Model supported on the target GPU.
PTXShaderModelEnum PTXShaderModel;
/// PTX Language Version.
PTXVersionEnum PTXVersion;
// The native .f64 type is supported on the hardware.
bool SupportsDouble;
// Use .u64 instead of .u32 for addresses.
bool Is64Bit;
public:
PTXSubtarget(const std::string &TT, const std::string &FS, bool is64Bit);
std::string getTargetString() const;
std::string getPTXVersionString() const;
bool supportsDouble() const { return SupportsDouble; }
bool is64Bit() const { return Is64Bit; }
bool supportsSM13() const { return PTXShaderModel >= PTX_SM_1_3; }
bool supportsSM20() const { return PTXShaderModel >= PTX_SM_2_0; }
bool supportsPTX21() const { return PTXVersion >= PTX_VERSION_2_1; }
bool supportsPTX22() const { return PTXVersion >= PTX_VERSION_2_2; }
std::string ParseSubtargetFeatures(const std::string &FS,
const std::string &CPU);
}; // class PTXSubtarget
} // namespace llvm
#endif // PTX_SUBTARGET_H