diff --git a/src/int/add.rs b/src/int/add.rs index 4253b64..b0f7ab6 100644 --- a/src/int/add.rs +++ b/src/int/add.rs @@ -46,25 +46,21 @@ impl Addo for i128 {} impl Addo for u128 {} #[cfg_attr(not(stage0), lang = "i128_add")] -#[allow(dead_code)] -fn rust_i128_add(a: i128, b: i128) -> i128 { +pub fn rust_i128_add(a: i128, b: i128) -> i128 { rust_u128_add(a as _, b as _) as _ } #[cfg_attr(not(stage0), lang = "i128_addo")] -#[allow(dead_code)] -fn rust_i128_addo(a: i128, b: i128) -> (i128, bool) { +pub fn rust_i128_addo(a: i128, b: i128) -> (i128, bool) { let mut oflow = 0; let r = a.addo(b, &mut oflow); (r, oflow != 0) } #[cfg_attr(not(stage0), lang = "u128_add")] -#[allow(dead_code)] -fn rust_u128_add(a: u128, b: u128) -> u128 { +pub fn rust_u128_add(a: u128, b: u128) -> u128 { a.add(b) } #[cfg_attr(not(stage0), lang = "u128_addo")] -#[allow(dead_code)] -fn rust_u128_addo(a: u128, b: u128) -> (u128, bool) { +pub fn rust_u128_addo(a: u128, b: u128) -> (u128, bool) { let mut oflow = 0; let r = a.addo(b, &mut oflow); (r, oflow != 0) diff --git a/src/int/mul.rs b/src/int/mul.rs index 9d45fa5..61c379c 100644 --- a/src/int/mul.rs +++ b/src/int/mul.rs @@ -109,25 +109,21 @@ intrinsics! { } #[cfg_attr(not(stage0), lang = "i128_mul")] -#[allow(dead_code)] -fn rust_i128_mul(a: i128, b: i128) -> i128 { +pub fn rust_i128_mul(a: i128, b: i128) -> i128 { __multi3(a, b) } #[cfg_attr(not(stage0), lang = "i128_mulo")] -#[allow(dead_code)] -fn rust_i128_mulo(a: i128, b: i128) -> (i128, bool) { +pub fn rust_i128_mulo(a: i128, b: i128) -> (i128, bool) { let mut oflow = 0; let r = __muloti4(a, b, &mut oflow); (r, oflow != 0) } #[cfg_attr(not(stage0), lang = "u128_mul")] -#[allow(dead_code)] -fn rust_u128_mul(a: u128, b: u128) -> u128 { +pub fn rust_u128_mul(a: u128, b: u128) -> u128 { __multi3(a as _, b as _) as _ } #[cfg_attr(not(stage0), lang = "u128_mulo")] -#[allow(dead_code)] -fn rust_u128_mulo(a: u128, b: u128) -> (u128, bool) { +pub fn rust_u128_mulo(a: u128, b: u128) -> (u128, bool) { let mut oflow = 0; let r = a.mulo(b, &mut oflow); (r, oflow != 0) diff --git a/src/int/sdiv.rs b/src/int/sdiv.rs index 6fef631..0308664 100644 --- a/src/int/sdiv.rs +++ b/src/int/sdiv.rs @@ -99,12 +99,10 @@ intrinsics! { } #[cfg_attr(not(stage0), lang = "i128_div")] -#[allow(dead_code)] -fn rust_i128_div(a: i128, b: i128) -> i128 { +pub fn rust_i128_div(a: i128, b: i128) -> i128 { __divti3(a, b) } #[cfg_attr(not(stage0), lang = "i128_rem")] -#[allow(dead_code)] -fn rust_i128_rem(a: i128, b: i128) -> i128 { +pub fn rust_i128_rem(a: i128, b: i128) -> i128 { __modti3(a, b) } diff --git a/src/int/shift.rs b/src/int/shift.rs index de6d06b..f8faad8 100644 --- a/src/int/shift.rs +++ b/src/int/shift.rs @@ -97,43 +97,35 @@ intrinsics! { } #[cfg_attr(not(stage0), lang = "i128_shl")] -#[allow(dead_code)] -fn rust_i128_shl(a: i128, b: u32) -> i128 { +pub fn rust_i128_shl(a: i128, b: u32) -> i128 { __ashlti3(a as _, b) as _ } #[cfg_attr(not(stage0), lang = "i128_shlo")] -#[allow(dead_code)] -fn rust_i128_shlo(a: i128, b: u128) -> (i128, bool) { +pub fn rust_i128_shlo(a: i128, b: u128) -> (i128, bool) { (rust_i128_shl(a, b as _), b >= 128) } #[cfg_attr(not(stage0), lang = "u128_shl")] -#[allow(dead_code)] -fn rust_u128_shl(a: u128, b: u32) -> u128 { +pub fn rust_u128_shl(a: u128, b: u32) -> u128 { __ashlti3(a, b) } #[cfg_attr(not(stage0), lang = "u128_shlo")] -#[allow(dead_code)] -fn rust_u128_shlo(a: u128, b: u128) -> (u128, bool) { +pub fn rust_u128_shlo(a: u128, b: u128) -> (u128, bool) { (rust_u128_shl(a, b as _), b >= 128) } #[cfg_attr(not(stage0), lang = "i128_shr")] -#[allow(dead_code)] -fn rust_i128_shr(a: i128, b: u32) -> i128 { +pub fn rust_i128_shr(a: i128, b: u32) -> i128 { __ashrti3(a, b) } #[cfg_attr(not(stage0), lang = "i128_shro")] -#[allow(dead_code)] -fn rust_i128_shro(a: i128, b: u128) -> (i128, bool) { +pub fn rust_i128_shro(a: i128, b: u128) -> (i128, bool) { (rust_i128_shr(a, b as _), b >= 128) } #[cfg_attr(not(stage0), lang = "u128_shr")] -#[allow(dead_code)] -fn rust_u128_shr(a: u128, b: u32) -> u128 { +pub fn rust_u128_shr(a: u128, b: u32) -> u128 { __lshrti3(a, b) } #[cfg_attr(not(stage0), lang = "u128_shro")] -#[allow(dead_code)] -fn rust_u128_shro(a: u128, b: u128) -> (u128, bool) { +pub fn rust_u128_shro(a: u128, b: u128) -> (u128, bool) { (rust_u128_shr(a, b as _), b >= 128) } diff --git a/src/int/sub.rs b/src/int/sub.rs index ba29c10..0b0cbf2 100644 --- a/src/int/sub.rs +++ b/src/int/sub.rs @@ -31,25 +31,21 @@ impl Subo for i128 {} impl Subo for u128 {} #[cfg_attr(not(stage0), lang = "i128_sub")] -#[allow(dead_code)] -fn rust_i128_sub(a: i128, b: i128) -> i128 { +pub fn rust_i128_sub(a: i128, b: i128) -> i128 { rust_u128_sub(a as _, b as _) as _ } #[cfg_attr(not(stage0), lang = "i128_subo")] -#[allow(dead_code)] -fn rust_i128_subo(a: i128, b: i128) -> (i128, bool) { +pub fn rust_i128_subo(a: i128, b: i128) -> (i128, bool) { let mut oflow = 0; let r = a.subo(b, &mut oflow); (r, oflow != 0) } #[cfg_attr(not(stage0), lang = "u128_sub")] -#[allow(dead_code)] -fn rust_u128_sub(a: u128, b: u128) -> u128 { +pub fn rust_u128_sub(a: u128, b: u128) -> u128 { a.sub(b) } #[cfg_attr(not(stage0), lang = "u128_subo")] -#[allow(dead_code)] -fn rust_u128_subo(a: u128, b: u128) -> (u128, bool) { +pub fn rust_u128_subo(a: u128, b: u128) -> (u128, bool) { let mut oflow = 0; let r = a.subo(b, &mut oflow); (r, oflow != 0) diff --git a/src/int/udiv.rs b/src/int/udiv.rs index 0442a8c..6c100f3 100644 --- a/src/int/udiv.rs +++ b/src/int/udiv.rs @@ -271,12 +271,10 @@ intrinsics! { } #[cfg_attr(not(stage0), lang = "u128_div")] -#[allow(dead_code)] -fn rust_u128_div(a: u128, b: u128) -> u128 { +pub fn rust_u128_div(a: u128, b: u128) -> u128 { __udivti3(a, b) } #[cfg_attr(not(stage0), lang = "u128_rem")] -#[allow(dead_code)] -fn rust_u128_rem(a: u128, b: u128) -> u128 { +pub fn rust_u128_rem(a: u128, b: u128) -> u128 { __umodti3(a, b) }