[0/4] aarch64: Add armv9.5-a FP8 datatype conversion

Message ID 20240410152950.1134020-1-victor.donascimento@arm.com
Headers
Series aarch64: Add armv9.5-a FP8 datatype conversion |

Message

Victor Do Nascimento April 10, 2024, 3:29 p.m. UTC
  The addition of the novel FP8 8-bit floating-point data-type, as
highlighted in "Arm A-Profile Architecture Developments 2023" [1],
(both in its E5M2 and E4M3 formats) and its associated data-processing
operations has led to the requirement that we be able to convert
between FP8 and existing data-types as well as scale resulting
floating-point values.

The following conversions are made possible as a result of the FP8
extension:

  - FP8 to BFloat16
  - FP8 to half-precision
  - Half-precision to FP8
  - single-precision to FP8

Scaling instructions allow FP8 values to be scaled by integer powers
of two.

Such conversion and scaling instructions are added not only in the
context of the advanced SIMD architectural extension, but are also
supported for the SVE2 and SME2 architectural extensions.

SME2 FP8 support:
-----------------
In the presence of SME2 support, the FP8 extension adds the following
SME2 multi-vector instructions:
  - FP8 convert instructions.
  - Floating-point scaling instructions.

SVE2 FP8 convert instructions:
------------------------------
  - In the presence of the SVE2 extension, these convert instructions
require that the streaming SVE mode is not enabled.
  - In the presence of the SME2 extension, these convert instructions
  require that the streaming SVE mode be enabled.

N.B. Due to the collaborative nature of FP8 feature implementation,
this patch series does not add the FPMR register.  Upstreaming of this
patch-series should be deferred until the register implementation has
been upstreamed.

Regtested on aarch64-linux-gnu, no new regressions.

[1] https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/arm-a-profile-architecture-developments-2023

Victor Do Nascimento (4):
  aarch64: fp8 convert and scale - add feature flags and related
    structures
  aarch64: fp8 convert and scale - Add advsimd insn variants
  aarch64: fp8 convert and scale - add sve2 insn variants
  aarch64: fp8 convert and scale - add sme2 insn variants

 gas/config/tc-aarch64.c                       |   1 +
 gas/doc/c-aarch64.texi                        |   2 +
 gas/testsuite/gas/aarch64/advsimd-fp8-fail.d  |   2 +
 gas/testsuite/gas/aarch64/advsimd-fp8-fail.l  | 262 ++++++
 gas/testsuite/gas/aarch64/advsimd-fp8-fail.s  | 121 +++
 gas/testsuite/gas/aarch64/advsimd-fp8.d       | 120 +++
 gas/testsuite/gas/aarch64/advsimd-fp8.s       |  76 ++
 gas/testsuite/gas/aarch64/sme2-24-invalid.l   |   4 +-
 gas/testsuite/gas/aarch64/sme2-fp8-fail.d     |   2 +
 gas/testsuite/gas/aarch64/sme2-fp8-fail.l     | 273 ++++++
 gas/testsuite/gas/aarch64/sme2-fp8-fail.s     | 106 +++
 .../gas/aarch64/sme2-fp8-streaming.d          |   4 +
 gas/testsuite/gas/aarch64/sme2-fp8.d          | 128 +++
 gas/testsuite/gas/aarch64/sme2-fp8.s          | 112 +++
 gas/testsuite/gas/aarch64/sve2-fp8-dump       |  53 ++
 gas/testsuite/gas/aarch64/sve2-fp8-fail.d     |   2 +
 gas/testsuite/gas/aarch64/sve2-fp8-fail.l     | 161 ++++
 gas/testsuite/gas/aarch64/sve2-fp8-fail.s     |  42 +
 gas/testsuite/gas/aarch64/sve2-fp8.d          |   3 +
 gas/testsuite/gas/aarch64/sve2-fp8.s          |  48 +
 include/opcode/aarch64.h                      |   2 +
 opcodes/aarch64-dis-2.c                       | 817 ++++++++++++++----
 opcodes/aarch64-tbl.h                         |  95 ++
 23 files changed, 2251 insertions(+), 185 deletions(-)
 create mode 100644 gas/testsuite/gas/aarch64/advsimd-fp8-fail.d
 create mode 100644 gas/testsuite/gas/aarch64/advsimd-fp8-fail.l
 create mode 100644 gas/testsuite/gas/aarch64/advsimd-fp8-fail.s
 create mode 100644 gas/testsuite/gas/aarch64/advsimd-fp8.d
 create mode 100644 gas/testsuite/gas/aarch64/advsimd-fp8.s
 create mode 100644 gas/testsuite/gas/aarch64/sme2-fp8-fail.d
 create mode 100644 gas/testsuite/gas/aarch64/sme2-fp8-fail.l
 create mode 100644 gas/testsuite/gas/aarch64/sme2-fp8-fail.s
 create mode 100644 gas/testsuite/gas/aarch64/sme2-fp8-streaming.d
 create mode 100644 gas/testsuite/gas/aarch64/sme2-fp8.d
 create mode 100644 gas/testsuite/gas/aarch64/sme2-fp8.s
 create mode 100644 gas/testsuite/gas/aarch64/sve2-fp8-dump
 create mode 100644 gas/testsuite/gas/aarch64/sve2-fp8-fail.d
 create mode 100644 gas/testsuite/gas/aarch64/sve2-fp8-fail.l
 create mode 100644 gas/testsuite/gas/aarch64/sve2-fp8-fail.s
 create mode 100644 gas/testsuite/gas/aarch64/sve2-fp8.d
 create mode 100644 gas/testsuite/gas/aarch64/sve2-fp8.s
  

