================
@@ -2540,8 +2540,12 @@ void AMDGPUOperand::addLiteralImmOperand(MCInst &Inst,
int64_t Val, bool ApplyMo
// truncated to uint32_t), if the target doesn't support 64-bit literals,
or
// the lit modifier is explicitly used, we need to truncate it to the 32
// LSBs.
- if (!AsmParser->has64BitLiterals() || Lit == LitModifier::Lit)
+ if (!AsmParser->has64BitLiterals() || Lit == LitModifier::Lit) {
+ if (!isInt<32>(Val) && !isUInt<32>(Val))
+ const_cast<AMDGPUAsmParser *>(AsmParser)->Error(
+ Inst.getLoc(), "invalid literal value");
----------------
jayfoad wrote:
The error message could be more helpful, maybe something like "literal value
out of range"?
https://github.com/llvm/llvm-project/pull/197803
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits