This is an archive of the discontinued LLVM Phabricator instance.

[Aarch64][SVE] Add intrinsics for gather loads with 32-bits offsets
ClosedPublic

Authored by andwar on Nov 27 2019, 7:13 AM.

Details

Summary

This patch adds intrinsics for SVE gather loads for which the offsets are 32-bits wide and are:

  • unscaled
    • @llvm.aarch64.sve.ld1.gather.sxtw
    • @llvm.aarch64.sve.ld1.gather.uxtw
  • scaled (offsets become indices)
    • @llvm.arch64.sve.ld1.gather.sxtw.index
    • @llvm.arch64.sve.ld1.gather.uxtw.index

The offsets are either zero (uxtw) or sign (sxtw) extended to 64 bits.

These intrinsics map 1-1 to the corresponding SVE instructions (examples for half-words):

  • unscaled
    • ld1h { z0.s }, p0/z, [x0, z0.s, sxtw]
    • ld1h { z0.s }, p0/z, [x0, z0.s, uxtw]
  • scaled
    • ld1h { z0.s }, p0/z, [x0, z0.s, sxtw #1]
    • ld1h { z0.s }, p0/z, [x0, z0.s, uxtw #1]

Diff Detail

Event Timeline

andwar created this revision.Nov 27 2019, 7:13 AM
Herald added a project: Restricted Project. · View Herald Transcript
andwar edited the summary of this revision. (Show Details)Nov 27 2019, 7:13 AM

Build result: FAILURE - Could not check out parent git hash "None". It was not found in the repository. Did you configure the "Parent Revision" in Phabricator properly? Trying to apply the patch to the master branch instead...

ERROR: arc patch failed with error code 1. Check build log for details.
Log files: console-log.txt, CMakeCache.txt

andwar edited the summary of this revision. (Show Details)Nov 27 2019, 7:18 AM

Sorry for the builedbot failure. It can be ignored as this patch depends on https://reviews.llvm.org/D70542. It hasn't been merged-in yet and hence the patch doesn't apply cleanly.

I removed myself from the "pre-merge beta testing" project to avoid further notifications.

sdesmalen added inline comments.Nov 27 2019, 10:06 AM
llvm/include/llvm/IR/IntrinsicsAArch64.td
1166

The sxtw/uxtw/uxtw_index/sxtw_index intrinsics all share the same intrinsic signature.
You can create a class for that, and derive from that, similar to what has been done for the other intrinsics.

llvm/test/CodeGen/AArch64/sve-intrinsics-gather-loads-unscaled-32bit-offsets.ll
233 ↗(On Diff #231251)

nit: I don't think these comments add much value here.

andwar marked 2 inline comments as done.Nov 28 2019, 6:54 AM
andwar added inline comments.
llvm/test/CodeGen/AArch64/sve-intrinsics-gather-loads-unscaled-32bit-offsets.ll
233 ↗(On Diff #231251)

TBH I feel that they do help organise the tests, so would like to leave them here.

andwar updated this revision to Diff 231429.Nov 28 2019, 6:56 AM

Thank you for reviewing @sdesmalen , updated accordingly.

I also renamed the test files for consistency with the previous patch for gather loads.

sdesmalen accepted this revision.Dec 2 2019, 5:41 AM

LGTM!

This revision is now accepted and ready to land.Dec 2 2019, 5:41 AM
This revision was automatically updated to reflect the committed changes.