Page MenuHomePhabricator

[ARM] First MVE instructions: scalar shifts.
ClosedPublic

Authored by miyuki on May 30 2019, 8:19 AM.

Details

Summary

This introduces a new decoding table for MVE instructions, and starts
by adding the family of scalar shift instructions that are part of the
MVE architecture extension: saturating shifts within a single GPR, and
long shifts across a pair of GPRs (both saturating and normal).

Some of these shift instructions have only 3-bit register fields in
the encoding, with the low bit fixed. So they can only address an odd
or even numbered GPR (depending on the operand), and therefore I add
two new register classes, GPREven and GPROdd.

Event Timeline

simon_tatham created this revision.May 30 2019, 8:19 AM
SjoerdMeijer added inline comments.Jun 3 2019, 1:40 AM
llvm/lib/Target/ARM/ARMInstrMVE.td
39

I think it would be better to pass bits {5-4} as an argument. Then the definition would look like:

def t2SQSHL : t2MVEShiftSRegImm<"sqshl", 0b11>;

which I think is nicer, conciser, and more consistent (with other .td descriptions).

Same for other instructions further below.

ostannard added inline comments.
llvm/test/MC/ARM/mve-scalar-shift.s
2

If all of the instructions in this file are expected to be valid with and without FP, we can use the same check-prefix for both. We should also check the error output in the no-FP case.

We should probably also be checking that these instructions are all rejected when MVE is disabled, like you are already doing for disassembly.

miyuki added a subscriber: miyuki.Jun 11 2019, 2:46 AM
miyuki commandeered this revision.Jun 11 2019, 2:48 AM
miyuki updated this revision to Diff 203998.
miyuki added a reviewer: simon_tatham.

Fixed the tablegen file and tests according to reviewer's comments. Added missing cases to ARMRegisterBankInfo.cpp

miyuki marked an inline comment as done.Jun 11 2019, 2:52 AM
dmgreen added inline comments.Jun 11 2019, 3:03 AM
llvm/lib/Target/ARM/ARMInstrMVE.td
2

This file needs the normal copyright headers, if this is where it is added.

miyuki updated this revision to Diff 204006.Jun 11 2019, 3:39 AM
miyuki marked an inline comment as done.
miyuki marked an inline comment as done.
dmgreen accepted this revision.Jun 11 2019, 3:56 AM

LGTM

This revision is now accepted and ready to land.Jun 11 2019, 3:56 AM
miyuki set the repository for this revision to rG LLVM Github Monorepo.Jun 11 2019, 4:53 AM
This revision was automatically updated to reflect the committed changes.