This is an archive of the discontinued LLVM Phabricator instance.

[ARM,MVE] Use VMOV.{S8,S16} for sign-extended extractelement.
ClosedPublic

Authored by simon_tatham on Nov 12 2019, 9:56 AM.

Details

Summary

MVE includes instructions that extract an 8- or 16-bit lane from a
vector and sign-extend it into the output 32-bit GPR. ARMInstrMVE.td
already included isel patterns to select those instructions in
response to the ARMISD::VGETLANEs selection-DAG node type. But
ARMISD::VGETLANEs was never actually generated, because the code
that creates it was conditioned on NEON only.

It's an easy fix to enable the same code for integer MVE, and now IR
that sign-extends the result of an extractelement (whether explicitly
or as part of the function call ABI) will use vmov.s8 instead of
vmov.u8 followed by sxtb.

Diff Detail

Event Timeline

simon_tatham created this revision.Nov 12 2019, 9:56 AM
dmgreen accepted this revision.Nov 12 2019, 2:26 PM

Very nice. LGTM.

This revision is now accepted and ready to land.Nov 12 2019, 2:26 PM
This revision was automatically updated to reflect the committed changes.