[RISCV] Add vendor-defined XTHeadBs (single-bit) extension
authorPhilipp Tomsich <philipp.tomsich@vrull.eu>
Mon, 13 Feb 2023 15:10:11 +0000 (16:10 +0100)
committerPhilipp Tomsich <philipp.tomsich@vrull.eu>
Mon, 13 Feb 2023 15:28:26 +0000 (16:28 +0100)
commit04a2baf58f2362cac85edbd55747cecb135b9ae5
tree47ecd90660f3d78720503e12e1b6e7817e937da2
parent676bca0b6f0df943935e3b17cfd1d9e8d9eb4797
[RISCV] Add vendor-defined XTHeadBs (single-bit) extension

The vendor-defined XTHeadBs (predating the standard Zbs extension)
extension adds a bit-test instruction (th.tst) with similar semantics
as bexti from Zbs.  It is supported by the C9xx cores (e.g., found in
the wild in the Allwinner D1) by Alibaba T-Head.

The current (as of this commit) public documentation for XTHeadBs is
available from:
  https://github.com/T-head-Semi/thead-extension-spec/releases/download/2.2.2/xthead-2023-01-30-2.2.2.pdf

Support for these instructions has already landed in GNU Binutils:
  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=8254c3d2c94ae5458095ea6c25446ba89134b9da

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D143036
15 files changed:
llvm/docs/RISCVUsage.rst
llvm/docs/ReleaseNotes.rst
llvm/lib/Support/RISCVISAInfo.cpp
llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp
llvm/lib/Target/RISCV/RISCVFeatures.td
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/lib/Target/RISCV/RISCVInstrInfoXTHead.td
llvm/test/CodeGen/RISCV/attributes.ll
llvm/test/CodeGen/RISCV/bittest.ll
llvm/test/CodeGen/RISCV/rv32xtheadbs.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/rv64xtheadbs.ll [new file with mode: 0644]
llvm/test/MC/RISCV/rv32xtheadbs-invalid.s [new file with mode: 0644]
llvm/test/MC/RISCV/rv32xtheadbs-valid.s [new file with mode: 0644]
llvm/test/MC/RISCV/rv64xtheadbs-invalid.s [new file with mode: 0644]