Skip to content

Commit

Permalink
line-index: don't try to use neon on big-endian aarch64.
Browse files Browse the repository at this point in the history
  • Loading branch information
he32 committed Feb 4, 2025
1 parent 3288929 commit 9bf4fe4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/tools/rust-analyzer/lib/line-index/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand Down Expand Up @@ -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
//
Expand All @@ -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>,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 9bf4fe4

Please sign in to comment.