about summary refs log tree commit diff
path: root/compiler/rustc_span/src/lib.rs
diff options
context:
space:
mode:
authorWANG Rui <wangrui@loongson.cn>2025-08-28 23:31:46 +0800
committerWANG Rui <wangrui@loongson.cn>2025-09-28 09:35:07 +0800
commitc1259aa26fead9a9d365c4436d5ceb00cad88bbe (patch)
tree8b1d53333880092a896056386af7d5e148be439b /compiler/rustc_span/src/lib.rs
parent4082d6a3f0347c2fc4b8c8d5a6a38ed7248fa161 (diff)
downloadrust-c1259aa26fead9a9d365c4436d5ceb00cad88bbe.tar.gz
rust-c1259aa26fead9a9d365c4436d5ceb00cad88bbe.zip
Add LSX accelerated implementation for source file analysis
This patch introduces an LSX-optimized version of `analyze_source_file`
for the `loongarch64` target. Similar to existing SSE2 implementation
for x86, this version:

- Processes 16-byte chunks at a time using LSX vector intrinsics.
- Quickly identifies newlines in ASCII-only chunks.
- Falls back to the generic implementation when multi-byte UTF-8
  characters are detected or in the tail portion.
Diffstat (limited to 'compiler/rustc_span/src/lib.rs')
-rw-r--r--compiler/rustc_span/src/lib.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_span/src/lib.rs b/compiler/rustc_span/src/lib.rs
index 35dbbe58db9..ededbea57e9 100644
--- a/compiler/rustc_span/src/lib.rs
+++ b/compiler/rustc_span/src/lib.rs
@@ -17,6 +17,7 @@
 
 // tidy-alphabetical-start
 #![allow(internal_features)]
+#![cfg_attr(target_arch = "loongarch64", feature(stdarch_loongarch))]
 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
 #![doc(rust_logo)]
 #![feature(array_windows)]