[PATCH] D60905: [OpenMP][LLVM][WIP] Add math functions support to OpenMP
Gheorghe-Teodor Bercea via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 24 06:58:04 PDT 2019
gtbercea updated this revision to Diff 196441.
gtbercea added a comment.
- Add pow function to NVPTX function index.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D60905/new/
https://reviews.llvm.org/D60905
Files:
lib/Analysis/TargetLibraryInfo.cpp
lib/Target/NVPTX/NVPTXISelLowering.cpp
Index: lib/Target/NVPTX/NVPTXISelLowering.cpp
===================================================================
--- lib/Target/NVPTX/NVPTXISelLowering.cpp
+++ lib/Target/NVPTX/NVPTXISelLowering.cpp
@@ -583,6 +583,14 @@
// No FEXP2, FLOG2. The PTX ex2 and log2 functions are always approximate.
// No FPOW or FREM in PTX.
+ setOperationAction(ISD::FPOW, MVT::f32, Expand);
+ setOperationAction(ISD::FPOW, MVT::f64, Expand);
+ setOperationAction(ISD::FPOW, MVT::f80, Expand);
+
+ setOperationAction(ISD::FSIN, MVT::f32, Expand);
+ setOperationAction(ISD::FSIN, MVT::f64, Expand);
+ setOperationAction(ISD::FSIN, MVT::f80, Expand);
+
// Now deduce the information based on the above mentioned
// actions
computeRegisterProperties(STI.getRegisterInfo());
Index: lib/Analysis/TargetLibraryInfo.cpp
===================================================================
--- lib/Analysis/TargetLibraryInfo.cpp
+++ lib/Analysis/TargetLibraryInfo.cpp
@@ -550,6 +550,12 @@
if (T.isNVPTX()) {
TLI.disableAllFunctions();
TLI.setAvailable(LibFunc_nvvm_reflect);
+ TLI.setAvailable(LibFunc_pow);
+ TLI.setAvailable(LibFunc_pow_finite);
+ TLI.setAvailable(LibFunc_powf);
+ TLI.setAvailable(LibFunc_powf_finite);
+ TLI.setAvailable(LibFunc_powl);
+ TLI.setAvailable(LibFunc_powl_finite);
} else {
TLI.setUnavailable(LibFunc_nvvm_reflect);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60905.196441.patch
Type: text/x-patch
Size: 1480 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190424/df781c5e/attachment.bin>
More information about the llvm-commits
mailing list