diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2025-03-20 13:50:13 +0000 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2025-03-20 13:50:13 +0000 |
| commit | b9e67a2e286e17d3dd5d88ff9dadb98641a6b21b (patch) | |
| tree | 95f3132103992eca4d2fb400d095187b057c9361 /src | |
| parent | cb4a25ca81e266703a8ffa4fe80a53e954bb992d (diff) | |
| download | rust-b9e67a2e286e17d3dd5d88ff9dadb98641a6b21b.tar.gz rust-b9e67a2e286e17d3dd5d88ff9dadb98641a6b21b.zip | |
Enable target features in inline asm on arm64
Diffstat (limited to 'src')
| -rw-r--r-- | src/inline_asm.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/inline_asm.rs b/src/inline_asm.rs index 59d10934131..fbc33a64285 100644 --- a/src/inline_asm.rs +++ b/src/inline_asm.rs @@ -612,6 +612,15 @@ impl<'tcx> InlineAssemblyGenerator<'_, 'tcx> { generated_asm.push_str(".att_syntax\n"); } + if self.arch == InlineAsmArch::AArch64 { + for feature in &self.tcx.codegen_fn_attrs(self.enclosing_def_id).target_features { + if feature.name == sym::neon { + continue; + } + writeln!(generated_asm, ".arch_extension {}", feature.name).unwrap(); + } + } + // The actual inline asm for piece in self.template { match piece { @@ -679,6 +688,15 @@ impl<'tcx> InlineAssemblyGenerator<'_, 'tcx> { } generated_asm.push('\n'); + if self.arch == InlineAsmArch::AArch64 { + for feature in &self.tcx.codegen_fn_attrs(self.enclosing_def_id).target_features { + if feature.name == sym::neon { + continue; + } + writeln!(generated_asm, ".arch_extension no{}", feature.name).unwrap(); + } + } + if is_x86 && self.options.contains(InlineAsmOptions::ATT_SYNTAX) { generated_asm.push_str(".intel_syntax noprefix\n"); } |
