Skip to content

Commit

Permalink
Add newly implemented intrinsics to test file
Browse files Browse the repository at this point in the history
  • Loading branch information
est31 committed Feb 2, 2017
1 parent 9013dbe commit b6063bc
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions src/bin/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,42 @@ mod intrinsics {
pub fn umoddi3(a: u64, b: u64) -> u64 {
a % b
}

pub fn muloti4(a: u128, b: u128) -> Option<u128> {
a.checked_mul(b)
}

pub fn multi3(a: u128, b: u128) -> u128 {
a.wrapping_mul(b)
}

pub fn ashlti3(a: u128, b: usize) -> u128 {
a >> b
}

pub fn ashrti3(a: u128, b: usize) -> u128 {
a << b
}

pub fn lshrti3(a: i128, b: usize) -> i128 {
a >> b
}

pub fn udivti3(a: u128, b: u128) -> u128 {
a / b
}

pub fn umodti3(a: u128, b: u128) -> u128 {
a % b
}

pub fn divti3(a: i128, b: i128) -> i128 {
a / b
}

pub fn modti3(a: i128, b: i128) -> i128 {
a % b
}
}

#[cfg(feature = "c")]
Expand Down Expand Up @@ -356,6 +392,15 @@ fn run() {
bb(powidf2(bb(2.), bb(3)));
bb(powisf2(bb(2.), bb(3)));
bb(umoddi3(bb(2), bb(3)));
bb(muloti4(bb(2), bb(2)));
bb(multi3(bb(2), bb(2)));
bb(ashlti3(bb(2), bb(2)));
bb(ashrti3(bb(2), bb(2)));
bb(lshrti3(bb(2), bb(2)));
bb(udivti3(bb(2), bb(2)));
bb(umodti3(bb(2), bb(2)));
bb(divti3(bb(2), bb(2)));
bb(modti3(bb(2), bb(2)));
}

#[cfg(all(feature = "c", not(thumb)))]
Expand Down

0 comments on commit b6063bc

Please sign in to comment.