[PATCH v3 0/5] aarch64: Add support for sme2 and sve2 BFloat16 feature.

Srinath Parvathaneni srinath.parvathaneni@arm.com
Tue Jan 7 11:34:10 GMT 2025


Changes v2-v3:

  In 1/5:
  * Removed FEAT_SVE_SVE2_B16B16 entry from virtual feature bits and
    aarch64_virtual_dependency_table aarch64_dependencies.
  * Retained the same feature list macro (B16B16_SVE2) for FEAT_SVE_B16B16
    to avoid unnecessary changes in opcode tables.
  * Replaced OP_SVE_SMSS with OP_SVE_HMHH in B16B16_SVE2_INSNC expansions.
  * Renamed test filenames, FEAT_SVE_B16B16 (+sve2) tests are renamed with
    prefix "sve-b16b16-sve2", eg sve-b16b16-sve2-1.s.
  * Added ` ?` to the vector lists in the tests with z vectors
    e.g. `{z0\.h-z3\.h}` -> `{ ?z0\.h-z3\.h ?}`.
  * Documented +sve-b16b16 option.

  In 2/5
  * Removed FEAT_SVE_SME2_B16B16 entry from virtual feature bits and
    aarch64_virtual_dependency_table aarch64_dependencies.
  * Macro using the feature list (&aarch64_feature_sve_b16b16_sme2) is
    renamed to SVE_B16B16_SME.
  * F_OD(2) and F_OD(4) are dropped from  SVE_B16B16_SME_INSN "bfclamp"
    instructions.
  * Renamed test filenames, FEAT_SVE_B16B16 (+sme2) tests are renamed with
    prefix "sve-b16b16-sme2", eg sve-b16b16-sme2-1.s.
  * Added ` ?` to the vector lists in the tests with z vectors
    e.g. `{z0\.h-z3\.h}` -> `{ ?z0\.h-z3\.h ?}`.

  In 4/5:
  * Fixed the gas/NEWS entry for feature name.
  * Documented +sme-b16b16 option.
  * Renamed test filenames, FEAT_SME_B16B16 tests are renamed with prefix
    "sme-b16b16", eg sme-b16b16-1.s.
  * For some the instructions, added tests with different index value in
    the last operands.
  * Corrected the feature list and dependencies for the option "sme-b16b16".

Changes v1 -> v2:

* Previously in version v1 this patch series was posted on top of master + FEAT_SME_F16F16 [3], 
  but this failed to apply by the Linaro CI due to dependency on FEAT_SME_F16F16. I have
  rebased the patch series on later master (without FEAT_SME_F16F16) in version v2.

version v1:
In the current assembler, SVE2 Bfloat16 instructions are implemented with tick
FEAT_B16B16 and command line flag "+b16b16" and this feature was suspended
due to incomplete support.

In the new spec available here(SVE[1], SME[2]), FEAT_B16B16 is replaced with
FEAT_SVE_B16B16 and FEAT_SME_B16B16 and command line flag "+b16b16" is replaced
with "+sve-b16b16"(+sme2 or +sve2) and "+sme-b16b16".

More details about the Bfloat16 are provided below:
The Bfloat16 feature in sve2 and sme2 is divided into 3 combinations.
* SVE Z-targeting non-widening BFloat16 instructions under FEAT_SVE_B16B16
  implemented with command line flag "+sve-b16b16+sve2".
* SME Z-targeting multi-vector non-widening BFloat16 instructions under
  FEAT_SVE_B16B16 implemented with command line flag "+sve-b16b16+sme2".
* SME ZA-targeting non-widening BFloat16 instructions under FEAT_SME_B16B16
  implemented with command line flag "+sme-b16b16".
* Added ` ?` to the vector lists in the tests with z vectors
    e.g. `{z0\.h-z3\.h}` -> `{ ?z0\.h-z3\.h ?}`.

This following 5 patch series add support for above combinations and instructions:
Srinath Parvathaneni (5):
  aarch64: Add support for FEAT_SVE_B16B16 feature.
  aarch64: Add support for FEAT_SVE_B16B16 min and max instructions.
  aarch64: Add support for FEAT_SVE_B16B16 min and max instructions (autogenerated files).
  aarch64: Add support for FEAT_SME_B16B16 feature.
  aarch64: Add support for FEAT_SME_B16B16 feature (autogenerated files).

SVE[1]: https://developer.arm.com/documentation/ddi0602/2024-06/SVE-Instructions?lang=en
SME[2]: https://developer.arm.com/documentation/ddi0602/2024-06/SME-Instructions?lang=en
FEAT_SME_F16F16: https://sourceware.org/pipermail/binutils/2025-January/138318.html

Regression testing for aarch64-none-elf target and found no regressions.

Ok for binutils-master?

Regards,
Srinath.

