Index: lib/Target/AMDGPU/VOP2Instructions.td =================================================================== --- lib/Target/AMDGPU/VOP2Instructions.td +++ lib/Target/AMDGPU/VOP2Instructions.td @@ -283,7 +283,7 @@ def VOP_WRITELANE : VOPProfile<[i32, i32, i32]> { let Outs32 = (outs VGPR_32:$vdst); let Outs64 = Outs32; - let Ins32 = (ins SReg_32:$src0, SCSrc_b32:$src1); + let Ins32 = (ins SCSrc_b32:$src0, SCSrc_b32:$src1); let Ins64 = Ins32; let Asm32 = " $vdst, $src0, $src1"; let Asm64 = Asm32; @@ -577,7 +577,11 @@ defm V_SUBBREV_U32 : VOP2be_Real_e32e64_si <0x2a>; defm V_READLANE_B32 : VOP2_Real_si <0x01>; + +// Enable offline literals for src0 +let InOperandList = (ins SSrc_b32:$src0, SCSrc_b32:$src1) in { defm V_WRITELANE_B32 : VOP2_Real_si <0x02>; +} defm V_MAC_LEGACY_F32 : VOP2_Real_e32e64_si <0x6>; defm V_MIN_LEGACY_F32 : VOP2_Real_e32e64_si <0xd>; Index: test/MC/AMDGPU/vop2.s =================================================================== --- test/MC/AMDGPU/vop2.s +++ test/MC/AMDGPU/vop2.s @@ -120,6 +120,14 @@ // VI: v_writelane_b32 v1, s2, 4 ; encoding: [0x01,0x00,0x8a,0xd2,0x02,0x08,0x01,0x00] v_writelane_b32 v1, s2, 4 +// SICI: v_writelane_b32 v2, 1, s4 ; encoding: [0x81,0x08,0x04,0x04] +// VI: v_writelane_b32 v2, 1, s4 ; encoding: [0x02,0x00,0x8a,0xd2,0x81,0x08,0x00,0x00] +v_writelane_b32 v2, 1, s4 + +// SICI: v_writelane_b32 v255, 0xaf123456, 2 ; encoding: [0xff,0x04,0xff,0x05,0x56,0x34,0x12,0xaf] +// NOVI: error: instruction not supported on this GPU +v_writelane_b32 v255, 0xaf123456, 2 + // SICI: v_add_f32_e32 v1, v2, v3 ; encoding: [0x02,0x07,0x02,0x06] // VI: v_add_f32_e32 v1, v2, v3 ; encoding: [0x02,0x07,0x02,0x02] v_add_f32 v1, v2, v3