1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn -mcpu=gfx900 -run-pass si-mode-register %s -o - | FileCheck %s --check-prefixes=CHECK
3 # RUN: llc -mtriple=amdgcn -mcpu=gfx1010 -run-pass si-mode-register %s -o - | FileCheck %s --check-prefixes=CHECK
4 # RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -run-pass si-mode-register %s -o - | FileCheck %s --check-prefixes=GFX11
12 ; CHECK-LABEL: name: ftrunc_tonearest
13 ; CHECK: liveins: $sgpr0
15 ; CHECK-NEXT: $vgpr0 = V_MOV_B32_e32 killed $sgpr0, implicit $exec, implicit $exec
16 ; CHECK-NEXT: $vgpr1 = V_CVT_F16_F32_e32 $vgpr0, implicit $mode, implicit $exec
17 ; CHECK-NEXT: S_ENDPGM 0
19 ; GFX11-LABEL: name: ftrunc_tonearest
20 ; GFX11: liveins: $sgpr0
22 ; GFX11-NEXT: $vgpr0 = V_MOV_B32_e32 killed $sgpr0, implicit $exec, implicit $exec
23 ; GFX11-NEXT: $vgpr1 = V_CVT_F16_F32_fake16_e64 0, $vgpr0, 0, 0, implicit $mode, implicit $exec
24 ; GFX11-NEXT: S_ENDPGM 0
25 $vgpr0 = V_MOV_B32_e32 killed $sgpr0, implicit $exec, implicit $exec
26 $vgpr1 = FPTRUNC_ROUND_F16_F32_PSEUDO $vgpr0, 0, implicit $mode, implicit $exec
35 ; CHECK-LABEL: name: ftrunc_upward
36 ; CHECK: liveins: $sgpr0
38 ; CHECK-NEXT: $vgpr0 = V_MOV_B32_e32 killed $sgpr0, implicit $exec, implicit $exec
39 ; CHECK-NEXT: S_SETREG_IMM32_B32 1, 129, implicit-def $mode, implicit $mode
40 ; CHECK-NEXT: $vgpr1 = V_CVT_F16_F32_e32 $vgpr0, implicit $mode, implicit $exec
41 ; CHECK-NEXT: S_ENDPGM 0
43 ; GFX11-LABEL: name: ftrunc_upward
44 ; GFX11: liveins: $sgpr0
46 ; GFX11-NEXT: $vgpr0 = V_MOV_B32_e32 killed $sgpr0, implicit $exec, implicit $exec
47 ; GFX11-NEXT: S_SETREG_IMM32_B32 1, 129, implicit-def $mode, implicit $mode
48 ; GFX11-NEXT: $vgpr1 = V_CVT_F16_F32_fake16_e64 0, $vgpr0, 0, 0, implicit $mode, implicit $exec
49 ; GFX11-NEXT: S_ENDPGM 0
50 $vgpr0 = V_MOV_B32_e32 killed $sgpr0, implicit $exec, implicit $exec
51 $vgpr1 = FPTRUNC_ROUND_F16_F32_PSEUDO $vgpr0, 1, implicit $mode, implicit $exec
60 ; CHECK-LABEL: name: ftrunc_downward
61 ; CHECK: liveins: $sgpr0
63 ; CHECK-NEXT: $vgpr1 = V_MOV_B32_e32 killed $sgpr0, implicit $exec, implicit $exec
64 ; CHECK-NEXT: S_SETREG_IMM32_B32 1, 193, implicit-def $mode, implicit $mode
65 ; CHECK-NEXT: $vgpr0 = V_CVT_F16_F32_e32 $vgpr1, implicit $mode, implicit $exec
66 ; CHECK-NEXT: S_ENDPGM 0
68 ; GFX11-LABEL: name: ftrunc_downward
69 ; GFX11: liveins: $sgpr0
71 ; GFX11-NEXT: $vgpr1 = V_MOV_B32_e32 killed $sgpr0, implicit $exec, implicit $exec
72 ; GFX11-NEXT: S_SETREG_IMM32_B32 1, 193, implicit-def $mode, implicit $mode
73 ; GFX11-NEXT: $vgpr0 = V_CVT_F16_F32_fake16_e64 0, $vgpr1, 0, 0, implicit $mode, implicit $exec
74 ; GFX11-NEXT: S_ENDPGM 0
75 $vgpr1 = V_MOV_B32_e32 killed $sgpr0, implicit $exec, implicit $exec
76 $vgpr0 = FPTRUNC_ROUND_F16_F32_PSEUDO $vgpr1, 2, implicit $mode, implicit $exec
80 name: ftrunc_towardzero
85 ; CHECK-LABEL: name: ftrunc_towardzero
86 ; CHECK: liveins: $sgpr0
88 ; CHECK-NEXT: $vgpr0 = V_MOV_B32_e32 killed $sgpr0, implicit $exec, implicit $exec
89 ; CHECK-NEXT: S_SETREG_IMM32_B32 3, 2177, implicit-def $mode, implicit $mode
90 ; CHECK-NEXT: $vgpr1 = V_CVT_F16_F32_e32 $vgpr0, implicit $mode, implicit $exec
91 ; CHECK-NEXT: S_ENDPGM 0
93 ; GFX11-LABEL: name: ftrunc_towardzero
94 ; GFX11: liveins: $sgpr0
96 ; GFX11-NEXT: $vgpr0 = V_MOV_B32_e32 killed $sgpr0, implicit $exec, implicit $exec
97 ; GFX11-NEXT: S_SETREG_IMM32_B32 3, 2177, implicit-def $mode, implicit $mode
98 ; GFX11-NEXT: $vgpr1 = V_CVT_F16_F32_fake16_e64 0, $vgpr0, 0, 0, implicit $mode, implicit $exec
99 ; GFX11-NEXT: S_ENDPGM 0
100 $vgpr0 = V_MOV_B32_e32 killed $sgpr0, implicit $exec, implicit $exec
101 $vgpr1 = FPTRUNC_ROUND_F16_F32_PSEUDO $vgpr0, 3, implicit $mode, implicit $exec