Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions llvm/lib/Target/RISCV/RISCVInstrInfoC.td
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ def c_lui_imm : RISCVOp,
let OperandType = "OPERAND_CLUI_IMM";
let MCOperandPredicate = [{
int64_t Imm;
if (MCOp.evaluateAsConstantImm(Imm))
return (Imm != 0) && (isUInt<5>(Imm) ||
(Imm >= 0xfffe0 && Imm <= 0xfffff));
return MCOp.isBareSymbolRef();
if (!MCOp.evaluateAsConstantImm(Imm))
return false;
return (Imm != 0) && (isUInt<5>(Imm) ||
(Imm >= 0xfffe0 && Imm <= 0xfffff));
}];
}

Expand Down
1 change: 1 addition & 0 deletions llvm/test/MC/RISCV/rv32c-invalid.s
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ c.lui t0, 0 # CHECK: :[[@LINE]]:11: error: immediate must be in [0xfffe0, 0xffff
c.lui t0, 32 # CHECK: :[[@LINE]]:11: error: immediate must be in [0xfffe0, 0xfffff] or [1, 31]
c.lui t0, 0xffffdf # CHECK: :[[@LINE]]:11: error: immediate must be in [0xfffe0, 0xfffff] or [1, 31]
c.lui t0, 0x1000000 # CHECK: :[[@LINE]]:11: error: immediate must be in [0xfffe0, 0xfffff] or [1, 31]
c.lui t0, foo # CHECK: [[@LINE]]:11: error: immediate must be in [0xfffe0, 0xfffff] or [1, 31]

## uimm8_lsb00
c.lwsp ra, 256(sp) # CHECK: :[[@LINE]]:13: error: immediate must be a multiple of 4 bytes in the range [0, 252]
Expand Down