about summary refs log tree commit diff
path: root/compiler/rustc_target
diff options
context:
space:
mode:
authorWANG Rui <wangrui@loongson.cn>2025-08-30 21:31:16 +0800
committerWANG Rui <wangrui@loongson.cn>2025-08-30 21:36:23 +0800
commit0b1bc65002371c36b6e796f8933f8cb96e5d31d8 (patch)
treed122321246bd86b9aa60c9a73f3fca8c7e87622e /compiler/rustc_target
parent846e377215c5985b3a0fe7af6bb71bdc45912aae (diff)
downloadrust-0b1bc65002371c36b6e796f8933f8cb96e5d31d8.tar.gz
rust-0b1bc65002371c36b6e796f8933f8cb96e5d31d8.zip
Explicity disable LSX feature for `loongarch64-unknown-none` target
The `loongarch64-unknown-none` target is a bare-metal target with
hardware floating-point support and should not enable SIMD extensions
by default. However, LLVM's LoongArch64 backend enables LSX implicitly,
inadvertently activating SIMD instructions for this target. This patch
explicitly disable LSX feature to prevent unintended SIMD usage.
Diffstat (limited to 'compiler/rustc_target')
-rw-r--r--compiler/rustc_target/src/spec/targets/loongarch64_unknown_none.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none.rs b/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none.rs
index 91e3064aaed..b6a08958284 100644
--- a/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none.rs
+++ b/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none.rs
@@ -17,7 +17,7 @@ pub(crate) fn target() -> Target {
         arch: "loongarch64".into(),
         options: TargetOptions {
             cpu: "generic".into(),
-            features: "+f,+d".into(),
+            features: "+f,+d,-lsx".into(),
             linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
             linker: Some("rust-lld".into()),
             llvm_abiname: "lp64d".into(),