-
Notifications
You must be signed in to change notification settings - Fork 38
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
Create PQR instruction class #81
Create PQR instruction class #81
Conversation
I think it would be nice to have a test for 256 bit mul, to ensure the codegen is good. Possibly with overflow detection too. This change makes a big difference for NeonVM and Solang. It would nice to ensure it works as expected. |
What do you mean by "codegen is good"? 256-bit multiplications generate many assembly instructions. |
If the |
I'll include a test for that. Keep in mind that correctly breaking down 256-bit operations happens in LLVM's target independent code generation. This PR only matches the ISDOpCode MULHU/MULHS with the new instructions if ISDOpCodes are generated. Emitting The function below has more than 100 instructions and utilizes
|
That's broken then |
Ok, I'm not adding the test then. I counted 16 multiplications in total (10 lmul64 and 6 uhmu64). Maybe the algorithm is not as lean as we were expecting. |
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.
LGTM.
be616a0
into
anza-xyz:solana-rustc/16.0-2023-06-05
* Create PQR instruction class
* Create PQR instruction class
* Create PQR instruction class
* Create PQR instruction class
This PR creates the PQR instruction class for SBFv2, as it introduced in solana-labs/rbpf#498.
This is another task in solana-labs/solana#34250 to implement the SBFv2 changes in the LLVM backend.
I also tested these new instructions with all the programs in
programs/sbf
on the main repository. The only failure I got was a different instruction count, so I assume everything is working.