Skip to content

Commit 0a24694

Browse files
committed
Add comments in NT asm blocks for future reference
1 parent 45a8896 commit 0a24694

File tree

6 files changed

+13
-0
lines changed

6 files changed

+13
-0
lines changed

crates/core_arch/src/x86/avx.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1833,6 +1833,7 @@ pub unsafe fn _mm256_lddqu_si256(mem_addr: *const __m256i) -> __m256i {
18331833
#[cfg_attr(test, assert_instr(vmovntdq))]
18341834
#[stable(feature = "simd_x86", since = "1.27.0")]
18351835
pub unsafe fn _mm256_stream_si256(mem_addr: *mut __m256i, a: __m256i) {
1836+
// see #1541, we should use inline asm to be sure, because LangRef isn't clear enough
18361837
crate::arch::asm!(
18371838
vps!("vmovntdq", ",{a}"),
18381839
p = in(reg) mem_addr,
@@ -1861,6 +1862,7 @@ pub unsafe fn _mm256_stream_si256(mem_addr: *mut __m256i, a: __m256i) {
18611862
#[stable(feature = "simd_x86", since = "1.27.0")]
18621863
#[allow(clippy::cast_ptr_alignment)]
18631864
pub unsafe fn _mm256_stream_pd(mem_addr: *mut f64, a: __m256d) {
1865+
// see #1541, we should use inline asm to be sure, because LangRef isn't clear enough
18641866
crate::arch::asm!(
18651867
vps!("vmovntpd", ",{a}"),
18661868
p = in(reg) mem_addr,
@@ -1890,6 +1892,7 @@ pub unsafe fn _mm256_stream_pd(mem_addr: *mut f64, a: __m256d) {
18901892
#[stable(feature = "simd_x86", since = "1.27.0")]
18911893
#[allow(clippy::cast_ptr_alignment)]
18921894
pub unsafe fn _mm256_stream_ps(mem_addr: *mut f32, a: __m256) {
1895+
// see #1541, we should use inline asm to be sure, because LangRef isn't clear enough
18931896
crate::arch::asm!(
18941897
vps!("vmovntps", ",{a}"),
18951898
p = in(reg) mem_addr,

crates/core_arch/src/x86/avx512f.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29593,6 +29593,7 @@ pub fn _mm_mask_testn_epi64_mask(k: __mmask8, a: __m128i, b: __m128i) -> __mmask
2959329593
#[cfg_attr(test, assert_instr(vmovntps))]
2959429594
#[allow(clippy::cast_ptr_alignment)]
2959529595
pub unsafe fn _mm512_stream_ps(mem_addr: *mut f32, a: __m512) {
29596+
// see #1541, we should use inline asm to be sure, because LangRef isn't clear enough
2959629597
crate::arch::asm!(
2959729598
vps!("vmovntps", ",{a}"),
2959829599
p = in(reg) mem_addr,
@@ -29619,6 +29620,7 @@ pub unsafe fn _mm512_stream_ps(mem_addr: *mut f32, a: __m512) {
2961929620
#[cfg_attr(test, assert_instr(vmovntpd))]
2962029621
#[allow(clippy::cast_ptr_alignment)]
2962129622
pub unsafe fn _mm512_stream_pd(mem_addr: *mut f64, a: __m512d) {
29623+
// see #1541, we should use inline asm to be sure, because LangRef isn't clear enough
2962229624
crate::arch::asm!(
2962329625
vps!("vmovntpd", ",{a}"),
2962429626
p = in(reg) mem_addr,
@@ -29645,6 +29647,7 @@ pub unsafe fn _mm512_stream_pd(mem_addr: *mut f64, a: __m512d) {
2964529647
#[cfg_attr(test, assert_instr(vmovntdq))]
2964629648
#[allow(clippy::cast_ptr_alignment)]
2964729649
pub unsafe fn _mm512_stream_si512(mem_addr: *mut __m512i, a: __m512i) {
29650+
// see #1541, we should use inline asm to be sure, because LangRef isn't clear enough
2964829651
crate::arch::asm!(
2964929652
vps!("vmovntdq", ",{a}"),
2965029653
p = in(reg) mem_addr,

crates/core_arch/src/x86/sse.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2022,6 +2022,7 @@ unsafe extern "C" {
20222022
#[stable(feature = "simd_x86", since = "1.27.0")]
20232023
#[allow(clippy::cast_ptr_alignment)]
20242024
pub unsafe fn _mm_stream_ps(mem_addr: *mut f32, a: __m128) {
2025+
// see #1541, we should use inline asm to be sure, because LangRef isn't clear enough
20252026
crate::arch::asm!(
20262027
vps!("movntps", ",{a}"),
20272028
p = in(reg) mem_addr,

crates/core_arch/src/x86/sse2.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,6 +1363,7 @@ pub unsafe fn _mm_storel_epi64(mem_addr: *mut __m128i, a: __m128i) {
13631363
#[cfg_attr(test, assert_instr(movntdq))]
13641364
#[stable(feature = "simd_x86", since = "1.27.0")]
13651365
pub unsafe fn _mm_stream_si128(mem_addr: *mut __m128i, a: __m128i) {
1366+
// see #1541, we should use inline asm to be sure, because LangRef isn't clear enough
13661367
crate::arch::asm!(
13671368
vps!("movntdq", ",{a}"),
13681369
p = in(reg) mem_addr,
@@ -1390,6 +1391,7 @@ pub unsafe fn _mm_stream_si128(mem_addr: *mut __m128i, a: __m128i) {
13901391
#[cfg_attr(test, assert_instr(movnti))]
13911392
#[stable(feature = "simd_x86", since = "1.27.0")]
13921393
pub unsafe fn _mm_stream_si32(mem_addr: *mut i32, a: i32) {
1394+
// see #1541, we should use inline asm to be sure, because LangRef isn't clear enough
13931395
crate::arch::asm!(
13941396
vps!("movnti", ",{a:e}"), // `:e` for 32bit value
13951397
p = in(reg) mem_addr,
@@ -2627,6 +2629,7 @@ pub unsafe fn _mm_loadl_pd(a: __m128d, mem_addr: *const f64) -> __m128d {
26272629
#[stable(feature = "simd_x86", since = "1.27.0")]
26282630
#[allow(clippy::cast_ptr_alignment)]
26292631
pub unsafe fn _mm_stream_pd(mem_addr: *mut f64, a: __m128d) {
2632+
// see #1541, we should use inline asm to be sure, because LangRef isn't clear enough
26302633
crate::arch::asm!(
26312634
vps!("movntpd", ",{a}"),
26322635
p = in(reg) mem_addr,

crates/core_arch/src/x86/sse4a.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ pub fn _mm_inserti_si64<const LEN: i32, const IDX: i32>(x: __m128i, y: __m128i)
110110
#[cfg_attr(test, assert_instr(movntsd))]
111111
#[stable(feature = "simd_x86", since = "1.27.0")]
112112
pub unsafe fn _mm_stream_sd(p: *mut f64, a: __m128d) {
113+
// see #1541, we should use inline asm to be sure, because LangRef isn't clear enough
113114
crate::arch::asm!(
114115
vps!("movntsd", ",{a}"),
115116
p = in(reg) p,
@@ -135,6 +136,7 @@ pub unsafe fn _mm_stream_sd(p: *mut f64, a: __m128d) {
135136
#[cfg_attr(test, assert_instr(movntss))]
136137
#[stable(feature = "simd_x86", since = "1.27.0")]
137138
pub unsafe fn _mm_stream_ss(p: *mut f32, a: __m128) {
139+
// see #1541, we should use inline asm to be sure, because LangRef isn't clear enough
138140
crate::arch::asm!(
139141
vps!("movntss", ",{a}"),
140142
p = in(reg) p,

crates/core_arch/src/x86_64/sse2.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ pub fn _mm_cvttsd_si64x(a: __m128d) -> i64 {
7878
#[cfg_attr(test, assert_instr(movnti))]
7979
#[stable(feature = "simd_x86", since = "1.27.0")]
8080
pub unsafe fn _mm_stream_si64(mem_addr: *mut i64, a: i64) {
81+
// see #1541, we should use inline asm to be sure, because LangRef isn't clear enough
8182
crate::arch::asm!(
8283
vps!("movnti", ",{a}"),
8384
p = in(reg) mem_addr,

0 commit comments

Comments
 (0)