llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
27.92k stars 11.52k forks source link

[RISC-V] Inconsistent implied/required extension behavior for zabha/zvk* #102249

Open patrick-rivos opened 1 month ago

patrick-rivos commented 1 month ago

Zabha/Zvk currently requires the user to specify Zaamo/{V|Zve}.

Godbolt: zabha: https://godbolt.org/z/bYrY8fzcv zvk: https://godbolt.org/z/fqheWoM7d

This behavior doesn't seem to match the RISC-V spec: Zabha spec: https://github.com/riscv/riscv-isa-manual/blob/d2999932625d2cab25bb2081f7da915411e65ad3/src/zabha.adoc?plain=1#L28-L29 Zvk* spec: https://github.com/riscv/riscv-isa-manual/blob/d2999932625d2cab25bb2081f7da915411e65ad3/src/vector-crypto.adoc?plain=1#L471-L473

"requires" is equivalent to "depends upon": https://github.com/riscv/riscv-v-spec/issues/723#issuecomment-949542444 "depends upon" seems to be specified behavior: https://github.com/riscv/riscv-isa-manual/blob/399c9a759eb4540a65c60e2cc236164821ff2346/src/naming.tex#L46

This behavior isn't consistent within LLVM: zcb "depends upon" zca and is implicitly added by llvm: https://godbolt.org/z/aoYGbaWvz

llvmbot commented 1 month ago

@llvm/issue-subscribers-backend-risc-v

Author: Patrick O'Neill (patrick-rivos)

Zabha/Zvk currently requires the user to specify Zaamo/{V|Zve}. Godbolt: zabha: https://godbolt.org/z/bYrY8fzcv zvk: https://godbolt.org/z/fqheWoM7d This behavior doesn't seem to match the RISC-V spec: Zabha spec: https://github.com/riscv/riscv-isa-manual/blob/d2999932625d2cab25bb2081f7da915411e65ad3/src/zabha.adoc?plain=1#L28-L29 Zvk* spec: https://github.com/riscv/riscv-isa-manual/blob/d2999932625d2cab25bb2081f7da915411e65ad3/src/vector-crypto.adoc?plain=1#L471-L473 "requires" is equivalent to "depends upon": https://github.com/riscv/riscv-v-spec/issues/723#issuecomment-949542444 "depends upon" seems to be specified behavior: https://github.com/riscv/riscv-isa-manual/blob/399c9a759eb4540a65c60e2cc236164821ff2346/src/naming.tex#L46 This behavior isn't consistent within LLVM: [zcb "depends upon" zca](https://github.com/riscv/riscv-isa-manual/blob/d2999932625d2cab25bb2081f7da915411e65ad3/src/zc.adoc?plain=1#L130) and is implicitly added by llvm: https://godbolt.org/z/aoYGbaWvz