diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2025-03-27 14:50:23 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-27 14:50:23 +0100 |
| commit | 8364234af67e7a9211070a637d1a9791b6007e6e (patch) | |
| tree | 01f28da0b595e60b6b22341d73095df9c4c95e4b | |
| parent | 1875905a94f72e043eb356efe30d40fe165fea20 (diff) | |
| parent | ce57133ad170cb069a06f2595d84d3be2e478a86 (diff) | |
| download | rust-8364234af67e7a9211070a637d1a9791b6007e6e.tar.gz rust-8364234af67e7a9211070a637d1a9791b6007e6e.zip | |
Merge pull request #1566 from rust-lang/arm64_fixes
Fix the half and bytecount crates on arm64
| -rw-r--r-- | src/inline_asm.rs | 18 | ||||
| -rw-r--r-- | src/intrinsics/llvm_aarch64.rs | 4 |
2 files changed, 20 insertions, 2 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"); } diff --git a/src/intrinsics/llvm_aarch64.rs b/src/intrinsics/llvm_aarch64.rs index b77c99fa289..387c87d123a 100644 --- a/src/intrinsics/llvm_aarch64.rs +++ b/src/intrinsics/llvm_aarch64.rs @@ -21,7 +21,7 @@ pub(crate) fn codegen_aarch64_llvm_intrinsic_call<'tcx>( fx.bcx.ins().fence(); } - "llvm.aarch64.neon.ld1x4.v16i8.p0i8" => { + "llvm.aarch64.neon.ld1x4.v16i8.p0" => { intrinsic_args!(fx, args => (ptr); intrinsic); let ptr = ptr.load_scalar(fx); @@ -253,7 +253,7 @@ pub(crate) fn codegen_aarch64_llvm_intrinsic_call<'tcx>( } let res = CValue::by_val( fx.bcx.ins().uextend(types::I32, res_val), - fx.layout_of(fx.tcx.types.u32), + fx.layout_of(fx.tcx.types.i32), ); ret.write_cvalue(fx, res); } |
