-
Notifications
You must be signed in to change notification settings - Fork 65
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
Comments
Hi Jim,
The instruction zext.w was removed from Zbb on purpose. Perhaps this was because it had originally been defined as an alias for pack rd, rs1, zero which had been removed from zbb and it wasn’t considered worth the (small) cost. However, you are correct that this could also be an alias for addu.w rd, rs1, zero. We could add it back as an alias into zba – not quite what you are looking for.
That said, pack is needed for crypto. It might make sense to add pack back into Zbb and then we can get zext.w for free again.
Ken
From: Jim Wilson <[email protected]>
Sent: Thursday, February 25, 2021 2:13 PM
To: riscv/riscv-bitmanip <[email protected]>
Cc: Subscribed <[email protected]>
Subject: [riscv/riscv-bitmanip] zext.w missing from zbb table (#120)
CAUTION: This email originated from outside of the organization.
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.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#120>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AI6QBRVWNS2PLB3CF66BSITTA2VN5ANCNFSM4YHE67IQ>.
|
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. |
Oops, the current implementation in gcc is generating |
Maybe slli.uw for imm = 0 instruction should be the alias for zext.w and in zbb. 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 |
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.
The text was updated successfully, but these errors were encountered: