[PATCH] D130141: [RISCV] Add part support of RISCV Zc Extension (Zca, Zcb, Zcmp)

Xinlong Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 19 20:54:19 PDT 2022


VincentWu created this revision.
VincentWu added reviewers: kito-cheng, MaskRay, craig.topper, HsiangKai, jrtc27, Jim.
Herald added subscribers: sunshaoce, luke957, StephenFan, vkmr, frasercrmck, jdoerfert, evandro, luismarques, apazos, sameer.abuasal, s.egerton, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, shiva0217, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya, arichardson, mgorny.
Herald added a project: All.
VincentWu requested review of this revision.
Herald added subscribers: llvm-commits, pcwang-thead, eopXD.
Herald added a project: LLVM.

This patch adds support for part of Zc extension (Zca, Zcb, Zcmp) which are ratified already.

This extension is designed to continue reducing the binary size of RISC-V programs. 
In this patch:
`Zca` is a subset of C extension instructions that are compatible with the Zc extension.
`Zcb` is shortened format for basic bit manipulation instructions
`zcmp` is trying to compress prologue&epilogue and move instructions.

The spec of Zc ext is Here <https://github.com/riscv/riscv-code-size-reduction/releases>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D130141

Files:
  llvm/lib/Object/ELFObjectFile.cpp
  llvm/lib/Support/RISCVISAInfo.cpp
  llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
  llvm/lib/Target/RISCV/CMakeLists.txt
  llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.cpp
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.h
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVInstPrinter.cpp
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVInstPrinter.h
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCObjectFileInfo.cpp
  llvm/lib/Target/RISCV/RISCV.h
  llvm/lib/Target/RISCV/RISCV.td
  llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
  llvm/lib/Target/RISCV/RISCVFrameLowering.h
  llvm/lib/Target/RISCV/RISCVISelLowering.cpp
  llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
  llvm/lib/Target/RISCV/RISCVInstrInfo.h
  llvm/lib/Target/RISCV/RISCVInstrInfo.td
  llvm/lib/Target/RISCV/RISCVInstrInfoC.td
  llvm/lib/Target/RISCV/RISCVInstrInfoZc.td
  llvm/lib/Target/RISCV/RISCVMachineFunctionInfo.h
  llvm/lib/Target/RISCV/RISCVMoveOptimizer.cpp
  llvm/lib/Target/RISCV/RISCVOptimizePushPop.cpp
  llvm/lib/Target/RISCV/RISCVRegisterInfo.td
  llvm/lib/Target/RISCV/RISCVSubtarget.h
  llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
  llvm/test/CodeGen/RISCV/O0-pipeline.ll
  llvm/test/CodeGen/RISCV/O3-pipeline.ll
  llvm/test/CodeGen/RISCV/attributes.ll
  llvm/test/CodeGen/RISCV/callee-saved-gprs.ll
  llvm/test/CodeGen/RISCV/cm_mvas_mvsa.ll
  llvm/test/CodeGen/RISCV/push-pop-popret.ll
  llvm/test/MC/RISCV/attribute-arch.s
  llvm/test/MC/RISCV/rv32c-only-valid.s
  llvm/test/MC/RISCV/rv32zca-aliases-valid.s
  llvm/test/MC/RISCV/rv32zca-invalid.s
  llvm/test/MC/RISCV/rv32zca-valid.s
  llvm/test/MC/RISCV/rv32zcb-Invalid.s
  llvm/test/MC/RISCV/rv32zcb-valid.s
  llvm/test/MC/RISCV/rv32zcmp-Invalid.s
  llvm/test/MC/RISCV/rv32zcmp-valid.s
  llvm/test/MC/RISCV/rv64zca-aliases-valid.s
  llvm/test/MC/RISCV/rv64zca-hints-valid.s
  llvm/test/MC/RISCV/rv64zca-invalid.s
  llvm/test/MC/RISCV/rv64zca-valid.s
  llvm/test/MC/RISCV/rv64zcb-Invalid.s
  llvm/test/MC/RISCV/rv64zcb-valid.s
  llvm/test/MC/RISCV/rv64zcmp-Invalid.s
  llvm/test/MC/RISCV/rv64zcmp-valid.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130141.446029.patch
Type: text/x-patch
Size: 239138 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220720/f6a51ee7/attachment-0001.bin>


More information about the llvm-commits mailing list