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        "sign_return_address_all",
37        "If function return address signing is enabled, then apply it to all \
38        functions; does not have an effect on code generation by itself.",
39        "",
40        false,
41    );
42    settings.add_bool(
43        "sign_return_address",
44        "Use pointer authentication instructions to sign function return \
45         addresses; HINT-space instructions using the A key are generated \
46         and simple functions that do not use the stack are not affected \
47         unless overridden by other settings.",
48        "",
49        false,
50    );
51    settings.add_bool(
52        "sign_return_address_with_bkey",
53        "Use the B key with pointer authentication instructions instead of \
54        the default A key; does not have an effect on code generation by \
55        itself. Some platform ABIs may require this, for example.",
56        "",
57        false,
58    );
59    settings.add_bool(
60        "use_bti",
61        "Use Branch Target Identification (FEAT_BTI) instructions.",
62        "",
63        false,
64    );
65    settings.add_bool(
66        "use_csdb",
67        "Use the `csdb` instruction when spectre mitigations are enabled",
68        "",
69        false,
70    );
71
72    TargetIsa::new("arm64", settings.build())
73}