-
Notifications
You must be signed in to change notification settings - Fork 232
Add k-ext support with v1.0.0-rc #254
Add k-ext support with v1.0.0-rc #254
Conversation
Shouldn't these be sent to riscv-binutils-experiment branch? |
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.
Overall it looks OK. There are a just a few minor questions I have, and some apparent issues with changing the patch base which confused the patch a little.
In general, I would prefer that patches go upstream. Branches here in github.com/riscv/riscv-binutils-gdb are becoming a serious liability. But we are still in the process of moving stuff upstream (waiting for gcc-11 branch), and using github for patch reviews is probably more convenient than email for many people. |
Kito's review of the K gcc patch reminds me, I didn't see testcases. It is generally a good idea to add a gas testcase for new extensions, to verify that we can assemble all of the instructions, and then disassemble them correctly. We will also need to make sure we didn't accidentally break gdb. We can't do that in riscv-gnu-toolchain because we use different release branches for binutils and gdb. But in the FSF development tree, binutils and gdb development sources are on the same master branch. |
92ff7c9
to
b426ce6
Compare
a69bb36
to
72ef429
Compare
a369a75
to
9e61e0b
Compare
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.
Generally looks good, except the k expansions, GNU coding standards and CSR issue. We don't need to care the k expansions here, we can fix them when sending the draft k stuff to the FSF users/riscv/binutils-integration-branch.
However, we should all pay attention to the GNU coding standards. You can refer to my previous three patches as follows,
- RISC-V: Comments tidy and improvement.
- RISC-V: Error and warning messages tidy.
- RISC-V: Indent and GNU coding standards tidy, also aligned the code.
After fixing the GNU comments and indents, and the CSR problem, the patch looks good to me.
bfd/elfxx-riscv.c
Outdated
@@ -1760,6 +1761,66 @@ riscv_parse_add_implicit_subsets (riscv_parse_subset_t *rps) | |||
riscv_parse_add_subset (rps, "zicsr", | |||
RISCV_UNKNOWN_VERSION, | |||
RISCV_UNKNOWN_VERSION, TRUE); | |||
else if ((riscv_lookup_subset (rps->subset_list, "k", &subset))) |
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 suppose k, zkn and zks are similar to g, they used to expand into others. We won't output g to the final architecture string, so k, zkn and zks should be the same. I had done some improvement on FSF binutils about this, so it might be easier to complete over there.
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.
However,my old implementation here did not consider so much, so it looks OK.
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.
Okay, if it need change, I will update it.
gas/config/tc-riscv.c
Outdated
@@ -143,6 +143,18 @@ static const struct riscv_ext_version ext_version_table[] = | |||
{"zba", ISA_SPEC_CLASS_DRAFT, 0, 93}, | |||
{"zbc", ISA_SPEC_CLASS_DRAFT, 0, 93}, | |||
|
|||
{"k", ISA_SPEC_CLASS_DRAFT, 0, 90}, |
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.
Same as above, if k, zkn and zks are expansions, then we don't need to add the default versions for them.
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.
Okay, I deleted the version for k,zkn,zks.
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.
Sorry that may have misunderstood you. I meant this is OK for riscv-binutils-experiment, but could be improved in the FSF binutils. Therefore, we don't need to care about the k and p's expansions in the riscv-binutils-experiment.
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.
Ok, let me delete the expansions with k,zkn,zks in the riscv-binutils-experiment..
FYI, you can press the "Resolve conversation" if you have fixed them. So that the PR will look a little cleaner, thanks. |
Fix intend problems and update CSR testcases, delete the version for k, zkn, zks.
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, thanks.
include/opcode/riscv-opc.h
Outdated
@@ -710,6 +776,7 @@ | |||
#define CSR_MARCHID 0xf12 | |||
#define CSR_MIMPID 0xf13 | |||
#define CSR_MHARTID 0xf14 | |||
#define CSR_MENTROPY 0xf15 |
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.
Maybe you forgot this one :)
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.
Thank you for your metion, I had update the 'mentorpy' case.
3b3c319
to
5792217
Compare
Update the CRS testcases and remove the expand for 'k',‘zkn’,'zks'.
Update the testcases with csr define.
5792217
to
15c2f2b
Compare
Update to spec v0.93, change mentropy into sentropy, update some aes encoding with 'bs', change 'rcon' into 'rnum'.
adffaa1
to
5921fb6
Compare
Update the aes32* opcode and csr with spec v0.94.
We had updated with the scalar crypto spec 1.0.0-rc, and merge it with the b-ext spec 1.0.0-rc contants zba_zbb_zbc_zbs for reusing of zbk[bcx]. Sorry for the miss closing of this PR due to branch rename. |
Update with spec 1.0.0-rc4
This work had been merged into the binutils upstream branch https://sourceware.org/git/?p=binutils-gdb.git close the PR. |
PLCT had add k-ext support with crypto spec v0.90 with finish all regress testing in binutils part, please check it.