about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLaurențiu Nicola <lnicola@users.noreply.github.com>2025-02-04 15:36:58 +0000
committerGitHub <noreply@github.com>2025-02-04 15:36:58 +0000
commit96f96a4f4492b6bea00eeaa9cfb65dc75abbb59d (patch)
tree662d9113388a130fc38cc262977b8e41b72d1ef4
parent21ddcbb836e4ee785cf64fdffa15c0f52503b5d4 (diff)
parent9bf4fe4ab7281e213f78e02bcc8ebd421be83745 (diff)
downloadrust-96f96a4f4492b6bea00eeaa9cfb65dc75abbb59d.tar.gz
rust-96f96a4f4492b6bea00eeaa9cfb65dc75abbb59d.zip
Merge pull request #19083 from he32/fix-arm64-be
line-index: don't try to use (unavailable) neon on big-endian aarch64
-rw-r--r--src/tools/rust-analyzer/lib/line-index/src/lib.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/tools/rust-analyzer/lib/line-index/src/lib.rs b/src/tools/rust-analyzer/lib/line-index/src/lib.rs
index 6f0455ee98b..bc87ada3eb5 100644
--- a/src/tools/rust-analyzer/lib/line-index/src/lib.rs
+++ b/src/tools/rust-analyzer/lib/line-index/src/lib.rs
@@ -235,7 +235,7 @@ fn analyze_source_file_dispatch(
     }
 }
 
-#[cfg(target_arch = "aarch64")]
+#[cfg(all(target_arch = "aarch64", target_endian = "little"))]
 fn analyze_source_file_dispatch(
     src: &str,
     lines: &mut Vec<TextSize>,
@@ -347,7 +347,7 @@ unsafe fn analyze_source_file_sse2(
 }
 
 #[target_feature(enable = "neon")]
-#[cfg(target_arch = "aarch64")]
+#[cfg(all(target_arch = "aarch64", target_endian = "little"))]
 #[inline]
 // See https://community.arm.com/arm-community-blogs/b/infrastructure-solutions-blog/posts/porting-x86-vector-bitmask-optimizations-to-arm-neon
 //
@@ -362,7 +362,7 @@ unsafe fn move_mask(v: std::arch::aarch64::uint8x16_t) -> u64 {
 }
 
 #[target_feature(enable = "neon")]
-#[cfg(target_arch = "aarch64")]
+#[cfg(all(target_arch = "aarch64", target_endian = "little"))]
 unsafe fn analyze_source_file_neon(
     src: &str,
     lines: &mut Vec<TextSize>,
@@ -441,7 +441,11 @@ unsafe fn analyze_source_file_neon(
     }
 }
 
-#[cfg(not(any(target_arch = "x86", target_arch = "x86_64", target_arch = "aarch64")))]
+#[cfg(not(any(
+    target_arch = "x86",
+    target_arch = "x86_64",
+    all(target_arch = "aarch64", target_endian = "little")
+)))]
 // The target (or compiler version) does not support SSE2 ...
 fn analyze_source_file_dispatch(
     src: &str,