-
Notifications
You must be signed in to change notification settings - Fork 98
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
Arith machine (field operations only) for BabyBear field #1775
Conversation
build is failing. @qwang98 is this ready for review? |
@leonardoalt Can merge when approved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You also need to activate the test in Rust powdr_std.rs
Fixed and let's wait for it to complete again :) |
#[ignore = "Too slow"] | ||
fn arith256_small_test() { | ||
let f = "std/arith256_small_test.asm"; | ||
regular_test_small_field(f, &[]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, we already have a similar test though, didn't we merge this already? Check 2 tests up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope. It's different. Arith_small does 32 bit number mul and div, which combined with add_sub_small, satisfies our uses in the riscv machine.
Arith256 (this PR) does 256 bit number arith.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yes true, I remember now
This is the 256 bit version decomposed to 16 bit limbs, but not immediately needed by our BabyBear RISCV VM. Keeping it here though in case needed in the future.
Adapted
eq0
only from our original arith machine. Exposes one operation that should work for add, sub, mul, div. Inputs are 16 bits. Decomposed to 8 bit intermediate columns for constraints.All original test vectors passed. Original comments not fully cleaned up though.