[PATCH] D59470: [RISCV] Add basic RV32E definitions and MC layer support

Alex Bradbury via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 17 05:13:59 PDT 2019


asb created this revision.
asb added reviewers: apazos, shiva0217, kito-cheng.
Herald added subscribers: psnobl, jocewei, PkmX, jfb, rkruppe, the_o, brucehoult, MartinMosbeck, rogfer01, atanasyan, edward-jones, zzheng, jrtc27, niosHD, sabuasal, simoncook, johnrusso, rbar, arichardson, sdardis.
Herald added a project: LLVM.

The RISC-V ISA defines RV32E as an alternative "base" instruction set encoding, that differs from RV32I by having only 16 rather than 32 registers. This patch adds basic definitions for RV32E as well as MC layer support (assembling, disassembling) and tests. The only supported ABI on RV32E is ILP32E.

Add a new RISCVFeatures::validate() helper to RISCVUtils which can be called from codegen or MC layer libraries to validate the combination of TargetTriple and FeatureBitSet. Other targets have similar checks (e.g. erroring if SPE is enabled on PPC64 or oddspreg + o32 ABI on Mips), but they either duplicate the checks (Mips), or fail to check for both codegen and MC codepaths (PPC).

Codegen for the ILP32E ABI support and RV32E codegen are left for a future patch/patches.


Repository:
  rL LLVM

https://reviews.llvm.org/D59470

Files:
  lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
  lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp
  lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.h
  lib/Target/RISCV/RISCV.td
  lib/Target/RISCV/RISCVISelLowering.cpp
  lib/Target/RISCV/RISCVSubtarget.cpp
  lib/Target/RISCV/RISCVSubtarget.h
  lib/Target/RISCV/Utils/RISCVBaseInfo.cpp
  lib/Target/RISCV/Utils/RISCVBaseInfo.h
  test/CodeGen/RISCV/mattr-invalid-combination.ll
  test/CodeGen/RISCV/rv32e.ll
  test/MC/RISCV/elf-flags.s
  test/MC/RISCV/mattr-invalid-combination.s
  test/MC/RISCV/rv32e-invalid.s
  test/MC/RISCV/rv32e-valid.s
  test/MC/RISCV/target-abi-invalid.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59470.191014.patch
Type: text/x-patch
Size: 20877 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190317/db98d8e1/attachment.bin>


More information about the llvm-commits mailing list