]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
AArch64: Add SME LUTv2 architecture extension
authorKarl Meakin <karl.meakin@arm.com>
Thu, 18 Sep 2025 14:15:45 +0000 (15:15 +0100)
committerTamar Christina <tamar.christina@arm.com>
Thu, 18 Sep 2025 14:15:45 +0000 (15:15 +0100)
Add the SME LUTv2 architecture extension. Users can enable the extension
by adding `+sme-lutv2` to `-march` or `-mcpu`, and test for its presence
with the `__ARM_FEATURE_SME_LUTv2` macro. The intrinsics will be added
in the next commit.

gcc/ChangeLog:

* config/aarch64/aarch64-c.cc (aarch64_update_cpp_builtins): Conditonally define
`__ARM_FEATURE_SME_LUTv2" macro.
* config/aarch64/aarch64-option-extensions.def (AARCH64_OPT_EXTENSION("sme-lutv2")): New
optional architecture extension.
* config/aarch64/aarch64.h (TARGET_SME_LUTv2): New macro.
* doc/invoke.texi: Document `+sme-lutv2` flag.

gcc/config/aarch64/aarch64-c.cc
gcc/config/aarch64/aarch64-option-extensions.def
gcc/config/aarch64/aarch64.h
gcc/doc/invoke.texi

index 98337b7f693bc4f7a743d6d74b02ed3dad4d80e3..a8ff58e49945cc871e407927302cc77f5e968618 100644 (file)
@@ -269,6 +269,7 @@ aarch64_update_cpp_builtins (cpp_reader *pfile)
                        "__ARM_FEATURE_SVE_BF16", pfile);
 
   aarch64_def_or_undef (TARGET_LUT, "__ARM_FEATURE_LUT", pfile);
+  aarch64_def_or_undef (TARGET_SME_LUTv2, "__ARM_FEATURE_SME_LUTv2", pfile);
 
   aarch64_def_or_undef (TARGET_FP8, "__ARM_FEATURE_FP8", pfile);
 
index db88df08a6afc0f7707812a6793c48b08618aa2e..a70375c053f24ca1b943e4783aa1be7ee05020ba 100644 (file)
@@ -277,6 +277,8 @@ AARCH64_OPT_EXTENSION("ssve-fp8dot2", SSVE_FP8DOT2, (SME2, FP8), (), (), "smesf8
 
 AARCH64_OPT_EXTENSION("lut", LUT, (SIMD), (), (), "lut")
 
+AARCH64_OPT_EXTENSION ("sme-lutv2", SME_LUTv2, (SME2), (), (), "sme-lutv2")
+
 AARCH64_OPT_EXTENSION("cpa", CPA, (), (), (), "")
 
 #undef AARCH64_OPT_FMV_EXTENSION
index 2b3610c86ed55d3cd3057a736f67abb57a10dcf6..2b6075d3824051c597d3a7edcff4606ab62905ae 100644 (file)
@@ -477,9 +477,14 @@ constexpr auto AARCH64_FL_DEFAULT_ISA_MODE ATTRIBUTE_UNUSED
    enabled through +faminmax.  */
 #define TARGET_FAMINMAX AARCH64_HAVE_ISA (FAMINMAX)
 
-/* Lookup table (LUTI) extension instructions are enabled through +lut.  */
+/* Lookup table (LUTI) extension instructions with 2-bit and 4-bit indices are
+   enabled through +lut.  */
 #define TARGET_LUT AARCH64_HAVE_ISA (LUT)
 
+/* Lookup table (LUTI) extension instructions with 4-bit indices and 8-bit
+   elements are enabled through +sme-lutv2.  */
+#define TARGET_SME_LUTv2 AARCH64_HAVE_ISA (SME_LUTv2)
+
 /* Prefer different predicate registers for the output of a predicated
    operation over re-using an existing input predicate.  */
 #define TARGET_SVE_PRED_CLOBBER (TARGET_SVE \
index 3cf326cc22c35b1c325757c0f3a2aa576e880f13..76ecea550f31c2ca43d1ebf522d06105a973729e 100644 (file)
@@ -22728,6 +22728,8 @@ extension in streaming mode.
 Enable the Floating Point Absolute Maximum/Minimum extension.
 @item lut
 Enable the Lookup Table extension.
+@item sme-lutv2
+Enable the SME Lookup Table v2 (LUTv2) extension.
 @item cpa
 Enable the Checked Pointer Arithmetic instructions.
 @item sve-b16b16