-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
riscv64: Add remaining Zfa Instructions #8582
Conversation
Subscribe to Label Action
This issue or pull request has been labeled: "cranelift", "cranelift:area:riscv64", "isle"
Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
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.
Thanks!
One thought below about Capstone but otherwise good to go 👍
; fsd fs10, 0x10(sp) | ||
; fsd fs11, 8(sp) | ||
; block1: ; offset 0x40 | ||
; .byte 0x53, 0x05, 0x10, 0xf0 |
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.
interesting that Capstone doesn't yet support these fli
s; does a newer version exist that does?
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.
Capstone in general doesn't support any RISC-V extension, last time I checked the RISC-V support seemed a bit abandoned, but I'll go check again.
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.
I had a look at the release notes for the capstone engine for the past year or so. There aren't many RISC-V specific fixes, and none of them add any extensions 😞
👋 Hey,
This PR adds support for the remaining instructions in the Zfa extension (introduced in #8536).
The first one is
fround.{s,d}
that is a direct match of all of our float rounding instructions (ceil
,floor
,trunc
,nearest
) depending on how the instruction is encoded.The second one is
fli.{s,d}
that loads a floating point constant from a predefined table of constants. Additionally I've also added a rule that supports loading the negated constant and then subsequently inverting the sign bit withfneg
.There are additional instructions in Zfa, but none that can be easily matched with our IR.