xref: /freebsd/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64FMV.td (revision b64c5a0ace59af62eff52bfe110a521dc73c937b)
1//=------ AArch64FMV.td - Describe AArch64 FMV Features ------*- tablegen -*-=//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// Function MultiVersioning (FMV) properties. FMV features are accepted by the
10// attributes target_version and target_clones, and they correspond to a mapping
11// from the FMV feature name to:
12//  - A bit in the FMV ABI, as defined by the ACLE.
13//  - The FMV priority, as defined by the ACLE.
14//  - A list of backend features.
15//
16// The list of backend features is not a set of dependencies; it is specific to
17// LLVM and indicates how to do codegen when the FMV feature is present.
18//
19// Therefore FMVExtensions are separated from regular AArch64 Extensions, which
20// encode dependencies between themselves and other SubtargetFeatures.
21//===----------------------------------------------------------------------===//
22
23
24// Something you can add to target_version or target_clones.
25class FMVExtension<string n, string b, string f, int p> {
26    // Name, as spelled in target_version or target_clones. e.g. "memtag".
27    string Name = n;
28
29    // A C++ expression giving the number of the bit in the FMV ABI.
30    // Currently this is given as a value from the enum "CPUFeatures".
31    string Bit = b;
32
33    // SubtargetFeatures enabled for codegen when this FMV feature is present.
34    string BackendFeatures = f;
35
36    // The FMV priority.
37    int Priority = p;
38}
39
40def : FMVExtension<"aes", "FEAT_AES", "+fp-armv8,+neon", 150>;
41def : FMVExtension<"bf16", "FEAT_BF16", "+bf16", 280>;
42def : FMVExtension<"bti", "FEAT_BTI", "+bti", 510>;
43def : FMVExtension<"crc", "FEAT_CRC", "+crc", 110>;
44def : FMVExtension<"dgh", "FEAT_DGH", "", 260>;
45def : FMVExtension<"dit", "FEAT_DIT", "+dit", 180>;
46def : FMVExtension<"dotprod", "FEAT_DOTPROD", "+dotprod,+fp-armv8,+neon", 104>;
47def : FMVExtension<"dpb", "FEAT_DPB", "+ccpp", 190>;
48def : FMVExtension<"dpb2", "FEAT_DPB2", "+ccpp,+ccdp", 200>;
49def : FMVExtension<"ebf16", "FEAT_EBF16", "+bf16", 290>;
50def : FMVExtension<"f32mm", "FEAT_SVE_F32MM", "+sve,+f32mm,+fullfp16,+fp-armv8,+neon", 350>;
51def : FMVExtension<"f64mm", "FEAT_SVE_F64MM", "+sve,+f64mm,+fullfp16,+fp-armv8,+neon", 360>;
52def : FMVExtension<"fcma", "FEAT_FCMA", "+fp-armv8,+neon,+complxnum", 220>;
53def : FMVExtension<"flagm", "FEAT_FLAGM", "+flagm", 20>;
54def : FMVExtension<"flagm2", "FEAT_FLAGM2", "+flagm,+altnzcv", 30>;
55def : FMVExtension<"fp", "FEAT_FP", "+fp-armv8,+neon", 90>;
56def : FMVExtension<"fp16", "FEAT_FP16", "+fullfp16,+fp-armv8,+neon", 170>;
57def : FMVExtension<"fp16fml", "FEAT_FP16FML", "+fp16fml,+fullfp16,+fp-armv8,+neon", 175>;
58def : FMVExtension<"frintts", "FEAT_FRINTTS", "+fptoint", 250>;
59def : FMVExtension<"i8mm", "FEAT_I8MM", "+i8mm", 270>;
60def : FMVExtension<"jscvt", "FEAT_JSCVT", "+fp-armv8,+neon,+jsconv", 210>;
61def : FMVExtension<"ls64", "FEAT_LS64", "", 520>;
62def : FMVExtension<"ls64_accdata", "FEAT_LS64_ACCDATA", "+ls64", 540>;
63def : FMVExtension<"ls64_v", "FEAT_LS64_V", "", 530>;
64def : FMVExtension<"lse", "FEAT_LSE", "+lse", 80>;
65def : FMVExtension<"memtag", "FEAT_MEMTAG", "", 440>;
66def : FMVExtension<"memtag2", "FEAT_MEMTAG2", "+mte", 450>;
67def : FMVExtension<"memtag3", "FEAT_MEMTAG3", "+mte", 460>;
68def : FMVExtension<"mops", "FEAT_MOPS", "+mops", 650>;
69def : FMVExtension<"pmull", "FEAT_PMULL", "+aes,+fp-armv8,+neon", 160>;
70def : FMVExtension<"predres", "FEAT_PREDRES", "+predres", 480>;
71def : FMVExtension<"rcpc", "FEAT_RCPC", "+rcpc", 230>;
72def : FMVExtension<"rcpc2", "FEAT_RCPC2", "+rcpc", 240>;
73def : FMVExtension<"rcpc3", "FEAT_RCPC3", "+rcpc,+rcpc3", 241>;
74def : FMVExtension<"rdm", "FEAT_RDM", "+rdm,+fp-armv8,+neon", 108>;
75def : FMVExtension<"rng", "FEAT_RNG", "+rand", 10>;
76def : FMVExtension<"rpres", "FEAT_RPRES", "", 300>;
77def : FMVExtension<"sb", "FEAT_SB", "+sb", 470>;
78def : FMVExtension<"sha1", "FEAT_SHA1", "+fp-armv8,+neon", 120>;
79def : FMVExtension<"sha2", "FEAT_SHA2", "+sha2,+fp-armv8,+neon", 130>;
80def : FMVExtension<"sha3", "FEAT_SHA3", "+sha3,+sha2,+fp-armv8,+neon", 140>;
81def : FMVExtension<"simd", "FEAT_SIMD", "+fp-armv8,+neon", 100>;
82def : FMVExtension<"sm4", "FEAT_SM4", "+sm4,+fp-armv8,+neon", 106>;
83def : FMVExtension<"sme", "FEAT_SME", "+sme,+bf16", 430>;
84def : FMVExtension<"sme-f64f64", "FEAT_SME_F64", "+sme,+sme-f64f64,+bf16", 560>;
85def : FMVExtension<"sme-i16i64", "FEAT_SME_I64", "+sme,+sme-i16i64,+bf16", 570>;
86def : FMVExtension<"sme2", "FEAT_SME2", "+sme2,+sme,+bf16", 580>;
87def : FMVExtension<"ssbs", "FEAT_SSBS", "", 490>;
88def : FMVExtension<"ssbs2", "FEAT_SSBS2", "+ssbs", 500>;
89def : FMVExtension<"sve", "FEAT_SVE", "+sve,+fullfp16,+fp-armv8,+neon", 310>;
90def : FMVExtension<"sve-bf16", "FEAT_SVE_BF16", "+sve,+bf16,+fullfp16,+fp-armv8,+neon", 320>;
91def : FMVExtension<"sve-ebf16", "FEAT_SVE_EBF16", "+sve,+bf16,+fullfp16,+fp-armv8,+neon", 330>;
92def : FMVExtension<"sve-i8mm", "FEAT_SVE_I8MM", "+sve,+i8mm,+fullfp16,+fp-armv8,+neon", 340>;
93def : FMVExtension<"sve2", "FEAT_SVE2", "+sve2,+sve,+fullfp16,+fp-armv8,+neon", 370>;
94def : FMVExtension<"sve2-aes", "FEAT_SVE_AES", "+sve2,+sve,+sve2-aes,+fullfp16,+fp-armv8,+neon", 380>;
95def : FMVExtension<"sve2-bitperm", "FEAT_SVE_BITPERM", "+sve2,+sve,+sve2-bitperm,+fullfp16,+fp-armv8,+neon", 400>;
96def : FMVExtension<"sve2-pmull128", "FEAT_SVE_PMULL128", "+sve2,+sve,+sve2-aes,+fullfp16,+fp-armv8,+neon", 390>;
97def : FMVExtension<"sve2-sha3", "FEAT_SVE_SHA3", "+sve2,+sve,+sve2-sha3,+fullfp16,+fp-armv8,+neon", 410>;
98def : FMVExtension<"sve2-sm4", "FEAT_SVE_SM4", "+sve2,+sve,+sve2-sm4,+fullfp16,+fp-armv8,+neon", 420>;
99def : FMVExtension<"wfxt", "FEAT_WFXT", "+wfxt", 550>;
100