Add #[cfg_attr(miri, ignore)] to SSE and SSE2 that cannot be supported by Miri

This commit is contained in:
Eduardo Sánchez Muñoz 2023-09-29 17:42:43 +02:00 committed by Amanieu d'Antras
parent 41dc4aad89
commit 95d83fd436
3 changed files with 28 additions and 0 deletions

View file

@ -2848,6 +2848,7 @@ mod tests {
#[allow(deprecated)] // FIXME: This test uses deprecated CSR access functions
#[simd_test(enable = "sse")]
#[cfg_attr(miri, ignore)] // Uses _mm_setcsr, which is not supported by Miri
unsafe fn test_mm_comieq_ss_vs_ucomieq_ss() {
// If one of the arguments is a quiet NaN `comieq_ss` should signal an
// Invalid Operation Exception while `ucomieq_ss` should not.
@ -3267,12 +3268,15 @@ mod tests {
}
#[simd_test(enable = "sse")]
// Miri cannot support this until it is clear how it fits in the Rust memory model
#[cfg_attr(miri, ignore)]
unsafe fn test_mm_sfence() {
_mm_sfence();
}
#[allow(deprecated)] // FIXME: This tests functions that are immediate UB
#[simd_test(enable = "sse")]
#[cfg_attr(miri, ignore)] // Miri does not support accesing the CSR
unsafe fn test_mm_getcsr_setcsr_1() {
let saved_csr = _mm_getcsr();
@ -3290,6 +3294,7 @@ mod tests {
#[allow(deprecated)] // FIXME: This tests functions that are immediate UB
#[simd_test(enable = "sse")]
#[cfg_attr(miri, ignore)] // Miri does not support accesing the CSR
unsafe fn test_mm_getcsr_setcsr_2() {
// Same as _mm_setcsr_1 test, but with opposite flag value.
@ -3309,6 +3314,7 @@ mod tests {
#[allow(deprecated)] // FIXME: This tests functions that are immediate UB
#[simd_test(enable = "sse")]
#[cfg_attr(miri, ignore)] // Miri does not support accesing the CSR
unsafe fn test_mm_getcsr_setcsr_underflow() {
_MM_SET_EXCEPTION_STATE(0);
@ -3347,6 +3353,9 @@ mod tests {
}
#[simd_test(enable = "sse")]
// Miri cannot support this until it is clear how it fits in the Rust memory model
// (non-temporal store)
#[cfg_attr(miri, ignore)]
unsafe fn test_mm_stream_ps() {
let a = _mm_set1_ps(7.0);
let mut mem = Memory { data: [-1.0; 4] };

View file

@ -2956,11 +2956,15 @@ mod tests {
}
#[simd_test(enable = "sse2")]
// Miri cannot support this until it is clear how it fits in the Rust memory model
#[cfg_attr(miri, ignore)]
unsafe fn test_mm_lfence() {
_mm_lfence();
}
#[simd_test(enable = "sse2")]
// Miri cannot support this until it is clear how it fits in the Rust memory model
#[cfg_attr(miri, ignore)]
unsafe fn test_mm_mfence() {
_mm_mfence();
}
@ -3828,6 +3832,9 @@ mod tests {
}
#[simd_test(enable = "sse2")]
// Miri cannot support this until it is clear how it fits in the Rust memory model
// (non-temporal store)
#[cfg_attr(miri, ignore)]
unsafe fn test_mm_maskmoveu_si128() {
let a = _mm_set1_epi8(9);
#[rustfmt::skip]
@ -3866,6 +3873,9 @@ mod tests {
}
#[simd_test(enable = "sse2")]
// Miri cannot support this until it is clear how it fits in the Rust memory model
// (non-temporal store)
#[cfg_attr(miri, ignore)]
unsafe fn test_mm_stream_si128() {
let a = _mm_setr_epi32(1, 2, 3, 4);
let mut r = _mm_undefined_si128();
@ -3874,6 +3884,9 @@ mod tests {
}
#[simd_test(enable = "sse2")]
// Miri cannot support this until it is clear how it fits in the Rust memory model
// (non-temporal store)
#[cfg_attr(miri, ignore)]
unsafe fn test_mm_stream_si32() {
let a: i32 = 7;
let mut mem = boxed::Box::<i32>::new(-1);
@ -4562,6 +4575,9 @@ mod tests {
}
#[simd_test(enable = "sse2")]
// Miri cannot support this until it is clear how it fits in the Rust memory model
// (non-temporal store)
#[cfg_attr(miri, ignore)]
unsafe fn test_mm_stream_pd() {
#[repr(align(128))]
struct Memory {

View file

@ -181,6 +181,9 @@ mod tests {
}
#[simd_test(enable = "sse2")]
// Miri cannot support this until it is clear how it fits in the Rust memory model
// (non-temporal store)
#[cfg_attr(miri, ignore)]
unsafe fn test_mm_stream_si64() {
let a: i64 = 7;
let mut mem = boxed::Box::<i64>::new(-1);