267 lines · plain
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py2# RUN: llc -mtriple=x86_64-linux-gnu -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s3 4--- |5 6 define signext i8 @float_to_int8(float %val) {7 entry:8 %conv = fptosi float %val to i89 ret i8 %conv10 }11 12 define signext i16 @float_to_int16(float %val) {13 entry:14 %conv = fptosi float %val to i1615 ret i16 %conv16 }17 18 define i32 @float_to_int32(float %val) {19 entry:20 %conv = fptosi float %val to i3221 ret i32 %conv22 }23 24 define i64 @float_to_int64(float %val) {25 entry:26 %conv = fptosi float %val to i6427 ret i64 %conv28 }29 30 define signext i8 @double_to_int8(double %val) {31 entry:32 %conv = fptosi double %val to i833 ret i8 %conv34 }35 36 define signext i16 @double_to_int16(double %val) {37 entry:38 %conv = fptosi double %val to i1639 ret i16 %conv40 }41 42 define i32 @double_to_int32(double %val) {43 entry:44 %conv = fptosi double %val to i3245 ret i32 %conv46 }47 48 define i64 @double_to_int64(double %val) {49 entry:50 %conv = fptosi double %val to i6451 ret i64 %conv52 }53 54...55---56name: float_to_int857alignment: 1658tracksRegLiveness: true59registers:60 - { id: 0, class: _ }61 - { id: 1, class: _ }62 - { id: 2, class: _ }63body: |64 bb.1.entry:65 liveins: $xmm066 67 ; CHECK-LABEL: name: float_to_int868 ; CHECK: liveins: $xmm069 ; CHECK: [[COPY:%[0-9]+]]:_(s128) = COPY $xmm070 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s128)71 ; CHECK: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[TRUNC]](s32)72 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[FPTOSI]](s32)73 ; CHECK: $al = COPY [[TRUNC1]](s8)74 ; CHECK: RET 0, implicit $al75 %1:_(s128) = COPY $xmm076 %0:_(s32) = G_TRUNC %1(s128)77 %2:_(s8) = G_FPTOSI %0(s32)78 $al = COPY %2(s8)79 RET 0, implicit $al80 81...82---83name: float_to_int1684alignment: 1685tracksRegLiveness: true86registers:87 - { id: 0, class: _ }88 - { id: 1, class: _ }89 - { id: 2, class: _ }90body: |91 bb.1.entry:92 liveins: $xmm093 94 ; CHECK-LABEL: name: float_to_int1695 ; CHECK: liveins: $xmm096 ; CHECK: [[COPY:%[0-9]+]]:_(s128) = COPY $xmm097 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s128)98 ; CHECK: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[TRUNC]](s32)99 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[FPTOSI]](s32)100 ; CHECK: $ax = COPY [[TRUNC1]](s16)101 ; CHECK: RET 0, implicit $ax102 %1:_(s128) = COPY $xmm0103 %0:_(s32) = G_TRUNC %1(s128)104 %2:_(s16) = G_FPTOSI %0(s32)105 $ax = COPY %2(s16)106 RET 0, implicit $ax107 108...109---110name: float_to_int32111alignment: 16112tracksRegLiveness: true113registers:114 - { id: 0, class: _ }115 - { id: 1, class: _ }116 - { id: 2, class: _ }117body: |118 bb.1.entry:119 liveins: $xmm0120 121 ; CHECK-LABEL: name: float_to_int32122 ; CHECK: liveins: $xmm0123 ; CHECK: [[COPY:%[0-9]+]]:_(s128) = COPY $xmm0124 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s128)125 ; CHECK: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[TRUNC]](s32)126 ; CHECK: $eax = COPY [[FPTOSI]](s32)127 ; CHECK: RET 0, implicit $eax128 %1:_(s128) = COPY $xmm0129 %0:_(s32) = G_TRUNC %1(s128)130 %2:_(s32) = G_FPTOSI %0(s32)131 $eax = COPY %2(s32)132 RET 0, implicit $eax133 134...135---136name: float_to_int64137alignment: 16138tracksRegLiveness: true139registers:140 - { id: 0, class: _ }141 - { id: 1, class: _ }142 - { id: 2, class: _ }143body: |144 bb.1.entry:145 liveins: $xmm0146 147 ; CHECK-LABEL: name: float_to_int64148 ; CHECK: liveins: $xmm0149 ; CHECK: [[COPY:%[0-9]+]]:_(s128) = COPY $xmm0150 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s128)151 ; CHECK: [[FPTOSI:%[0-9]+]]:_(s64) = G_FPTOSI [[TRUNC]](s32)152 ; CHECK: $rax = COPY [[FPTOSI]](s64)153 ; CHECK: RET 0, implicit $rax154 %1:_(s128) = COPY $xmm0155 %0:_(s32) = G_TRUNC %1(s128)156 %2:_(s64) = G_FPTOSI %0(s32)157 $rax = COPY %2(s64)158 RET 0, implicit $rax159 160...161---162name: double_to_int8163alignment: 16164tracksRegLiveness: true165registers:166 - { id: 0, class: _ }167 - { id: 1, class: _ }168 - { id: 2, class: _ }169body: |170 bb.1.entry:171 liveins: $xmm0172 173 ; CHECK-LABEL: name: double_to_int8174 ; CHECK: liveins: $xmm0175 ; CHECK: [[COPY:%[0-9]+]]:_(s128) = COPY $xmm0176 ; CHECK: [[TRUNC:%[0-9]+]]:_(s64) = G_TRUNC [[COPY]](s128)177 ; CHECK: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[TRUNC]](s64)178 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[FPTOSI]](s32)179 ; CHECK: $al = COPY [[TRUNC1]](s8)180 ; CHECK: RET 0, implicit $al181 %1:_(s128) = COPY $xmm0182 %0:_(s64) = G_TRUNC %1(s128)183 %2:_(s8) = G_FPTOSI %0(s64)184 $al = COPY %2(s8)185 RET 0, implicit $al186 187...188---189name: double_to_int16190alignment: 16191tracksRegLiveness: true192registers:193 - { id: 0, class: _ }194 - { id: 1, class: _ }195 - { id: 2, class: _ }196body: |197 bb.1.entry:198 liveins: $xmm0199 200 ; CHECK-LABEL: name: double_to_int16201 ; CHECK: liveins: $xmm0202 ; CHECK: [[COPY:%[0-9]+]]:_(s128) = COPY $xmm0203 ; CHECK: [[TRUNC:%[0-9]+]]:_(s64) = G_TRUNC [[COPY]](s128)204 ; CHECK: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[TRUNC]](s64)205 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[FPTOSI]](s32)206 ; CHECK: $ax = COPY [[TRUNC1]](s16)207 ; CHECK: RET 0, implicit $ax208 %1:_(s128) = COPY $xmm0209 %0:_(s64) = G_TRUNC %1(s128)210 %2:_(s16) = G_FPTOSI %0(s64)211 $ax = COPY %2(s16)212 RET 0, implicit $ax213 214...215---216name: double_to_int32217alignment: 16218tracksRegLiveness: true219registers:220 - { id: 0, class: _ }221 - { id: 1, class: _ }222 - { id: 2, class: _ }223body: |224 bb.1.entry:225 liveins: $xmm0226 227 ; CHECK-LABEL: name: double_to_int32228 ; CHECK: liveins: $xmm0229 ; CHECK: [[COPY:%[0-9]+]]:_(s128) = COPY $xmm0230 ; CHECK: [[TRUNC:%[0-9]+]]:_(s64) = G_TRUNC [[COPY]](s128)231 ; CHECK: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[TRUNC]](s64)232 ; CHECK: $eax = COPY [[FPTOSI]](s32)233 ; CHECK: RET 0, implicit $eax234 %1:_(s128) = COPY $xmm0235 %0:_(s64) = G_TRUNC %1(s128)236 %2:_(s32) = G_FPTOSI %0(s64)237 $eax = COPY %2(s32)238 RET 0, implicit $eax239 240...241---242name: double_to_int64243alignment: 16244tracksRegLiveness: true245registers:246 - { id: 0, class: _ }247 - { id: 1, class: _ }248 - { id: 2, class: _ }249body: |250 bb.1.entry:251 liveins: $xmm0252 253 ; CHECK-LABEL: name: double_to_int64254 ; CHECK: liveins: $xmm0255 ; CHECK: [[COPY:%[0-9]+]]:_(s128) = COPY $xmm0256 ; CHECK: [[TRUNC:%[0-9]+]]:_(s64) = G_TRUNC [[COPY]](s128)257 ; CHECK: [[FPTOSI:%[0-9]+]]:_(s64) = G_FPTOSI [[TRUNC]](s64)258 ; CHECK: $rax = COPY [[FPTOSI]](s64)259 ; CHECK: RET 0, implicit $rax260 %1:_(s128) = COPY $xmm0261 %0:_(s64) = G_TRUNC %1(s128)262 %2:_(s64) = G_FPTOSI %0(s64)263 $rax = COPY %2(s64)264 RET 0, implicit $rax265 266...267