Skip to content

Commit 96f96a4

Browse files
authored
Merge pull request #19083 from he32/fix-arm64-be
line-index: don't try to use (unavailable) neon on big-endian aarch64
2 parents 21ddcbb + 9bf4fe4 commit 96f96a4

File tree

1 file changed

+8
-4
lines changed
  • src/tools/rust-analyzer/lib/line-index/src

1 file changed

+8
-4
lines changed

src/tools/rust-analyzer/lib/line-index/src/lib.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ fn analyze_source_file_dispatch(
235235
}
236236
}
237237

238-
#[cfg(target_arch = "aarch64")]
238+
#[cfg(all(target_arch = "aarch64", target_endian = "little"))]
239239
fn analyze_source_file_dispatch(
240240
src: &str,
241241
lines: &mut Vec<TextSize>,
@@ -347,7 +347,7 @@ unsafe fn analyze_source_file_sse2(
347347
}
348348

349349
#[target_feature(enable = "neon")]
350-
#[cfg(target_arch = "aarch64")]
350+
#[cfg(all(target_arch = "aarch64", target_endian = "little"))]
351351
#[inline]
352352
// See https://community.arm.com/arm-community-blogs/b/infrastructure-solutions-blog/posts/porting-x86-vector-bitmask-optimizations-to-arm-neon
353353
//
@@ -362,7 +362,7 @@ unsafe fn move_mask(v: std::arch::aarch64::uint8x16_t) -> u64 {
362362
}
363363

364364
#[target_feature(enable = "neon")]
365-
#[cfg(target_arch = "aarch64")]
365+
#[cfg(all(target_arch = "aarch64", target_endian = "little"))]
366366
unsafe fn analyze_source_file_neon(
367367
src: &str,
368368
lines: &mut Vec<TextSize>,
@@ -441,7 +441,11 @@ unsafe fn analyze_source_file_neon(
441441
}
442442
}
443443

444-
#[cfg(not(any(target_arch = "x86", target_arch = "x86_64", target_arch = "aarch64")))]
444+
#[cfg(not(any(
445+
target_arch = "x86",
446+
target_arch = "x86_64",
447+
all(target_arch = "aarch64", target_endian = "little")
448+
)))]
445449
// The target (or compiler version) does not support SSE2 ...
446450
fn analyze_source_file_dispatch(
447451
src: &str,

0 commit comments

Comments
 (0)