-
Notifications
You must be signed in to change notification settings - Fork 758
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AMDGPU][True16][CodeGen] true16 codegen pat for fptrunc_round (#124044)
true16 codegen pattern for fptrunc_round f32 to f16. For mir test, split to preGFX11 and postGFX11. and add a true16 and a fake16 test accordingly
- Loading branch information
1 parent
7ceef1b
commit a51798e
Showing
7 changed files
with
672 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
llvm/test/CodeGen/AMDGPU/mode-register-fptrunc.gfx11plus-fake16.mir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py | ||
# RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -mattr=-real-true16 -run-pass si-mode-register %s -o - | FileCheck %s --check-prefixes=GFX11 | ||
|
||
--- | ||
name: ftrunc_tonearest | ||
|
||
body: | | ||
bb.0: | ||
liveins: $sgpr0 | ||
; GFX11-LABEL: name: ftrunc_tonearest | ||
; GFX11: liveins: $sgpr0 | ||
; GFX11-NEXT: {{ $}} | ||
; GFX11-NEXT: $vgpr0 = V_MOV_B32_e32 killed $sgpr0, implicit $exec, implicit $exec | ||
; GFX11-NEXT: $vgpr1 = V_CVT_F16_F32_fake16_e32 $vgpr0, implicit $mode, implicit $exec | ||
; GFX11-NEXT: S_ENDPGM 0 | ||
$vgpr0 = V_MOV_B32_e32 killed $sgpr0, implicit $exec, implicit $exec | ||
$vgpr1 = FPTRUNC_ROUND_F16_F32_PSEUDO_fake16_e32 $vgpr0, 0, implicit $mode, implicit $exec | ||
S_ENDPGM 0 | ||
... | ||
|
||
--- | ||
name: ftrunc_upward | ||
|
||
body: | | ||
bb.0: | ||
liveins: $sgpr0 | ||
; GFX11-LABEL: name: ftrunc_upward | ||
; GFX11: liveins: $sgpr0 | ||
; GFX11-NEXT: {{ $}} | ||
; GFX11-NEXT: $vgpr0 = V_MOV_B32_e32 killed $sgpr0, implicit $exec, implicit $exec | ||
; GFX11-NEXT: S_SETREG_IMM32_B32 1, 129, implicit-def $mode, implicit $mode | ||
; GFX11-NEXT: $vgpr1 = V_CVT_F16_F32_fake16_e32 $vgpr0, implicit $mode, implicit $exec | ||
; GFX11-NEXT: S_ENDPGM 0 | ||
$vgpr0 = V_MOV_B32_e32 killed $sgpr0, implicit $exec, implicit $exec | ||
$vgpr1 = FPTRUNC_ROUND_F16_F32_PSEUDO_fake16_e32 $vgpr0, 1, implicit $mode, implicit $exec | ||
S_ENDPGM 0 | ||
... | ||
|
||
--- | ||
name: ftrunc_downward | ||
|
||
body: | | ||
bb.0: | ||
liveins: $sgpr0 | ||
; GFX11-LABEL: name: ftrunc_downward | ||
; GFX11: liveins: $sgpr0 | ||
; GFX11-NEXT: {{ $}} | ||
; GFX11-NEXT: $vgpr1 = V_MOV_B32_e32 killed $sgpr0, implicit $exec, implicit $exec | ||
; GFX11-NEXT: S_SETREG_IMM32_B32 1, 193, implicit-def $mode, implicit $mode | ||
; GFX11-NEXT: $vgpr0 = V_CVT_F16_F32_fake16_e32 $vgpr1, implicit $mode, implicit $exec | ||
; GFX11-NEXT: S_ENDPGM 0 | ||
$vgpr1 = V_MOV_B32_e32 killed $sgpr0, implicit $exec, implicit $exec | ||
$vgpr0 = FPTRUNC_ROUND_F16_F32_PSEUDO_fake16_e32 $vgpr1, 2, implicit $mode, implicit $exec | ||
S_ENDPGM 0 | ||
... | ||
|
||
--- | ||
name: ftrunc_towardzero | ||
|
||
body: | | ||
bb.0: | ||
liveins: $sgpr0 | ||
; GFX11-LABEL: name: ftrunc_towardzero | ||
; GFX11: liveins: $sgpr0 | ||
; GFX11-NEXT: {{ $}} | ||
; GFX11-NEXT: $vgpr0 = V_MOV_B32_e32 killed $sgpr0, implicit $exec, implicit $exec | ||
; GFX11-NEXT: S_SETREG_IMM32_B32 3, 2177, implicit-def $mode, implicit $mode | ||
; GFX11-NEXT: $vgpr1 = V_CVT_F16_F32_fake16_e32 $vgpr0, implicit $mode, implicit $exec | ||
; GFX11-NEXT: S_ENDPGM 0 | ||
$vgpr0 = V_MOV_B32_e32 killed $sgpr0, implicit $exec, implicit $exec | ||
$vgpr1 = FPTRUNC_ROUND_F16_F32_PSEUDO_fake16_e32 $vgpr0, 3, implicit $mode, implicit $exec | ||
S_ENDPGM 0 | ||
... |
73 changes: 73 additions & 0 deletions
73
llvm/test/CodeGen/AMDGPU/mode-register-fptrunc.gfx11plus.mir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py | ||
# RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -mattr=+real-true16 -run-pass si-mode-register %s -o - | FileCheck %s --check-prefixes=GFX11 | ||
|
||
--- | ||
name: ftrunc_tonearest | ||
|
||
body: | | ||
bb.0: | ||
liveins: $sgpr0 | ||
; GFX11-LABEL: name: ftrunc_tonearest | ||
; GFX11: liveins: $sgpr0 | ||
; GFX11-NEXT: {{ $}} | ||
; GFX11-NEXT: $vgpr0 = V_MOV_B32_e32 killed $sgpr0, implicit $exec, implicit $exec | ||
; GFX11-NEXT: $vgpr1_hi16 = V_CVT_F16_F32_t16_e64 0, $vgpr0, 0, 0, 0, implicit $mode, implicit $exec | ||
; GFX11-NEXT: S_ENDPGM 0 | ||
$vgpr0 = V_MOV_B32_e32 killed $sgpr0, implicit $exec, implicit $exec | ||
$vgpr1_hi16 = FPTRUNC_ROUND_F16_F32_PSEUDO_t16_e64 0, $vgpr0, 0, 0, 0, 0, implicit $mode, implicit $exec | ||
S_ENDPGM 0 | ||
... | ||
|
||
--- | ||
name: ftrunc_upward | ||
|
||
body: | | ||
bb.0: | ||
liveins: $sgpr0 | ||
; GFX11-LABEL: name: ftrunc_upward | ||
; GFX11: liveins: $sgpr0 | ||
; GFX11-NEXT: {{ $}} | ||
; GFX11-NEXT: $vgpr0 = V_MOV_B32_e32 killed $sgpr0, implicit $exec, implicit $exec | ||
; GFX11-NEXT: S_SETREG_IMM32_B32 1, 129, implicit-def $mode, implicit $mode | ||
; GFX11-NEXT: $vgpr1_hi16 = V_CVT_F16_F32_t16_e64 0, $vgpr0, 0, 0, 0, implicit $mode, implicit $exec | ||
; GFX11-NEXT: S_ENDPGM 0 | ||
$vgpr0 = V_MOV_B32_e32 killed $sgpr0, implicit $exec, implicit $exec | ||
$vgpr1_hi16 = FPTRUNC_ROUND_F16_F32_PSEUDO_t16_e64 0, $vgpr0, 0, 0, 0, 1, implicit $mode, implicit $exec | ||
S_ENDPGM 0 | ||
... | ||
|
||
--- | ||
name: ftrunc_downward | ||
|
||
body: | | ||
bb.0: | ||
liveins: $sgpr0 | ||
; GFX11-LABEL: name: ftrunc_downward | ||
; GFX11: liveins: $sgpr0 | ||
; GFX11-NEXT: {{ $}} | ||
; GFX11-NEXT: $vgpr1 = V_MOV_B32_e32 killed $sgpr0, implicit $exec, implicit $exec | ||
; GFX11-NEXT: S_SETREG_IMM32_B32 1, 193, implicit-def $mode, implicit $mode | ||
; GFX11-NEXT: $vgpr0_hi16 = V_CVT_F16_F32_t16_e64 0, $vgpr1, 0, 0, 0, implicit $mode, implicit $exec | ||
; GFX11-NEXT: S_ENDPGM 0 | ||
$vgpr1 = V_MOV_B32_e32 killed $sgpr0, implicit $exec, implicit $exec | ||
$vgpr0_hi16 = FPTRUNC_ROUND_F16_F32_PSEUDO_t16_e64 0, $vgpr1, 0, 0, 0, 2, implicit $mode, implicit $exec | ||
S_ENDPGM 0 | ||
... | ||
|
||
--- | ||
name: ftrunc_towardzero | ||
|
||
body: | | ||
bb.0: | ||
liveins: $sgpr0 | ||
; GFX11-LABEL: name: ftrunc_towardzero | ||
; GFX11: liveins: $sgpr0 | ||
; GFX11-NEXT: {{ $}} | ||
; GFX11-NEXT: $vgpr0 = V_MOV_B32_e32 killed $sgpr0, implicit $exec, implicit $exec | ||
; GFX11-NEXT: S_SETREG_IMM32_B32 3, 2177, implicit-def $mode, implicit $mode | ||
; GFX11-NEXT: $vgpr1_hi16 = V_CVT_F16_F32_t16_e64 0, $vgpr0, 0, 0, 0, implicit $mode, implicit $exec | ||
; GFX11-NEXT: S_ENDPGM 0 | ||
$vgpr0 = V_MOV_B32_e32 killed $sgpr0, implicit $exec, implicit $exec | ||
$vgpr1_hi16 = FPTRUNC_ROUND_F16_F32_PSEUDO_t16_e64 0, $vgpr0, 0, 0, 0, 3, implicit $mode, implicit $exec | ||
S_ENDPGM 0 | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.