Skip to content

Commit ef5216c

Browse files
committed
Auto merge of rust-lang#137033 - usamoi:test-safe-x86-intrinsics, r=<try>
[DO NOT MERGE] test safe x86 intrinsics This draft pull request is only used for a crater run, to check for any breakage caused by rust-lang/stdarch#1714 in the ecosystem. cc `@Amanieu`
2 parents d8810e3 + 6ba649a commit ef5216c

File tree

5 files changed

+17
-14
lines changed

5 files changed

+17
-14
lines changed

Diff for: .gitmodules

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
shallow = true
2121
[submodule "library/stdarch"]
2222
path = library/stdarch
23-
url = https://github.com/rust-lang/stdarch.git
23+
url = https://github.com/usamoi/stdarch.git
2424
shallow = true
2525
[submodule "src/doc/edition-guide"]
2626
path = src/doc/edition-guide

Diff for: compiler/rustc_span/src/analyze_source_file.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,17 @@ cfg_match! {
8787

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

9494
// If the bit mask is all zero, we only have ASCII chars here:
9595
if multibyte_mask == 0 {
9696
assert!(intra_chunk_offset == 0);
9797

9898
// Check for newlines in the chunk
99-
let newlines_test = unsafe { _mm_cmpeq_epi8(chunk, _mm_set1_epi8(b'\n' as i8)) };
100-
let mut newlines_mask = unsafe { _mm_movemask_epi8(newlines_test) };
99+
let newlines_test = _mm_cmpeq_epi8(chunk, _mm_set1_epi8(b'\n' as i8));
100+
let mut newlines_mask = _mm_movemask_epi8(newlines_test);
101101

102102
let output_offset = RelativeBytePos::from_usize(chunk_index * CHUNK_SIZE + 1);
103103

@@ -212,17 +212,17 @@ cfg_match! {
212212

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

219219
// If the bit mask is all zero, we only have ASCII chars here:
220220
if multibyte_mask == 0 {
221221
assert!(intra_chunk_offset == 0);
222222

223223
// Check for newlines in the chunk
224-
let newlines_test = unsafe { _mm_cmpeq_epi8(chunk, _mm_set1_epi8(b'\n' as i8)) };
225-
let mut newlines_mask = unsafe { _mm_movemask_epi8(newlines_test) };
224+
let newlines_test = _mm_cmpeq_epi8(chunk, _mm_set1_epi8(b'\n' as i8));
225+
let mut newlines_mask = _mm_movemask_epi8(newlines_test);
226226

227227
let output_offset = RelativeBytePos::from_usize(chunk_index * CHUNK_SIZE + 1);
228228

Diff for: library/core/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -210,12 +210,15 @@
210210
#![feature(powerpc_target_feature)]
211211
#![feature(riscv_target_feature)]
212212
#![feature(rtm_target_feature)]
213+
#![feature(s390x_target_feature)]
213214
#![feature(sha512_sm_x86)]
214215
#![feature(sse4a_target_feature)]
215216
#![feature(tbm_target_feature)]
216217
#![feature(wasm_target_feature)]
217218
#![feature(x86_amx_intrinsics)]
218219
// tidy-alphabetical-end
220+
#![allow(stable_features)]
221+
#![feature(target_feature_11)]
219222

220223
// allow using `core::` in intra-doc links
221224
#[allow(unused_extern_crates)]

Diff for: library/stdarch

Submodule stdarch updated 167 files

Diff for: src/tools/rust-analyzer/lib/line-index/src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -287,17 +287,17 @@ unsafe fn analyze_source_file_sse2(
287287

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

294294
// If the bit mask is all zero, we only have ASCII chars here:
295295
if multibyte_mask == 0 {
296296
assert!(intra_chunk_offset == 0);
297297

298298
// 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) };
299+
let newlines_test = _mm_cmpeq_epi8(chunk, _mm_set1_epi8(b'\n' as i8));
300+
let newlines_mask = _mm_movemask_epi8(newlines_test);
301301

302302
if newlines_mask != 0 {
303303
// All control characters are newlines, record them

0 commit comments

Comments
 (0)