Skip to content
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

zext.w missing from zbb table #120

Open
jim-wilson opened this issue Feb 25, 2021 · 4 comments
Open

zext.w missing from zbb table #120

jim-wilson opened this issue Feb 25, 2021 · 4 comments

Comments

@jim-wilson
Copy link

The table at the beginning of chapter 2 which lists all of the instructions in each subset doesn't mention zext.w for zbb. It is supposed to be in there. It is an alias of add.uw which is zba, but the subset that provides zext.w is in zbb. Just like zext.h in zbb is an alias for pack/packw even though pack/packw are not in zbb.

The idea here is that the base architecture plus zbb is supposed to provide a complete set of [sz]ext.[bhw] instructions. This set is not complete unless we have zext.w for rv64.

@kdockser
Copy link
Collaborator

kdockser commented Feb 25, 2021 via email

@jim-wilson
Copy link
Author

zext.w is already mentioned in multiple places in the document as an alias for add.wu. I thought we had agreement that the zext.w subset of add.wu would be part of zbb, but Andrew Waterman tells me it isn't. Oh well. This means that I plus zbb has 5 of the 6 possible [zs]ext.[bhw] instructions, and you need I plus zbb+zba to get all 6 of them. But anyone sensible should be implementing zbb+zba anyways, so we can live with that. In the short term, we have a few broken toolchains floating around, because the toolchain folks thought that zext.w was in zbb, but this will be a temporary problem.

@kito-cheng
Copy link
Member

Oops, the current implementation in gcc is generating zext.w for zbb or zba, seems like it should fix...

@RogierBrussee
Copy link

Maybe slli.uw for imm = 0 instruction should be the alias for zext.w and in zbb.
IIUC it is preferred to special case an immediate over special casing rs1 or rs2 == zero.

Or maybe it is not too late to include the whole slli.uw instruction in Zbb, so that with just I + Zbb you can do sensible unsigned index -> address computation even if you don't want to implement the fused slli.uw + add
of Zba (but as Jim rightly remarks, implementing Zba is the sensible thing to do).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants