Page MenuHomePhabricator

[AArch64][SVE] Add SVE index intrinsic
ClosedPublic

Authored by kmclaughlin on Feb 13 2020, 5:40 AM.

Details

Summary

Implements the @llvm.aarch64.sve.index intrinsic, which
takes a scalar base and step value.

This patch also adds the printSImm function to AArch64InstPrinter
to ensure that immediates of type i8 & i16 are printed correctly.

Diff Detail

Event Timeline

kmclaughlin created this revision.Feb 13 2020, 5:40 AM
Herald added a project: Restricted Project. · View Herald Transcript
cameron.mcinally accepted this revision.Feb 13 2020, 7:36 AM

LGTM

llvm/include/llvm/IR/IntrinsicsAArch64.td
804

Nit: The return type should really be something like llvm_anyintvector_ty, but I don't think there's a way to express that right now.

This revision is now accepted and ready to land.Feb 13 2020, 7:36 AM
andwar added inline comments.Feb 13 2020, 9:50 AM
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
10923
sdesmalen added inline comments.Feb 14 2020, 3:04 AM
llvm/test/CodeGen/AArch64/sve-intrinsics-index.ll
36

Is there a reason you're not testing for -16, 15 for all of these intrinsics? Probably better to test the edge-cases. It's also worth adding some "negative" tests for these, where the value should use the reg form instead if the immediate is not within the range.

  • Changed 'dl' to 'DL' as suggested by @andwar
  • Updated tests to address @sdesmalen's comment (changed all tests to check min & max immediate values, plus added some tests where the immediate is out of range)

Nice, thanks for adding those tests @kmclaughlin. LGTM!

This revision was automatically updated to reflect the committed changes.