Skip to content

Commit

Permalink
[AMDGPU] gfx11 support add_f16
Browse files Browse the repository at this point in the history
The instruction was skipped in the earlier large patch adding
VOP2, https://reviews.llvm.org/D126917.

Reviewed By: rampitec, #amdgpu

Differential Revision: https://reviews.llvm.org/D127697
  • Loading branch information
Sisyph committed Jun 14, 2022
1 parent d713f0e commit 989bd57
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/lib/Target/AMDGPU/VOP2Instructions.td
Original file line number Diff line number Diff line change
Expand Up @@ -1548,7 +1548,7 @@ defm V_XNOR_B32 : VOP2_Real_gfx10_gfx11<0x01e>;
defm V_FMAC_F32 : VOP2_Real_gfx10_gfx11<0x02b>;
defm V_FMAMK_F32 : VOP2Only_Real_MADK_gfx10_gfx11<0x02c>;
defm V_FMAAK_F32 : VOP2Only_Real_MADK_gfx10_gfx11<0x02d>;
defm V_ADD_F16 : VOP2_Real_gfx10<0x032>;
defm V_ADD_F16 : VOP2_Real_gfx10_gfx11<0x032>;
defm V_SUB_F16 : VOP2_Real_gfx10_gfx11<0x033>;
defm V_SUBREV_F16 : VOP2_Real_gfx10_gfx11<0x034>;
defm V_MUL_F16 : VOP2_Real_gfx10_gfx11<0x035>;
Expand Down
6 changes: 6 additions & 0 deletions llvm/test/MC/AMDGPU/gfx11_asm_dpp16.s
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,9 @@ v_subrev_co_ci_u32 v5, vcc_lo, v1, v2, vcc_lo quad_perm:[3,2,1,0] row_mask:0x0 b
v_fmac_f32 v5, v1, v2 quad_perm:[3,2,1,0] row_mask:0x0 bank_mask:0x0
// GFX11: encoding: [0xfa,0x04,0x0a,0x56,0x01,0x1b,0x00,0x00]

v_add_f16 v5, v1, v2 quad_perm:[3,2,1,0] row_mask:0x0 bank_mask:0x0
// GFX11: encoding: [0xfa,0x04,0x0a,0x64,0x01,0x1b,0x00,0x00]

v_sub_f16 v5, v1, v2 quad_perm:[3,2,1,0] row_mask:0x0 bank_mask:0x0
// GFX11: encoding: [0xfa,0x04,0x0a,0x66,0x01,0x1b,0x00,0x00]

Expand Down Expand Up @@ -570,6 +573,9 @@ v_xnor_b32 v5, v1, v2 quad_perm:[3,2,1,0] row_mask:0x0 bank_mask:0x0 fi:1
v_fmac_f32 v5, v1, v2 quad_perm:[3,2,1,0] row_mask:0x0 bank_mask:0x0 fi:1
// GFX11: encoding: [0xfa,0x04,0x0a,0x56,0x01,0x1b,0x04,0x00]

v_add_f16 v5, v1, v2 quad_perm:[3,2,1,0] row_mask:0x0 bank_mask:0x0 fi:1
// GFX11: encoding: [0xfa,0x04,0x0a,0x64,0x01,0x1b,0x04,0x00]

v_sub_f16 v5, v1, v2 quad_perm:[3,2,1,0] row_mask:0x0 bank_mask:0x0 fi:1
// GFX11: encoding: [0xfa,0x04,0x0a,0x66,0x01,0x1b,0x04,0x00]

Expand Down
6 changes: 6 additions & 0 deletions llvm/test/MC/AMDGPU/gfx11_asm_dpp8.s
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,9 @@ v_xor_b32 v5, v1, v2 dpp8:[0,1,2,3,4,5,6,7]
v_xnor_b32 v5, v1, v2 dpp8:[0,1,2,3,4,5,6,7]
// GFX11: encoding: [0xe9,0x04,0x0a,0x3c,0x01,0x88,0xc6,0xfa]

v_add_f16 v5, v1, v2 dpp8:[0,1,2,3,4,5,6,7]
// GFX11: encoding: [0xe9,0x04,0x0a,0x64,0x01,0x88,0xc6,0xfa]

