Adds support for the following builtins:
- abs, neg:
- .bf16,
- .bf16x2
- min, max
- {.ftz}{.NaN}{.xorsign.abs}.f16
- {.ftz}{.NaN}{.xorsign.abs}.f16x2
- {.NaN}{.xorsign.abs}.bf16
- {.NaN}{.xorsign.abs}.bf16x2
- {.ftz}{.NaN}{.xorsign.abs}.f32
Paths
| Differential D117887
[NVPTX] Expose float tys min, max, abs, neg as builtins ClosedPublic Authored by jchlanda on Jan 21 2022, 5:52 AM.
Details Summary Adds support for the following builtins:
Diff Detail
Unit TestsFailed Event TimelineHerald added subscribers: asavonic, hiraditya, jholewinski. · View Herald TranscriptJan 21 2022, 5:52 AM Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJan 21 2022, 5:52 AM Comment Actions Looks good overall. There are few newer variants of these instructions that appear to be missing. E.g. {min/max}.xorsign.abs.
Comment Actions
Yeap, we were only going to bump up to 7.0, I don't mind adding the xorsign.abs, while I'm at it. Will update the diff shortly. Comment Actions
ptxas is happy with asm generated from both math-intrins-sm86-ptx72.ll and math-intrins-sm80-ptx70.ll Comment Actions
Thank you for checking that.
This revision is now accepted and ready to land.Feb 2 2022, 10:18 AM jchlanda added a child revision: D118977: [NVPTX] Add more FMA intriniscs/builtins.Feb 4 2022, 2:01 AM
This revision was landed with ongoing or failed builds.Feb 23 2022, 1:57 PM Closed by commit rGe0dc4ac28f00: [NVPTX] Expose float tys min, max, abs, neg as builtins (authored by jchlanda, committed by tra). · Explain Why This revision was automatically updated to reflect the committed changes. Comment Actions @tra thank you for landing the patches, it seems that the clang part (builtin declarations and tests) have been dropped, only llvm dir changes made it through. Is there any way I could fix it (same goes for the other two patches in this stack)? Comment Actions
Somehow arc export | git apply didn't pick clang changes when I was transferring the patch from the phabricator. I'll re-fetch the patches and will land the missing pieces shortly. I'm not sure how the you've submitted the patch to phabricator. In general, it works best when the patch is supplied as a gic commit diff, with the author metadata, etc. Comment Actions
I went with the web interface as described here: https://llvm.org/docs/Phabricator.html#requesting-a-review-via-the-web-interface All working now, thank you for resolving that so quickly. Comment Actions
git show -U99999 should work even better as it would include author info and commit log message, so one would not need to re-enter it manually when importing the patch from phabricator. In any case that's probably not the root cause of my error, just a minor inconvenience.
Revision Contents
Diff 405161 clang/include/clang/Basic/BuiltinsNVPTX.def
clang/test/CodeGen/builtins-nvptx-native-half-type.c
clang/test/CodeGen/builtins-nvptx.c
llvm/include/llvm/IR/IntrinsicsNVVM.td
llvm/lib/Target/NVPTX/NVPTXInstrInfo.td
llvm/lib/Target/NVPTX/NVPTXIntrinsics.td
llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.cpp
llvm/test/CodeGen/NVPTX/math-intrins-sm80-ptx70-instcombine.ll
llvm/test/CodeGen/NVPTX/math-intrins-sm80-ptx70.ll
llvm/test/CodeGen/NVPTX/math-intrins-sm86-ptx72.ll
|
I'd #define the magic values to give them sensible names.