Skip to content

Commit

Permalink
Fix _mm_stream_si64
Browse files Browse the repository at this point in the history
  • Loading branch information
sayantn committed Aug 3, 2024
1 parent 7c6e063 commit e140da6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
13 changes: 13 additions & 0 deletions crates/core_arch/src/x86_64/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,16 @@ macro_rules! static_assert_sae {
static_assert!($imm == 4 || $imm == 8, "Invalid IMM value")
};
}

#[cfg(target_pointer_width = "32")]
macro_rules! vps {
($inst1:expr, $inst2:expr) => {
concat!($inst1, " [{p:e}]", $inst2)
};
}
#[cfg(target_pointer_width = "64")]
macro_rules! vps {
($inst1:expr, $inst2:expr) => {
concat!($inst1, " [{p}]", $inst2)
};
}
4 changes: 2 additions & 2 deletions crates/core_arch/src/x86_64/sse2.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! `x86_64`'s Streaming SIMD Extensions 2 (SSE2)

use crate::{core_arch::x86::*, intrinsics::simd::*};
use crate::{core_arch::x86_64::*, intrinsics::simd::*};

#[cfg(test)]
use stdarch_test::assert_instr;
Expand Down Expand Up @@ -79,7 +79,7 @@ pub unsafe fn _mm_cvttsd_si64x(a: __m128d) -> i64 {
#[stable(feature = "simd_x86", since = "1.27.0")]
pub unsafe fn _mm_stream_si64(mem_addr: *mut i64, a: i64) {
crate::arch::asm!(
"movnti [{p}], {a}",
vps!("movnti", ",{a}"),
p = in(reg) mem_addr,
a = in(reg) a,
options(nostack, preserves_flags),
Expand Down

0 comments on commit e140da6

Please sign in to comment.