Skip to content

Commit f4c0fdc

Browse files
committed
[AMDGPU] Set unused dst_sel to '?' in the encoding
This is to allow disasm with any bits in the unused fields. Differential Revision: https://reviews.llvm.org/D102526
1 parent e092165 commit f4c0fdc

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

llvm/lib/Target/AMDGPU/VOPInstructions.td

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,8 @@ class VOP_SDWAe<VOPProfile P> : Enc64 {
417417
bits<1> clamp;
418418

419419
let Inst{39-32} = !if(P.HasSrc0, src0{7-0}, 0);
420-
let Inst{42-40} = !if(P.EmitDstSel, dst_sel{2-0}, 0);
421-
let Inst{44-43} = !if(P.EmitDstSel, dst_unused{1-0}, 0);
420+
let Inst{42-40} = !if(P.EmitDstSel, dst_sel{2-0}, ?);
421+
let Inst{44-43} = !if(P.EmitDstSel, dst_unused{1-0}, ?);
422422
let Inst{45} = !if(P.HasSDWAClamp, clamp{0}, 0);
423423
let Inst{50-48} = !if(P.HasSrc0, src0_sel{2-0}, 0);
424424
let Inst{51} = !if(P.HasSrc0IntMods, src0_modifiers{0}, 0);
@@ -468,8 +468,8 @@ class VOP_SDWA9Ae<VOPProfile P> : VOP_SDWA9e<P> {
468468
bits<1> clamp;
469469
bits<2> omod;
470470

471-
let Inst{42-40} = !if(P.EmitDstSel, dst_sel{2-0}, 0);
472-
let Inst{44-43} = !if(P.EmitDstSel, dst_unused{1-0}, 0);
471+
let Inst{42-40} = !if(P.EmitDstSel, dst_sel{2-0}, ?);
472+
let Inst{44-43} = !if(P.EmitDstSel, dst_unused{1-0}, ?);
473473
let Inst{45} = !if(P.HasSDWAClamp, clamp{0}, 0);
474474
let Inst{47-46} = !if(P.HasSDWAOMod, omod{1-0}, 0);
475475
}

llvm/test/MC/Disassembler/AMDGPU/sdwa_gfx9.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,12 @@
448448
# GFX9: v_cmpx_class_f32_sdwa vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 ; encoding: [0xf9,0x04,0x22,0x7c,0x01,0x00,0x02,0x04]
449449
0xf9 0x04 0x22 0x7c 0x01 0x00 0x02 0x04
450450

451+
# GFX9: v_cmp_lt_f32_sdwa vcc, v2, v4 src0_sel:BYTE_1 src1_sel:DWORD ; encoding: [0xf9,0x08,0x82,0x7c,0x02,0x00,0x01,0x06]
452+
0xf9,0x08,0x82,0x7c,0x02,0x00,0x01,0x06
453+
454+
# GFX9: v_cmp_lt_f32_sdwa vcc, v2, v4 src0_sel:BYTE_1 src1_sel:DWORD ; encoding: [0xf9,0x08,0x82,0x7c,0x02,0x00,0x01,0x06]
455+
0xf9,0x08,0x82,0x7c,0x02,0x06,0x01,0x06
456+
451457
#-----------------------------------------------------------------------------#
452458
# Modifiers
453459
#-----------------------------------------------------------------------------#

llvm/test/MC/Disassembler/AMDGPU/sdwa_vi.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,3 +368,9 @@
368368

369369
# VI: v_cndmask_b32_sdwa v5, v1, v2, vcc dst_sel:BYTE_0 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x04,0x0a,0x00,0x01,0x00,0x06,0x06]
370370
0xf9,0x04,0x0a,0x00,0x01,0x00,0x06,0x06
371+
372+
# VI: v_cmp_lt_f32 vcc, v2, v4 src0_sel:BYTE_1 src1_sel:DWORD ; encoding: [0xf9,0x08,0x82,0x7c,0x02,0x00,0x01,0x06]
373+
0xf9,0x08,0x82,0x7c,0x02,0x00,0x01,0x06
374+
375+
# VI: v_cmp_lt_f32 vcc, v2, v4 src0_sel:BYTE_1 src1_sel:DWORD ; encoding: [0xf9,0x08,0x82,0x7c,0x02,0x00,0x01,0x06]
376+
0xf9,0x08,0x82,0x7c,0x02,0x06,0x01,0x06

0 commit comments

Comments
 (0)