Skip to content
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

Fix division in tests/alu.pir #122

Merged
merged 2 commits into from
Aug 1, 2023
Merged
Changes from all commits
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
6 changes: 4 additions & 2 deletions tests/alu.pir
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ def div_next prev a b m n acc = {
// Shift the divisor
def c = b * (2^n);
// Check if shifting produces larger number
def d = ult m c a;
// Subtract the shifted value if it is smaller
def d = ule m c a;
// Subtract the shifted value if it is smaller or equal
def e = a - d * c;
// Move to the next round on the remainder
prev e b m n (d:acc)
Expand Down Expand Up @@ -245,6 +245,8 @@ def rem n a b = snd (divrem n a b);

(25,21) = divrem 32 3846 153;

(282,0) = divrem 32 282 1;

range 4 15;

def D = 10;