diff options
author | Philip Reames <preames@rivosinc.com> | 2022-11-14 08:29:55 -0800 |
---|---|---|
committer | Philip Reames <listmail@philipreames.com> | 2022-11-14 09:01:54 -0800 |
commit | 780c53984449e14f50e2418de993bbf560f54bfc (patch) | |
tree | 81501804061b73172173dcbbf3558abe297ef9c0 /llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp | |
parent | 4f729d5a7056bbb59621c1332598db924c2f1fd6 (diff) | |
download | llvm-780c53984449e14f50e2418de993bbf560f54bfc.zip llvm-780c53984449e14f50e2418de993bbf560f54bfc.tar.gz llvm-780c53984449e14f50e2418de993bbf560f54bfc.tar.bz2 |
[RISCV] Implement assembler support for XVentanaCondOps
This change provides an implementation of the XVentanaCondOps vendor extension. This extension is defined in version 1.0.0 of the VTx-family custom instructions specification (https://github.com/ventanamicro/ventana-custom-extensions/releases/download/v1.0.0/ventana-custom-extensions-v1.0.0.pdf) by Ventana Micro Systems.
In addition to the technical contribution, this change is intended to be a test case for our vendor extension policy.
Once this lands, I plan to use this extension to prototype selection lowering to conditional moves. There's an RVI proposal in flight, and the expectation is that lowering to these and the new RVI instructions is likely to be substantially similar.
Differential Revision: https://reviews.llvm.org/D137350
Diffstat (limited to 'llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp')
-rw-r--r-- | llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp b/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp index 1c732a1..4a00e50 100644 --- a/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp +++ b/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp @@ -465,6 +465,16 @@ DecodeStatus RISCVDisassembler::getInstruction(MCInst &MI, uint64_t &Size, return Result; } } + if (STI.getFeatureBits()[RISCV::FeatureVendorXVentanaCondOps]) { + LLVM_DEBUG(dbgs() << "Trying Ventana custom opcode table:\n"); + Result = decodeInstruction(DecoderTableVentana32, MI, Insn, Address, this, + STI); + if (Result != MCDisassembler::Fail) { + Size = 4; + return Result; + } + } + LLVM_DEBUG(dbgs() << "Trying RISCV32 table :\n"); Result = decodeInstruction(DecoderTable32, MI, Insn, Address, this, STI); Size = 4; |