Srinath Parvathaneni (5):
  aarch64: Add support for FEAT_SVE_B16B16 feature.
  aarch64: Add support for FEAT_SVE_B16B16 min and max instructions.
  aarch64: Add support for FEAT_SVE_B16B16 min and max instructions
    (autogenerated files).
  aarch64: Add support for FEAT_SME_B16B16 feature.
  aarch64: Add support for FEAT_SME_B16B16 feature (autogenerated
    files).

 gas/NEWS                                      |   7 +-
 gas/config/tc-aarch64.c                       |   6 +-
 gas/doc/c-aarch64.texi                        |   6 +-
 .../gas/aarch64/bfloat16-1-invalid.d          |   4 -
 .../gas/aarch64/bfloat16-2-invalid.d          |   5 -
 gas/testsuite/gas/aarch64/bfloat16-bad.d      |   4 -
 gas/testsuite/gas/aarch64/bfloat16-bad.l      | 100 --
 gas/testsuite/gas/aarch64/sme-b16b16-1.d      | 126 +++
 gas/testsuite/gas/aarch64/sme-b16b16-1.s      | 143 +++
 gas/testsuite/gas/aarch64/sme-b16b16-bad-1.d  |   3 +
 gas/testsuite/gas/aarch64/sme-b16b16-bad-1.l  | 193 ++++
 gas/testsuite/gas/aarch64/sme-b16b16-bad-1.s  | 173 ++++
 .../gas/aarch64/sve-b16b16-sme2-bad-1.d       |   3 +
 .../gas/aarch64/sve-b16b16-sme2-bad-1.l       | 159 ++++
 .../gas/aarch64/sve-b16b16-sme2-bad-1.s       | 136 +++
 gas/testsuite/gas/aarch64/sve-b16b16-sme2.d   | 122 +++
 gas/testsuite/gas/aarch64/sve-b16b16-sme2.s   | 138 +++
 .../gas/aarch64/sve-b16b16-sve2-bad-1.d       |   3 +
 ...16-1-invalid.l => sve-b16b16-sve2-bad-1.l} |   0
 ...16-1-invalid.s => sve-b16b16-sve2-bad-1.s} |   0
 .../gas/aarch64/sve-b16b16-sve2-bad-2.d       |   3 +
 ...16-2-invalid.l => sve-b16b16-sve2-bad-2.l} |  24 +-
 ...16-2-invalid.s => sve-b16b16-sve2-bad-2.s} |   0
 .../{bfloat16-1.d => sve-b16b16-sve2.d}       |   5 +-
 .../{bfloat16-1.s => sve-b16b16-sve2.s}       |   0
 include/opcode/aarch64.h                      |   6 +-
 opcodes/aarch64-dis-2.c                       | 886 +++++++++++-------
 opcodes/aarch64-tbl.h                         |  87 +-
 28 files changed, 1866 insertions(+), 476 deletions(-)
 delete mode 100644 gas/testsuite/gas/aarch64/bfloat16-1-invalid.d
 delete mode 100644 gas/testsuite/gas/aarch64/bfloat16-2-invalid.d
 delete mode 100644 gas/testsuite/gas/aarch64/bfloat16-bad.d
 delete mode 100644 gas/testsuite/gas/aarch64/bfloat16-bad.l
 create mode 100644 gas/testsuite/gas/aarch64/sme-b16b16-1.d
 create mode 100644 gas/testsuite/gas/aarch64/sme-b16b16-1.s
 create mode 100644 gas/testsuite/gas/aarch64/sme-b16b16-bad-1.d
 create mode 100644 gas/testsuite/gas/aarch64/sme-b16b16-bad-1.l
 create mode 100644 gas/testsuite/gas/aarch64/sme-b16b16-bad-1.s
 create mode 100644 gas/testsuite/gas/aarch64/sve-b16b16-sme2-bad-1.d
 create mode 100644 gas/testsuite/gas/aarch64/sve-b16b16-sme2-bad-1.l
 create mode 100644 gas/testsuite/gas/aarch64/sve-b16b16-sme2-bad-1.s
 create mode 100644 gas/testsuite/gas/aarch64/sve-b16b16-sme2.d
 create mode 100644 gas/testsuite/gas/aarch64/sve-b16b16-sme2.s
 create mode 100644 gas/testsuite/gas/aarch64/sve-b16b16-sve2-bad-1.d
 rename gas/testsuite/gas/aarch64/{bfloat16-1-invalid.l => sve-b16b16-sve2-bad-1.l} (100%)
 rename gas/testsuite/gas/aarch64/{bfloat16-1-invalid.s => sve-b16b16-sve2-bad-1.s} (100%)
 create mode 100644 gas/testsuite/gas/aarch64/sve-b16b16-sve2-bad-2.d
 rename gas/testsuite/gas/aarch64/{bfloat16-2-invalid.l => sve-b16b16-sve2-bad-2.l} (93%)
 rename gas/testsuite/gas/aarch64/{bfloat16-2-invalid.s => sve-b16b16-sve2-bad-2.s} (100%)
 rename gas/testsuite/gas/aarch64/{bfloat16-1.d => sve-b16b16-sve2.d} (97%)
 rename gas/testsuite/gas/aarch64/{bfloat16-1.s => sve-b16b16-sve2.s} (100%)

-- 
2.25.1



More information about the Binutils mailing list