[RISCV] Rename FPRs and use Register arithmetic
authorLuis Marques <luismarques@lowrisc.org>
Fri, 27 Sep 2019 15:49:10 +0000 (15:49 +0000)
committerLuis Marques <luismarques@lowrisc.org>
Fri, 27 Sep 2019 15:49:10 +0000 (15:49 +0000)
commitaae97bfd0c323edef5363ce296c9f6f79db410cf
tree2b40b835d4c7a0727675fe1dc01c0f38cb7a9bc7
parent623b0e6963e5cbf59e180a9aadb1da8e61d84b47
[RISCV] Rename FPRs and use Register arithmetic

The new names for FPRs ensure that the Register values within the same class are
enumerated consecutively (the order is determined by the `LessRecordRegister`
function object). Where there were tables mapping between 32- and 64-bit FPRs
(and vice versa) this patch replaces them with Register arithmetic. The
enumeration order between different register classes is expected to continue to
be arbitrary, although it does impact the conversion from the (overloaded) asm
FPR names to Register values, and therefore might require updates to the target
if the sorting algorithm is changed. Static asserts were added to ensure that
changes to the ordering that would impact the current implementation are
detected.

Differential Revision: https://reviews.llvm.org/D67423

llvm-svn: 373096
llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp
llvm/lib/Target/RISCV/RISCVCallingConv.td
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp
llvm/lib/Target/RISCV/RISCVRegisterInfo.td