summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/lib/Target/NVPTX/NVPTXSubtarget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/lib/Target/NVPTX/NVPTXSubtarget.cpp')
-rw-r--r--contrib/llvm/lib/Target/NVPTX/NVPTXSubtarget.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/contrib/llvm/lib/Target/NVPTX/NVPTXSubtarget.cpp b/contrib/llvm/lib/Target/NVPTX/NVPTXSubtarget.cpp
index 6e1f427..acbee86 100644
--- a/contrib/llvm/lib/Target/NVPTX/NVPTXSubtarget.cpp
+++ b/contrib/llvm/lib/Target/NVPTX/NVPTXSubtarget.cpp
@@ -23,6 +23,11 @@ using namespace llvm;
#define GET_SUBTARGETINFO_CTOR
#include "NVPTXGenSubtargetInfo.inc"
+static cl::opt<bool>
+ NoF16Math("nvptx-no-f16-math", cl::ZeroOrMore, cl::Hidden,
+ cl::desc("NVPTX Specific: Disable generation of f16 math ops."),
+ cl::init(false));
+
// Pin the vtable to this file.
void NVPTXSubtarget::anchor() {}
@@ -57,3 +62,7 @@ bool NVPTXSubtarget::hasImageHandles() const {
// Disabled, otherwise
return false;
}
+
+bool NVPTXSubtarget::allowFP16Math() const {
+ return hasFP16Math() && NoF16Math == false;
+}
OpenPOWER on IntegriCloud