Skip to content

port udivmoddi4 and __aeabi_uldivmod #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Aug 11, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
move return into if branches
  • Loading branch information
Jorge Aparicio committed Aug 11, 2016
commit a2fc4da7a52c31e4b83692f34cf96d7c0dd9bf69
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,15 @@ pub extern "C" fn __udivmoddi4(a: u64, b: u64, rem: Option<&mut u64>) -> u64 {

// NOTE X is unknown, K != 0
if n.high == 0 {
return if d.high == 0 {
if d.high == 0 {
// 0 X
// ---
// 0 X

if let Some(rem) = rem {
*rem = u64::from(n.low % d.low);
}
u64::from(n.low / d.low)
return u64::from(n.low / d.low);
} else
// d.high != 0
{
Expand All @@ -160,7 +160,7 @@ pub extern "C" fn __udivmoddi4(a: u64, b: u64, rem: Option<&mut u64>) -> u64 {
if let Some(rem) = rem {
*rem = u64::from(n.low);
}
0
return 0;
};
}

Expand Down