summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/GlobalISel/x86_64-select-sitofp.mir
blob: f853fe7bbb3e130041d0d52bc224fba420b7f38c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple=x86_64-linux-gnu -global-isel -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s

--- |
  ; ModuleID = 'sitofp_legal.ll'
  source_filename = "sitofp.c"
  target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
  target triple = "x86_64-unknown-linux-gnu"

  ; Function Attrs: norecurse nounwind readnone uwtable
  define dso_local float @int32_to_float(i32 %a) local_unnamed_addr #0 {
  entry:
    %conv = sitofp i32 %a to float
    ret float %conv
  }

  ; Function Attrs: norecurse nounwind readnone uwtable
  define dso_local float @int64_to_float(i64 %a) local_unnamed_addr #0 {
  entry:
    %conv = sitofp i64 %a to float
    ret float %conv
  }

  ; Function Attrs: norecurse nounwind readnone uwtable
  define dso_local double @int32_to_double(i32 %a) local_unnamed_addr #0 {
  entry:
    %conv = sitofp i32 %a to double
    ret double %conv
  }

  ; Function Attrs: norecurse nounwind readnone uwtable
  define dso_local double @int64_to_double(i64 %a) local_unnamed_addr #0 {
  entry:
    %conv = sitofp i64 %a to double
    ret double %conv
  }

  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" }

  !llvm.module.flags = !{!0}
  !llvm.ident = !{!1}

  !0 = !{i32 1, !"wchar_size", i32 4}
  !1 = !{!"clang version 7.0.0"}

...
---
name:            int32_to_float
alignment:       16
legalized:       true
regBankSelected: true
tracksRegLiveness: true
registers:
  - { id: 0, class: gpr }
  - { id: 1, class: vecr }
  - { id: 2, class: vecr }
body:             |
  bb.1.entry:
    liveins: $edi

    ; CHECK-LABEL: name: int32_to_float
    ; CHECK: liveins: $edi
    ; CHECK: [[COPY:%[0-9]+]]:gr32 = COPY $edi
    ; CHECK: [[CVTSI2SSrr:%[0-9]+]]:fr32 = CVTSI2SSrr [[COPY]]
    ; CHECK: [[COPY1:%[0-9]+]]:vr128 = COPY [[CVTSI2SSrr]]
    ; CHECK: $xmm0 = COPY [[COPY1]]
    ; CHECK: RET 0, implicit $xmm0
    %0:gpr(s32) = COPY $edi
    %1:vecr(s32) = G_SITOFP %0(s32)
    %2:vecr(s128) = G_ANYEXT %1(s32)
    $xmm0 = COPY %2(s128)
    RET 0, implicit $xmm0

...
---
name:            int64_to_float
alignment:       16
legalized:       true
regBankSelected: true
tracksRegLiveness: true
registers:
  - { id: 0, class: gpr }
  - { id: 1, class: vecr }
  - { id: 2, class: vecr }
body:             |
  bb.1.entry:
    liveins: $rdi

    ; CHECK-LABEL: name: int64_to_float
    ; CHECK: liveins: $rdi
    ; CHECK: [[COPY:%[0-9]+]]:gr64 = COPY $rdi
    ; CHECK: [[CVTSI642SSrr:%[0-9]+]]:fr32 = CVTSI642SSrr [[COPY]]
    ; CHECK: [[COPY1:%[0-9]+]]:vr128 = COPY [[CVTSI642SSrr]]
    ; CHECK: $xmm0 = COPY [[COPY1]]
    ; CHECK: RET 0, implicit $xmm0
    %0:gpr(s64) = COPY $rdi
    %1:vecr(s32) = G_SITOFP %0(s64)
    %2:vecr(s128) = G_ANYEXT %1(s32)
    $xmm0 = COPY %2(s128)
    RET 0, implicit $xmm0

...
---
name:            int32_to_double
alignment:       16
legalized:       true
regBankSelected: true
tracksRegLiveness: true
registers:
  - { id: 0, class: gpr }
  - { id: 1, class: vecr }
  - { id: 2, class: vecr }
body:             |
  bb.1.entry:
    liveins: $edi

    ; CHECK-LABEL: name: int32_to_double
    ; CHECK: liveins: $edi
    ; CHECK: [[COPY:%[0-9]+]]:gr32 = COPY $edi
    ; CHECK: [[CVTSI2SDrr:%[0-9]+]]:fr64 = CVTSI2SDrr [[COPY]]
    ; CHECK: [[COPY1:%[0-9]+]]:vr128 = COPY [[CVTSI2SDrr]]
    ; CHECK: $xmm0 = COPY [[COPY1]]
    ; CHECK: RET 0, implicit $xmm0
    %0:gpr(s32) = COPY $edi
    %1:vecr(s64) = G_SITOFP %0(s32)
    %2:vecr(s128) = G_ANYEXT %1(s64)
    $xmm0 = COPY %2(s128)
    RET 0, implicit $xmm0

...
---
name:            int64_to_double
alignment:       16
legalized:       true
regBankSelected: true
tracksRegLiveness: true
registers:
  - { id: 0, class: gpr }
  - { id: 1, class: vecr }
  - { id: 2, class: vecr }
body:             |
  bb.1.entry:
    liveins: $rdi

    ; CHECK-LABEL: name: int64_to_double
    ; CHECK: liveins: $rdi
    ; CHECK: [[COPY:%[0-9]+]]:gr64 = COPY $rdi
    ; CHECK: [[CVTSI642SDrr:%[0-9]+]]:fr64 = CVTSI642SDrr [[COPY]]
    ; CHECK: [[COPY1:%[0-9]+]]:vr128 = COPY [[CVTSI642SDrr]]
    ; CHECK: $xmm0 = COPY [[COPY1]]
    ; CHECK: RET 0, implicit $xmm0
    %0:gpr(s64) = COPY $rdi
    %1:vecr(s64) = G_SITOFP %0(s64)
    %2:vecr(s128) = G_ANYEXT %1(s64)
    $xmm0 = COPY %2(s128)
    RET 0, implicit $xmm0

...
OpenPOWER on IntegriCloud