This is an archive of the discontinued LLVM Phabricator instance.

[SVE] Lower fixed length vXi32/vXi64 SDIV
ClosedPublic

Authored by cameron.mcinally on Aug 14 2020, 11:17 AM.

Details

Summary

Here's a patch to lower SDIV for vectors of i32/i64 to scalable vectors.

And a couple follow-up questions:

  1. v2i32 and v4i64 do not have NEON support, so I mapped those to scalable vectors. Is that the correct thing to do?
  1. How do we want to handle i8/i16 vectors? Shall we sign extend to i32 vectors, then truncate the result?

Diff Detail

Event Timeline

cameron.mcinally requested review of this revision.Aug 14 2020, 11:17 AM

v2i32 and v4i64 do not have NEON support, so I mapped those to scalable vectors. Is that the correct thing to do?

Makes sense to me.

How do we want to handle i8/i16 vectors? Shall we sign extend to i32 vectors, then truncate the result?

We have code to do this for scalable types in AArch64TargetLowering::LowerDIV; I think it makes sense to extend it to fixed types. We can leave this for a followup, though.

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
1140

Did you mean to add udiv testcases?

Remove UDIV setOperationAction.

cameron.mcinally marked an inline comment as done.Aug 14 2020, 11:41 AM
cameron.mcinally added inline comments.
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
1140

Whoops. Not yet. I figure it makes sense to finalize the SDIV flowerings before starting on UDIV.

cameron.mcinally marked an inline comment as done.

Remove unneeded braces.

This revision is now accepted and ready to land.Aug 14 2020, 2:42 PM