Skip to content

Commit 8f3f70c

Browse files
committed
Update stdarch
1 parent 96cfc75 commit 8f3f70c

File tree

5 files changed

+15
-9
lines changed

5 files changed

+15
-9
lines changed

compiler/rustc_span/src/analyze_source_file.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,17 @@ cfg_match! {
8383

8484
// For character in the chunk, see if its byte value is < 0, which
8585
// indicates that it's part of a UTF-8 char.
86-
let multibyte_test = unsafe { _mm_cmplt_epi8(chunk, _mm_set1_epi8(0)) };
86+
let multibyte_test = _mm_cmplt_epi8(chunk, _mm_set1_epi8(0));
8787
// Create a bit mask from the comparison results.
88-
let multibyte_mask = unsafe { _mm_movemask_epi8(multibyte_test) };
88+
let multibyte_mask = _mm_movemask_epi8(multibyte_test);
8989

9090
// If the bit mask is all zero, we only have ASCII chars here:
9191
if multibyte_mask == 0 {
9292
assert!(intra_chunk_offset == 0);
9393

9494
// Check for newlines in the chunk
95-
let newlines_test = unsafe { _mm_cmpeq_epi8(chunk, _mm_set1_epi8(b'\n' as i8)) };
96-
let mut newlines_mask = unsafe { _mm_movemask_epi8(newlines_test) };
95+
let newlines_test = _mm_cmpeq_epi8(chunk, _mm_set1_epi8(b'\n' as i8));
96+
let mut newlines_mask = _mm_movemask_epi8(newlines_test);
9797

9898
let output_offset = RelativeBytePos::from_usize(chunk_index * CHUNK_SIZE + 1);
9999

library/core/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ check-cfg = [
3232
'cfg(bootstrap)',
3333
'cfg(no_fp_fmt_parse)',
3434
'cfg(stdarch_intel_sde)',
35+
# #[cfg(bootstrap)]
36+
'cfg(target_feature, values("vector-enhancements-1"))',
3537
# core use #[path] imports to portable-simd `core_simd` crate
3638
# and to stdarch `core_arch` crate which messes-up with Cargo list
3739
# of declared features, we therefor expect any feature cfg

library/core/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,13 @@
205205
#![feature(arm_target_feature)]
206206
#![feature(avx512_target_feature)]
207207
#![feature(hexagon_target_feature)]
208+
#![feature(keylocker_x86)]
208209
#![feature(loongarch_target_feature)]
209210
#![feature(mips_target_feature)]
210211
#![feature(powerpc_target_feature)]
211212
#![feature(riscv_target_feature)]
212213
#![feature(rtm_target_feature)]
214+
#![feature(s390x_target_feature)]
213215
#![feature(sha512_sm_x86)]
214216
#![feature(sse4a_target_feature)]
215217
#![feature(tbm_target_feature)]

library/stdarch

Submodule stdarch updated 190 files

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

+6-4
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,8 @@ fn analyze_source_file_dispatch(
257257
/// SSE2 intrinsics to quickly find all newlines.
258258
#[target_feature(enable = "sse2")]
259259
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
260+
// This can be removed once 1.87 is stable due to some intrinsics switching to safe.
261+
#[allow(unsafe_op_in_unsafe_fn)]
260262
unsafe fn analyze_source_file_sse2(
261263
src: &str,
262264
lines: &mut Vec<TextSize>,
@@ -287,17 +289,17 @@ unsafe fn analyze_source_file_sse2(
287289

288290
// For character in the chunk, see if its byte value is < 0, which
289291
// indicates that it's part of a UTF-8 char.
290-
let multibyte_test = unsafe { _mm_cmplt_epi8(chunk, _mm_set1_epi8(0)) };
292+
let multibyte_test = _mm_cmplt_epi8(chunk, _mm_set1_epi8(0));
291293
// Create a bit mask from the comparison results.
292-
let multibyte_mask = unsafe { _mm_movemask_epi8(multibyte_test) };
294+
let multibyte_mask = _mm_movemask_epi8(multibyte_test);
293295

294296
// If the bit mask is all zero, we only have ASCII chars here:
295297
if multibyte_mask == 0 {
296298
assert!(intra_chunk_offset == 0);
297299

298300
// Check for newlines in the chunk
299-
let newlines_test = unsafe { _mm_cmpeq_epi8(chunk, _mm_set1_epi8(b'\n' as i8)) };
300-
let newlines_mask = unsafe { _mm_movemask_epi8(newlines_test) };
301+
let newlines_test = _mm_cmpeq_epi8(chunk, _mm_set1_epi8(b'\n' as i8));
302+
let newlines_mask = _mm_movemask_epi8(newlines_test);
301303

302304
if newlines_mask != 0 {
303305
// All control characters are newlines, record them

0 commit comments

Comments
 (0)