blob: 9a9ada2af6d40356e141d9651f84a36b6d89ca22 [file] [log] [blame]
Eric Christopher50880d02010-09-18 18:52:28 +00001//====-- PTXSubtarget.h - Define Subtarget for the PTX ---------*- C++ -*--===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file declares the PTX specific subclass of TargetSubtarget.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef PTX_SUBTARGET_H
15#define PTX_SUBTARGET_H
16
17#include "llvm/Target/TargetSubtarget.h"
18
19namespace llvm {
20 class PTXSubtarget : public TargetSubtarget {
21 private:
Che-Liang Chioufd8978b2011-03-02 03:20:28 +000022 enum PTXShaderModelEnum {
23 PTX_SM_1_0,
24 PTX_SM_1_3,
25 PTX_SM_2_0
26 };
27
28 enum PTXVersionEnum {
29 PTX_VERSION_1_4,
30 PTX_VERSION_2_0,
31 PTX_VERSION_2_1
32 };
33
34 /// Shader Model supported on the target GPU.
35 PTXShaderModelEnum PTXShaderModel;
36
37 /// PTX Language Version.
38 PTXVersionEnum PTXVersion;
39
40 // The native .f64 type is supported on the hardware.
41 bool SupportsDouble;
Eric Christopher50880d02010-09-18 18:52:28 +000042
43 public:
44 PTXSubtarget(const std::string &TT, const std::string &FS);
45
Che-Liang Chioufd8978b2011-03-02 03:20:28 +000046 std::string getTargetString() const;
47
48 std::string getPTXVersionString() const;
49
50 bool supportsDouble() const { return SupportsDouble; }
51
Eric Christopher50880d02010-09-18 18:52:28 +000052 std::string ParseSubtargetFeatures(const std::string &FS,
53 const std::string &CPU);
54 }; // class PTXSubtarget
55} // namespace llvm
56
57#endif // PTX_SUBTARGET_H