[llvm] [RISCV] For RV32C, disassembly of c.slli should fail when immediate > 31 (PR #133713)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 31 05:51:33 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mc
Author: Paul Bowen-Huggett (paulhuggett)
<details>
<summary>Changes</summary>
Fix for #<!-- -->133712.
The change causes `c.slli` instructions whose immediate has bit 5 to be rejected when disassembling RV32C. Added a test to exhaustively cover c.slli for 32 and bit targets. Minor tweak to make the debug output a little more readable.
---
Patch is 122.02 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/133713.diff
2 Files Affected:
- (modified) llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp (+8-4)
- (added) llvm/test/MC/Disassembler/RISCV/c_slli.txt (+3119)
``````````diff
diff --git a/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp b/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp
index b46b72b4b73e9..b22a4a7246c23 100644
--- a/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp
+++ b/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp
@@ -558,8 +558,12 @@ static DecodeStatus decodeRVCInstrRdRs1UImm(MCInst &Inst, uint32_t Insn,
const MCDisassembler *Decoder) {
Inst.addOperand(MCOperand::createReg(RISCV::X0));
Inst.addOperand(Inst.getOperand(0));
- uint32_t UImm6 =
- fieldFromInstruction(Insn, 12, 1) << 5 | fieldFromInstruction(Insn, 2, 5);
+
+ uint32_t UImm6 = fieldFromInstruction(Insn, 12, 1) << 5;
+ // On RV32C, uimm[5]=1 is reserved for custom extensions.
+ if (UImm6 != 0 && Decoder->getSubtargetInfo().hasFeature(RISCV::Feature32Bit))
+ return MCDisassembler::Fail;
+ UImm6 |= fieldFromInstruction(Insn, 2, 5);
[[maybe_unused]] DecodeStatus Result =
decodeUImmOperand<6>(Inst, UImm6, Address, Decoder);
assert(Result == MCDisassembler::Success && "Invalid immediate");
@@ -784,7 +788,7 @@ DecodeStatus RISCVDisassembler::getInstruction16(MCInst &MI, uint64_t &Size,
if (!Entry.haveContainedFeatures(STI.getFeatureBits()))
continue;
- LLVM_DEBUG(dbgs() << "Trying " << Entry.Desc << "table:\n");
+ LLVM_DEBUG(dbgs() << "Trying " << Entry.Desc << " table:\n");
DecodeStatus Result =
decodeInstruction(Entry.Table, MI, Insn, Address, this, STI);
if (Result == MCDisassembler::Fail)
@@ -820,7 +824,7 @@ DecodeStatus RISCVDisassembler::getInstruction48(MCInst &MI, uint64_t &Size,
if (!Entry.haveContainedFeatures(STI.getFeatureBits()))
continue;
- LLVM_DEBUG(dbgs() << "Trying " << Entry.Desc << "table:\n");
+ LLVM_DEBUG(dbgs() << "Trying " << Entry.Desc << " table:\n");
DecodeStatus Result =
decodeInstruction(Entry.Table, MI, Insn, Address, this, STI);
if (Result == MCDisassembler::Fail)
diff --git a/llvm/test/MC/Disassembler/RISCV/c_slli.txt b/llvm/test/MC/Disassembler/RISCV/c_slli.txt
new file mode 100644
index 0000000000000..6e8dc4c05147f
--- /dev/null
+++ b/llvm/test/MC/Disassembler/RISCV/c_slli.txt
@@ -0,0 +1,3119 @@
+# This test verifies the disassembler's behavior for all C.LUI opcodes with the
+# exception of those assigned to C.ADDI16SP
+#
+# RUN: llvm-mc --disassemble -triple=riscv32 -mattr=+c -M no-aliases \
+# RUN: --show-encoding < %s | FileCheck --check-prefixes=GOOD %s
+#
+# RUN: llvm-mc --disassemble -triple=riscv64 -mattr=+c -M no-aliases \
+# RUN: --show-encoding < %s | FileCheck --check-prefixes=GOOD,GOOD64 %s
+#
+# RUN: llvm-mc --disassemble -triple=riscv32 -mattr=+c -M no-aliases \
+# RUN: --show-encoding < %s 2>&1 | FileCheck --check-prefix=BAD32 %s
+#
+# RUN: llvm-mc --disassemble -triple=riscv32 -mattr=+c -mattr=+no-rvc-hints \
+# RUN: -M no-aliases --show-encoding < %s 2>&1 | \
+# RUN: FileCheck --check-prefix=NOHINTS %s
+
+0x06 0x00 # GOOD: c.slli zero, 1
+0x06 0x00 # NOHINTS: invalid instruction encoding
+0x0A 0x00 # GOOD: c.slli zero, 2
+0x0A 0x00 # NOHINTS: invalid instruction encoding
+0x0E 0x00 # GOOD: c.slli zero, 3
+0x0E 0x00 # NOHINTS: invalid instruction encoding
+0x12 0x00 # GOOD: c.slli zero, 4
+0x12 0x00 # NOHINTS: invalid instruction encoding
+0x16 0x00 # GOOD: c.slli zero, 5
+0x16 0x00 # NOHINTS: invalid instruction encoding
+0x1A 0x00 # GOOD: c.slli zero, 6
+0x1A 0x00 # NOHINTS: invalid instruction encoding
+0x1E 0x00 # GOOD: c.slli zero, 7
+0x1E 0x00 # NOHINTS: invalid instruction encoding
+0x22 0x00 # GOOD: c.slli zero, 8
+0x22 0x00 # NOHINTS: invalid instruction encoding
+0x26 0x00 # GOOD: c.slli zero, 9
+0x26 0x00 # NOHINTS: invalid instruction encoding
+0x2A 0x00 # GOOD: c.slli zero, 10
+0x2A 0x00 # NOHINTS: invalid instruction encoding
+0x2E 0x00 # GOOD: c.slli zero, 11
+0x2E 0x00 # NOHINTS: invalid instruction encoding
+0x32 0x00 # GOOD: c.slli zero, 12
+0x32 0x00 # NOHINTS: invalid instruction encoding
+0x36 0x00 # GOOD: c.slli zero, 13
+0x36 0x00 # NOHINTS: invalid instruction encoding
+0x3A 0x00 # GOOD: c.slli zero, 14
+0x3A 0x00 # NOHINTS: invalid instruction encoding
+0x3E 0x00 # GOOD: c.slli zero, 15
+0x3E 0x00 # NOHINTS: invalid instruction encoding
+0x42 0x00 # GOOD: c.slli zero, 16
+0x42 0x00 # NOHINTS: invalid instruction encoding
+0x46 0x00 # GOOD: c.slli zero, 17
+0x46 0x00 # NOHINTS: invalid instruction encoding
+0x4A 0x00 # GOOD: c.slli zero, 18
+0x4A 0x00 # NOHINTS: invalid instruction encoding
+0x4E 0x00 # GOOD: c.slli zero, 19
+0x4E 0x00 # NOHINTS: invalid instruction encoding
+0x52 0x00 # GOOD: c.slli zero, 20
+0x52 0x00 # NOHINTS: invalid instruction encoding
+0x56 0x00 # GOOD: c.slli zero, 21
+0x56 0x00 # NOHINTS: invalid instruction encoding
+0x5A 0x00 # GOOD: c.slli zero, 22
+0x5A 0x00 # NOHINTS: invalid instruction encoding
+0x5E 0x00 # GOOD: c.slli zero, 23
+0x5E 0x00 # NOHINTS: invalid instruction encoding
+0x62 0x00 # GOOD: c.slli zero, 24
+0x62 0x00 # NOHINTS: invalid instruction encoding
+0x66 0x00 # GOOD: c.slli zero, 25
+0x66 0x00 # NOHINTS: invalid instruction encoding
+0x6A 0x00 # GOOD: c.slli zero, 26
+0x6A 0x00 # NOHINTS: invalid instruction encoding
+0x6E 0x00 # GOOD: c.slli zero, 27
+0x6E 0x00 # NOHINTS: invalid instruction encoding
+0x72 0x00 # GOOD: c.slli zero, 28
+0x72 0x00 # NOHINTS: invalid instruction encoding
+0x76 0x00 # GOOD: c.slli zero, 29
+0x76 0x00 # NOHINTS: invalid instruction encoding
+0x7A 0x00 # GOOD: c.slli zero, 30
+0x7A 0x00 # NOHINTS: invalid instruction encoding
+0x7E 0x00 # GOOD: c.slli zero, 31
+0x7E 0x00 # NOHINTS: invalid instruction encoding
+0x02 0x10 # BAD32: invalid instruction encoding
+0x02 0x10 # GOOD64: c.slli zero, 32
+0x02 0x10 # NOHINTS: invalid instruction encoding
+0x06 0x10 # BAD32: invalid instruction encoding
+0x06 0x10 # GOOD64: c.slli zero, 33
+0x06 0x10 # NOHINTS: invalid instruction encoding
+0x0A 0x10 # BAD32: invalid instruction encoding
+0x0A 0x10 # GOOD64: c.slli zero, 34
+0x0A 0x10 # NOHINTS: invalid instruction encoding
+0x0E 0x10 # BAD32: invalid instruction encoding
+0x0E 0x10 # GOOD64: c.slli zero, 35
+0x0E 0x10 # NOHINTS: invalid instruction encoding
+0x12 0x10 # BAD32: invalid instruction encoding
+0x12 0x10 # GOOD64: c.slli zero, 36
+0x12 0x10 # NOHINTS: invalid instruction encoding
+0x16 0x10 # BAD32: invalid instruction encoding
+0x16 0x10 # GOOD64: c.slli zero, 37
+0x16 0x10 # NOHINTS: invalid instruction encoding
+0x1A 0x10 # BAD32: invalid instruction encoding
+0x1A 0x10 # GOOD64: c.slli zero, 38
+0x1A 0x10 # NOHINTS: invalid instruction encoding
+0x1E 0x10 # BAD32: invalid instruction encoding
+0x1E 0x10 # GOOD64: c.slli zero, 39
+0x1E 0x10 # NOHINTS: invalid instruction encoding
+0x22 0x10 # BAD32: invalid instruction encoding
+0x22 0x10 # GOOD64: c.slli zero, 40
+0x22 0x10 # NOHINTS: invalid instruction encoding
+0x26 0x10 # BAD32: invalid instruction encoding
+0x26 0x10 # GOOD64: c.slli zero, 41
+0x26 0x10 # NOHINTS: invalid instruction encoding
+0x2A 0x10 # BAD32: invalid instruction encoding
+0x2A 0x10 # GOOD64: c.slli zero, 42
+0x2A 0x10 # NOHINTS: invalid instruction encoding
+0x2E 0x10 # BAD32: invalid instruction encoding
+0x2E 0x10 # GOOD64: c.slli zero, 43
+0x2E 0x10 # NOHINTS: invalid instruction encoding
+0x32 0x10 # BAD32: invalid instruction encoding
+0x32 0x10 # GOOD64: c.slli zero, 44
+0x32 0x10 # NOHINTS: invalid instruction encoding
+0x36 0x10 # BAD32: invalid instruction encoding
+0x36 0x10 # GOOD64: c.slli zero, 45
+0x36 0x10 # NOHINTS: invalid instruction encoding
+0x3A 0x10 # BAD32: invalid instruction encoding
+0x3A 0x10 # GOOD64: c.slli zero, 46
+0x3A 0x10 # NOHINTS: invalid instruction encoding
+0x3E 0x10 # BAD32: invalid instruction encoding
+0x3E 0x10 # GOOD64: c.slli zero, 47
+0x3E 0x10 # NOHINTS: invalid instruction encoding
+0x42 0x10 # BAD32: invalid instruction encoding
+0x42 0x10 # GOOD64: c.slli zero, 48
+0x42 0x10 # NOHINTS: invalid instruction encoding
+0x46 0x10 # BAD32: invalid instruction encoding
+0x46 0x10 # GOOD64: c.slli zero, 49
+0x46 0x10 # NOHINTS: invalid instruction encoding
+0x4A 0x10 # BAD32: invalid instruction encoding
+0x4A 0x10 # GOOD64: c.slli zero, 50
+0x4A 0x10 # NOHINTS: invalid instruction encoding
+0x4E 0x10 # BAD32: invalid instruction encoding
+0x4E 0x10 # GOOD64: c.slli zero, 51
+0x4E 0x10 # NOHINTS: invalid instruction encoding
+0x52 0x10 # BAD32: invalid instruction encoding
+0x52 0x10 # GOOD64: c.slli zero, 52
+0x52 0x10 # NOHINTS: invalid instruction encoding
+0x56 0x10 # BAD32: invalid instruction encoding
+0x56 0x10 # GOOD64: c.slli zero, 53
+0x56 0x10 # NOHINTS: invalid instruction encoding
+0x5A 0x10 # BAD32: invalid instruction encoding
+0x5A 0x10 # GOOD64: c.slli zero, 54
+0x5A 0x10 # NOHINTS: invalid instruction encoding
+0x5E 0x10 # BAD32: invalid instruction encoding
+0x5E 0x10 # GOOD64: c.slli zero, 55
+0x5E 0x10 # NOHINTS: invalid instruction encoding
+0x62 0x10 # BAD32: invalid instruction encoding
+0x62 0x10 # GOOD64: c.slli zero, 56
+0x62 0x10 # NOHINTS: invalid instruction encoding
+0x66 0x10 # BAD32: invalid instruction encoding
+0x66 0x10 # GOOD64: c.slli zero, 57
+0x66 0x10 # NOHINTS: invalid instruction encoding
+0x6A 0x10 # BAD32: invalid instruction encoding
+0x6A 0x10 # GOOD64: c.slli zero, 58
+0x6A 0x10 # NOHINTS: invalid instruction encoding
+0x6E 0x10 # BAD32: invalid instruction encoding
+0x6E 0x10 # GOOD64: c.slli zero, 59
+0x6E 0x10 # NOHINTS: invalid instruction encoding
+0x72 0x10 # BAD32: invalid instruction encoding
+0x72 0x10 # GOOD64: c.slli zero, 60
+0x72 0x10 # NOHINTS: invalid instruction encoding
+0x76 0x10 # BAD32: invalid instruction encoding
+0x76 0x10 # GOOD64: c.slli zero, 61
+0x76 0x10 # NOHINTS: invalid instruction encoding
+0x7A 0x10 # BAD32: invalid instruction encoding
+0x7A 0x10 # GOOD64: c.slli zero, 62
+0x7A 0x10 # NOHINTS: invalid instruction encoding
+0x7E 0x10 # BAD32: invalid instruction encoding
+0x7E 0x10 # GOOD64: c.slli zero, 63
+0x7E 0x10 # NOHINTS: invalid instruction encoding
+0x86 0x00 # GOOD: c.slli ra, 1
+0x8A 0x00 # GOOD: c.slli ra, 2
+0x8E 0x00 # GOOD: c.slli ra, 3
+0x92 0x00 # GOOD: c.slli ra, 4
+0x96 0x00 # GOOD: c.slli ra, 5
+0x9A 0x00 # GOOD: c.slli ra, 6
+0x9E 0x00 # GOOD: c.slli ra, 7
+0xA2 0x00 # GOOD: c.slli ra, 8
+0xA6 0x00 # GOOD: c.slli ra, 9
+0xAA 0x00 # GOOD: c.slli ra, 10
+0xAE 0x00 # GOOD: c.slli ra, 11
+0xB2 0x00 # GOOD: c.slli ra, 12
+0xB6 0x00 # GOOD: c.slli ra, 13
+0xBA 0x00 # GOOD: c.slli ra, 14
+0xBE 0x00 # GOOD: c.slli ra, 15
+0xC2 0x00 # GOOD: c.slli ra, 16
+0xC6 0x00 # GOOD: c.slli ra, 17
+0xCA 0x00 # GOOD: c.slli ra, 18
+0xCE 0x00 # GOOD: c.slli ra, 19
+0xD2 0x00 # GOOD: c.slli ra, 20
+0xD6 0x00 # GOOD: c.slli ra, 21
+0xDA 0x00 # GOOD: c.slli ra, 22
+0xDE 0x00 # GOOD: c.slli ra, 23
+0xE2 0x00 # GOOD: c.slli ra, 24
+0xE6 0x00 # GOOD: c.slli ra, 25
+0xEA 0x00 # GOOD: c.slli ra, 26
+0xEE 0x00 # GOOD: c.slli ra, 27
+0xF2 0x00 # GOOD: c.slli ra, 28
+0xF6 0x00 # GOOD: c.slli ra, 29
+0xFA 0x00 # GOOD: c.slli ra, 30
+0xFE 0x00 # GOOD: c.slli ra, 31
+0x82 0x10 # BAD32: invalid instruction encoding
+0x82 0x10 # GOOD64: c.slli ra, 32
+0x86 0x10 # BAD32: invalid instruction encoding
+0x86 0x10 # GOOD64: c.slli ra, 33
+0x8A 0x10 # BAD32: invalid instruction encoding
+0x8A 0x10 # GOOD64: c.slli ra, 34
+0x8E 0x10 # BAD32: invalid instruction encoding
+0x8E 0x10 # GOOD64: c.slli ra, 35
+0x92 0x10 # BAD32: invalid instruction encoding
+0x92 0x10 # GOOD64: c.slli ra, 36
+0x96 0x10 # BAD32: invalid instruction encoding
+0x96 0x10 # GOOD64: c.slli ra, 37
+0x9A 0x10 # BAD32: invalid instruction encoding
+0x9A 0x10 # GOOD64: c.slli ra, 38
+0x9E 0x10 # BAD32: invalid instruction encoding
+0x9E 0x10 # GOOD64: c.slli ra, 39
+0xA2 0x10 # BAD32: invalid instruction encoding
+0xA2 0x10 # GOOD64: c.slli ra, 40
+0xA6 0x10 # BAD32: invalid instruction encoding
+0xA6 0x10 # GOOD64: c.slli ra, 41
+0xAA 0x10 # BAD32: invalid instruction encoding
+0xAA 0x10 # GOOD64: c.slli ra, 42
+0xAE 0x10 # BAD32: invalid instruction encoding
+0xAE 0x10 # GOOD64: c.slli ra, 43
+0xB2 0x10 # BAD32: invalid instruction encoding
+0xB2 0x10 # GOOD64: c.slli ra, 44
+0xB6 0x10 # BAD32: invalid instruction encoding
+0xB6 0x10 # GOOD64: c.slli ra, 45
+0xBA 0x10 # BAD32: invalid instruction encoding
+0xBA 0x10 # GOOD64: c.slli ra, 46
+0xBE 0x10 # BAD32: invalid instruction encoding
+0xBE 0x10 # GOOD64: c.slli ra, 47
+0xC2 0x10 # BAD32: invalid instruction encoding
+0xC2 0x10 # GOOD64: c.slli ra, 48
+0xC6 0x10 # BAD32: invalid instruction encoding
+0xC6 0x10 # GOOD64: c.slli ra, 49
+0xCA 0x10 # BAD32: invalid instruction encoding
+0xCA 0x10 # GOOD64: c.slli ra, 50
+0xCE 0x10 # BAD32: invalid instruction encoding
+0xCE 0x10 # GOOD64: c.slli ra, 51
+0xD2 0x10 # BAD32: invalid instruction encoding
+0xD2 0x10 # GOOD64: c.slli ra, 52
+0xD6 0x10 # BAD32: invalid instruction encoding
+0xD6 0x10 # GOOD64: c.slli ra, 53
+0xDA 0x10 # BAD32: invalid instruction encoding
+0xDA 0x10 # GOOD64: c.slli ra, 54
+0xDE 0x10 # BAD32: invalid instruction encoding
+0xDE 0x10 # GOOD64: c.slli ra, 55
+0xE2 0x10 # BAD32: invalid instruction encoding
+0xE2 0x10 # GOOD64: c.slli ra, 56
+0xE6 0x10 # BAD32: invalid instruction encoding
+0xE6 0x10 # GOOD64: c.slli ra, 57
+0xEA 0x10 # BAD32: invalid instruction encoding
+0xEA 0x10 # GOOD64: c.slli ra, 58
+0xEE 0x10 # BAD32: invalid instruction encoding
+0xEE 0x10 # GOOD64: c.slli ra, 59
+0xF2 0x10 # BAD32: invalid instruction encoding
+0xF2 0x10 # GOOD64: c.slli ra, 60
+0xF6 0x10 # BAD32: invalid instruction encoding
+0xF6 0x10 # GOOD64: c.slli ra, 61
+0xFA 0x10 # BAD32: invalid instruction encoding
+0xFA 0x10 # GOOD64: c.slli ra, 62
+0xFE 0x10 # BAD32: invalid instruction encoding
+0xFE 0x10 # GOOD64: c.slli ra, 63
+0x06 0x01 # GOOD: c.slli sp, 1
+0x0A 0x01 # GOOD: c.slli sp, 2
+0x0E 0x01 # GOOD: c.slli sp, 3
+0x12 0x01 # GOOD: c.slli sp, 4
+0x16 0x01 # GOOD: c.slli sp, 5
+0x1A 0x01 # GOOD: c.slli sp, 6
+0x1E 0x01 # GOOD: c.slli sp, 7
+0x22 0x01 # GOOD: c.slli sp, 8
+0x26 0x01 # GOOD: c.slli sp, 9
+0x2A 0x01 # GOOD: c.slli sp, 10
+0x2E 0x01 # GOOD: c.slli sp, 11
+0x32 0x01 # GOOD: c.slli sp, 12
+0x36 0x01 # GOOD: c.slli sp, 13
+0x3A 0x01 # GOOD: c.slli sp, 14
+0x3E 0x01 # GOOD: c.slli sp, 15
+0x42 0x01 # GOOD: c.slli sp, 16
+0x46 0x01 # GOOD: c.slli sp, 17
+0x4A 0x01 # GOOD: c.slli sp, 18
+0x4E 0x01 # GOOD: c.slli sp, 19
+0x52 0x01 # GOOD: c.slli sp, 20
+0x56 0x01 # GOOD: c.slli sp, 21
+0x5A 0x01 # GOOD: c.slli sp, 22
+0x5E 0x01 # GOOD: c.slli sp, 23
+0x62 0x01 # GOOD: c.slli sp, 24
+0x66 0x01 # GOOD: c.slli sp, 25
+0x6A 0x01 # GOOD: c.slli sp, 26
+0x6E 0x01 # GOOD: c.slli sp, 27
+0x72 0x01 # GOOD: c.slli sp, 28
+0x76 0x01 # GOOD: c.slli sp, 29
+0x7A 0x01 # GOOD: c.slli sp, 30
+0x7E 0x01 # GOOD: c.slli sp, 31
+0x02 0x11 # BAD32: invalid instruction encoding
+0x02 0x11 # GOOD64: c.slli sp, 32
+0x06 0x11 # BAD32: invalid instruction encoding
+0x06 0x11 # GOOD64: c.slli sp, 33
+0x0A 0x11 # BAD32: invalid instruction encoding
+0x0A 0x11 # GOOD64: c.slli sp, 34
+0x0E 0x11 # BAD32: invalid instruction encoding
+0x0E 0x11 # GOOD64: c.slli sp, 35
+0x12 0x11 # BAD32: invalid instruction encoding
+0x12 0x11 # GOOD64: c.slli sp, 36
+0x16 0x11 # BAD32: invalid instruction encoding
+0x16 0x11 # GOOD64: c.slli sp, 37
+0x1A 0x11 # BAD32: invalid instruction encoding
+0x1A 0x11 # GOOD64: c.slli sp, 38
+0x1E 0x11 # BAD32: invalid instruction encoding
+0x1E 0x11 # GOOD64: c.slli sp, 39
+0x22 0x11 # BAD32: invalid instruction encoding
+0x22 0x11 # GOOD64: c.slli sp, 40
+0x26 0x11 # BAD32: invalid instruction encoding
+0x26 0x11 # GOOD64: c.slli sp, 41
+0x2A 0x11 # BAD32: invalid instruction encoding
+0x2A 0x11 # GOOD64: c.slli sp, 42
+0x2E 0x11 # BAD32: invalid instruction encoding
+0x2E 0x11 # GOOD64: c.slli sp, 43
+0x32 0x11 # BAD32: invalid instruction encoding
+0x32 0x11 # GOOD64: c.slli sp, 44
+0x36 0x11 # BAD32: invalid instruction encoding
+0x36 0x11 # GOOD64: c.slli sp, 45
+0x3A 0x11 # BAD32: invalid instruction encoding
+0x3A 0x11 # GOOD64: c.slli sp, 46
+0x3E 0x11 # BAD32: invalid instruction encoding
+0x3E 0x11 # GOOD64: c.slli sp, 47
+0x42 0x11 # BAD32: invalid instruction encoding
+0x42 0x11 # GOOD64: c.slli sp, 48
+0x46 0x11 # BAD32: invalid instruction encoding
+0x46 0x11 # GOOD64: c.slli sp, 49
+0x4A 0x11 # BAD32: invalid instruction encoding
+0x4A 0x11 # GOOD64: c.slli sp, 50
+0x4E 0x11 # BAD32: invalid instruction encoding
+0x4E 0x11 # GOOD64: c.slli sp, 51
+0x52 0x11 # BAD32: invalid instruction encoding
+0x52 0x11 # GOOD64: c.slli sp, 52
+0x56 0x11 # BAD32: invalid instruction encoding
+0x56 0x11 # GOOD64: c.slli sp, 53
+0x5A 0x11 # BAD32: invalid instruction encoding
+0x5A 0x11 # GOOD64: c.slli sp, 54
+0x5E 0x11 # BAD32: invalid instruction encoding
+0x5E 0x11 # GOOD64: c.slli sp, 55
+0x62 0x11 # BAD32: invalid instruction encoding
+0x62 0x11 # GOOD64: c.slli sp, 56
+0x66 0x11 # BAD32: invalid instruction encoding
+0x66 0x11 # GOOD64: c.slli sp, 57
+0x6A 0x11 # BAD32: invalid instruction encoding
+0x6A 0x11 # GOOD64: c.slli sp, 58
+0x6E 0x11 # BAD32: invalid instruction encoding
+0x6E 0x11 # GOOD64: c.slli sp, 59
+0x72 0x11 # BAD32: invalid instruction encoding
+0x72 0x11 # GOOD64: c.slli sp, 60
+0x76 0x11 # BAD32: invalid instruction encoding
+0x76 0x11 # GOOD64: c.slli sp, 61
+0x7A 0x11 # BAD32: invalid instruction encoding
+0x7A 0x11 # GOOD64: c.slli sp, 62
+0x7E 0x11 # BAD32: invalid instruction encoding
+0x7E 0x11 # GOOD64: c.slli sp, 63
+0x86 0x01 # GOOD: c.slli gp, 1
+0x8A 0x01 # GOOD: c.slli gp, 2
+0x8E 0x01 # GOOD: c.slli gp, 3
+0x92 0x01 # GOOD: c.slli gp, 4
+0x96 0x01 # GOOD: c.slli gp, 5
+0x9A 0x01 # GOOD: c.slli gp, 6
+0x9E 0x01 # GOOD: c.slli gp, 7
+0xA2 0x01 # GOOD: c.slli gp, 8
+0xA6 0x01 # GOOD: c.slli gp, 9
+0xAA 0x01 # GOOD: c.slli gp, 10
+0xAE 0x01 # GOOD: c.slli gp, 11
+0xB2 0x01 # GOOD: c.slli gp, 12
+0xB6 0x01 # GOOD: c.slli gp, 13
+0xBA 0x01 # GOOD: c.slli gp, 14
+0xBE 0x01 # GOOD: c.slli gp, 15
+0xC2 0x01 # GOOD: c.slli gp, 16
+0xC6 0x01 # GOOD: c.slli gp, 17
+0xCA 0x01 # GOOD: c.slli gp, 18
+0xCE 0x01 # GOOD: c.slli gp, 19
+0xD2 0x01 # GOOD: c.slli gp, 20
+0xD6 0x01 # GOOD: c.slli gp, 21
+0xDA 0x01 # GOOD: c.slli gp, 22
+0xDE 0x01 # GOOD: c.slli gp, 23
+0xE2 0x01 # GOOD: c.slli gp, 24
+0xE6 0x01 # GOOD: c.slli gp, 25
+0xEA 0x01 # GOOD: c.slli gp, 26
+0xEE 0x01 # GOOD: c.slli gp, 27
+0xF2 0x01 # GOOD: c.slli gp, 28
+0xF6 0x01 # GOOD: c.slli gp, 29
+0xFA 0x01 # GOOD: c.slli gp, 30
+0xFE 0x01 # GOOD: c.slli gp, 31
+0x82 0x11 # BAD32: invalid instruction encoding
+0x82 0x11 # GOOD64: c.slli gp, 32
+0x86 0x11 # BAD32: invalid instruction encoding
+0x86 0x11 # GOOD64: c.slli gp, 33
+0x8A 0x11 # BAD32: invalid instruction encoding
+0x8A 0x11 # GOOD64: c.slli gp, 34
+0x8E 0x11 # BAD32: invalid instruction encoding
+0x8E 0x11 # GOOD64: c.slli gp, 35
+0x92 0x11 # BAD32: invalid instruction encoding
+0x92 0x11 # GOOD64: c.slli gp, 36
+0x96 0x11 # BAD32: invalid instruction encoding
+0x96 0x11 # GOOD64: c.slli gp, 37
+0x9A 0x11 # BAD32: invalid instruction encoding
+0x9A 0x11 # GOOD64: c.slli gp, 38
+0x9E 0x11 # BAD32: invalid instruction encoding
+0x9E 0x11 # GOOD64: c.slli gp, 39
+0xA2 0x11 # BAD32: invalid instruction encoding
+0xA2 0x11 # GOOD64: c.slli gp, 40
+0xA6 0x11 # BAD32: invalid instruction encoding
+0xA6 0x11 # GOOD64: c.slli gp, 41
+0xAA 0x11 # BAD32: invalid instruction encoding
+0xAA 0x11 # GOOD64: c.slli gp, 42
+0xAE 0x11 # BAD32: invalid instruction encoding
+0xAE 0x11 # GOOD64: c.slli gp, 43
+0xB2 0x11 # BAD32: invalid instruction encoding
+0xB2 0x11 # GOOD64: c.slli gp, 44
+0xB6 0x11 # BAD32: invalid instruction encoding
+0xB6 0x11 # GOOD64: c.slli gp, 45
+0xBA 0x11 # BAD32: invalid instruction encoding
+0xBA 0x11 # GOOD64: c.slli gp, 46
+0xBE 0x11 # BAD32: invalid instruction encoding
+0xBE 0x11 # GOOD64: c.slli gp, 47
+0xC2 0x11 # BAD32: invalid instruction encoding
+0xC2 0x11 # GOOD64: c.slli gp, 48
+0xC6 0x11 # BAD32: invalid instruction encoding
+0xC6 0x11 # GOOD64: c.slli gp, 49
+0xCA 0x11 # BAD32: invalid instruction encoding
+0xCA 0x11 # GOOD64: c.slli gp, 50
+0xCE 0x11 # BAD32: invalid instruction encoding
+0xCE 0x11 # GOOD64: c.slli gp, 51
+0xD2 0x11 # BAD32: invalid instruction encoding
+0xD2 0x11 # GOOD64: c.slli gp, 52
+0xD6 0x11 # BAD32: invalid instruction encoding
+0xD6 0x11 # GOOD64: c.slli gp, 53
+0xDA 0x11 # BAD32: invalid instruction encoding
+0xDA 0x11 # GOOD64: c.slli gp, 54
+0xDE 0x11 # BAD32: invalid instruction encoding
+0xDE 0x11 # GOOD64: c.s...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/133713
More information about the llvm-commits
mailing list