Attempt to use `intrinsics!`
This commit is contained in:
parent
2e8b85439f
commit
9a68e74ebd
|
@ -301,14 +301,16 @@ macro_rules! impl_wide_int {
|
|||
impl_wide_int!(u32, u64, 32);
|
||||
impl_wide_int!(u64, u128, 64);
|
||||
|
||||
#[no_mangle]
|
||||
intrinsics! {
|
||||
#[cfg(any(
|
||||
target_pointer_width = "16",
|
||||
target_pointer_width = "32",
|
||||
target_pointer_width = "64"
|
||||
))]
|
||||
pub extern "C" fn __clzsi2(mut x: usize) -> usize {
|
||||
pub extern "C" fn __clzsi2(x: usize) -> usize {
|
||||
// TODO: const this? Would require const-if
|
||||
// Note(Lokathor): the `intrinsics!` macro can't process mut inputs
|
||||
let mut x = x;
|
||||
let mut y: usize;
|
||||
let mut n: usize = {
|
||||
#[cfg(target_pointer_width = "64")]
|
||||
|
@ -362,3 +364,4 @@ pub extern "C" fn __clzsi2(mut x: usize) -> usize {
|
|||
n - x
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue