[llvm] [riscv] Fix the disassembler's handling of C.LUI when imm=0 (PR #133450)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 28 07:58:52 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-backend-risc-v
@llvm/pr-subscribers-mc
Author: Paul Bowen-Huggett (paulhuggett)
<details>
<summary>Changes</summary>
According to the RISC-V spec: "C.LUI is valid only when rd≠{x0,x2}, and when the immediate is not equal to zero. The code points with imm=0 are reserved".
This change makes the disassembler consider code points with imm=0 as illegal. It introduces a test which exercises every C.LUI opcode including the illegal ones but excluding those assigned to C.ADDI16SP). Output for +c, +c +Zcmop, and +c +no-rvc-hints is checked.
---
Patch is 72.18 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/133450.diff
2 Files Affected:
- (modified) llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp (+3)
- (added) llvm/test/MC/RISCV/c_lui_disasm.s (+2073)
``````````diff
diff --git a/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp b/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp
index 15f9ea0bb86bd..048f8e4edd44f 100644
--- a/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp
+++ b/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp
@@ -453,6 +453,9 @@ static DecodeStatus decodeCLUIImmOperand(MCInst &Inst, uint32_t Imm,
int64_t Address,
const MCDisassembler *Decoder) {
assert(isUInt<6>(Imm) && "Invalid immediate");
+ if (Imm == 0) {
+ return MCDisassembler::Fail;
+ }
if (Imm > 31) {
Imm = (SignExtend64<6>(Imm) & 0xfffff);
}
diff --git a/llvm/test/MC/RISCV/c_lui_disasm.s b/llvm/test/MC/RISCV/c_lui_disasm.s
new file mode 100644
index 0000000000000..e0002acd5ac6f
--- /dev/null
+++ b/llvm/test/MC/RISCV/c_lui_disasm.s
@@ -0,0 +1,2073 @@
+# 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-prefix=GOOD %s
+#
+# RUN: llvm-mc --disassemble -triple=riscv32 -mattr=+c -M no-aliases \
+# RUN: --show-encoding < %s 2>&1 | FileCheck --check-prefix=BAD %s
+#
+# RUN: llvm-mc --disassemble -triple=riscv32 -mattr=+c -mattr=+Zcmop \
+# RUN: -M no-aliases --show-encoding < %s | \
+# RUN: FileCheck --check-prefixes=GOOD,MOP %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
+
+0x01 0x60 # BAD: invalid instruction encoding
+0x01 0x60 # NOHINTS: invalid instruction encoding
+0x05 0x60 # GOOD: c.lui zero, 1
+0x05 0x60 # NOHINTS: invalid instruction encoding
+0x09 0x60 # GOOD: c.lui zero, 2
+0x09 0x60 # NOHINTS: invalid instruction encoding
+0x0D 0x60 # GOOD: c.lui zero, 3
+0x0D 0x60 # NOHINTS: invalid instruction encoding
+0x11 0x60 # GOOD: c.lui zero, 4
+0x11 0x60 # NOHINTS: invalid instruction encoding
+0x15 0x60 # GOOD: c.lui zero, 5
+0x15 0x60 # NOHINTS: invalid instruction encoding
+0x19 0x60 # GOOD: c.lui zero, 6
+0x19 0x60 # NOHINTS: invalid instruction encoding
+0x1D 0x60 # GOOD: c.lui zero, 7
+0x1D 0x60 # NOHINTS: invalid instruction encoding
+0x21 0x60 # GOOD: c.lui zero, 8
+0x21 0x60 # NOHINTS: invalid instruction encoding
+0x25 0x60 # GOOD: c.lui zero, 9
+0x25 0x60 # NOHINTS: invalid instruction encoding
+0x29 0x60 # GOOD: c.lui zero, 10
+0x29 0x60 # NOHINTS: invalid instruction encoding
+0x2D 0x60 # GOOD: c.lui zero, 11
+0x2D 0x60 # NOHINTS: invalid instruction encoding
+0x31 0x60 # GOOD: c.lui zero, 12
+0x31 0x60 # NOHINTS: invalid instruction encoding
+0x35 0x60 # GOOD: c.lui zero, 13
+0x35 0x60 # NOHINTS: invalid instruction encoding
+0x39 0x60 # GOOD: c.lui zero, 14
+0x39 0x60 # NOHINTS: invalid instruction encoding
+0x3D 0x60 # GOOD: c.lui zero, 15
+0x3D 0x60 # NOHINTS: invalid instruction encoding
+0x41 0x60 # GOOD: c.lui zero, 16
+0x41 0x60 # NOHINTS: invalid instruction encoding
+0x45 0x60 # GOOD: c.lui zero, 17
+0x45 0x60 # NOHINTS: invalid instruction encoding
+0x49 0x60 # GOOD: c.lui zero, 18
+0x49 0x60 # NOHINTS: invalid instruction encoding
+0x4D 0x60 # GOOD: c.lui zero, 19
+0x4D 0x60 # NOHINTS: invalid instruction encoding
+0x51 0x60 # GOOD: c.lui zero, 20
+0x51 0x60 # NOHINTS: invalid instruction encoding
+0x55 0x60 # GOOD: c.lui zero, 21
+0x55 0x60 # NOHINTS: invalid instruction encoding
+0x59 0x60 # GOOD: c.lui zero, 22
+0x59 0x60 # NOHINTS: invalid instruction encoding
+0x5D 0x60 # GOOD: c.lui zero, 23
+0x5D 0x60 # NOHINTS: invalid instruction encoding
+0x61 0x60 # GOOD: c.lui zero, 24
+0x61 0x60 # NOHINTS: invalid instruction encoding
+0x65 0x60 # GOOD: c.lui zero, 25
+0x65 0x60 # NOHINTS: invalid instruction encoding
+0x69 0x60 # GOOD: c.lui zero, 26
+0x69 0x60 # NOHINTS: invalid instruction encoding
+0x6D 0x60 # GOOD: c.lui zero, 27
+0x6D 0x60 # NOHINTS: invalid instruction encoding
+0x71 0x60 # GOOD: c.lui zero, 28
+0x71 0x60 # NOHINTS: invalid instruction encoding
+0x75 0x60 # GOOD: c.lui zero, 29
+0x75 0x60 # NOHINTS: invalid instruction encoding
+0x79 0x60 # GOOD: c.lui zero, 30
+0x79 0x60 # NOHINTS: invalid instruction encoding
+0x7D 0x60 # GOOD: c.lui zero, 31
+0x7D 0x60 # NOHINTS: invalid instruction encoding
+0x01 0x70 # GOOD: c.lui zero, -32
+0x01 0x70 # NOHINTS: invalid instruction encoding
+0x05 0x70 # GOOD: c.lui zero, -31
+0x05 0x70 # NOHINTS: invalid instruction encoding
+0x09 0x70 # GOOD: c.lui zero, -30
+0x09 0x70 # NOHINTS: invalid instruction encoding
+0x0D 0x70 # GOOD: c.lui zero, -29
+0x0D 0x70 # NOHINTS: invalid instruction encoding
+0x11 0x70 # GOOD: c.lui zero, -28
+0x11 0x70 # NOHINTS: invalid instruction encoding
+0x15 0x70 # GOOD: c.lui zero, -27
+0x15 0x70 # NOHINTS: invalid instruction encoding
+0x19 0x70 # GOOD: c.lui zero, -26
+0x19 0x70 # NOHINTS: invalid instruction encoding
+0x1D 0x70 # GOOD: c.lui zero, -25
+0x1D 0x70 # NOHINTS: invalid instruction encoding
+0x21 0x70 # GOOD: c.lui zero, -24
+0x21 0x70 # NOHINTS: invalid instruction encoding
+0x25 0x70 # GOOD: c.lui zero, -23
+0x25 0x70 # NOHINTS: invalid instruction encoding
+0x29 0x70 # GOOD: c.lui zero, -22
+0x29 0x70 # NOHINTS: invalid instruction encoding
+0x2D 0x70 # GOOD: c.lui zero, -21
+0x2D 0x70 # NOHINTS: invalid instruction encoding
+0x31 0x70 # GOOD: c.lui zero, -20
+0x31 0x70 # NOHINTS: invalid instruction encoding
+0x35 0x70 # GOOD: c.lui zero, -19
+0x35 0x70 # NOHINTS: invalid instruction encoding
+0x39 0x70 # GOOD: c.lui zero, -18
+0x39 0x70 # NOHINTS: invalid instruction encoding
+0x3D 0x70 # GOOD: c.lui zero, -17
+0x3D 0x70 # NOHINTS: invalid instruction encoding
+0x41 0x70 # GOOD: c.lui zero, -16
+0x41 0x70 # NOHINTS: invalid instruction encoding
+0x45 0x70 # GOOD: c.lui zero, -15
+0x45 0x70 # NOHINTS: invalid instruction encoding
+0x49 0x70 # GOOD: c.lui zero, -14
+0x49 0x70 # NOHINTS: invalid instruction encoding
+0x4D 0x70 # GOOD: c.lui zero, -13
+0x4D 0x70 # NOHINTS: invalid instruction encoding
+0x51 0x70 # GOOD: c.lui zero, -12
+0x51 0x70 # NOHINTS: invalid instruction encoding
+0x55 0x70 # GOOD: c.lui zero, -11
+0x55 0x70 # NOHINTS: invalid instruction encoding
+0x59 0x70 # GOOD: c.lui zero, -10
+0x59 0x70 # NOHINTS: invalid instruction encoding
+0x5D 0x70 # GOOD: c.lui zero, -9
+0x5D 0x70 # NOHINTS: invalid instruction encoding
+0x61 0x70 # GOOD: c.lui zero, -8
+0x61 0x70 # NOHINTS: invalid instruction encoding
+0x65 0x70 # GOOD: c.lui zero, -7
+0x65 0x70 # NOHINTS: invalid instruction encoding
+0x69 0x70 # GOOD: c.lui zero, -6
+0x69 0x70 # NOHINTS: invalid instruction encoding
+0x6D 0x70 # GOOD: c.lui zero, -5
+0x6D 0x70 # NOHINTS: invalid instruction encoding
+0x71 0x70 # GOOD: c.lui zero, -4
+0x71 0x70 # NOHINTS: invalid instruction encoding
+0x75 0x70 # GOOD: c.lui zero, -3
+0x75 0x70 # NOHINTS: invalid instruction encoding
+0x79 0x70 # GOOD: c.lui zero, -2
+0x79 0x70 # NOHINTS: invalid instruction encoding
+0x7D 0x70 # GOOD: c.lui zero, -1
+0x7D 0x70 # NOHINTS: invalid instruction encoding
+0x81 0x60 # BAD: invalid instruction encoding
+0x81 0x60 # MOP: c.mop.1
+0x85 0x60 # GOOD: c.lui ra, 1
+0x89 0x60 # GOOD: c.lui ra, 2
+0x8D 0x60 # GOOD: c.lui ra, 3
+0x91 0x60 # GOOD: c.lui ra, 4
+0x95 0x60 # GOOD: c.lui ra, 5
+0x99 0x60 # GOOD: c.lui ra, 6
+0x9D 0x60 # GOOD: c.lui ra, 7
+0xA1 0x60 # GOOD: c.lui ra, 8
+0xA5 0x60 # GOOD: c.lui ra, 9
+0xA9 0x60 # GOOD: c.lui ra, 10
+0xAD 0x60 # GOOD: c.lui ra, 11
+0xB1 0x60 # GOOD: c.lui ra, 12
+0xB5 0x60 # GOOD: c.lui ra, 13
+0xB9 0x60 # GOOD: c.lui ra, 14
+0xBD 0x60 # GOOD: c.lui ra, 15
+0xC1 0x60 # GOOD: c.lui ra, 16
+0xC5 0x60 # GOOD: c.lui ra, 17
+0xC9 0x60 # GOOD: c.lui ra, 18
+0xCD 0x60 # GOOD: c.lui ra, 19
+0xD1 0x60 # GOOD: c.lui ra, 20
+0xD5 0x60 # GOOD: c.lui ra, 21
+0xD9 0x60 # GOOD: c.lui ra, 22
+0xDD 0x60 # GOOD: c.lui ra, 23
+0xE1 0x60 # GOOD: c.lui ra, 24
+0xE5 0x60 # GOOD: c.lui ra, 25
+0xE9 0x60 # GOOD: c.lui ra, 26
+0xED 0x60 # GOOD: c.lui ra, 27
+0xF1 0x60 # GOOD: c.lui ra, 28
+0xF5 0x60 # GOOD: c.lui ra, 29
+0xF9 0x60 # GOOD: c.lui ra, 30
+0xFD 0x60 # GOOD: c.lui ra, 31
+0x81 0x70 # GOOD: c.lui ra, 1048544
+0x85 0x70 # GOOD: c.lui ra, 1048545
+0x89 0x70 # GOOD: c.lui ra, 1048546
+0x8D 0x70 # GOOD: c.lui ra, 1048547
+0x91 0x70 # GOOD: c.lui ra, 1048548
+0x95 0x70 # GOOD: c.lui ra, 1048549
+0x99 0x70 # GOOD: c.lui ra, 1048550
+0x9D 0x70 # GOOD: c.lui ra, 1048551
+0xA1 0x70 # GOOD: c.lui ra, 1048552
+0xA5 0x70 # GOOD: c.lui ra, 1048553
+0xA9 0x70 # GOOD: c.lui ra, 1048554
+0xAD 0x70 # GOOD: c.lui ra, 1048555
+0xB1 0x70 # GOOD: c.lui ra, 1048556
+0xB5 0x70 # GOOD: c.lui ra, 1048557
+0xB9 0x70 # GOOD: c.lui ra, 1048558
+0xBD 0x70 # GOOD: c.lui ra, 1048559
+0xC1 0x70 # GOOD: c.lui ra, 1048560
+0xC5 0x70 # GOOD: c.lui ra, 1048561
+0xC9 0x70 # GOOD: c.lui ra, 1048562
+0xCD 0x70 # GOOD: c.lui ra, 1048563
+0xD1 0x70 # GOOD: c.lui ra, 1048564
+0xD5 0x70 # GOOD: c.lui ra, 1048565
+0xD9 0x70 # GOOD: c.lui ra, 1048566
+0xDD 0x70 # GOOD: c.lui ra, 1048567
+0xE1 0x70 # GOOD: c.lui ra, 1048568
+0xE5 0x70 # GOOD: c.lui ra, 1048569
+0xE9 0x70 # GOOD: c.lui ra, 1048570
+0xED 0x70 # GOOD: c.lui ra, 1048571
+0xF1 0x70 # GOOD: c.lui ra, 1048572
+0xF5 0x70 # GOOD: c.lui ra, 1048573
+0xF9 0x70 # GOOD: c.lui ra, 1048574
+0xFD 0x70 # GOOD: c.lui ra, 1048575
+0x81 0x61 # BAD: invalid instruction encoding
+0x81 0x61 # MOP: c.mop.3
+0x85 0x61 # GOOD: c.lui gp, 1
+0x89 0x61 # GOOD: c.lui gp, 2
+0x8D 0x61 # GOOD: c.lui gp, 3
+0x91 0x61 # GOOD: c.lui gp, 4
+0x95 0x61 # GOOD: c.lui gp, 5
+0x99 0x61 # GOOD: c.lui gp, 6
+0x9D 0x61 # GOOD: c.lui gp, 7
+0xA1 0x61 # GOOD: c.lui gp, 8
+0xA5 0x61 # GOOD: c.lui gp, 9
+0xA9 0x61 # GOOD: c.lui gp, 10
+0xAD 0x61 # GOOD: c.lui gp, 11
+0xB1 0x61 # GOOD: c.lui gp, 12
+0xB5 0x61 # GOOD: c.lui gp, 13
+0xB9 0x61 # GOOD: c.lui gp, 14
+0xBD 0x61 # GOOD: c.lui gp, 15
+0xC1 0x61 # GOOD: c.lui gp, 16
+0xC5 0x61 # GOOD: c.lui gp, 17
+0xC9 0x61 # GOOD: c.lui gp, 18
+0xCD 0x61 # GOOD: c.lui gp, 19
+0xD1 0x61 # GOOD: c.lui gp, 20
+0xD5 0x61 # GOOD: c.lui gp, 21
+0xD9 0x61 # GOOD: c.lui gp, 22
+0xDD 0x61 # GOOD: c.lui gp, 23
+0xE1 0x61 # GOOD: c.lui gp, 24
+0xE5 0x61 # GOOD: c.lui gp, 25
+0xE9 0x61 # GOOD: c.lui gp, 26
+0xED 0x61 # GOOD: c.lui gp, 27
+0xF1 0x61 # GOOD: c.lui gp, 28
+0xF5 0x61 # GOOD: c.lui gp, 29
+0xF9 0x61 # GOOD: c.lui gp, 30
+0xFD 0x61 # GOOD: c.lui gp, 31
+0x81 0x71 # GOOD: c.lui gp, 1048544
+0x85 0x71 # GOOD: c.lui gp, 1048545
+0x89 0x71 # GOOD: c.lui gp, 1048546
+0x8D 0x71 # GOOD: c.lui gp, 1048547
+0x91 0x71 # GOOD: c.lui gp, 1048548
+0x95 0x71 # GOOD: c.lui gp, 1048549
+0x99 0x71 # GOOD: c.lui gp, 1048550
+0x9D 0x71 # GOOD: c.lui gp, 1048551
+0xA1 0x71 # GOOD: c.lui gp, 1048552
+0xA5 0x71 # GOOD: c.lui gp, 1048553
+0xA9 0x71 # GOOD: c.lui gp, 1048554
+0xAD 0x71 # GOOD: c.lui gp, 1048555
+0xB1 0x71 # GOOD: c.lui gp, 1048556
+0xB5 0x71 # GOOD: c.lui gp, 1048557
+0xB9 0x71 # GOOD: c.lui gp, 1048558
+0xBD 0x71 # GOOD: c.lui gp, 1048559
+0xC1 0x71 # GOOD: c.lui gp, 1048560
+0xC5 0x71 # GOOD: c.lui gp, 1048561
+0xC9 0x71 # GOOD: c.lui gp, 1048562
+0xCD 0x71 # GOOD: c.lui gp, 1048563
+0xD1 0x71 # GOOD: c.lui gp, 1048564
+0xD5 0x71 # GOOD: c.lui gp, 1048565
+0xD9 0x71 # GOOD: c.lui gp, 1048566
+0xDD 0x71 # GOOD: c.lui gp, 1048567
+0xE1 0x71 # GOOD: c.lui gp, 1048568
+0xE5 0x71 # GOOD: c.lui gp, 1048569
+0xE9 0x71 # GOOD: c.lui gp, 1048570
+0xED 0x71 # GOOD: c.lui gp, 1048571
+0xF1 0x71 # GOOD: c.lui gp, 1048572
+0xF5 0x71 # GOOD: c.lui gp, 1048573
+0xF9 0x71 # GOOD: c.lui gp, 1048574
+0xFD 0x71 # GOOD: c.lui gp, 1048575
+0x01 0x62 # BAD: invalid instruction encoding
+0x05 0x62 # GOOD: c.lui tp, 1
+0x09 0x62 # GOOD: c.lui tp, 2
+0x0D 0x62 # GOOD: c.lui tp, 3
+0x11 0x62 # GOOD: c.lui tp, 4
+0x15 0x62 # GOOD: c.lui tp, 5
+0x19 0x62 # GOOD: c.lui tp, 6
+0x1D 0x62 # GOOD: c.lui tp, 7
+0x21 0x62 # GOOD: c.lui tp, 8
+0x25 0x62 # GOOD: c.lui tp, 9
+0x29 0x62 # GOOD: c.lui tp, 10
+0x2D 0x62 # GOOD: c.lui tp, 11
+0x31 0x62 # GOOD: c.lui tp, 12
+0x35 0x62 # GOOD: c.lui tp, 13
+0x39 0x62 # GOOD: c.lui tp, 14
+0x3D 0x62 # GOOD: c.lui tp, 15
+0x41 0x62 # GOOD: c.lui tp, 16
+0x45 0x62 # GOOD: c.lui tp, 17
+0x49 0x62 # GOOD: c.lui tp, 18
+0x4D 0x62 # GOOD: c.lui tp, 19
+0x51 0x62 # GOOD: c.lui tp, 20
+0x55 0x62 # GOOD: c.lui tp, 21
+0x59 0x62 # GOOD: c.lui tp, 22
+0x5D 0x62 # GOOD: c.lui tp, 23
+0x61 0x62 # GOOD: c.lui tp, 24
+0x65 0x62 # GOOD: c.lui tp, 25
+0x69 0x62 # GOOD: c.lui tp, 26
+0x6D 0x62 # GOOD: c.lui tp, 27
+0x71 0x62 # GOOD: c.lui tp, 28
+0x75 0x62 # GOOD: c.lui tp, 29
+0x79 0x62 # GOOD: c.lui tp, 30
+0x7D 0x62 # GOOD: c.lui tp, 31
+0x01 0x72 # GOOD: c.lui tp, 1048544
+0x05 0x72 # GOOD: c.lui tp, 1048545
+0x09 0x72 # GOOD: c.lui tp, 1048546
+0x0D 0x72 # GOOD: c.lui tp, 1048547
+0x11 0x72 # GOOD: c.lui tp, 1048548
+0x15 0x72 # GOOD: c.lui tp, 1048549
+0x19 0x72 # GOOD: c.lui tp, 1048550
+0x1D 0x72 # GOOD: c.lui tp, 1048551
+0x21 0x72 # GOOD: c.lui tp, 1048552
+0x25 0x72 # GOOD: c.lui tp, 1048553
+0x29 0x72 # GOOD: c.lui tp, 1048554
+0x2D 0x72 # GOOD: c.lui tp, 1048555
+0x31 0x72 # GOOD: c.lui tp, 1048556
+0x35 0x72 # GOOD: c.lui tp, 1048557
+0x39 0x72 # GOOD: c.lui tp, 1048558
+0x3D 0x72 # GOOD: c.lui tp, 1048559
+0x41 0x72 # GOOD: c.lui tp, 1048560
+0x45 0x72 # GOOD: c.lui tp, 1048561
+0x49 0x72 # GOOD: c.lui tp, 1048562
+0x4D 0x72 # GOOD: c.lui tp, 1048563
+0x51 0x72 # GOOD: c.lui tp, 1048564
+0x55 0x72 # GOOD: c.lui tp, 1048565
+0x59 0x72 # GOOD: c.lui tp, 1048566
+0x5D 0x72 # GOOD: c.lui tp, 1048567
+0x61 0x72 # GOOD: c.lui tp, 1048568
+0x65 0x72 # GOOD: c.lui tp, 1048569
+0x69 0x72 # GOOD: c.lui tp, 1048570
+0x6D 0x72 # GOOD: c.lui tp, 1048571
+0x71 0x72 # GOOD: c.lui tp, 1048572
+0x75 0x72 # GOOD: c.lui tp, 1048573
+0x79 0x72 # GOOD: c.lui tp, 1048574
+0x7D 0x72 # GOOD: c.lui tp, 1048575
+0x81 0x62 # BAD: invalid instruction encoding
+0x81 0x62 # MOP: c.mop.5
+0x85 0x62 # GOOD: c.lui t0, 1
+0x89 0x62 # GOOD: c.lui t0, 2
+0x8D 0x62 # GOOD: c.lui t0, 3
+0x91 0x62 # GOOD: c.lui t0, 4
+0x95 0x62 # GOOD: c.lui t0, 5
+0x99 0x62 # GOOD: c.lui t0, 6
+0x9D 0x62 # GOOD: c.lui t0, 7
+0xA1 0x62 # GOOD: c.lui t0, 8
+0xA5 0x62 # GOOD: c.lui t0, 9
+0xA9 0x62 # GOOD: c.lui t0, 10
+0xAD 0x62 # GOOD: c.lui t0, 11
+0xB1 0x62 # GOOD: c.lui t0, 12
+0xB5 0x62 # GOOD: c.lui t0, 13
+0xB9 0x62 # GOOD: c.lui t0, 14
+0xBD 0x62 # GOOD: c.lui t0, 15
+0xC1 0x62 # GOOD: c.lui t0, 16
+0xC5 0x62 # GOOD: c.lui t0, 17
+0xC9 0x62 # GOOD: c.lui t0, 18
+0xCD 0x62 # GOOD: c.lui t0, 19
+0xD1 0x62 # GOOD: c.lui t0, 20
+0xD5 0x62 # GOOD: c.lui t0, 21
+0xD9 0x62 # GOOD: c.lui t0, 22
+0xDD 0x62 # GOOD: c.lui t0, 23
+0xE1 0x62 # GOOD: c.lui t0, 24
+0xE5 0x62 # GOOD: c.lui t0, 25
+0xE9 0x62 # GOOD: c.lui t0, 26
+0xED 0x62 # GOOD: c.lui t0, 27
+0xF1 0x62 # GOOD: c.lui t0, 28
+0xF5 0x62 # GOOD: c.lui t0, 29
+0xF9 0x62 # GOOD: c.lui t0, 30
+0xFD 0x62 # GOOD: c.lui t0, 31
+0x81 0x72 # GOOD: c.lui t0, 1048544
+0x85 0x72 # GOOD: c.lui t0, 1048545
+0x89 0x72 # GOOD: c.lui t0, 1048546
+0x8D 0x72 # GOOD: c.lui t0, 1048547
+0x91 0x72 # GOOD: c.lui t0, 1048548
+0x95 0x72 # GOOD: c.lui t0, 1048549
+0x99 0x72 # GOOD: c.lui t0, 1048550
+0x9D 0x72 # GOOD: c.lui t0, 1048551
+0xA1 0x72 # GOOD: c.lui t0, 1048552
+0xA5 0x72 # GOOD: c.lui t0, 1048553
+0xA9 0x72 # GOOD: c.lui t0, 1048554
+0xAD 0x72 # GOOD: c.lui t0, 1048555
+0xB1 0x72 # GOOD: c.lui t0, 1048556
+0xB5 0x72 # GOOD: c.lui t0, 1048557
+0xB9 0x72 # GOOD: c.lui t0, 1048558
+0xBD 0x72 # GOOD: c.lui t0, 1048559
+0xC1 0x72 # GOOD: c.lui t0, 1048560
+0xC5 0x72 # GOOD: c.lui t0, 1048561
+0xC9 0x72 # GOOD: c.lui t0, 1048562
+0xCD 0x72 # GOOD: c.lui t0, 1048563
+0xD1 0x72 # GOOD: c.lui t0, 1048564
+0xD5 0x72 # GOOD: c.lui t0, 1048565
+0xD9 0x72 # GOOD: c.lui t0, 1048566
+0xDD 0x72 # GOOD: c.lui t0, 1048567
+0xE1 0x72 # GOOD: c.lui t0, 1048568
+0xE5 0x72 # GOOD: c.lui t0, 1048569
+0xE9 0x72 # GOOD: c.lui t0, 1048570
+0xED 0x72 # GOOD: c.lui t0, 1048571
+0xF1 0x72 # GOOD: c.lui t0, 1048572
+0xF5 0x72 # GOOD: c.lui t0, 1048573
+0xF9 0x72 # GOOD: c.lui t0, 1048574
+0xFD 0x72 # GOOD: c.lui t0, 1048575
+0x01 0x63 # BAD: invalid instruction encoding
+0x05 0x63 # GOOD: c.lui t1, 1
+0x09 0x63 # GOOD: c.lui t1, 2
+0x0D 0x63 # GOOD: c.lui t1, 3
+0x11 0x63 # GOOD: c.lui t1, 4
+0x15 0x63 # GOOD: c.lui t1, 5
+0x19 0x63 # GOOD: c.lui t1, 6
+0x1D 0x63 # GOOD: c.lui t1, 7
+0x21 0x63 # GOOD: c.lui t1, 8
+0x25 0x63 # GOOD: c.lui t1, 9
+0x29 0x63 # GOOD: c.lui t1, 10
+0x2D 0x63 # GOOD: c.lui t1, 11
+0x31 0x63 # GOOD: c.lui t1, 12
+0x35 0x63 # GOOD: c.lui t1, 13
+0x39 0x63 # GOOD: c.lui t1, 14
+0x3D 0x63 # GOOD: c.lui t1, 15
+0x41 0x63 # GOOD: c.lui t1, 16
+0x45 0x63 # GOOD: c.lui t1, 17
+0x49 0x63 # GOOD: c.lui t1, 18
+0x4D 0x63 # GOOD: c.lui t1, 19
+0x51 0x63 # GOOD: c.lui t1, 20
+0x55 0x63 # GOOD: c.lui t1, 21
+0x59 0x63 # GOOD: c.lui t1, 22
+0x5D 0x63 # GOOD: c.lui t1, 23
+0x61 0x63 # GOOD: c.lui t1, 24
+0x65 0x63 # GOOD: c.lui t1, 25
+0x69 0x63 # GOOD: c.lui t1, 26
+0x6D 0x63 # GOOD: c.lui t1, 27
+0x71 0x63 # GOOD: c.lui t1, 28
+0x75 0x63 # GOOD: c.lui t1, 29
+0x79 0x63 # GOOD: c.lui t1, 30
+0x7D 0x63 # GOOD: c.lui t1, 31
+0x01 0x73 # GOOD: c.lui t1, 1048544
+0x05 0x73 # GOOD: c.lui t1, 1048545
+0x09 0x73 # GOOD: c.lui t1, 1048546
+0x0D 0x73 # GOOD: c.lui t1, 1048547
+0x11 0x73 # GOOD: c.lui t1, 1048548
+0x15 0x73 # GOOD: c.lui t1, 1048549
+0x19 0x73 # GOOD: c.lui t1, 1048550
+0x1D 0x73 # GOOD: c.lui t1, 1048551
+0x21 0x73 # GOOD: c.lui t1, 1048552
+0x25 0x73 # GOOD: c.lui t1, 1048553
+0x29 0x73 # GOOD: c.lui t1, 1048554
+0x2D 0x73 # GOOD: c.lui t1, 1048555
+0x31 0x73 # GOOD: c.lui t1, 1048556
+0x35 0x73 # GOOD: c.lui t1, 1048557
+0x39 0x73 # GOOD: c.lui t1, 1048558
+0x3D 0x73 # GOOD: c.lui t1, 1048559
+0x41 0x73 # GOOD: c.lui t1, 1048560
+0x45 0x73 # GOOD: c.lui t1, 1048561
+0x49 0x73 # GOOD: c.lui t1, 1048562
+0x4D 0x73 # GOOD: c.lui t1, 1048563
+0x51 0x73 # GOOD: c.lui t1, 1048564
+0x55 0x73 # GOOD: c.lui t1, 1048565
+0x59 0x73 # GOOD: c.lui t1, 1048566
+0x5D 0x73 # GOOD: c.lui t1, 1048567
+0x61 0x73 # GOOD: c.lui t1, 1048568
+0x65 0x73 # GOOD: c.lui t1, 1048569
+0x69 0x73 # GOOD: c.lui t1, 1048570
+0x6D 0x73 # GOOD: c.lui t1, 1048571
+0x71 0x73 # GOOD: c.lui t1, 1048572
+0x75 0x73 # GOOD: c.lui t1, 1048573
+0x79 0x73 # GOOD: c.lui t1, 1048574
+0x7D 0x73 # GOOD: c.lui t1, 1048575
+0x81 0x63 # BAD: invalid instruction encoding
+0x81 0x63 # MOP: c.mop.7
+0x85 0x63 # GOOD: c.lui t2, 1
+0x89 0x63 # GOOD: c.lui t2, 2
+0x8D 0x63 # GOOD: c.lui t2, 3
+0x91 0x63 # GOOD: c.lui t2, 4
+0x95 0x63 # GOOD: c.lui t2, 5
+0x99 0x63 # GOOD: c.lui t2, 6
+0x9D 0x63 # GOOD: c.lui t2, 7
+0xA1 0x63 # GOOD: c.lui t2, 8
+0xA5 0x63 # GOOD: c.lui t2, 9
+0xA9 0x63 # GOOD: c.lui t2, 10
+0xAD 0x63 # GOOD: c.lui t2, 11
+0xB1 0x63 # GOOD: c.lui t2, 12
+0xB5 0x63 # GOOD: c.lui t2, 13
+0xB9 0x63 # GOOD: c.lui t2, 14
+0xBD 0x63 # GOOD: c.lui t2, 15
+0xC1 0x63 # GOOD: c.lui t2, 16
+0xC5 0x63 # GOOD: c.lui t2, 17
+0xC9 0x63 # GOOD: c.lui t2, 18
+0xCD 0x63 # GOOD: c.lui t2, 19
+0xD1 0x63 # GOOD: c.lui t2, 20
+0xD5 0x63 # GOOD: c.lui t2, 21
+0xD9 0x63 # GOOD: c.lui t2, 22
+0xDD 0x63 # GOOD: c.lui t2, 23
+0xE1 0x63 # GOOD: c.lui t2, 24
+0xE5 0x63 # GOOD: c.lui t2, 25
+0xE9 0x63 # GOOD: c.lui t2, 26
+0xED 0x63 # GOOD: c.lui t2, 27
+0xF1 0x63 # GOOD: c.lui t2, 28
+0xF5 0x63 # GOOD: c.lui t2, 29
+0xF9 0x63 # GOOD: c.lui t2, 30
+0xFD 0x63 # GOOD: c.lui t2, 31
+0x81 0x73 # GOOD: c.lui t2, 1048544
+0x85 0x73 # GOOD: c.lui t2, 1048545
+0x89 0x73 # GOOD: c.lui t2, 1048546
+0x8D 0x73 # GOOD: c.lui t2, 1048547
+0x91 0x73 # GOOD: c.lui t2, 1048548
+0x95 0x73 # GOOD: c.lui t2, 1048549
+0x99 0x73 # GOOD: c.lui t2, 1048550
+0x9D 0x73 # GOOD: c.lui t2, 1048551
+0xA1 0x73 # GOOD: c.lui t2, 1048552
+0xA5 0x73 # GOOD: c.lui t2, 1048553
+0xA9 0x73 # GOOD: c.lui t2, 1048554
+0xAD 0x73 # GOOD: c.lui t2, 1048555
+0xB1 0x73 # GOOD: c.lui t2, 1048556
+0xB5 0x73 # GOOD: c.lui t2, 1048557
+0xB9 0x73 # GOOD: c.lui t2, 1048558
+0xBD 0x73 # GOOD: c.lui t2, 1048559
+0xC1 0x73 # GOOD: c.lui t2, 1048560
+0xC5 0x73 # GOOD: c.lui t2, 1048561
+0xC9 0x73 # GOOD: c.lui t2, 1048562
+0xCD 0x73 # GOOD: c.lui t2, 1048563
+0xD1 0x73 # GOOD: c.lui t2, 1048564
+0xD5 0x73 # GOOD: c.lui t2, 1048565
+0xD9 0x73 # GOOD: c.lui t2, 1048566
+0xDD 0x73 # GOOD: c.lui t2, 1048567
+0xE1 0x73 # GOOD: c.lui t2, 1048568
+0xE5 0x73 # GOOD: c.lui t2, 1048569
+0xE9 0x73 # GOOD: c.lui t2, 1048570
+0xED 0x73 # GOOD: c.lui t2, 1048571
+0xF1 0x73 # GOOD: c.lui t2, 1048572
+0xF5 0x73 # GOOD: c.lui t2, 1048573
+0xF9 0x73 ...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/133450
More information about the llvm-commits
mailing list