diff options
author | Thomas Lively <tlively@google.com> | 2019-12-13 17:08:04 -0800 |
---|---|---|
committer | Thomas Lively <tlively@google.com> | 2019-12-16 11:48:49 -0800 |
commit | 3a93756dfbb0dcb7c62fcbe5b0ab8f8591fc9721 (patch) | |
tree | 25092e97aee0e2bc19cf499520ed7693722f9e56 /llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp | |
parent | cc802ea67beb66d2f8a935e647c3aedcf7848211 (diff) | |
download | bcm5719-llvm-3a93756dfbb0dcb7c62fcbe5b0ab8f8591fc9721.tar.gz bcm5719-llvm-3a93756dfbb0dcb7c62fcbe5b0ab8f8591fc9721.zip |
[WebAssembly] Replace SIMD int min/max builtins with patterns
Summary:
The instructions were originally implemented via builtins and
intrinsics so users would have to explicitly opt-in to using
them. This was useful while were validating whether these instructions
should have been merged into the spec proposal. Now that they have
been, we can use normal codegen patterns, so the intrinsics and
builtins are no longer useful.
Reviewers: aheejin
Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D71500
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp')
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp index 7b972eda27e..5b177c0c5d9 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp @@ -181,6 +181,13 @@ WebAssemblyTargetLowering::WebAssemblyTargetLowering( setOperationAction(Op, MVT::v2i64, Expand); } + // But we do have integer min and max operations + if (Subtarget->hasUnimplementedSIMD128()) { + for (auto Op : {ISD::SMIN, ISD::SMAX, ISD::UMIN, ISD::UMAX}) + for (auto T : {MVT::v16i8, MVT::v8i16, MVT::v4i32}) + setOperationAction(Op, T, Legal); + } + // Expand float operations supported for scalars but not SIMD for (auto Op : {ISD::FCEIL, ISD::FFLOOR, ISD::FTRUNC, ISD::FNEARBYINT, ISD::FCOPYSIGN, ISD::FLOG, ISD::FLOG2, ISD::FLOG10, |