[ARM] Remove some spurious MVE reduction instructions.
authorSimon Tatham <simon.tatham@arm.com>
Mon, 9 Sep 2019 15:17:26 +0000 (15:17 +0000)
committerSimon Tatham <simon.tatham@arm.com>
Mon, 9 Sep 2019 15:17:26 +0000 (15:17 +0000)
commit0e48bd24e2120e0a9fbf2bc4896266b43496df3d
tree24c0a9f1b3e32db75fbf895953d3004cd0c1f463
parent508dff2ce15412a6b9a10a27f16d8c10b6e88c6b
[ARM] Remove some spurious MVE reduction instructions.

The family of 'dual-accumulating' vector multiply-add instructions
(VMLADAV, VMLALDAV and VRMLALDAVH) can all operate on both signed and
unsigned integer types, and they all have an 'exchange' variant (with
an X in the name) that modifies which pairs of vector lanes in the two
inputs are multiplied together. But there's a clause in the spec that
says that the X variants //don't// operate on unsigned integer types,
only signed. You can have X, or unsigned, or neither, but not both.

We didn't notice that clause when we implemented the MC support for
these instructions, so LLVM believes that things like VMLADAVX.U8 do
exist, contradicting the spec. Here I fix that by conditioning them
out in Tablegen.

In order to do that, I've reversed the nesting order of the Tablegen
multiclasses for those instructions. Previously, the innermost
multiclass generated the X and not-X variants, and the one outside
that generated the A and not-A variants. Now X is done by the outer
multiclass, which allows me to bypass that one when I only want the
two not-X variants.

Changing the multiclass nesting order also changes the names of the
instruction ids unless I make a special effort not to. I decided that
while I was changing them anyway I'd make them look nicer; so now the
instructions have names like MVE_VMLADAVs32 or MVE_VMLADAVaxs32,
instead of cumbersome _noacc_noexch suffixes.

The corresponding multiply-subtract instructions are unaffected. Those
don't accept unsigned types at all, either in the spec or in LLVM.

Reviewers: ostannard, dmgreen

Subscribers: javed.absar, kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D67214

llvm-svn: 371405
llvm/lib/Target/ARM/ARMInstrMVE.td
llvm/test/MC/ARM/mve-reductions.s
llvm/test/MC/Disassembler/ARM/mve-reductions.txt