[clang] [llvm] [RISC-V][MC] Introduce initial support for RVY (CHERI) (PR #199771)
Craig Topper via cfe-commits
cfe-commits at lists.llvm.org
Tue May 26 18:22:25 PDT 2026
================
@@ -239,6 +239,31 @@ static DecodeStatus DecodeTRM4RegisterClass(MCInst &Inst, uint32_t RegNo,
return MCDisassembler::Success;
}
+static DecodeStatus DecodeYBNDSWImm(MCInst &Inst, uint64_t Imm, int64_t Address,
+ const MCDisassembler *Decoder) {
+ assert(isUInt<9>(Imm) && "Invalid immediate");
+ uint64_t Result;
+ if (Imm == 0) {
+ // If imm[8:0] == 0, result is 4096.
+ Result = 4096;
+ } else if (Imm <= 255) {
+ // If imm[8] == 0 and imm[7:0] != 0, result is imm[7:0].
+ Result = Imm;
+ } else {
+ uint64_t Imm7To5 = (Imm & 0xFF) >> 5;
----------------
topperc wrote:
(Imm >> 5) & 0x7
https://github.com/llvm/llvm-project/pull/199771
More information about the cfe-commits
mailing list