[llvm] [AMDGPU] Fix conflicted literal test. NFC. (PR #197587)

Stanislav Mekhanoshin via llvm-commits llvm-commits at lists.llvm.org
Thu May 14 02:54:28 PDT 2026


================
@@ -1986,14 +1986,12 @@ v_add_f64 v[0:1], v[0:1], lit(1)
 // GFX89: v_add_f64 v[0:1], v[0:1], lit(0x1)      ; encoding: [0x00,0x00,0x80,0xd2,0x00,0xff,0x01,0x00]
 // SICI: v_add_f64 v[0:1], v[0:1], lit(0x1)      ; encoding: [0x00,0x00,0xc8,0xd2,0x00,0xff,0x01,0x00]
 
-// FIXME: Forced lit() encoding is not preserved after disasm
 v_add_f64 v[0:1], v[0:1], lit(1.0)
-// GFX11: v_add_f64 v[0:1], v[0:1], lit(0x3ff00000)      ; encoding: [0x00,0x00,0x27,0xd7,0x00,0xff,0x01,0x02,0x00,0x00,0xf0,0x3f]
-// GFX12: v_add_f64_e64 v[0:1], v[0:1], lit(0x3ff00000)  ; encoding: [0x00,0x00,0x02,0xd5,0x00,0xff,0x01,0x02,0x00,0x00,0xf0,0x3f]
-// GFX1250-ASM: v_add_f64_e64 v[0:1], v[0:1], lit(0x3ff00000) ; encoding: [0x00,0x00,0x02,0xd5,0x00,0xff,0x01,0x02,0x00,0x00,0xf0,0x3f]
-// GFX1250-DIS: v_add_f64_e64 v[0:1], v[0:1], 1.0       ; encoding: [0x00,0x00,0x02,0xd5,0x00,0xe5,0x01,0x02]
-// NOGFX89: :[[@LINE-5]]:31: error: literal operands are not supported
-// NOSICI: :[[@LINE-6]]:31: error: literal operands are not supported
+// NOGFX11: :[[@LINE-1]]:31: error: invalid operand for instruction
----------------
rampitec wrote:

Yes it should. It never was. IEEE representation of the constant different for FP32 and FP64. When I started to enforce to actually check what lit constant we are producing it started to fail. Basically 1.0 and lit(1.0) are different things when expanded in SP. I.e., it should work, but looks like it never did it correctly. Nor does it work correctly for SP3 as it does not know an operand type. I need to meditate on this, but as it was before it did not work as expected at least. I.e., lit(1.0) would expand exactly to which hex 64-bit value here?

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


More information about the llvm-commits mailing list