1 //===- PTXSubtarget.cpp - PTX Subtarget Information ---------------*- C++ -*-=//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file implements the PTX specific subclass of TargetSubtarget.
12 //===----------------------------------------------------------------------===//
14 #include "PTXSubtarget.h"
15 #include "llvm/Support/ErrorHandling.h"
19 PTXSubtarget::PTXSubtarget(const std::string
&TT
, const std::string
&FS
)
20 : PTXShaderModel(PTX_SM_1_0
),
21 PTXVersion(PTX_VERSION_2_0
),
22 SupportsDouble(false),
23 Use64BitAddresses(false) {
24 std::string TARGET
= "generic";
25 ParseSubtargetFeatures(FS
, TARGET
);
28 std::string
PTXSubtarget::getTargetString() const {
29 switch(PTXShaderModel
) {
30 default: llvm_unreachable("Unknown shader model");
31 case PTX_SM_1_0
: return "sm_10";
32 case PTX_SM_1_3
: return "sm_13";
33 case PTX_SM_2_0
: return "sm_20";
37 std::string
PTXSubtarget::getPTXVersionString() const {
39 default: llvm_unreachable("Unknown PTX version");
40 case PTX_VERSION_2_0
: return "2.0";
41 case PTX_VERSION_2_1
: return "2.1";
42 case PTX_VERSION_2_2
: return "2.2";
46 #include "PTXGenSubtarget.inc"