about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSayantan Chakraborty <142906350+sayantn@users.noreply.github.com>2025-07-24 14:54:05 +0000
committerGitHub <noreply@github.com>2025-07-24 14:54:05 +0000
commit14febfae1bc11abd01f146b8608449229d082b84 (patch)
tree37324dc6fa26214bf67e7430fbf77cc65e8c4412
parent0231fa9adfdc4c03d122087a4400a8199b97a369 (diff)
parentbe947d4d2ba7acc99010c5e41f5bb5e517bcfee1 (diff)
downloadrust-14febfae1bc11abd01f146b8608449229d082b84.tar.gz
rust-14febfae1bc11abd01f146b8608449229d082b84.zip
Merge pull request #1885 from 197g/maskmove-is-non-temporal
Add non-temporal note for maskmoveu_si128
-rw-r--r--library/stdarch/crates/core_arch/src/x86/sse2.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/library/stdarch/crates/core_arch/src/x86/sse2.rs b/library/stdarch/crates/core_arch/src/x86/sse2.rs
index 3dabcde18ce..1eaa89663b2 100644
--- a/library/stdarch/crates/core_arch/src/x86/sse2.rs
+++ b/library/stdarch/crates/core_arch/src/x86/sse2.rs
@@ -1272,7 +1272,7 @@ pub unsafe fn _mm_loadu_si128(mem_addr: *const __m128i) -> __m128i {
 }
 
 /// Conditionally store 8-bit integer elements from `a` into memory using
-/// `mask`.
+/// `mask` flagged as non-temporal (unlikely to be used again soon).
 ///
 /// Elements are not stored when the highest bit is not set in the
 /// corresponding element.
@@ -1281,6 +1281,15 @@ pub unsafe fn _mm_loadu_si128(mem_addr: *const __m128i) -> __m128i {
 /// to be aligned on any particular boundary.
 ///
 /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maskmoveu_si128)
+///
+/// # Safety of non-temporal stores
+///
+/// After using this intrinsic, but before any other access to the memory that this intrinsic
+/// mutates, a call to [`_mm_sfence`] must be performed by the thread that used the intrinsic. In
+/// particular, functions that call this intrinsic should generally call `_mm_sfence` before they
+/// return.
+///
+/// See [`_mm_sfence`] for details.
 #[inline]
 #[target_feature(enable = "sse2")]
 #[cfg_attr(test, assert_instr(maskmovdqu))]