2010-09-18 18:52:28 +00:00
|
|
|
//===- PTXSubtarget.cpp - PTX Subtarget Information ---------------*- C++ -*-=//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file implements the PTX specific subclass of TargetSubtarget.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "PTXSubtarget.h"
|
2011-03-02 03:20:28 +00:00
|
|
|
#include "llvm/Support/ErrorHandling.h"
|
2010-09-18 18:52:28 +00:00
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
2011-04-20 15:37:17 +00:00
|
|
|
PTXSubtarget::PTXSubtarget(const std::string &TT, const std::string &FS,
|
|
|
|
bool is64Bit)
|
2011-03-02 03:20:28 +00:00
|
|
|
: PTXShaderModel(PTX_SM_1_0),
|
2011-03-15 13:24:15 +00:00
|
|
|
PTXVersion(PTX_VERSION_2_0),
|
2011-03-02 07:36:48 +00:00
|
|
|
SupportsDouble(false),
|
2011-05-18 15:42:23 +00:00
|
|
|
SupportsFMA(true),
|
|
|
|
Is64Bit(is64Bit) {
|
2011-03-02 03:20:28 +00:00
|
|
|
std::string TARGET = "generic";
|
|
|
|
ParseSubtargetFeatures(FS, TARGET);
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string PTXSubtarget::getTargetString() const {
|
|
|
|
switch(PTXShaderModel) {
|
|
|
|
default: llvm_unreachable("Unknown shader model");
|
|
|
|
case PTX_SM_1_0: return "sm_10";
|
|
|
|
case PTX_SM_1_3: return "sm_13";
|
|
|
|
case PTX_SM_2_0: return "sm_20";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string PTXSubtarget::getPTXVersionString() const {
|
|
|
|
switch(PTXVersion) {
|
|
|
|
default: llvm_unreachable("Unknown PTX version");
|
|
|
|
case PTX_VERSION_2_0: return "2.0";
|
|
|
|
case PTX_VERSION_2_1: return "2.1";
|
2011-03-15 13:24:15 +00:00
|
|
|
case PTX_VERSION_2_2: return "2.2";
|
2011-05-06 11:40:36 +00:00
|
|
|
case PTX_VERSION_2_3: return "2.3";
|
2011-03-02 03:20:28 +00:00
|
|
|
}
|
2010-09-18 18:52:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#include "PTXGenSubtarget.inc"
|