1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -march=amdgcn -mcpu=hawaii -run-pass=instruction-select -verify-machineinstrs -o - %s | FileCheck %s -check-prefix=GCN
3
4---
5name: fptosi_s32_to_s32_vv
6legalized: true
7regBankSelected: true
8tracksRegLiveness: true
9
10body: |
11  bb.0:
12    liveins: $vgpr0
13
14    ; GCN-LABEL: name: fptosi_s32_to_s32_vv
15    ; GCN: liveins: $vgpr0
16    ; GCN: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
17    ; GCN: %1:vgpr_32 = nofpexcept V_CVT_I32_F32_e64 0, [[COPY]], 0, 0, implicit $mode, implicit $exec
18    ; GCN: $vgpr0 = COPY %1
19    %0:vgpr(s32) = COPY $vgpr0
20    %1:vgpr(s32) = G_FPTOSI %0
21    $vgpr0 = COPY %1
22...
23
24---
25name: fptosi_s32_to_s32_vs
26legalized: true
27regBankSelected: true
28tracksRegLiveness: true
29
30body: |
31  bb.0:
32    liveins: $sgpr0
33
34    ; GCN-LABEL: name: fptosi_s32_to_s32_vs
35    ; GCN: liveins: $sgpr0
36    ; GCN: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
37    ; GCN: %1:vgpr_32 = nofpexcept V_CVT_I32_F32_e64 0, [[COPY]], 0, 0, implicit $mode, implicit $exec
38    ; GCN: $vgpr0 = COPY %1
39    %0:sgpr(s32) = COPY $sgpr0
40    %1:vgpr(s32) = G_FPTOSI %0
41    $vgpr0 = COPY %1
42...
43
44---
45name: fptosi_s32_to_s32_fneg_vv
46legalized: true
47regBankSelected: true
48tracksRegLiveness: true
49
50body: |
51  bb.0:
52    liveins: $vgpr0
53
54    ; GCN-LABEL: name: fptosi_s32_to_s32_fneg_vv
55    ; GCN: liveins: $vgpr0
56    ; GCN: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
57    ; GCN: %2:vgpr_32 = nofpexcept V_CVT_I32_F32_e64 1, [[COPY]], 0, 0, implicit $mode, implicit $exec
58    ; GCN: $vgpr0 = COPY %2
59    %0:vgpr(s32) = COPY $vgpr0
60    %1:vgpr(s32) = G_FNEG %0
61    %2:vgpr(s32) = G_FPTOSI %1
62    $vgpr0 = COPY %2
63...
64
65---
66name: fptosi_s16_to_s32_vv
67legalized: true
68regBankSelected: true
69tracksRegLiveness: true
70
71body: |
72  bb.0:
73    liveins: $vgpr0
74
75    ; GCN-LABEL: name: fptosi_s16_to_s32_vv
76    ; GCN: liveins: $vgpr0
77    ; GCN: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
78    ; GCN: %3:vgpr_32 = nofpexcept V_CVT_F32_F16_e32 [[COPY]], implicit $mode, implicit $exec
79    ; GCN: %2:vgpr_32 = nofpexcept V_CVT_I32_F32_e32 %3, implicit $mode, implicit $exec
80    ; GCN: $vgpr0 = COPY %2
81    %0:vgpr(s32) = COPY $vgpr0
82    %1:vgpr(s16) = G_TRUNC %0
83    %2:vgpr(s32) = G_FPTOSI %1
84    $vgpr0 = COPY %2
85...
86
87---
88name: fptosi_s16_to_s32_vs
89legalized: true
90regBankSelected: true
91tracksRegLiveness: true
92
93body: |
94  bb.0:
95    liveins: $sgpr0
96
97    ; GCN-LABEL: name: fptosi_s16_to_s32_vs
98    ; GCN: liveins: $sgpr0
99    ; GCN: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
100    ; GCN: %3:vgpr_32 = nofpexcept V_CVT_F32_F16_e32 [[COPY]], implicit $mode, implicit $exec
101    ; GCN: %2:vgpr_32 = nofpexcept V_CVT_I32_F32_e32 %3, implicit $mode, implicit $exec
102    ; GCN: $vgpr0 = COPY %2
103    %0:sgpr(s32) = COPY $sgpr0
104    %1:sgpr(s16) = G_TRUNC %0
105    %2:vgpr(s32) = G_FPTOSI %1
106    $vgpr0 = COPY %2
107...
108
109---
110name: fptosi_s16_to_s32_fneg_vv
111legalized: true
112regBankSelected: true
113tracksRegLiveness: true
114
115body: |
116  bb.0:
117    liveins: $vgpr0
118
119    ; GCN-LABEL: name: fptosi_s16_to_s32_fneg_vv
120    ; GCN: liveins: $vgpr0
121    ; GCN: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
122    ; GCN: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 32768
123    ; GCN: [[V_XOR_B32_e32_:%[0-9]+]]:vgpr_32 = V_XOR_B32_e32 [[S_MOV_B32_]], [[COPY]], implicit $exec
124    ; GCN: %4:vgpr_32 = nofpexcept V_CVT_F32_F16_e32 [[V_XOR_B32_e32_]], implicit $mode, implicit $exec
125    ; GCN: %3:vgpr_32 = nofpexcept V_CVT_I32_F32_e32 %4, implicit $mode, implicit $exec
126    ; GCN: $vgpr0 = COPY %3
127    %0:vgpr(s32) = COPY $vgpr0
128    %1:vgpr(s16) = G_TRUNC %0
129    %2:vgpr(s16) = G_FNEG %1
130    %3:vgpr(s32) = G_FPTOSI %2
131    $vgpr0 = COPY %3
132...
133