1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=x86_64-linux-gnu -global-isel -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
5 ; ModuleID = 'sitofp_legal.ll'
6 source_filename = "sitofp.c"
7 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
8 target triple = "x86_64-unknown-linux-gnu"
10 ; Function Attrs: norecurse nounwind readnone uwtable
11 define dso_local float @int32_to_float(i32 %a) local_unnamed_addr #0 {
13 %conv = sitofp i32 %a to float
17 ; Function Attrs: norecurse nounwind readnone uwtable
18 define dso_local float @int64_to_float(i64 %a) local_unnamed_addr #0 {
20 %conv = sitofp i64 %a to float
24 ; Function Attrs: norecurse nounwind readnone uwtable
25 define dso_local double @int32_to_double(i32 %a) local_unnamed_addr #0 {
27 %conv = sitofp i32 %a to double
31 ; Function Attrs: norecurse nounwind readnone uwtable
32 define dso_local double @int64_to_double(i64 %a) local_unnamed_addr #0 {
34 %conv = sitofp i64 %a to double
38 attributes #0 = { norecurse nounwind readnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
40 !llvm.module.flags = !{!0}
43 !0 = !{i32 1, !"wchar_size", i32 4}
44 !1 = !{!"clang version 7.0.0"}
52 tracksRegLiveness: true
54 - { id: 0, class: gpr }
55 - { id: 1, class: vecr }
56 - { id: 2, class: vecr }
61 ; CHECK-LABEL: name: int32_to_float
62 ; CHECK: liveins: $edi
63 ; CHECK: [[COPY:%[0-9]+]]:gr32 = COPY $edi
64 ; CHECK: [[CVTSI2SSrr:%[0-9]+]]:fr32 = CVTSI2SSrr [[COPY]]
65 ; CHECK: [[COPY1:%[0-9]+]]:vr128 = COPY [[CVTSI2SSrr]]
66 ; CHECK: $xmm0 = COPY [[COPY1]]
67 ; CHECK: RET 0, implicit $xmm0
68 %0:gpr(s32) = COPY $edi
69 %1:vecr(s32) = G_SITOFP %0(s32)
70 %2:vecr(s128) = G_ANYEXT %1(s32)
80 tracksRegLiveness: true
82 - { id: 0, class: gpr }
83 - { id: 1, class: vecr }
84 - { id: 2, class: vecr }
89 ; CHECK-LABEL: name: int64_to_float
90 ; CHECK: liveins: $rdi
91 ; CHECK: [[COPY:%[0-9]+]]:gr64 = COPY $rdi
92 ; CHECK: [[CVTSI642SSrr:%[0-9]+]]:fr32 = CVTSI642SSrr [[COPY]]
93 ; CHECK: [[COPY1:%[0-9]+]]:vr128 = COPY [[CVTSI642SSrr]]
94 ; CHECK: $xmm0 = COPY [[COPY1]]
95 ; CHECK: RET 0, implicit $xmm0
96 %0:gpr(s64) = COPY $rdi
97 %1:vecr(s32) = G_SITOFP %0(s64)
98 %2:vecr(s128) = G_ANYEXT %1(s32)
100 RET 0, implicit $xmm0
104 name: int32_to_double
107 regBankSelected: true
108 tracksRegLiveness: true
110 - { id: 0, class: gpr }
111 - { id: 1, class: vecr }
112 - { id: 2, class: vecr }
117 ; CHECK-LABEL: name: int32_to_double
118 ; CHECK: liveins: $edi
119 ; CHECK: [[COPY:%[0-9]+]]:gr32 = COPY $edi
120 ; CHECK: [[CVTSI2SDrr:%[0-9]+]]:fr64 = CVTSI2SDrr [[COPY]]
121 ; CHECK: [[COPY1:%[0-9]+]]:vr128 = COPY [[CVTSI2SDrr]]
122 ; CHECK: $xmm0 = COPY [[COPY1]]
123 ; CHECK: RET 0, implicit $xmm0
124 %0:gpr(s32) = COPY $edi
125 %1:vecr(s64) = G_SITOFP %0(s32)
126 %2:vecr(s128) = G_ANYEXT %1(s64)
127 $xmm0 = COPY %2(s128)
128 RET 0, implicit $xmm0
132 name: int64_to_double
135 regBankSelected: true
136 tracksRegLiveness: true
138 - { id: 0, class: gpr }
139 - { id: 1, class: vecr }
140 - { id: 2, class: vecr }
145 ; CHECK-LABEL: name: int64_to_double
146 ; CHECK: liveins: $rdi
147 ; CHECK: [[COPY:%[0-9]+]]:gr64 = COPY $rdi
148 ; CHECK: [[CVTSI642SDrr:%[0-9]+]]:fr64 = CVTSI642SDrr [[COPY]]
149 ; CHECK: [[COPY1:%[0-9]+]]:vr128 = COPY [[CVTSI642SDrr]]
150 ; CHECK: $xmm0 = COPY [[COPY1]]
151 ; CHECK: RET 0, implicit $xmm0
152 %0:gpr(s64) = COPY $rdi
153 %1:vecr(s64) = G_SITOFP %0(s64)
154 %2:vecr(s128) = G_ANYEXT %1(s64)
155 $xmm0 = COPY %2(s128)
156 RET 0, implicit $xmm0