Comments

Nick Clifton April 17, 2024, 9:50 a.m. UTC | #1
Hi Victor,


> Regtested on aarch64-linux-gnu, no new regressions.
> 
> [1] https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/arm-a-profile-architecture-developments-2023
> 
> Victor Do Nascimento (4):
>    aarch64: fp8 convert and scale - add feature flags and related
>      structures
>    aarch64: fp8 convert and scale - Add advsimd insn variants
>    aarch64: fp8 convert and scale - add sve2 insn variants
>    aarch64: fp8 convert and scale - add sme2 insn variants
> 
>   gas/config/tc-aarch64.c                       |   1 +
>   gas/doc/c-aarch64.texi                        |   2 +
>   gas/testsuite/gas/aarch64/advsimd-fp8-fail.d  |   2 +
>   gas/testsuite/gas/aarch64/advsimd-fp8-fail.l  | 262 ++++++
>   gas/testsuite/gas/aarch64/advsimd-fp8-fail.s  | 121 +++
>   gas/testsuite/gas/aarch64/advsimd-fp8.d       | 120 +++
>   gas/testsuite/gas/aarch64/advsimd-fp8.s       |  76 ++
>   gas/testsuite/gas/aarch64/sme2-24-invalid.l   |   4 +-
>   gas/testsuite/gas/aarch64/sme2-fp8-fail.d     |   2 +
>   gas/testsuite/gas/aarch64/sme2-fp8-fail.l     | 273 ++++++
>   gas/testsuite/gas/aarch64/sme2-fp8-fail.s     | 106 +++
>   .../gas/aarch64/sme2-fp8-streaming.d          |   4 +
>   gas/testsuite/gas/aarch64/sme2-fp8.d          | 128 +++
>   gas/testsuite/gas/aarch64/sme2-fp8.s          | 112 +++
>   gas/testsuite/gas/aarch64/sve2-fp8-dump       |  53 ++
>   gas/testsuite/gas/aarch64/sve2-fp8-fail.d     |   2 +
>   gas/testsuite/gas/aarch64/sve2-fp8-fail.l     | 161 ++++
>   gas/testsuite/gas/aarch64/sve2-fp8-fail.s     |  42 +
>   gas/testsuite/gas/aarch64/sve2-fp8.d          |   3 +
>   gas/testsuite/gas/aarch64/sve2-fp8.s          |  48 +
>   include/opcode/aarch64.h                      |   2 +
>   opcodes/aarch64-dis-2.c                       | 817 ++++++++++++++----
>   opcodes/aarch64-tbl.h                         |  95 ++
>   23 files changed, 2251 insertions(+), 185 deletions(-)
>   create mode 100644 gas/testsuite/gas/aarch64/advsimd-fp8-fail.d
>   create mode 100644 gas/testsuite/gas/aarch64/advsimd-fp8-fail.l
>   create mode 100644 gas/testsuite/gas/aarch64/advsimd-fp8-fail.s
>   create mode 100644 gas/testsuite/gas/aarch64/advsimd-fp8.d
>   create mode 100644 gas/testsuite/gas/aarch64/advsimd-fp8.s
>   create mode 100644 gas/testsuite/gas/aarch64/sme2-fp8-fail.d
>   create mode 100644 gas/testsuite/gas/aarch64/sme2-fp8-fail.l
>   create mode 100644 gas/testsuite/gas/aarch64/sme2-fp8-fail.s
>   create mode 100644 gas/testsuite/gas/aarch64/sme2-fp8-streaming.d
>   create mode 100644 gas/testsuite/gas/aarch64/sme2-fp8.d
>   create mode 100644 gas/testsuite/gas/aarch64/sme2-fp8.s
>   create mode 100644 gas/testsuite/gas/aarch64/sve2-fp8-dump
>   create mode 100644 gas/testsuite/gas/aarch64/sve2-fp8-fail.d
>   create mode 100644 gas/testsuite/gas/aarch64/sve2-fp8-fail.l
>   create mode 100644 gas/testsuite/gas/aarch64/sve2-fp8-fail.s
>   create mode 100644 gas/testsuite/gas/aarch64/sve2-fp8.d
>   create mode 100644 gas/testsuite/gas/aarch64/sve2-fp8.s

Patch series approved - please apply.

Cheers
   Nick