Skip to main content

cranelift_codegen_meta/isa/
arm64.rs

1use crate::cdsl::isa::TargetIsa;
2use crate::cdsl::settings::SettingGroupBuilder;
3
4pub(crate) fn define() -> TargetIsa {
5    let mut settings = SettingGroupBuilder::new("arm64");
6
7    settings.add_bool(
8        "has_lse",
9        "Has Large System Extensions (FEAT_LSE) support.",
10        "",
11        false,
12    );
13    settings.add_bool(
14        "has_pauth",
15        "Has Pointer authentication (FEAT_PAuth) support; enables the use of \
16         non-HINT instructions, but does not have an effect on code generation \
17         by itself.",
18        "",
19        false,
20    );
21    settings.add_bool(
22        "has_fp16",
23        "Use half-precision floating point (FEAT_FP16) instructions.",
24        "",
25        false,
26    );
27    settings.add_bool(
28        "has_dotprod",
29        "Has Dot Product (FEAT_DotProd) support; enables lowering i8 dot \
30         products (e.g. the relaxed-SIMD i8x16 dot) to SDOT/UDOT instead of \
31         a smull/saddlp widening fallback.",
32        "",
33        false,
34    );
35    settings.add_bool(
36        "has_i8mm",
37        "Has Int8 Matrix Multiplication (FEAT_I8MM) support; enables lowering \
38         the mixed unsigned-by-signed i8 dot product to USDOT instead of a \
39         umull/smull + saddlp widening fallback.",
40        "",
41        false,
42    );
43    settings.add_bool(
44        "sign_return_address_all",
45        "If function return address signing is enabled, then apply it to all \
46        functions; does not have an effect on code generation by itself.",
47        "",
48        false,
49    );
50    settings.add_bool(
51        "sign_return_address",
52        "Use pointer authentication instructions to sign function return \
53         addresses; HINT-space instructions using the A key are generated \
54         and simple functions that do not use the stack are not affected \
55         unless overridden by other settings.",
56        "",
57        false,
58    );
59    settings.add_bool(
60        "sign_return_address_with_bkey",
61        "Use the B key with pointer authentication instructions instead of \
62        the default A key; does not have an effect on code generation by \
63        itself. Some platform ABIs may require this, for example.",
64        "",
65        false,
66    );
67    settings.add_bool(
68        "use_bti",
69        "Use Branch Target Identification (FEAT_BTI) instructions.",
70        "",
71        false,
72    );
73    settings.add_bool(
74        "use_csdb",
75        "Use the `csdb` instruction when spectre mitigations are enabled",
76        "",
77        false,
78    );
79
80    TargetIsa::new("arm64", settings.build())
81}