Skip to content

replace some #[rustc_intrinsic] usage with use of the libcore declarations #139915

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions tests/codegen/intrinsic-no-unnamed-attr.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
//@ compile-flags: -C no-prepopulate-passes

#![feature(intrinsics)]
#![feature(core_intrinsics)]

#[rustc_intrinsic]
unsafe fn sqrtf32(x: f32) -> f32;
use std::intrinsics::sqrtf32;

// CHECK: @llvm.sqrt.f32(float) #{{[0-9]*}}

Expand Down
51 changes: 2 additions & 49 deletions tests/ui/intrinsics/intrinsic-atomics.rs
Original file line number Diff line number Diff line change
@@ -1,53 +1,6 @@
//@ run-pass
#![feature(intrinsics)]

mod rusti {

#[rustc_intrinsic]
pub unsafe fn atomic_cxchg_seqcst_seqcst<T>(dst: *mut T, old: T, src: T) -> (T, bool);
#[rustc_intrinsic]
pub unsafe fn atomic_cxchg_acquire_acquire<T>(dst: *mut T, old: T, src: T) -> (T, bool);
#[rustc_intrinsic]
pub unsafe fn atomic_cxchg_release_relaxed<T>(dst: *mut T, old: T, src: T) -> (T, bool);

#[rustc_intrinsic]
pub unsafe fn atomic_cxchgweak_seqcst_seqcst<T>(dst: *mut T, old: T, src: T) -> (T, bool);
#[rustc_intrinsic]
pub unsafe fn atomic_cxchgweak_acquire_acquire<T>(dst: *mut T, old: T, src: T) -> (T, bool);
#[rustc_intrinsic]
pub unsafe fn atomic_cxchgweak_release_relaxed<T>(dst: *mut T, old: T, src: T) -> (T, bool);

#[rustc_intrinsic]
pub unsafe fn atomic_load_seqcst<T>(src: *const T) -> T;
#[rustc_intrinsic]
pub unsafe fn atomic_load_acquire<T>(src: *const T) -> T;

#[rustc_intrinsic]
pub unsafe fn atomic_store_seqcst<T>(dst: *mut T, val: T);
#[rustc_intrinsic]
pub unsafe fn atomic_store_release<T>(dst: *mut T, val: T);

#[rustc_intrinsic]
pub unsafe fn atomic_xchg_seqcst<T>(dst: *mut T, src: T) -> T;
#[rustc_intrinsic]
pub unsafe fn atomic_xchg_acquire<T>(dst: *mut T, src: T) -> T;
#[rustc_intrinsic]
pub unsafe fn atomic_xchg_release<T>(dst: *mut T, src: T) -> T;

#[rustc_intrinsic]
pub unsafe fn atomic_xadd_seqcst<T>(dst: *mut T, src: T) -> T;
#[rustc_intrinsic]
pub unsafe fn atomic_xadd_acquire<T>(dst: *mut T, src: T) -> T;
#[rustc_intrinsic]
pub unsafe fn atomic_xadd_release<T>(dst: *mut T, src: T) -> T;

#[rustc_intrinsic]
pub unsafe fn atomic_xsub_seqcst<T>(dst: *mut T, src: T) -> T;
#[rustc_intrinsic]
pub unsafe fn atomic_xsub_acquire<T>(dst: *mut T, src: T) -> T;
#[rustc_intrinsic]
pub unsafe fn atomic_xsub_release<T>(dst: *mut T, src: T) -> T;
}
#![feature(core_intrinsics)]
use std::intrinsics as rusti;

pub fn main() {
unsafe {
Expand Down
Loading