llvm-6502/lib/Target/PTX/PTXSubtarget.h
Che-Liang Chiou fd8978b021 Extend initial support for primitive types in PTX backend
- Allow i16, i32, i64, float, and double types, using the native .u16,
  .u32, .u64, .f32, and .f64 PTX types.
- Allow loading/storing of all primitive types.
- Allow primitive types to be passed as parameters.
- Allow selection of PTX Version and Shader Model as sub-target attributes.
- Merge integer/floating-point test cases for load/store.
- Use .u32 instead of .s32 to conform to output from NVidia nvcc compiler.

Patch by Justin Holewinski



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126824 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 03:20:28 +00:00

58 lines
1.5 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:
enum PTXShaderModelEnum {
PTX_SM_1_0,
PTX_SM_1_3,
PTX_SM_2_0
};
enum PTXVersionEnum {
PTX_VERSION_1_4,
PTX_VERSION_2_0,
PTX_VERSION_2_1
};
/// 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;
public:
PTXSubtarget(const std::string &TT, const std::string &FS);
std::string getTargetString() const;
std::string getPTXVersionString() const;
bool supportsDouble() const { return SupportsDouble; }
std::string ParseSubtargetFeatures(const std::string &FS,
const std::string &CPU);
}; // class PTXSubtarget
} // namespace llvm
#endif // PTX_SUBTARGET_H