-
Notifications
You must be signed in to change notification settings - Fork 270
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
Implement RISC-V Zk intrinsics #1453
Implement RISC-V Zk intrinsics #1453
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Amanieu (or someone else) soon. |
I have replaced most implementations with
I have also removed the |
CI should be fixed now, can you rebase? |
b274247
to
7cf295a
Compare
The current version of the docker Ubuntu image only supports the package What do we do here? Do we wait for the Ubuntu upstream to update? I am going to take a look into the other extensions. |
The disassembler used in CI is old and doesn't recognize the opcodes. You can try upgrading the CI image to see if this fixes it. Otherwise you can just comment out the |
The docker image uses 22.04, try upgrading to 23.04: https://github.com/rust-lang/stdarch/blob/master/ci/docker/riscv64gc-unknown-linux-gnu/Dockerfile |
I tried 23.04 and 23.10. Both are not new enough sadly. I will comment out the |
I think things should be all good now. If you are okay with everything, you can merge it. What do you think about the |
I don't think that should be exposed as an intrinsic. If people really need it then they can just use inline assembly. |
I stumbled onto an issue today. |
It seems like it does inline if you remove the |
That's where I got the idea that |
I found some info on these LLVM intrinsics. Seems like LLVM doesn't have pattern matching for zkne and zknd yet, so it cannot infer (probably) if |
The problem is caused by LLVM's inlining logic: it refuses to inline a function that has different target features. Basically this boils down to RISC-V not having a custom implementation of |
This is the first PR for rust-lang/rust#114544.
This PR changes the
core::arch::{riscv32, riscv64}
to be unstable under the newriscv_ext_intrinsics
feature-gate and adds all the instructions for thezk
extension except for the Entropy Source and the Zkt extensions. For these, it is not yet known how to deal with them.