1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv64 -mattr=+d -run-pass=regbankselect \
3 # RUN: -simplify-mir -verify-machineinstrs %s \
4 # RUN: -o - | FileCheck %s
9 tracksRegLiveness: true
14 ; CHECK-LABEL: name: sitofp_s32_s32
15 ; CHECK: liveins: $x10
17 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
18 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:gprb(s32) = G_TRUNC [[COPY]](s64)
19 ; CHECK-NEXT: [[SITOFP:%[0-9]+]]:fprb(s32) = G_SITOFP [[TRUNC]](s32)
20 ; CHECK-NEXT: $f10_f = COPY [[SITOFP]](s32)
21 ; CHECK-NEXT: PseudoRET implicit $f10_f
23 %1:_(s32) = G_TRUNC %0(s64)
24 %2:_(s32) = G_SITOFP %1(s32)
26 PseudoRET implicit $f10_f
32 tracksRegLiveness: true
37 ; CHECK-LABEL: name: uitofp_s32_s32
38 ; CHECK: liveins: $x10
40 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
41 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:gprb(s32) = G_TRUNC [[COPY]](s64)
42 ; CHECK-NEXT: [[UITOFP:%[0-9]+]]:fprb(s32) = G_UITOFP [[TRUNC]](s32)
43 ; CHECK-NEXT: $f10_f = COPY [[UITOFP]](s32)
44 ; CHECK-NEXT: PseudoRET implicit $f10_f
46 %1:_(s32) = G_TRUNC %0(s64)
47 %2:_(s32) = G_UITOFP %1(s32)
49 PseudoRET implicit $f10_f
55 tracksRegLiveness: true
60 ; CHECK-LABEL: name: sitofp_s32_s64
61 ; CHECK: liveins: $x10
63 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
64 ; CHECK-NEXT: [[SITOFP:%[0-9]+]]:fprb(s32) = G_SITOFP [[COPY]](s64)
65 ; CHECK-NEXT: $f10_f = COPY [[SITOFP]](s32)
66 ; CHECK-NEXT: PseudoRET implicit $f10_f
68 %1:_(s32) = G_SITOFP %0(s64)
70 PseudoRET implicit $f10_f
76 tracksRegLiveness: true
81 ; CHECK-LABEL: name: uitofp_s32_s64
82 ; CHECK: liveins: $x10
84 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
85 ; CHECK-NEXT: [[UITOFP:%[0-9]+]]:fprb(s32) = G_UITOFP [[COPY]](s64)
86 ; CHECK-NEXT: $f10_f = COPY [[UITOFP]](s32)
87 ; CHECK-NEXT: PseudoRET implicit $f10_f
89 %1:_(s32) = G_UITOFP %0(s64)
91 PseudoRET implicit $f10_f
97 tracksRegLiveness: true
102 ; CHECK-LABEL: name: sitofp_s64_s32
103 ; CHECK: liveins: $x10
105 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
106 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:gprb(s32) = G_TRUNC [[COPY]](s64)
107 ; CHECK-NEXT: [[SITOFP:%[0-9]+]]:fprb(s64) = G_SITOFP [[TRUNC]](s32)
108 ; CHECK-NEXT: $f10_d = COPY [[SITOFP]](s64)
109 ; CHECK-NEXT: PseudoRET implicit $f10_d
110 %0:_(s64) = COPY $x10
111 %1:_(s32) = G_TRUNC %0(s64)
112 %2:_(s64) = G_SITOFP %1(s32)
113 $f10_d = COPY %2(s64)
114 PseudoRET implicit $f10_d
120 tracksRegLiveness: true
125 ; CHECK-LABEL: name: uitofp_s64_s32
126 ; CHECK: liveins: $x10
128 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
129 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:gprb(s32) = G_TRUNC [[COPY]](s64)
130 ; CHECK-NEXT: [[UITOFP:%[0-9]+]]:fprb(s64) = G_UITOFP [[TRUNC]](s32)
131 ; CHECK-NEXT: $f10_d = COPY [[UITOFP]](s64)
132 ; CHECK-NEXT: PseudoRET implicit $f10_d
133 %0:_(s64) = COPY $x10
134 %1:_(s32) = G_TRUNC %0(s64)
135 %2:_(s64) = G_UITOFP %1(s32)
136 $f10_d = COPY %2(s64)
137 PseudoRET implicit $f10_d
143 tracksRegLiveness: true
148 ; CHECK-LABEL: name: sitofp_s64_s64
149 ; CHECK: liveins: $x10
151 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
152 ; CHECK-NEXT: [[SITOFP:%[0-9]+]]:fprb(s64) = G_SITOFP [[COPY]](s64)
153 ; CHECK-NEXT: $f10_d = COPY [[SITOFP]](s64)
154 ; CHECK-NEXT: PseudoRET implicit $f10_d
155 %0:_(s64) = COPY $x10
156 %1:_(s64) = G_SITOFP %0(s64)
157 $f10_d = COPY %1(s64)
158 PseudoRET implicit $f10_d
164 tracksRegLiveness: true
169 ; CHECK-LABEL: name: uitofp_s64_s64
170 ; CHECK: liveins: $x10
172 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
173 ; CHECK-NEXT: [[UITOFP:%[0-9]+]]:fprb(s64) = G_UITOFP [[COPY]](s64)
174 ; CHECK-NEXT: $f10_d = COPY [[UITOFP]](s64)
175 ; CHECK-NEXT: PseudoRET implicit $f10_d
176 %0:_(s64) = COPY $x10
177 %1:_(s64) = G_UITOFP %0(s64)
178 $f10_d = COPY %1(s64)
179 PseudoRET implicit $f10_d