v_sub_f16 v5, v1, v2 dpp8:[0,1,2,3,4,5,6,7]
// GFX11: encoding: [0xe9,0x04,0x0a,0x66,0x01,0x88,0xc6,0xfa]

Expand Down Expand Up @@ -477,6 +480,9 @@ v_xor_b32 v5, v1, v2 dpp8:[0,1,2,3,4,5,6,7] fi:1
v_xnor_b32 v5, v1, v2 dpp8:[0,1,2,3,4,5,6,7] fi:1
// GFX11: encoding: [0xea,0x04,0x0a,0x3c,0x01,0x88,0xc6,0xfa]

v_add_f16 v5, v1, v2 dpp8:[0,1,2,3,4,5,6,7] fi:1
// GFX11: encoding: [0xea,0x04,0x0a,0x64,0x01,0x88,0xc6,0xfa]

v_sub_f16 v5, v1, v2 dpp8:[0,1,2,3,4,5,6,7] fi:1
// GFX11: encoding: [0xea,0x04,0x0a,0x66,0x01,0x88,0xc6,0xfa]

Expand Down
12 changes: 12 additions & 0 deletions llvm/test/MC/Disassembler/AMDGPU/gfx11_dasm_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46334,6 +46334,12 @@
# W64: v_add_co_ci_u32_dpp v5, vcc, v1, v2, vcc quad_perm:[3,2,1,0] row_mask:0x0 bank_mask:0x0 ; encoding: [0xfa,0x04,0x0a,0x40,0x01,0x1b,0x00,0x00]
0xfa,0x04,0x0a,0x40,0x01,0x1b,0x00,0x00

# GFX11: v_add_f16_dpp v5, v1, v2 quad_perm:[3,2,1,0] row_mask:0x0 bank_mask:0x0 ; encoding: [0xfa,0x04,0x0a,0x64,0x01,0x1b,0x00,0x00]
0xfa,0x04,0x0a,0x64,0x01,0x1b,0x00,0x00

# GFX11: v_add_f16_dpp v5, v1, v2 quad_perm:[3,2,1,0] row_mask:0x0 bank_mask:0x0 fi:1 ; encoding: [0xfa,0x04,0x0a,0x64,0x01,0x1b,0x04,0x00]
0xfa,0x04,0x0a,0x64,0x01,0x1b,0x04,0x00

# GFX11: v_add_f32_dpp v5, v1, v2 quad_perm:[3,2,1,0] row_mask:0x0 bank_mask:0x0 ; encoding: [0xfa,0x04,0x0a,0x06,0x01,0x1b,0x00,0x00]
0xfa,0x04,0x0a,0x06,0x01,0x1b,0x00,0x00

Expand Down Expand Up @@ -46951,6 +46957,12 @@
# GFX11: v_xor_b32_dpp v5, v1, v2 quad_perm:[3,2,1,0] row_mask:0x0 bank_mask:0x0 fi:1 ; encoding: [0xfa,0x04,0x0a,0x3a,0x01,0x1b,0x04,0x00]
0xfa,0x04,0x0a,0x3a,0x01,0x1b,0x04,0x00

# GFX11: v_add_f16_dpp v5, v1, v2 dpp8:[0,1,2,3,4,5,6,7] ; encoding: [0xe9,0x04,0x0a,0x64,0x01,0x88,0xc6,0xfa]
0xe9,0x04,0x0a,0x64,0x01,0x88,0xc6,0xfa

# GFX11: v_add_f16_dpp v5, v1, v2 dpp8:[0,1,2,3,4,5,6,7] fi:1 ; encoding: [0xea,0x04,0x0a,0x64,0x01,0x88,0xc6,0xfa]
0xea,0x04,0x0a,0x64,0x01,0x88,0xc6,0xfa

# GFX11: v_add_f32_dpp v5, v1, v2 dpp8:[0,1,2,3,4,5,6,7] ; encoding: [0xe9,0x04,0x0a,0x06,0x01,0x88,0xc6,0xfa]
0xe9,0x04,0x0a,0x06,0x01,0x88,0xc6,0xfa

Expand Down

0 comments on commit 989bd57

Please sign in to comment.