87 Commits

Author SHA1 Message Date
Sam Tebbs
fb8dbd1fb6
[AArch64] Remove copy in SVE/SME predicate spill and fill (#81716)
7dc20ab introduced an extra COPY when spilling and filling a PNR
register, which can't be elided as the input (PNR predicate) and output
(PPR predicate) register classes differ. The patch adds a new register
class that covers both PPR and PNR so that STR_PXI and LDR_PXI can
take either of them, removing the need for the copy.
2024-04-09 16:17:27 +01:00
Sander de Smalen
e42e97a4ad
[AArch64][SME] Don't mark 'smstart za' as using/defining VG. (#84775)
VG is only used/defined when changing the streaming mode, using 'smstart
sm' or plainly 'smstart' (same for smstop).
2024-03-13 08:21:33 +00:00
Sander de Smalen
5bd01ac822
[AArch64] Re-enable rematerialization for streaming-mode-changing functions. (#83235)
We can add implicit defs/uses of the 'VG' register to the instructions
to prevent the register allocator from rematerializing values in between
streaming-mode changes, as the def/use of VG will further nail down the
ordering that comes out of ISel. This avoids the heavy-handed approach
to prevent any kind of rematerialization.

While we could add 'VG' as a Use to all SVE instructions, we only really
need to do this for instructions that are rematerializable, as the
smstart/smstop instructions and pseudos act as scheduling barriers which
is sufficient to prevent other instructions from being scheduled in
between the streaming-mode-changing call sequence. However, we may
revisit this in the future.
2024-02-29 15:35:46 +00:00
Sander de Smalen
d7ac412333
[AArch64][SME] Fix definition of uclamp/sclamp instructions. (#77619)
For some reason the arguments were in the wrong order.
2024-01-10 17:07:03 +00:00
Kerry McLaughlin
e9af57dfea
[Clang][SME2] Add builtins for moving multi-vectors to/from ZA (#71191)
Adds the following SME2 builtins:
 - svread_hor/ver,
 - svwrite_hor/ver,
 - svread_za64,
 - svwrite_za64

See https://github.com/ARM-software/acle/pull/217
2023-12-19 13:51:10 +00:00
Momchil Velikov
fd527def7e
[Clang][SVE2.1] Add floating-point variants of svrevd_XX (#75117) 2023-12-18 15:52:28 +00:00
Matthew Devereau
8186e1500b
[SME2] Add LUTI2 and LUTI4 single Builtins and Intrinsics (#73304)
See https://github.com/ARM-software/acle/pull/217

Patch by: Hassnaa Hamdi <hassnaa.hamdi@arm.com>
2023-12-06 16:35:56 +00:00
Matthew Devereau
6704d6aadd
[SME2] Add LUTI2 and LUTI4 quad Builtins and Intrinsics (#73317)
See https://github.com/ARM-software/acle/pull/217

Patch by: Hassnaa Hamdi <hassnaa.hamdi@arm.com>
2023-12-06 10:08:04 +00:00
Jon Roelofs
39d15a7d3b
[AArch64][SME] Remove implicit-def's on smstart (#69012)
When we lower calls, the sequence of argument copy-to-reg nodes are
glued to the smstart. In the InstrEmitter, these glued copies are turned
into implicit defs, since the actual call instruction uses those
physregs, resulting in the register allocator adding unnecessary copies
of regs that are preserved anyway.
2023-12-01 07:34:22 -08:00
Matthew Devereau
e59a0cd7d8
[AArch64][SME2] Add SME2 builtins for zero { zt0 } (#72274)
See https://github.com/ARM-software/acle/pull/217

Patch by: Kerry McLaughlin kerry.mclaughlin@arm.com
2023-12-01 14:30:39 +00:00
Matt Devereau
5fe7ae848c [AArch64][SME2] Add ldr_zt, str_zt builtins and intrinsics (#72849)
Adds the builtins:
void svldr_zt(uint64_t zt, const void *rn)
void svstr_zt(uint64_t zt, void *rn)

And the intrinsics:
call void @llvm.aarch64.sme.ldr.zt(i32, ptr)
tail call void @llvm.aarch64.sme.str.zt(i32, ptr)

Patch by: Kerry McLaughlin kerry.mclaughlin@arm.com
2023-12-01 09:34:38 +00:00
Sam Tebbs
f7b5c25507
[AArch64][SME] Remove immediate argument restriction for svldr and svstr (#68565)
The svldr_vnum and svstr_vnum builtins always modify the base register
and tile slice and provide immediate offsets of zero, even when the
offset provided to the builtin is an immediate. This patch optimises the
output of the builtins when the offset is an immediate, to pass it
directly to the instruction and to not need the base register and tile
slice updates.
2023-11-20 09:57:29 +00:00
Matt Devereau
e8dd7ecbc4 Revert "[AArch64][SME2] Add ldr_zt, str_zt builtins and intrinsics (#71795)"
This reverts commit cc1244980b74f45a06e2002a33444ce757b577aa.
2023-11-16 11:01:27 +00:00
Matthew Devereau
cc1244980b
[AArch64][SME2] Add ldr_zt, str_zt builtins and intrinsics (#71795)
Adds the builtins:
void svldr_zt(uint64_t zt, const void *rn)
void svstr_zt(uint64_t zt, void *rn)

And the intrinsics:
call void @llvm.aarch64.sme.ldr.zt(i32, ptr)
tail call void @llvm.aarch64.sme.str.zt(i32, ptr)

Patch by: Kerry McLaughlin <kerry.mclaughlin@arm.com>
2023-11-14 11:27:41 +00:00
Hassnaa Hamdi
f6ca0ed038
[llvm][AArch64][Assembly]: Add SME_F8F16 and SME_F8F32 Ass/Disass. (#70640)
This patch adds the feature flags of SME_F8F16 and SME_F8F32,
 and the assembly/disassembly for the following instructions of SME2:

  * SME:
    - FMLAL, FMLALL
    - FVDOT, FVDOTT
    - FVDOTB 
    - FMOPA
   
That is according to this documentation:
https://developer.arm.com/documentation/ddi0602/2023-09

Co-authored-by: Caroline Concatto <caroline.concatto@arm.com>
2023-11-03 15:00:54 +00:00
Hassnaa Hamdi
835c885ddb
[llvm][AArch64][Assembly]: Add LUT assembly/disassembly. (#70802)
This patch adds the feature flags of LUT and SME_LUTv2, and the
assembly/disassembly
for the following instructions of NEON, SVE2 and SME2:
  * NEON: 
    - LUT2
    - LUT4
  * SVE2:
    - LUTI2_ZZZI
    - LUTI4_ZZZI 
    - LUTI4_Z2ZZI
  * SME: 
     - MOVT
     - LUTI4_4ZZT2Z
     - LUTI4_S_4ZZT2Z

That is according to this documentation:
https://developer.arm.com/documentation/ddi0602/2023-09
2023-11-02 17:17:20 +00:00
hassnaaHamdi
78941e1eed
[llvm][AArch64][Assembly]: Add FP8 instructions assembly and disassembly. (#69632)
This patch adds the feature flag FP8 and the assembly/disassembly
for the following instructions of NEON, SVE2 and SME2:
  * NEON Instructions:
    + Advanced SIMD two-register miscellaneous:
      - F1CVTL, F1CVTL2, F2CVTL, F2CVTL2 
      - BF1CVTL, BF1CVTL2, BF2CVTL, BF2CVTL2
    + Advanced SIMD three-register extension:
       - FCVTN, FCVTN2 (FP32 to FP8) 
       - FCVTN (FP16 to FP8)
    + Advanced SIMD three same:
      - FSCALE
  * SVE2 Instructions:
    + Downconvert instructions:
       - FCVTN_Z2Z_HtoB
       - FCVTNB_Z2Z_StoB 
       - BFCVTN_Z2Z_HtoB 
       - FCVTNT_Z2Z_StoB
     + Upconvert instructions:
          - F1CVT_ZZ, F2CVT_ZZ
          - BF1CVT_ZZ, BF2CVT_ZZ
          - F1CVTLT_ZZ, F2CVTLT_ZZ 
          - BF1CVTLT_ZZ, BF2CVTLT_ZZ

  * SME2 Instructions:
    - F1CVT_2ZZ, F2CVT_2ZZ
    - BF1CVT_2ZZ, BF2CVT_2ZZ
    - F1CVTL_2ZZ, F2CVTL_2ZZ
    - BF1CVTL_2ZZ, BF2CVTL_2ZZ
    - FCVT_Z2Z_HtoB, BFCVT_Z2Z_HtoB
    - FCVT_Z4Z - FCVTN_Z4Z
    - FSCALE_2ZZ, FSCALE_4ZZ
    - FSCALE_2Z2Z, FSCALE_4Z4Z

That is according to this documentation:
https://developer.arm.com/documentation/ddi0602/2023-09
2023-10-26 16:09:59 +01:00
CarolineConcatto
e4e02e31c2
[AArch64][NFC] Refactor NEON, SVE and SME classes and multiclasses fo… (#68800)
…r the assembly disassembly

This NFC patch refactors the assembly/disassembly class and multiclass
in the AArch64 backend to receive a new 2023/09 AArch64[1] ISA release.
The encoding for the 2023 instructions re-uses encoding blocks from
previous assembly/disassembly instructions.
The refactoring makes the class and multiclass for assembly/disassembly
generic so it can be used to describe the instructions for the new ISA.

[1]https://developer.arm.com/documentation/ddi0602/2023-09
2023-10-13 14:25:42 +01:00
Matthew Devereau
b967f3a1d7
[AArch64] Separate PNR into its own Register Class (#65306)
This patch separates PNR registers into their own register class instead
of sharing a register class with PPR registers. This primarily allows us
to return more accurate register classes when applying assembly
constraints, but also more protection from supplying an incorrect
predicate type to an invalid register operand.
2023-09-21 19:53:16 +01:00
Sander de Smalen
ecb7b9c5c5 [Clang][AArch64] Diagnostics for SME attributes when target doesn't have 'sme'
This patch adds error diagnostics to Clang when code uses the AArch64 SME
attributes without specifying 'sme' as available target attribute.

* Function definitions marked as '__arm_streaming', '__arm_locally_streaming',
  '__arm_shared_za' or '__arm_new_za' will by definition use or require SME
  instructions.
* Calls from non-streaming functions to streaming-functions require
  the compiler to enable/disable streaming-SVE mode around the call-site.

In some cases we can accept the SME attributes without having 'sme' enabled:
* Function declaration can have the SME attributes.
* Definitions can be __arm_streaming_compatible since the generated
  code should execute on processing elements without SME.

Reviewed By: paulwalker-arm

Differential Revision: https://reviews.llvm.org/D157269
2023-08-09 12:31:02 +00:00
Sander de Smalen
437a516da8 [SME2/SVE2p1] Change psel intrinsic such that the result/first operand are not overloaded.
All the bits of the first operand are copied to the destination register,
if the tested bit (in the second source operand) is active. This means we
copy over all vscale x 16 x i1's of the first operand. There is no need to
overload that type.

Reviewed By: david-arm

Differential Revision: https://reviews.llvm.org/D150958
2023-05-22 13:52:06 +00:00
David Sherwood
4f66ca3fb7 [AArch64][SME] Disable ZA LDR/STR addressing optimisations
Since the same encoded offset is used for both the vector
select offset and the address offset we have to spot two
patterns simulatenously in the ldr/str intrinsic inputs, i.e.

vector select = base + off
address = base + (off * VL)

whereas currently we only look for the address pattern. I
don't think this is possible in tablegen, so I suspect we'll
have to do this manually as part of lowering or as a target
DAG combine. For now, I've removed these tablegen patterns
so that we at least do the correct thing even if the code
quality isn't great.

I've also changed some of the ldr/str tests to pass in the
same vector select pattern (base + off) as the address
pattern.

Differential Revision: https://reviews.llvm.org/D147433
2023-04-05 14:46:41 +00:00
Kerry McLaughlin
a9df627050 [SME2][AArch64] Add multi-indexed multiply-add long long intrinsics
Adds intrinsics for the following SME2 instructions (1, 2 & 4 vector):
 - smlall
 - umlall
 - smlsll
 - umlsll
 - sumlall
 - usmlall

NOTE: These intrinsics are still in development and are subject to future changes.

Reviewed By: david-arm

Differential Revision: https://reviews.llvm.org/D143278
2023-02-27 13:58:35 +00:00
Kerry McLaughlin
028c722ac8 [SME2][AArch64] Add multi-multi multiply-add long long intrinsics
Adds intrinsics for the following SME2 instructions (2 & 4 vectors):
 - smlall
 - smlsll
 - umlall
 - umlsll
 - usmlall

NOTE: These intrinsics are still in development and are subject to future changes.

Reviewed By: david-arm

Differential Revision: https://reviews.llvm.org/D143277
2023-02-20 14:01:56 +00:00
Kerry McLaughlin
ba23bca0a8 [SME2][AArch64] Add multi-single multiply-add long long intrinsics
Adds intrinsics for the following SME2 instructions:
 - smlall (1, 2 & 4 vectors)
 - umlall (1, 2 & 4 vectors)
 - smlsll (1, 2 & 4 vectors)
 - umlsll (1, 2 & 4 vectors)
 - sumlall (2 & 4 vectors)
 - usmlall (1, 2 & 4 vectors)

NOTE: These intrinsics are still in development and are subject to future changes.

Reviewed By: david-arm

Differential Revision: https://reviews.llvm.org/D143276
2023-02-16 13:12:47 +00:00
Kerry McLaughlin
aa39882447 [AArch64][SME2] Add SME2 outer product intrinsics
Adds intrinsics for the following:
 - smopa / smops
 - umopa / umops
 - bmopa / bmops

Tests for existing SME mopa/mops intrinsics have also been updated
to use the maximum allowed ZA tile number.

 NOTE: These intrinsics are still in development and are subject
 to future changes.

Reviewed By: david-arm

Differential Revision: https://reviews.llvm.org/D141849
2023-01-31 11:44:48 +00:00
Kerry McLaughlin
034ad11acf [AArch64][SME2] Add multi-vector saturating rounding shift right intrinsics
Adds IR intrinsics for the following SME2 instructions:
 - sqrshr (2 and 4 vector)
 - uqrshr (2 and 4 vector)
 - sqrshru (2 and 4 vector)
 - sqrshrn (4 vector)
 - uqrshrn (4 vector)
 - sqrshrun (4 vector)

Also adds intrinsics for the following SVE2p1 instructions:
 - sqrshrn (2 vector)
 - uqrshrn (2 vector)
 - sqrshrun (2 vector)

NOTE: These intrinsics are still in development and are subject to future changes.

Reviewed By: CarolineConcatto

Differential Revision: https://reviews.llvm.org/D142466
2023-01-26 11:13:15 +00:00
Kerry McLaughlin
5f3dab090b [AArch64][SME2] Add intrinsics to move multi-vectors to/from ZA.
Adds intrinsics for the following:
 - mova: array to vector / vector to array
 - mova: tile to vector / vector to tile

Tablegen patterns have been added to match the ZA write intrinsics. As the
read intrinsics return a multi-vector, a function called SelectMultiVectorMove
has been added to AArch64ISelDAGToDAG to select the correct instruction. The
SelectSMETile function has also been added to check that the tile number
passed to read intrinsics is valid for the base register.

This patch also cleans up the sme_vector_to_tile_patterns multiclass to remove
the pattern for an offset of 0, which is handled by tileslice.

NOTE: These intrinsics are still in development and are subject to future changes.

Reviewed By: david-arm

Differential Revision: https://reviews.llvm.org/D142031
2023-01-25 11:34:09 +00:00
Caroline Concatto
03aed95938 [AArch64][SME2] Add Multi-vector add/sub and accumulate into ZA intrinsic
Add the following intrinsic:
    ADD
    SUB
    FADD
    FSUB
NOTE: These intrinsics are still in development and are subject to future changes.

Reviewed By: kmclaughlin

Differential Revision: https://reviews.llvm.org/D142210
2023-01-25 10:40:33 +00:00
Caroline Concatto
06191d1327 [AArch64][SME2] Add Multi-vector saturating extract narrow and interleave intrinsics
Add the following intrinsic:
      SQCVTN
      SQCVTUN
      UQCVTN

 NOTE: These intrinsics are still in development and are subject to future changes.

Reviewed By: kmclaughlin

Differential Revision: https://reviews.llvm.org/D142089
2023-01-24 09:17:42 +00:00
Caroline Concatto
d62500dca7 [AArch64][SME2] Add Multi-vector saturating extract narrow intrinsics
Add the following intrinsic:
  SQCVT
  SQCVTU
  UQCVT

NOTE: These intrinsics are still in development and are subject to future changes.

Reviewed By: kmclaughlin

Differential Revision: https://reviews.llvm.org/D142035
2023-01-23 17:49:20 +00:00
Caroline Concatto
5f6a971157 [AArch64][SME2] Add multi-vector convert to/from floating-point intrinsic
Add the following intrinsic:

  FCVT
  BFCVT
  FCVTZS
  FCVTZU
  SCVTF
  UCVTF

This patch also adds SelectCVTIntrinsic to handle the cases when the
intrinsic returns multiple (two or four) outputs

NOTE: These intrinsics are still in development and are subject to future changes.

Reviewed By: kmclaughlin

Differential Revision: https://reviews.llvm.org/D142032
2023-01-23 17:09:04 +00:00
Sander de Smalen
08a19d7617 [AArch64][SME2] MOVA tile-to-vector and vector-to-tile should not accept VG suffix
Reviewed By: MattDevereau

Differential Revision: https://reviews.llvm.org/D141601
2023-01-23 13:10:09 +00:00
Sander de Smalen
2faebdef97 [AArch64][SME2] NFC: Simplify multiclasses for mova/movaz.
Reviewed By: CarolineConcatto

Differential Revision: https://reviews.llvm.org/D142198
2023-01-23 13:10:09 +00:00
Sander de Smalen
9a77e3c7bd [AArch64][SME] Allow predicate-as-counter operands for psel
The specification says:

  For programmer convenience, an assembler must also accept
  predicate-as-counter register names for the destination predicate
  register and the first source predicate register

Reviewed By: CarolineConcatto, MattDevereau

Differential Revision: https://reviews.llvm.org/D141603
2023-01-23 13:10:09 +00:00
Caroline Concatto
88fd2e4cb5 [AArch64][SME2] Add multi-vector FP convert from Float to interleave Half/BFloat intrinsic
Add the following intrinsic:
  FCVTN
  BFCVTN

NOTE: These intrinsics are still in development and are subject to future changes.

Reviewed By: david-arm

Differential Revision: https://reviews.llvm.org/D142025
2023-01-20 17:44:53 +00:00
Kerry McLaughlin
2e35d684d7 [AArch64][SME2] Add multi-vector multiply-add long intrinsics.
Adds (single, multi & indexed) intrinsics for the following:
 - bfmlal/bfmlsl
 - fmlal/fmlsl
 - smlal/smlsl
 - umlal/umlsl

This patch also extends SelectSMETileSlice to handle scaled vector select offsets.

NOTE: These intrinsics are still in development and are subject to future changes.

Reviewed By: CarolineConcatto

Differential Revision: https://reviews.llvm.org/D142004
2023-01-20 11:33:29 +00:00
Kerry McLaughlin
cfd3a0e04a [AArch64][SME2] Add multi-vector fused multiply-add/subtract intrinsics
Adds intrinsics for the following:
 - fmla (single, multi & indexed)
 - fmls (single, multi & indexed)

NOTE: These intrinsics are still in development and are subject
to future changes.

Reviewed By: CarolineConcatto

Differential Revision: https://reviews.llvm.org/D141946
2023-01-20 11:14:41 +00:00
Kerry McLaughlin
6387d38966 [AArch64][SME] Add an instruction mapping for SME pseudos
Adds an instruction mapping to SMEInstrFormats which matches SME
pseudos with the real instructions they are transformed to.
A new flag is also added to AArch64Inst (SMEMatrixType), which is
used to indicate the base register required when emitting many
of the SME instructions.

This reduces the number of pseudos handled by the switch statement
in EmitInstrWithCustomInserter.

Reviewed By: david-arm

Differential Revision: https://reviews.llvm.org/D136856
2023-01-16 11:52:44 +00:00
David Sherwood
2e02f007a2 [AArch64][SME2] Remove vector constraints from zip/uzp (2-vector) instruction classes
The zip/uzp (2-vector) instruction classes have the incorrect
register constraints and mark the destination as also being an
input. However, the instructions are fully destructive so I've
restructured the classes.

Differential Revision: https://reviews.llvm.org/D138288
2022-11-18 14:30:48 +00:00
Caroline Concatto
3eacda4547 [AArch64] Add all SME2.1 instructions Assembly/Disassembly
This patch adds a new feature flag:
sme-f16f16 to represent FEAT_SME-F16F16

This patch add the following instructions:
SME2.1 stand alone instructions:
   MOVAZ (array to vector, four registers): Move and zero four ZA single-vector groups to vector registers.
         (array to vector, two registers): Move and zero two ZA single-vector groups to vector registers.
         (tile to vector, four registers): Move and zero four ZA tile slices to vector registers.
         (tile to vector, single): Move and zero ZA tile slice to vector register.
         (tile to vector, two registers): Move and zero two ZA tile slices to vector registers.

   LUTI2 (Strided four registers): Lookup table read with 2-bit indexes.
         (Strided two registers): Lookup table read with 2-bit indexes.

   LUTI4 (Strided four registers): Lookup table read with 4-bit indexes.
         (Strided two registers): Lookup table read with 4-bit indexes.

   ZERO (double-vector): Zero ZA double-vector groups.
        (quad-vector): Zero ZA quad-vector groups.
        (single-vector): Zero ZA single-vector groups.

SME2p1 and SME-F16F16:
 All instructions are half precision elements:
   FADD: Floating-point add multi-vector to ZA array vector accumulators.

   FSUB: Floating-point subtract multi-vector from ZA array vector accumulators.

   FMLA (multiple and indexed vector): Multi-vector floating-point fused multiply-add by indexed element.
        (multiple and single vector): Multi-vector floating-point fused multiply-add by vector.
        (multiple vectors): Multi-vector floating-point fused multiply-add.

   FMLS (multiple and indexed vector): Multi-vector floating-point fused multiply-subtract by indexed element.
        (multiple and single vector): Multi-vector floating-point fused multiply-subtract by vector.
        (multiple vectors): Multi-vector floating-point fused multiply-subtract.

   FCVT (widening): Multi-vector floating-point convert from half-precision to single-precision (in-order).

   FCVTL: Multi-vector floating-point convert from half-precision to deinterleaved single-precision.

   FMOPA (non-widening): Floating-point outer product and accumulate.

   FMOPS (non-widening): Floating-point outer product and subtract.

SME2p1 and B16B16:
   BFADD: BFloat16 floating-point add multi-vector to ZA array vector accumulators.

   BFSUB: BFloat16 floating-point subtract multi-vector from ZA array vector accumulators.

   BFCLAMP: Multi-vector BFloat16 floating-point clamp to minimum/maximum number.

   BFMLA (multiple and indexed vector): Multi-vector BFloat16 floating-point fused multiply-add by indexed element.
         (multiple and single vector): Multi-vector BFloat16 floating-point fused multiply-add by vector.
         (multiple vectors): Multi-vector BFloat16 floating-point fused multiply-add.

   BFMLS (multiple and indexed vector): Multi-vector BFloat16 floating-point fused multiply-subtract by indexed element.
         (multiple and single vector): Multi-vector BFloat16 floating-point fused multiply-subtract by vector.
         (multiple vectors): Multi-vector BFloat16 floating-point fused multiply-subtract.

   BFMAX (multiple and single vector): Multi-vector BFloat16 floating-point maximum by vector.
         (multiple vectors): Multi-vector BFloat16 floating-point maximum.

   BFMAXNM (multiple and single vector): Multi-vector BFloat16 floating-point maximum number by vector.
           (multiple vectors): Multi-vector BFloat16 floating-point maximum number.

   BFMIN (multiple and single vector): Multi-vector BFloat16 floating-point minimum by vector.
         (multiple vectors): Multi-vector BFloat16 floating-point minimum.

   BFMINNM (multiple and single vector): Multi-vector BFloat16 floating-point minimum number by vector.
           (multiple vectors): Multi-vector BFloat16 floating-point minimum number.

   BFMOPA (non-widening): BFloat16 floating-point outer product and accumulate.

   BFMOPS (non-widening): BFloat16 floating-point outer product and subtract.

The reference can be found here:

https://developer.arm.com/documentation/ddi0602/2022-09

Differential Revision: https://reviews.llvm.org/D137571
2022-11-14 14:56:16 +00:00
Caroline Concatto
ecab1bc0dc [AArch64]SME2 Multi vector Sel Load and Store instructions
This patch adds the assembly/disassembly for the following instruction:

   SEL: Multi-vector conditionally select elements from two vectors
        for 2 and 4 registers

Non-constiguous load with stride resgisters:

  LD1B (scalar + immediate): Contiguous load of bytes to multiple strided vectors (immediate index).
       (scalar + scalar): Contiguous load of bytes to multiple strided vectors (scalar index).
  LD1D (scalar + immediate): Contiguous load of doublewords to multiple strided vectors (immediate index).
       (scalar + scalar): Contiguous load of doublewords to multiple strided vectors (scalar index).
  LD1H (scalar + immediate): Contiguous load of halfwords to multiple strided vectors (immediate index).
       (scalar + scalar): Contiguous load of halfwords to multiple strided vectors (scalar index).
  LD1W (scalar + immediate): Contiguous load of words to multiple strided vectors (immediate index).
       (scalar + scalar): Contiguous load of words to multiple strided vectors (scalar index).

  LDNT1B (scalar + immediate): Contiguous load non-temporal of bytes to multiple strided vectors (immediate index).
         (scalar + scalar): Contiguous load non-temporal of bytes to multiple strided vectors (scalar index).
  LDNT1D (scalar + immediate): Contiguous load non-temporal of doublewords to multiple strided vectors (immediate index).
         (scalar + scalar): Contiguous load non-temporal of doublewords to multiple strided vectors (scalar index).
  LDNT1H (scalar + immediate): Contiguous load non-temporal of halfwords to multiple strided vectors (immediate index).
         (scalar + scalar): Contiguous load non-temporal of halfwords to multiple strided vectors (scalar index).
  LDNT1W (scalar + immediate): Contiguous load non-temporal of words to multiple strided vectors (immediate index).
         (scalar + scalar): Contiguous load non-temporal of words to multiple strided vectors (scalar index).

Non-constiguous store with stride resgisters:

  ST1B (scalar + immediate): Contiguous store of bytes from multiple strided vectors (immediate index).
       (scalar + scalar): Contiguous store of bytes from multiple strided vectors (scalar index).
  ST1D (scalar + immediate): Contiguous store of doublewords from multiple strided vectors (immediate index).
       (scalar + scalar): Contiguous store of doublewords from multiple strided vectors (scalar index).
  ST1H (scalar + immediate): Contiguous store of halfwords from multiple strided vectors (immediate index).
       (scalar + scalar): Contiguous store of halfwords from multiple strided vectors (scalar index).
  ST1W (scalar + immediate): Contiguous store of words from multiple strided vectors (immediate index).
       (scalar + scalar): Contiguous store of words from multiple strided vectors (scalar index).

  STNT1B (scalar + immediate): Contiguous store non-temporal of bytes from multiple strided vectors (immediate index).
         (scalar + scalar): Contiguous store non-temporal of bytes from multiple strided vectors (scalar index).
  STNT1D (scalar + immediate): Contiguous store non-temporal of doublewords from multiple strided vectors (immediate index).
         (scalar + scalar): Contiguous store non-temporal of doublewords from multiple strided vectors (scalar index).
  STNT1H (scalar + immediate): Contiguous store non-temporal of halfwords from multiple strided vectors (immediate index).
         (scalar + scalar): Contiguous store non-temporal of halfwords from multiple strided vectors (scalar index).
  STNT1W (scalar + immediate): Contiguous store non-temporal of words from multiple strided vectors (immediate index).
         (scalar + scalar): Contiguous store non-temporal of words from multiple strided vectors (scalar index).

    The reference can be found here:

        https://developer.arm.com/documentation/ddi0602/2022-09

This patch also adds a new SVE vector list to represent the stride loads/stores
ZPRVectorListStrided and the sets of 2 and 4 ZA registers:
ZZ_[b|h|w|d]_strided and ZZZZ_[b|h|w|d]_strided

Differential Revision: https://reviews.llvm.org/D136172
2022-11-10 16:04:57 +00:00
Caroline Concatto
d917276cd8 [AArch64]SME2 Single and Multi vector Shift and Multiply instructions
This patch adds the assembly/disassembly for the following instructions:

  SQRSHR (four registers): Multi-vector signed saturating rounding shift right narrow by immediate.
         (two registers): Multi-vector signed saturating rounding shift right narrow by immediate.
  SQRSHRN: Multi-vector signed saturating rounding shift right narrow by immediate and interleave.
  SQRSHRU (four registers): Multi-vector signed saturating rounding shift right unsigned narrow by immediate.
          (two registers): Multi-vector signed saturating rounding shift right unsigned narrow by immediate.
  SQRSHRUN: Multi-vector signed saturating rounding shift right unsigned narrow by immediate and interleave.
  UQRSHR (four registers): Multi-vector unsigned saturating rounding shift right narrow by immediate
         (two registers): Multi-vector unsigned saturating rounding shift right narrow by immediate.
  UQRSHRN: Multi-vector unsigned saturating rounding shift right narrow by immediate and interleave.

The reference can be found here:

https://developer.arm.com/documentation/ddi0602/2022-09

Reviewed By: paulwalker-arm

Differential Revision: https://reviews.llvm.org/D136150
2022-11-08 12:32:48 +00:00
Caroline Concatto
1a917568e7 [AArch64]SME2 MOV Instructions
This patch adds the assembly/disassembly for the following instructions:

MOVA (array to vector, four registers): Move four ZA single-vector groups to four vector registers.
     (array to vector, two registers): Move two ZA single-vector groups to two vector registers.
     (tile to vector, four registers): Move four ZA tile slices to four vector registers.
     (tile to vector, single): Move ZA tile slice to vector register.
     (tile to vector, two registers): Move two ZA tile slices to two vector registers.
     (vector to array, four registers): Move four vector registers to four ZA single-vector groups.
     (vector to array, two registers): Move two vector registers to two ZA single-vector groups.
     (vector to tile, four registers): Move four vector registers to four ZA tile slices.
     (vector to tile, single): Move vector register to ZA tile slice.
     (vector to tile, two registers): Move two vector registers to two ZA tile slices.

The reference can be found here:

https://developer.arm.com/documentation/ddi0602/2022-09

It add more sizes for Matrix Operand:
MatrixOp8 and MatrixOp16
two implicit operands uimm0s2range and uimm0s4range.
and  uimm1s2range that are immediates

Differential Revision: https://reviews.llvm.org/D136142
2022-11-08 09:51:56 +00:00
Caroline Concatto
529a932e3f [AArch64] SME2 multi-vec unpack, ZIP, frint for two and four registers
This patch adds the assembly/disassembly for the following instructions:
  SUNPK: Unpack and sign-extend multi-vector elements.
  UUNPK: Unpack and zero-extend multi-vector elements.
  ZIP (four registers): Interleave elements from four vectors.
  ZIP (two registers): Interleave elements from two vectors.
  FRINTA: Multi-vector floating-point round to integral value, to nearest with ties away from zero.
  FRINTM: Multi-vector floating-point round to integral value, toward minus Infinity.
  FRINTN: Multi-vector floating-point round to integral value, to nearest with ties to even.
  FRINTP: Multi-vector floating-point round to integral value, toward plus Infinity.

The reference can be found here:

https://developer.arm.com/documentation/ddi0602/2022-09

Differential Revision: https://reviews.llvm.org/D136091
2022-11-04 09:11:07 +00:00
Caroline Concatto
a20112a74c [AArch64]SME2 instructions that use ZTO operand
This patch adds the assembly/disassembly for the following instructions:
  ZERO (ZT0): Zero ZT0.
  LDR (ZT0): Load ZT0 register.
  STR (ZT0): Store ZT0 register.
  MOVT (scalar to ZT0): Move 8 bytes from general-purpose register to ZT0.
       (ZT0 to scalar): Move 8 bytes from ZT0 to general-purpose register.
 Consecutive:
   LUTI2 (single): Lookup table read with 2-bit indexes.
         (two registers): Lookup table read with 2-bit indexes.
         (four registers): Lookup table read with 2-bit indexes.
   LUTI4 (single): Lookup table read with 4-bit indexes.
         (two registers): Lookup table read with 4-bit indexes.
         (four registers): Lookup table read with 4-bit indexes.

The reference can be found here:

https://developer.arm.com/documentation/ddi0602/2022-09

This patch also adds a new register class and operand for zt0
and a another index operand uimm3s8

Differential Revision: https://reviews.llvm.org/D136088
2022-11-03 07:35:21 +00:00
Caroline Concatto
7fd2afaf59 [AArch64]SME2 Outer Product and Accumulate instructions
This patch adds the assembly/disassembly for the following instructions:
  BMOPA: Bitwise exclusive NOR population count outer product and accumulate.
  BMOPS: Bitwise exclusive NOR population count outer product and subtract.

  SMOPA (2-way): Signed integer sum of outer products and accumulate.
  SMOPS (2-way): Signed integer sum of outer products and subtract.

  UMOPA (2-way): Unsigned integer sum of outer products and accumulate.
  UMOPS (2-way): Signed integer sum of outer products and accumulate.
The reference can be found here:

https://developer.arm.com/documentation/ddi0602/2022-09

Differential Revision: https://reviews.llvm.org/D136077
2022-11-01 13:18:48 +00:00
Sander de Smalen
0fe9453005 [AArch64][SME] Make all SME intrinsics use 32bit immediates.
This aligns with what was done for SVE, which consistently uses 32bit
immediates at the LLVM IR level.

Additionally, this change forces the intrinsic operands to be immediates
using ImmArg<>, which subsequently requires the codegenerator to match
TargetConstants instead of Constants.

Reviewed By: paulwalker-arm

Differential Revision: https://reviews.llvm.org/D136933
2022-10-31 11:28:12 +00:00
Nathan Chancellor
23c50432fb
Revert "[AArch64]SME2 Outer Product and Accumulate instructions"
This reverts commit 4df36f168763af725ba5bc852a4321afd0f769c4.

This change does not pass check-llvm.
2022-10-28 15:31:04 -07:00
Caroline Concatto
4df36f1687 [AArch64]SME2 Outer Product and Accumulate instructions
This patch adds the assembly/disassembly for the following instructions:
  BMOPA: Bitwise exclusive NOR population count outer product and accumulate.
  BMOPS: Bitwise exclusive NOR population count outer product and subtract.

  SMOPA (2-way): Signed integer sum of outer products and accumulate.
  SMOPS (2-way): Signed integer sum of outer products and subtract.

  UMOPA (2-way): Unsigned integer sum of outer products and accumulate.
  UMOPS (2-way): Signed integer sum of outer products and accumulate.
The reference can be found here:

https://developer.arm.com/documentation/ddi0602/2022-09

Differential Revision: https://reviews.llvm.org/D136077
2022-10-28 17:56:06 +01:00