[PATCH] D88161: [AArch64] No NEON instructions to support vector of i64 reductions
Cameron McInally via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 23 09:30:59 PDT 2020
cameron.mcinally created this revision.
cameron.mcinally added reviewers: aemerson, paulwalker-arm, efriedma, t.p.northover.
Herald added subscribers: llvm-commits, danielkiss, hiraditya, kristof.beyls.
Herald added a project: LLVM.
cameron.mcinally requested review of this revision.
There are no NEON instructions to support vector of i64 reductions.
It could be possible to support v2i64 ISD::VECREDUC_ADD with AArch64ISD::UADDLV, but that's probably better left for a separate patch.
Does this change need an XFAIL test? They're not currently tested, so wasn't sure on the protocol for that.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D88161
Files:
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
Index: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
===================================================================
--- llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -888,20 +888,23 @@
setOperationAction(ISD::MUL, MVT::v4i32, Custom);
setOperationAction(ISD::MUL, MVT::v2i64, Custom);
+ // Saturates
for (MVT VT : { MVT::v8i8, MVT::v4i16, MVT::v2i32,
MVT::v16i8, MVT::v8i16, MVT::v4i32, MVT::v2i64 }) {
- // Vector reductions
+ setOperationAction(ISD::SADDSAT, VT, Legal);
+ setOperationAction(ISD::UADDSAT, VT, Legal);
+ setOperationAction(ISD::SSUBSAT, VT, Legal);
+ setOperationAction(ISD::USUBSAT, VT, Legal);
+ }
+
+ // Vector reductions
+ for (MVT VT : { MVT::v8i8, MVT::v4i16, MVT::v2i32,
+ MVT::v16i8, MVT::v8i16, MVT::v4i32 }) {
setOperationAction(ISD::VECREDUCE_ADD, VT, Custom);
setOperationAction(ISD::VECREDUCE_SMAX, VT, Custom);
setOperationAction(ISD::VECREDUCE_SMIN, VT, Custom);
setOperationAction(ISD::VECREDUCE_UMAX, VT, Custom);
setOperationAction(ISD::VECREDUCE_UMIN, VT, Custom);
-
- // Saturates
- setOperationAction(ISD::SADDSAT, VT, Legal);
- setOperationAction(ISD::UADDSAT, VT, Legal);
- setOperationAction(ISD::SSUBSAT, VT, Legal);
- setOperationAction(ISD::USUBSAT, VT, Legal);
}
for (MVT VT : { MVT::v4f16, MVT::v2f32,
MVT::v8f16, MVT::v4f32, MVT::v2f64 }) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88161.293768.patch
Type: text/x-patch
Size: 1538 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200923/59abed37/attachment.bin>
More information about the llvm-commits
mailing list