[llvm] [AMDGPU] Change the representation of double literals in operands (PR #68740)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 11 02:07:15 PDT 2023


================
@@ -2241,7 +2242,10 @@ void AMDGPUOperand::addLiteralImmOperand(MCInst &Inst, int64_t Val, bool ApplyMo
       return;
     }
 
-    Inst.addOperand(MCOperand::createImm(Lo_32(Val)));
+    if (isInt<32>(Val) || isUInt<32>(Val))
+      Val = AMDGPU::isSISrcFPOperand(InstDesc, OpNum) ? Val << 32 : Lo_32(Val);
----------------
jayfoad wrote:

This doesn't fully make sense to me. Ignoring the FP case, it simplifies to:
```
  if (isInt<32>(Val) || isUInt<32>(Val))
    Val = Lo_32(Val);
```
Why would we only do the Lo_32 if Val is already a (signed or unsigned) 32 bit value???

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


More information about the llvm-commits mailing list