[RISCV] Move the even register check for rv32zdinx later in the matching process.
authorCraig Topper <craig.topper@sifive.com>
Wed, 1 Feb 2023 18:55:35 +0000 (10:55 -0800)
committerCraig Topper <craig.topper@sifive.com>
Wed, 1 Feb 2023 19:15:06 +0000 (11:15 -0800)
commit84b6d074d7dc4474e259d2f535cb53901a03008c
tree00d28f22cee467c667183a56f7d31c6a42df5eae
parentdc017e03ca55ed0b2054e4a7d5e5ca049a054fcc
[RISCV] Move the even register check for rv32zdinx later in the matching process.

And remove the IsRV64 checks for isGPRAsFPR and isGPRPF64AsFPR.

Overall I think this results in a better diagnostic experience. We
now do a better job of matching Zdinx instructions even if the registers
aren't correct and report an error for missing features like RV64.

Unfortunately, this makes it difficult to recover the error location
for the invalid odd register when we do report it. But to make up
for it, I gave a more specific error message.

It doesn't look like binutils gives any warning or error for odd registers.

Reviewed By: asb

Differential Revision: https://reviews.llvm.org/D142997
llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
llvm/test/MC/RISCV/rv32zdinx-invalid.s
llvm/test/MC/RISCV/rv32zfinx-invalid.s
llvm/test/MC/RISCV/rv64zdinx-valid.s