-
Notifications
You must be signed in to change notification settings - Fork 163
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
Clarification on canonical representation for Tag_RISCV_arch #203
Comments
We already require some amount of canonicalisation:
I guess your issue is with a literal strcmp vs having to split on _ and do set comparisons? Is there a situation where a strcmp is actually useful though? I'd expect some amount of parsing to be required to work out if it's a subset of the current environment (in the loader case) or if the union of two strings is a valid arch string (in the static linker case to detect conflicting extensions). |
i.e. the only thing we don't currently impose is canonicalisation on the order of the non-single-letter extensions (i.e. nothing beyond what the ISA unprivileged spec says) |
ISA spec isn't clear enough for following case:
In theory they are equal on left and right side, but ... what is one canonical order for them? if both are canonical order, we must write down more detail rule there. I prefer expanded and most verbose form (right side), it's less ambiguous during look-up some extensions are enabled or not, for example, the ISA string split into a list by Let see what happen on ISA spec side :p |
Set comparisons only work, if extensions are composed within a trivial hierarchy.
I don't mind requiring tools to parse the string, but I would like to see a note so that people are aware of that. And if a canonical form is not required, then we could reconsider the following requirement: |
That requirement exists so that kernels and loaders don't all need to embed a full parser of the arch string, which was deemed a non-starter (and I would entirely agree with that, the rules are really complicated). The Zce proposal sounds horrendous to me, that is a violation of sensible principles for extensions. Having rv32idzce not be a superset of rv32izce is all kinds of "god no don't do that". Extensions are extensions, period. Zceb must therefore be an explicit extension that's incompatible with D from my perspective. The Zcea situation is completely fine. Any binary using C.MUL will have Zcea and either M or Zmmul in its attributes, so the requirements are entirely captured with no implication logic needed. If the hart has Zmmul (or full-blown M) then the binary will work. If the hart doesn't then the loader will see that and the binary won't be loaded. |
I feel the Tag_RISCV_arch is underspecified without additional guidance on what caonicalisation of the string is required when one extension implies another, and it would be worth seeking to address this in someway ahead of 1.0. |
The attribute
Tag_RISCV_arch
is defined as a valid argument for-march
to describe the ISA extension as defined in the ISA extension naming convention, which is part of the RISC-V unpriv specification.I propose to either require a canonical representation to be stored there (I am aware that there is no defined canonical form atm),
or to add a comment to not expect a canonical representation in that string (i.e. a user of the field needs to parse the string before further processing because two different strings might be semantically identical).
Related issues (with some examples):
riscv-non-isa/riscv-toolchain-conventions#11
riscv/riscv-isa-manual#670
The text was updated successfully, but these errors were encountered: