-
Notifications
You must be signed in to change notification settings - Fork 44
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
BEXTM(I) Encoding Tables are Incorrect #17
Comments
Good spot, thank you. For avoidance of doubt the encoding used by hardware is this one: Lines 151 to 153 in a4412c0
So as you say, the mistake in the table is it documents bits |
(also the comment in that header is outdated; the extension is Xh3bextm and it consists solely of these two instructions) |
…le instruction macros. Also fix outdated comment about these encodings in rv_opcodes.vh
I added a note on this to the v1.0 release notes. I'm not going to update the PDF as there are other docs changes ahead of this on the develop branch, and I don't want to add a dirty PDF build to the v1.0 release. I will release a new PDF with the v1.1 release, which will contain this fix. It will document the same versions of all existing custom extensions as the v1.0 PDF (which for the record I consider to be extension versions 1.0). |
The following two custom instruction encoding tables are slightly wrong:
Hazard3/doc/sections/custom_extensions.adoc
Lines 102 to 111 in a4412c0
Hazard3/doc/sections/custom_extensions.adoc
Lines 154 to 163 in a4412c0
The issue is with bits
6:0
(the final two rows): these tables claim that:1:0
should be11
6:2
should be01011
When using the
custom-0
opcode, according to Table 70 of the unpriviliged spec ("RISC-V base opcode map"), the following instruction encoding is described:1:0
should be11
(from the table header)4:2
should be010
(from header row)6:5
should be00
(from first column)It looks like the problem here is that when you separated out the
size
field, you ended up repeating the bits from the opcode -- which implicitly encode the instruction size -- into youropc
field.The assembler directives using
.insn I, 0x0b ...
work correctly, because these directives put the0xb
value into bits6:0
, rather than knowing that an I-type instruction is always 32-bits and putting the0xb
value into bits6:2
(and0b11
into bits1:0
).The text was updated successfully, but these errors were encountered: