Skip to content

Commit

Permalink
Rollup merge of rust-lang#124003 - WaffleLapkin:dellvmization, r=scot…
Browse files Browse the repository at this point in the history
…tmcm,RalfJung,antoyo

Dellvmize some intrinsics (use `u32` instead of `Self` in some integer intrinsics)

This implements rust-lang/compiler-team#693 minus what was implemented in rust-lang#123226.

Note: I decided to _not_ change `shl`/... builder methods, as it just doesn't seem worth it.

r? ``@scottmcm``
  • Loading branch information
matthiaskrgr authored Apr 23, 2024
2 parents 224285d + dd50f45 commit 79d217f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions example/example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,10 @@ fn array_as_slice(arr: &[u8; 3]) -> &[u8] {
arr
}

unsafe fn use_ctlz_nonzero(a: u16) -> u16 {
intrinsics::ctlz_nonzero(a)
}
// FIXME: fix the intrinsic implementation to work with the new ->u32 signature
// unsafe fn use_ctlz_nonzero(a: u16) -> u32 {
// intrinsics::ctlz_nonzero(a)
// }

fn ptr_as_usize(ptr: *const u8) -> usize {
ptr as usize
Expand Down
2 changes: 1 addition & 1 deletion example/mini_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ pub mod intrinsics {
pub fn min_align_of_val<T: ?Sized>(val: *const T) -> usize;
pub fn copy<T>(src: *const T, dst: *mut T, count: usize);
pub fn transmute<T, U>(e: T) -> U;
pub fn ctlz_nonzero<T>(x: T) -> T;
pub fn ctlz_nonzero<T>(x: T) -> u32;
#[rustc_safe_intrinsic]
pub fn needs_drop<T: ?Sized>() -> bool;
#[rustc_safe_intrinsic]
Expand Down

0 comments on commit 79d217f

Please sign in to comment.