1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv64 -mattr=+zfh -run-pass=legalizer %s -o - \
11 ; CHECK-LABEL: name: fptosi_s1_s16
12 ; CHECK: liveins: $f10_h
14 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $f10_h
15 ; CHECK-NEXT: [[FCVT_W_RV64_:%[0-9]+]]:_(s64) = G_FCVT_W_RV64 [[COPY]](s16), 1
16 ; CHECK-NEXT: $x10 = COPY [[FCVT_W_RV64_]](s64)
17 ; CHECK-NEXT: PseudoRET implicit $x10
18 %0:_(s16) = COPY $f10_h
19 %1:_(s1) = G_FPTOSI %0(s16)
20 %2:_(s64) = G_ANYEXT %1(s1)
22 PseudoRET implicit $x10
31 ; CHECK-LABEL: name: fptoui_s1_s16
32 ; CHECK: liveins: $f10_h
34 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $f10_h
35 ; CHECK-NEXT: [[FCVT_WU_RV64_:%[0-9]+]]:_(s64) = G_FCVT_WU_RV64 [[COPY]](s16), 1
36 ; CHECK-NEXT: $x10 = COPY [[FCVT_WU_RV64_]](s64)
37 ; CHECK-NEXT: PseudoRET implicit $x10
38 %0:_(s16) = COPY $f10_h
39 %1:_(s1) = G_FPTOUI %0(s16)
40 %2:_(s64) = G_ANYEXT %1(s1)
42 PseudoRET implicit $x10
51 ; CHECK-LABEL: name: fptosi_s8_s16
52 ; CHECK: liveins: $f10_h
54 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $f10_h
55 ; CHECK-NEXT: [[FCVT_W_RV64_:%[0-9]+]]:_(s64) = G_FCVT_W_RV64 [[COPY]](s16), 1
56 ; CHECK-NEXT: $x10 = COPY [[FCVT_W_RV64_]](s64)
57 ; CHECK-NEXT: PseudoRET implicit $x10
58 %0:_(s16) = COPY $f10_h
59 %1:_(s8) = G_FPTOSI %0(s16)
60 %2:_(s64) = G_ANYEXT %1(s8)
62 PseudoRET implicit $x10
71 ; CHECK-LABEL: name: fptoui_s8_s16
72 ; CHECK: liveins: $f10_h
74 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $f10_h
75 ; CHECK-NEXT: [[FCVT_WU_RV64_:%[0-9]+]]:_(s64) = G_FCVT_WU_RV64 [[COPY]](s16), 1
76 ; CHECK-NEXT: $x10 = COPY [[FCVT_WU_RV64_]](s64)
77 ; CHECK-NEXT: PseudoRET implicit $x10
78 %0:_(s16) = COPY $f10_h
79 %1:_(s8) = G_FPTOUI %0(s16)
80 %2:_(s64) = G_ANYEXT %1(s8)
82 PseudoRET implicit $x10
91 ; CHECK-LABEL: name: fptosi_s16_s16
92 ; CHECK: liveins: $f10_h
94 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $f10_h
95 ; CHECK-NEXT: [[FCVT_W_RV64_:%[0-9]+]]:_(s64) = G_FCVT_W_RV64 [[COPY]](s16), 1
96 ; CHECK-NEXT: $x10 = COPY [[FCVT_W_RV64_]](s64)
97 ; CHECK-NEXT: PseudoRET implicit $x10
98 %0:_(s16) = COPY $f10_h
99 %1:_(s16) = G_FPTOSI %0(s16)
100 %2:_(s64) = G_ANYEXT %1(s16)
102 PseudoRET implicit $x10
111 ; CHECK-LABEL: name: fptoui_s16_s16
112 ; CHECK: liveins: $f10_h
114 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $f10_h
115 ; CHECK-NEXT: [[FCVT_WU_RV64_:%[0-9]+]]:_(s64) = G_FCVT_WU_RV64 [[COPY]](s16), 1
116 ; CHECK-NEXT: $x10 = COPY [[FCVT_WU_RV64_]](s64)
117 ; CHECK-NEXT: PseudoRET implicit $x10
118 %0:_(s16) = COPY $f10_h
119 %1:_(s16) = G_FPTOUI %0(s16)
120 %2:_(s64) = G_ANYEXT %1(s16)
122 PseudoRET implicit $x10
131 ; CHECK-LABEL: name: fptosi_s32_s16
132 ; CHECK: liveins: $f10_h
134 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $f10_h
135 ; CHECK-NEXT: [[FCVT_W_RV64_:%[0-9]+]]:_(s64) = G_FCVT_W_RV64 [[COPY]](s16), 1
136 ; CHECK-NEXT: $x10 = COPY [[FCVT_W_RV64_]](s64)
137 ; CHECK-NEXT: PseudoRET implicit $x10
138 %0:_(s16) = COPY $f10_h
139 %1:_(s32) = G_FPTOSI %0(s16)
140 %2:_(s64) = G_ANYEXT %1(s32)
142 PseudoRET implicit $x10
151 ; CHECK-LABEL: name: fptoui_s32_s16
152 ; CHECK: liveins: $f10_h
154 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $f10_h
155 ; CHECK-NEXT: [[FCVT_WU_RV64_:%[0-9]+]]:_(s64) = G_FCVT_WU_RV64 [[COPY]](s16), 1
156 ; CHECK-NEXT: $x10 = COPY [[FCVT_WU_RV64_]](s64)
157 ; CHECK-NEXT: PseudoRET implicit $x10
158 %0:_(s16) = COPY $f10_h
159 %1:_(s32) = G_FPTOUI %0(s16)
160 %2:_(s64) = G_ANYEXT %1(s32)
162 PseudoRET implicit $x10
171 ; CHECK-LABEL: name: fptosi_s64_s16
172 ; CHECK: liveins: $f10_h
174 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $f10_h
175 ; CHECK-NEXT: [[FPTOSI:%[0-9]+]]:_(s64) = G_FPTOSI [[COPY]](s16)
176 ; CHECK-NEXT: $x10 = COPY [[FPTOSI]](s64)
177 ; CHECK-NEXT: PseudoRET implicit $x10
178 %0:_(s16) = COPY $f10_h
179 %1:_(s64) = G_FPTOSI %0(s16)
181 PseudoRET implicit $x10
190 ; CHECK-LABEL: name: fptoui_s64_s16
191 ; CHECK: liveins: $f10_h
193 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $f10_h
194 ; CHECK-NEXT: [[FPTOUI:%[0-9]+]]:_(s64) = G_FPTOUI [[COPY]](s16)
195 ; CHECK-NEXT: $x10 = COPY [[FPTOUI]](s64)
196 ; CHECK-NEXT: PseudoRET implicit $x10
197 %0:_(s16) = COPY $f10_h
198 %1:_(s64) = G_FPTOUI %0(s16)
200 PseudoRET implicit $x10