Skip to content

Commit 206b5a4

Browse files
committed
Use unadjusted ABI and restore intra-doc links with crate::arch::x86
Switch the llvm.x86.clflushopt extern block from "C" to "unadjusted" to match the convention for LLVM intrinsics (movrs, kl, adx, rdrand) — the unadjusted ABI passes the signature 1:1 with no C-ABI adjustments. Restore the _mm_clflush/_mm_sfence/_mm_mfence intra-doc link definitions using crate::arch::x86 (not x86_64), which resolves on all targets and avoids the i686 rustdoc broken-intra-doc-links lint. The links are needed because this module has no glob import to bring them into scope.
1 parent 64df571 commit 206b5a4

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

crates/core_arch/src/x86/clflushopt.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use stdarch_test::assert_instr;
55

66
#[allow(improper_ctypes)]
7-
unsafe extern "C" {
7+
unsafe extern "unadjusted" {
88
#[link_name = "llvm.x86.clflushopt"]
99
fn clflushopt(p: *const u8);
1010
}
@@ -26,6 +26,10 @@ unsafe extern "C" {
2626
/// Unlike the prefetch intrinsics, `CLFLUSHOPT` is subject to all the
2727
/// permission checking and faults associated with a byte load, so `p` must
2828
/// point to a byte that is valid for reads.
29+
///
30+
/// [`_mm_clflush`]: crate::arch::x86::_mm_clflush
31+
/// [`_mm_sfence`]: crate::arch::x86::_mm_sfence
32+
/// [`_mm_mfence`]: crate::arch::x86::_mm_mfence
2933
#[inline]
3034
#[target_feature(enable = "clflushopt")]
3135
#[cfg_attr(test, assert_instr(clflushopt))]

0 commit comments

Comments
 (0)