jolt icon indicating copy to clipboard operation
jolt copied to clipboard

RV32I M-Extension

Open GUJustin opened this issue 10 months ago • 8 comments

More instructions: The Jolt codebase currently implements the RISC-V 32-bit Base Integer instruction set (RV32I), but the Jolt construction is highly flexible. Add support for the RISC-V “M” extension for integer multiplication and division, as described in the Jolt paper. Further, Jolt can trivially support the 64-bit variant RV64IM.

GUJustin avatar Apr 01 '24 21:04 GUJustin

@GUJustin @moodlezoup potentially interested in tackling this if an open issue, might need a few eyes on my PR drafts as I implement this 😄

mw2000 avatar Apr 13 '24 09:04 mw2000

Hi @mw2000, feel free to give it a shot! My suggestion would be to start with just the instructions/subtables for the (32-bit) M extension (i.e. the stuff in jolt-core/src/jolt/instruction and jolt-core/src/jolt/subtable). The rest of the work shouldn't be too bad either, but will require some refactoring (as described in the Jolt paper, the M extension introduces the notion of "virtual instructions", which complicates things a bit)

moodlezoup avatar Apr 13 '24 15:04 moodlezoup

Sounds good! I'll make small atomic PRs for the instructions and pass them over for review.

More than happy to break this issue into smaller ones (and use this as the bucket) if it makes sense for tracking (assuming 1 issue = 1 PR)

mw2000 avatar Apr 13 '24 16:04 mw2000

Sure, go for it. Thanks for taking this on!

moodlezoup avatar Apr 13 '24 16:04 moodlezoup

Just wanted to give an update, still on it. I should have something up in next couple days

mw2000 avatar Apr 16 '24 05:04 mw2000

Great, let me know if you have any questions!

moodlezoup avatar Apr 16 '24 18:04 moodlezoup

Hey @moodlezoup Was implementing the non-virtual multiplication instructions, MUL, MULU and MULHU. I was able to get the first two running just fine, but running into some trouble with MULHU.

With this context, i wanted to understand what exactly a subtable is and if you could add more color to the jolt_instruction_test! Macro

mw2000 avatar Apr 19 '24 08:04 mw2000

Hi @mw2000, could you DM me on Twitter or post your Telegram handle here? Will be easier to communicate over one of those channels

moodlezoup avatar Apr 19 '24 13:04 moodlezoup

hi. are people working on rest of the instructions such as div and rem?

Ethan-000 avatar May 24 '24 09:05 Ethan-000

Hey @Ethan-000, I and @shreyas-londhe are currently working on the rest of the M extension commands! You're welcome to join us 😄

mw2000 avatar May 24 '24 17:05 mw2000

sure :) how to coordinate? is there a branch you guys are working on?

Ethan-000 avatar May 24 '24 17:05 Ethan-000

@Ethan-000 Feel free to dm me on TG, my handle is that_one_nerdy

Right now we've been coordinating over DM, but happy to create a group or something similar

We've currently been working off of my fork of the repo

mw2000 avatar May 24 '24 20:05 mw2000