1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py 2# RUN: llc -O0 -run-pass=legalizer %s -o - | FileCheck %s 3 4--- | 5 target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128" 6 target triple = "aarch64--" 7 8 define void @test_sitofp_s32_s32() { ret void } 9 define void @test_uitofp_s32_s32() { ret void } 10 define void @test_sitofp_s32_s64() { ret void } 11 define void @test_uitofp_s32_s64() { ret void } 12 13 define void @test_sitofp_s64_s32() { ret void } 14 define void @test_uitofp_s64_s32() { ret void } 15 define void @test_sitofp_s64_s64() { ret void } 16 define void @test_uitofp_s64_s64() { ret void } 17 18 define void @test_sitofp_s32_s1() { ret void } 19 define void @test_uitofp_s32_s1() { ret void } 20 21 define void @test_sitofp_s64_s8() { ret void } 22 define void @test_uitofp_s64_s8() { ret void } 23 24 define void @test_sitofp_s32_s16() { ret void } 25 define void @test_uitofp_s32_s16() { ret void } 26... 27 28--- 29name: test_sitofp_s32_s32 30body: | 31 bb.0: 32 liveins: $w0 33 ; CHECK-LABEL: name: test_sitofp_s32_s32 34 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0 35 ; CHECK: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[COPY]](s32) 36 %0:_(s32) = COPY $w0 37 %1:_(s32) = G_SITOFP %0 38 $w0 = COPY %1 39... 40 41--- 42name: test_uitofp_s32_s32 43body: | 44 bb.0: 45 liveins: $w0 46 ; CHECK-LABEL: name: test_uitofp_s32_s32 47 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0 48 ; CHECK: [[UITOFP:%[0-9]+]]:_(s32) = G_UITOFP [[COPY]](s32) 49 %0:_(s32) = COPY $w0 50 %1:_(s32) = G_UITOFP %0 51 $w0 = COPY %1 52... 53 54--- 55name: test_sitofp_s32_s64 56body: | 57 bb.0: 58 liveins: $x0 59 ; CHECK-LABEL: name: test_sitofp_s32_s64 60 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0 61 ; CHECK: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[COPY]](s64) 62 %0:_(s64) = COPY $x0 63 %1:_(s32) = G_SITOFP %0 64 $w0 = COPY %1 65... 66 67--- 68name: test_uitofp_s32_s64 69body: | 70 bb.0: 71 liveins: $x0 72 ; CHECK-LABEL: name: test_uitofp_s32_s64 73 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0 74 ; CHECK: [[UITOFP:%[0-9]+]]:_(s32) = G_UITOFP [[COPY]](s64) 75 %0:_(s64) = COPY $x0 76 %1:_(s32) = G_UITOFP %0 77 $w0 = COPY %1 78... 79 80--- 81name: test_sitofp_s64_s32 82body: | 83 bb.0: 84 liveins: $w0 85 ; CHECK-LABEL: name: test_sitofp_s64_s32 86 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0 87 ; CHECK: [[SITOFP:%[0-9]+]]:_(s64) = G_SITOFP [[COPY]](s32) 88 %0:_(s32) = COPY $w0 89 %1:_(s64) = G_SITOFP %0 90 $x0 = COPY %1 91... 92 93--- 94name: test_uitofp_s64_s32 95body: | 96 bb.0: 97 liveins: $w0 98 ; CHECK-LABEL: name: test_uitofp_s64_s32 99 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0 100 ; CHECK: [[UITOFP:%[0-9]+]]:_(s64) = G_UITOFP [[COPY]](s32) 101 %0:_(s32) = COPY $w0 102 %1:_(s64) = G_UITOFP %0 103 $x0 = COPY %1 104... 105 106--- 107name: test_sitofp_s64_s64 108body: | 109 bb.0: 110 liveins: $x0 111 ; CHECK-LABEL: name: test_sitofp_s64_s64 112 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0 113 ; CHECK: [[SITOFP:%[0-9]+]]:_(s64) = G_SITOFP [[COPY]](s64) 114 %0:_(s64) = COPY $x0 115 %1:_(s64) = G_SITOFP %0 116 $x0 = COPY %1 117... 118 119--- 120name: test_uitofp_s64_s64 121body: | 122 bb.0: 123 liveins: $x0 124 ; CHECK-LABEL: name: test_uitofp_s64_s64 125 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0 126 ; CHECK: [[UITOFP:%[0-9]+]]:_(s64) = G_UITOFP [[COPY]](s64) 127 %0:_(s64) = COPY $x0 128 %1:_(s64) = G_UITOFP %0 129 $x0 = COPY %1 130... 131 132 133--- 134name: test_sitofp_s32_s1 135body: | 136 bb.0: 137 liveins: $w0 138 ; CHECK-LABEL: name: test_sitofp_s32_s1 139 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0 140 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 31 141 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32) 142 ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]] 143 ; CHECK: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]] 144 ; CHECK: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[ASHR]](s32) 145 %0:_(s32) = COPY $w0 146 %1:_(s1) = G_TRUNC %0 147 %2:_(s32) = G_SITOFP %1 148 $w0 = COPY %2 149... 150 151--- 152name: test_uitofp_s32_s1 153body: | 154 bb.0: 155 liveins: $w0 156 ; CHECK-LABEL: name: test_uitofp_s32_s1 157 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0 158 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 159 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32) 160 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]] 161 ; CHECK: [[UITOFP:%[0-9]+]]:_(s32) = G_UITOFP [[AND]](s32) 162 %0:_(s32) = COPY $w0 163 %1:_(s1) = G_TRUNC %0 164 %2:_(s32) = G_UITOFP %1 165 $w0 = COPY %2 166... 167 168--- 169name: test_sitofp_s64_s8 170body: | 171 bb.0: 172 liveins: $w0 173 ; CHECK-LABEL: name: test_sitofp_s64_s8 174 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0 175 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 24 176 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32) 177 ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]] 178 ; CHECK: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]] 179 ; CHECK: [[SITOFP:%[0-9]+]]:_(s64) = G_SITOFP [[ASHR]](s32) 180 %0:_(s32) = COPY $w0 181 %1:_(s8) = G_TRUNC %0 182 %2:_(s64) = G_SITOFP %1 183 $x0 = COPY %2 184... 185 186--- 187name: test_uitofp_s64_s8 188body: | 189 bb.0: 190 liveins: $w0 191 ; CHECK-LABEL: name: test_uitofp_s64_s8 192 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0 193 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 194 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32) 195 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]] 196 ; CHECK: [[UITOFP:%[0-9]+]]:_(s64) = G_UITOFP [[AND]](s32) 197 %0:_(s32) = COPY $w0 198 %1:_(s8) = G_TRUNC %0 199 %2:_(s64) = G_UITOFP %1 200 $x0 = COPY %2 201... 202 203--- 204name: test_sitofp_s32_s16 205body: | 206 bb.0: 207 liveins: $w0 208 ; CHECK-LABEL: name: test_sitofp_s32_s16 209 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0 210 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16 211 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32) 212 ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]] 213 ; CHECK: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]] 214 ; CHECK: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[ASHR]](s32) 215 %0:_(s32) = COPY $w0 216 %1:_(s16) = G_TRUNC %0 217 %2:_(s32) = G_SITOFP %1 218 $w0 = COPY %2 219... 220 221--- 222name: test_uitofp_s32_s16 223body: | 224 bb.0: 225 liveins: $w0 226 ; CHECK-LABEL: name: test_uitofp_s32_s16 227 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0 228 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 229 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32) 230 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]] 231 ; CHECK: [[UITOFP:%[0-9]+]]:_(s32) = G_UITOFP [[AND]](s32) 232 %0:_(s32) = COPY $w0 233 %1:_(s16) = G_TRUNC %0 234 %2:_(s32) = G_UITOFP %1 235 $w0 = COPY %2 236... 237