Skip to content

Commit

Permalink
Big update
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross35 committed Apr 14, 2024
1 parent 4a69a34 commit 32d6c0f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/int/big.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ macro_rules! impl_common {
impl_common!(i256);
impl_common!(u256);


macro_rules! word {
(1, $val:expr) => {
(($val >> (32 * 3)) & Self::from(WORD_LO_MASK)) as u64
Expand Down
3 changes: 2 additions & 1 deletion src/int/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ pub mod sdiv;
pub mod shift;
pub mod udiv;

pub use self::leading_zeros::__clzsi2;
pub use leading_zeros::__clzsi2;
pub use big::{i256, u256};

public_test_dep! {
/// Minimal integer implementations needed on all integer types, including wide integers.
Expand Down
10 changes: 10 additions & 0 deletions testcrate/tests/big.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use compiler_builtins::int::{i256, u256, HInt};

#[test]
fn widen() {
assert_eq!(u128::MAX.widen(), u256([u64::MAX, u64::MAX, 0, 0]));
assert_eq!(
0xaaaaaaaaaaaaaaaaffffffffffffffff_u128.widen(),
u256([u64::MAX, 0xaaaaaaaaaaaaaaaa, 0, 0])
);
}

0 comments on commit 32d6c0f

Please sign in to comment.