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 Jan 6, 2017
1 parent e4091a9 commit d3b0497
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: i::U128_) -> ::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 d3b0497

Please sign in to comment.