[clang] [llvm] [AMDGPU] Split OPERAND_REG_IMM_INT64 into signed and unsigned variants (PR #186575)

Jay Foad via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 19 03:02:16 PDT 2026


================
@@ -269,8 +275,12 @@ static uint32_t getLit64Encoding(const MCInstrDesc &Desc, uint64_t Val,
     return CanUse64BitLiterals && Lo_32(Val) ? 254 : 255;
   }
 
-  return CanUse64BitLiterals && (!isInt<32>(Val) || !isUInt<32>(Val)) ? 254
-                                                                      : 255;
+  // For integer operands, determine if we need 64-bit literal encoding based
+  // on whether the value fits in a sign-extended or zero-extended 32-bit
+  // literal. Signed operands use IsInt<32>, unsigned operands use IsUInt<32>.
----------------
jayfoad wrote:

IsInt/IsUInt is just an implementation detail. Don't keep repeating it in comments.

https://github.com/llvm/llvm-project/pull/186575


More information about the cfe-commits mailing list