Skip to content

Commit 70e049b

Browse files
committed
Fix stdarch-verify
1 parent e907456 commit 70e049b

File tree

3 files changed

+11
-15
lines changed

3 files changed

+11
-15
lines changed

crates/core_arch/src/x86/sse.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3030,7 +3030,7 @@ mod tests {
30303030
}
30313031

30323032
#[simd_test(enable = "sse")]
3033-
unsafe fn test_mm_shuffle() {
3033+
unsafe fn test_MM_SHUFFLE() {
30343034
assert_eq!(_MM_SHUFFLE(0, 1, 1, 3), 0b00_01_01_11);
30353035
assert_eq!(_MM_SHUFFLE(3, 1, 1, 0), 0b11_01_01_00);
30363036
assert_eq!(_MM_SHUFFLE(1, 2, 2, 1), 0b01_10_10_01);

crates/stdarch-verify/src/lib.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,7 @@ fn functions(input: TokenStream, dirs: &[&str]) -> TokenStream {
7070
}
7171
assert!(!tests.is_empty());
7272

73-
functions.retain(|(f, _)| {
74-
if let syn::Visibility::Public(_) = f.vis {
75-
if f.sig.unsafety.is_some() {
76-
return true;
77-
}
78-
}
79-
false
80-
});
73+
functions.retain(|(f, _)| matches!(f.vis, syn::Visibility::Public(_)));
8174
assert!(!functions.is_empty());
8275

8376
let input = proc_macro2::TokenStream::from(input);

crates/stdarch-verify/tests/x86-intel.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ fn verify_all_signatures() {
244244
"_fxrstor",
245245
"_fxrstor64",
246246
"_xend",
247+
"_xabort_code",
247248
// Aliases
248249
"_mm_comige_ss",
249250
"_mm_cvt_ss2si",
@@ -290,13 +291,10 @@ fn verify_all_signatures() {
290291
"__cpuid_count" |
291292
"__cpuid" |
292293
"__get_cpuid_max" |
294+
"_MM_SHUFFLE" |
295+
"_xabort_code" |
293296
// Not listed with intel, but manually verified
294-
"cmpxchg16b" |
295-
// Intel requires the mask argument for _mm_shuffle_ps to be an
296-
// unsigned integer, but all other _mm_shuffle_.. intrinsics
297-
// take a signed-integer. This breaks `_MM_SHUFFLE` for
298-
// `_mm_shuffle_ps`
299-
"_mm_shuffle_ps"
297+
"cmpxchg16b"
300298
=> continue,
301299
_ => {}
302300
}
@@ -871,6 +869,11 @@ fn equate(
871869
// The _mm_stream_load_si128 intrinsic take a mutable pointer in the intrinsics
872870
// guide even though they never write through the pointer
873871
(&Type::ConstPtr(&Type::M128I), "void*") if intrinsic.name == "_mm_stream_load_si128" => {}
872+
/// Intel requires the mask argument for _mm_shuffle_ps to be an
873+
// unsigned integer, but all other _mm_shuffle_.. intrinsics
874+
// take a signed-integer. This breaks `_MM_SHUFFLE` for
875+
// `_mm_shuffle_ps`
876+
(&Type::PrimSigned(32), "unsigned int") if intrinsic.name == "_mm_shuffle_ps" => {}
874877

875878
_ => bail!(
876879
"failed to equate: `{intel}` and {t:?} for {}",

0 commit comments

Comments
 (0)