[llvm] [AMDGPU] Only src0 and mandatory literals can use literal64 (PR #196456)

Stanislav Mekhanoshin via llvm-commits llvm-commits at lists.llvm.org
Fri May 8 10:35:15 PDT 2026


rampitec wrote:

> > The still remaining problem:
> > ```
> > llvm-mc -arch=amdgcn -mcpu=gfx1250 -show-encoding <<< 'v_add_f64 v[0:1], v[0:1], lit(1)'
> > 	v_add_f64_e64 v[0:1], v[0:1], lit(0x1)  ; encoding: [0x00,0x00,0x02,0xd5,0x00,0xfd,0x01,0x02,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00]
> > ```
> > @kosarev could you please take a look? That shall use lit32 I believe, no reason to force lit64, it was not requested. And then it is simply illegal. I.e., literal can be represented as 32-bit. If it is not then we shall issue an error here.
> 
> It looks like `lit(0x1)` here means the f64 bit pattern 0x0000000000000001, which can't be represented as lit32 because that only lets you specify the high 32 bits of an f64 value.

OK, then it shall be rejected because it creates invalid encoding.

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


More information about the llvm-commits mailing list