Skip to content

Commit 59cdd4c

Browse files
author
Fedor Ryabinin
committed
Undo changes to stdarch
1 parent 3b7aa7b commit 59cdd4c

2 files changed

Lines changed: 0 additions & 78 deletions

File tree

library/stdarch/crates/core_arch/src/x86/sse3.rs

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
//! Streaming SIMD Extensions 3 (SSE3)
22
3-
#![feature(ub_checks)]
4-
use safety::{ensures,requires};
5-
#[cfg(kani)]
6-
#[unstable(feature="kani", issue="none")]
7-
use core::kani;
8-
#[allow(unused_imports)]
9-
#[unstable(feature = "ub_checks", issue = "none")]
10-
use core::ub_checks::*;
11-
123
use crate::core_arch::{simd::*, x86::*};
134
use crate::intrinsics::simd::*;
145

@@ -108,7 +99,6 @@ pub fn _mm_hsub_ps(a: __m128, b: __m128) -> __m128 {
10899
#[target_feature(enable = "sse3")]
109100
#[cfg_attr(test, assert_instr(lddqu))]
110101
#[stable(feature = "simd_x86", since = "1.27.0")]
111-
#[requires(can_dereference(mem_addr))]
112102
pub unsafe fn _mm_lddqu_si128(mem_addr: *const __m128i) -> __m128i {
113103
transmute(lddqu(mem_addr as *const _))
114104
}
@@ -270,37 +260,3 @@ mod tests {
270260
assert_eq_m128d(r, _mm_setr_pd(d, d));
271261
}
272262
}
273-
#[cfg(kani)]
274-
mod verify {
275-
use super::*;
276-
277-
#[cfg(kani)]
278-
#[kani::proof_for_contract(unsafe fn _mm_lddqu_si128(mem_addr: *const __m128i) -> __m128i)]
279-
fn proof_mm_lddqu_si128() {
280-
// Create a valid __m128i value
281-
let mut value = [0i32; 4];
282-
283-
// Get a pointer to the value
284-
let ptr: *const __m128i = value.as_ptr() as *const __m128i;
285-
286-
// Call the function with the valid pointer
287-
unsafe {
288-
let _result = _mm_lddqu_si128(ptr);
289-
}
290-
}
291-
292-
#[cfg(kani)]
293-
#[kani::proof_for_contract(unsafe fn _mm_loadddup_pd(mem_addr: *const f64) -> __m128d)]
294-
fn proof_mm_loadddup_pd() {
295-
// Create a valid f64 value
296-
let value: f64 = 0.0;
297-
298-
// Get a pointer to the value
299-
let ptr: *const f64 = &value;
300-
301-
// Call the function with the valid pointer
302-
unsafe {
303-
let _result = _mm_loadddup_pd(ptr);
304-
}
305-
}
306-
}

library/stdarch/crates/core_arch/src/x86/sse41.rs

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
//! Streaming SIMD Extensions 4.1 (SSE4.1)
22
3-
#![feature(ub_checks)]
4-
use safety::{ensures,requires};
5-
#[cfg(kani)]
6-
#[unstable(feature="kani", issue="none")]
7-
use core::kani;
8-
#[allow(unused_imports)]
9-
#[unstable(feature = "ub_checks", issue = "none")]
10-
use core::ub_checks::*;
11-
123
use crate::core_arch::{simd::*, x86::*};
134
use crate::intrinsics::simd::*;
145

@@ -1141,8 +1132,6 @@ pub fn _mm_test_mix_ones_zeros(a: __m128i, mask: __m128i) -> i32 {
11411132
#[target_feature(enable = "sse4.1")]
11421133
#[cfg_attr(test, assert_instr(movntdqa))]
11431134
#[stable(feature = "simd_x86_updates", since = "1.82.0")]
1144-
#[requires(can_dereference(mem_addr))]
1145-
#[requires(mem_addr as usize % 16 == 0)]
11461135
pub unsafe fn _mm_stream_load_si128(mem_addr: *const __m128i) -> __m128i {
11471136
let dst: __m128i;
11481137
crate::arch::asm!(
@@ -1950,26 +1939,3 @@ mod tests {
19501939
assert_eq_m128i(a, r);
19511940
}
19521941
}
1953-
#[cfg(kani)]
1954-
mod verify {
1955-
use super::*;
1956-
#[cfg(kani)]
1957-
#[repr(align(16))]
1958-
struct Aligned16Bytes {
1959-
data: [u8; 16],
1960-
}
1961-
1962-
#[cfg(kani)]
1963-
#[kani::proof_for_contract(_mm_stream_load_si128)]
1964-
fn verify_mm_stream_load_si128() {
1965-
// Allocate memory for __m128i (16 bytes) with proper alignment
1966-
let mut aligned_data = Aligned16Bytes { data: [0u8; 16] };
1967-
let ptr = &aligned_data.data as *const _ as *const __m128i;
1968-
1969-
// Call the function with our properly aligned pointer
1970-
unsafe {
1971-
let _result = _mm_stream_load_si128(ptr);
1972-
// No postconditions to verify
1973-
}
1974-
}
1975-
}

0 commit comments

Comments
 (0)