1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv32 -mattr=+zfh -run-pass=legalizer %s -o - \
7 tracksRegLiveness: true
12 ; CHECK-LABEL: name: sitofp_s16_s1
13 ; CHECK: liveins: $x10
15 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
16 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 31
17 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s32)
18 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
19 ; CHECK-NEXT: [[SITOFP:%[0-9]+]]:_(s16) = G_SITOFP [[ASHR]](s32)
20 ; CHECK-NEXT: $f10_h = COPY [[SITOFP]](s16)
21 ; CHECK-NEXT: PseudoRET implicit $f10_h
23 %0:_(s1) = G_TRUNC %1(s32)
24 %2:_(s16) = G_SITOFP %0(s1)
26 PseudoRET implicit $f10_h
31 tracksRegLiveness: true
36 ; CHECK-LABEL: name: uitofp_s16_s1
37 ; CHECK: liveins: $x10
39 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
40 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
41 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]]
42 ; CHECK-NEXT: [[UITOFP:%[0-9]+]]:_(s16) = G_UITOFP [[AND]](s32)
43 ; CHECK-NEXT: $f10_h = COPY [[UITOFP]](s16)
44 ; CHECK-NEXT: PseudoRET implicit $f10_h
46 %0:_(s1) = G_TRUNC %1(s32)
47 %2:_(s16) = G_UITOFP %0(s1)
49 PseudoRET implicit $f10_h
54 tracksRegLiveness: true
59 ; CHECK-LABEL: name: sitofp_s16_s8
60 ; CHECK: liveins: $x10
62 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
63 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
64 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s32)
65 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
66 ; CHECK-NEXT: [[SITOFP:%[0-9]+]]:_(s16) = G_SITOFP [[ASHR]](s32)
67 ; CHECK-NEXT: $f10_h = COPY [[SITOFP]](s16)
68 ; CHECK-NEXT: PseudoRET implicit $f10_h
70 %0:_(s8) = G_TRUNC %1(s32)
71 %2:_(s16) = G_SITOFP %0(s8)
73 PseudoRET implicit $f10_h
78 tracksRegLiveness: true
83 ; CHECK-LABEL: name: uitofp_s16_s8
84 ; CHECK: liveins: $x10
86 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
87 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
88 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]]
89 ; CHECK-NEXT: [[UITOFP:%[0-9]+]]:_(s16) = G_UITOFP [[AND]](s32)
90 ; CHECK-NEXT: $f10_h = COPY [[UITOFP]](s16)
91 ; CHECK-NEXT: PseudoRET implicit $f10_h
93 %0:_(s8) = G_TRUNC %1(s32)
94 %2:_(s16) = G_UITOFP %0(s8)
96 PseudoRET implicit $f10_h
101 tracksRegLiveness: true
106 ; CHECK-LABEL: name: sitofp_s16_s16
107 ; CHECK: liveins: $x10
109 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
110 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
111 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s32)
112 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
113 ; CHECK-NEXT: [[SITOFP:%[0-9]+]]:_(s16) = G_SITOFP [[ASHR]](s32)
114 ; CHECK-NEXT: $f10_h = COPY [[SITOFP]](s16)
115 ; CHECK-NEXT: PseudoRET implicit $f10_h
116 %1:_(s32) = COPY $x10
117 %0:_(s16) = G_TRUNC %1(s32)
118 %2:_(s16) = G_SITOFP %0(s16)
119 $f10_h = COPY %2(s16)
120 PseudoRET implicit $f10_h
125 tracksRegLiveness: true
130 ; CHECK-LABEL: name: uitofp_s16_s16
131 ; CHECK: liveins: $x10
133 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
134 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
135 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]]
136 ; CHECK-NEXT: [[UITOFP:%[0-9]+]]:_(s16) = G_UITOFP [[AND]](s32)
137 ; CHECK-NEXT: $f10_h = COPY [[UITOFP]](s16)
138 ; CHECK-NEXT: PseudoRET implicit $f10_h
139 %1:_(s32) = COPY $x10
140 %0:_(s16) = G_TRUNC %1(s32)
141 %2:_(s16) = G_UITOFP %0(s16)
142 $f10_h = COPY %2(s16)
143 PseudoRET implicit $f10_h
148 tracksRegLiveness: true
153 ; CHECK-LABEL: name: sitofp_s16_s32
154 ; CHECK: liveins: $x10
156 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
157 ; CHECK-NEXT: [[SITOFP:%[0-9]+]]:_(s16) = G_SITOFP [[COPY]](s32)
158 ; CHECK-NEXT: $f10_h = COPY [[SITOFP]](s16)
159 ; CHECK-NEXT: PseudoRET implicit $f10_h
160 %0:_(s32) = COPY $x10
161 %1:_(s16) = G_SITOFP %0(s32)
162 $f10_h = COPY %1(s16)
163 PseudoRET implicit $f10_h
168 tracksRegLiveness: true
173 ; CHECK-LABEL: name: uitofp_s16_s32
174 ; CHECK: liveins: $x10
176 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
177 ; CHECK-NEXT: [[UITOFP:%[0-9]+]]:_(s16) = G_UITOFP [[COPY]](s32)
178 ; CHECK-NEXT: $f10_h = COPY [[UITOFP]](s16)
179 ; CHECK-NEXT: PseudoRET implicit $f10_h
180 %0:_(s32) = COPY $x10
181 %1:_(s16) = G_UITOFP %0(s32)
182 $f10_h = COPY %1(s16)
183 PseudoRET implicit $f10_h