vec-itofp.ll
5.72 KB
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \
; RUN: -mcpu=pwr8 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | \
; RUN: FileCheck %s --check-prefix=CHECK-P8
; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \
; RUN: -mcpu=pwr9 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | \
; RUN: FileCheck %s --check-prefix=CHECK-P9
; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu \
; RUN: -mcpu=pwr9 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | \
; RUN: FileCheck %s --check-prefix=CHECK-BE
define void @test8(<8 x double>* nocapture %Sink, <8 x i16>* nocapture readonly %SrcPtr) {
entry:
%0 = load <8 x i16>, <8 x i16>* %SrcPtr, align 16
%1 = uitofp <8 x i16> %0 to <8 x double>
store <8 x double> %1, <8 x double>* %Sink, align 16
ret void
; CHECK-P9-LABEL: @test8
; CHECK-P9: vperm
; CHECK-P9: xvcvuxddp
; CHECK-P9: vperm
; CHECK-P9: xvcvuxddp
; CHECK-P9: vperm
; CHECK-P9: xvcvuxddp
; CHECK-P9: vperm
; CHECK-P9: xvcvuxddp
; CHECK-P8-LABEL: @test8
; CHECK-P8: vperm
; CHECK-P8: vperm
; CHECK-P8: vperm
; CHECK-P8: vperm
; CHECK-P8: xvcvuxddp
; CHECK-P8: xvcvuxddp
; CHECK-P8: xvcvuxddp
; CHECK-P8: xvcvuxddp
}
define void @test4(<4 x double>* nocapture %Sink, <4 x i16>* nocapture readonly %SrcPtr) {
entry:
%0 = load <4 x i16>, <4 x i16>* %SrcPtr, align 16
%1 = uitofp <4 x i16> %0 to <4 x double>
store <4 x double> %1, <4 x double>* %Sink, align 16
ret void
; CHECK-P9-LABEL: @test4
; CHECK-P9: vperm
; CHECK-P9: xvcvuxddp
; CHECK-P9: vperm
; CHECK-P9: xvcvuxddp
; CHECK-P8-LABEL: @test4
; CHECK-P8: vperm
; CHECK-P8: vperm
; CHECK-P8: xvcvuxddp
; CHECK-P8: xvcvuxddp
}
define void @test2(<2 x double>* nocapture %Sink, <2 x i16>* nocapture readonly %SrcPtr) {
entry:
%0 = load <2 x i16>, <2 x i16>* %SrcPtr, align 16
%1 = uitofp <2 x i16> %0 to <2 x double>
store <2 x double> %1, <2 x double>* %Sink, align 16
ret void
; CHECK-P9-LABEL: .LCPI2_0:
; CHECK-P9-NEXT: .byte 31
; CHECK-P9-NEXT: .byte 30
; CHECK-P9-NEXT: .byte 13
; CHECK-P9-NEXT: .byte 12
; CHECK-P9-NEXT: .byte 11
; CHECK-P9-NEXT: .byte 10
; CHECK-P9-NEXT: .byte 9
; CHECK-P9-NEXT: .byte 8
; CHECK-P9-NEXT: .byte 29
; CHECK-P9-NEXT: .byte 28
; CHECK-P9-NEXT: .byte 5
; CHECK-P9-NEXT: .byte 4
; CHECK-P9-NEXT: .byte 3
; CHECK-P9-NEXT: .byte 2
; CHECK-P9-NEXT: .byte 1
; CHECK-P9-NEXT: .byte 0
; CHECK-P9: addi [[REG1:r[0-9]+]], {{r[0-9]+}}, .LCPI2_0@toc@l
; CHECK-P9: lxvx [[REG2:v[0-9]+]], 0, [[REG1]]
; CHECK-P9: vperm [[REG3:v[0-9]+]], {{v[0-9]+}}, {{v[0-9]+}}, [[REG2]]
; CHECK-P9: xvcvuxddp {{vs[0-9]+}}, [[REG3]]
; CHECK-P8-LABEL: @test2
; CHECK-P8: vperm [[REG1:v[0-9]+]]
; CHECK-P8: xvcvuxddp {{vs[0-9]+}}, [[REG1]]
; CHECK-BE-LABEL: .LCPI2_0:
; CHECK-BE-NEXT: .byte 16
; CHECK-BE-NEXT: .byte 17
; CHECK-BE-NEXT: .byte 18
; CHECK-BE-NEXT: .byte 19
; CHECK-BE-NEXT: .byte 20
; CHECK-BE-NEXT: .byte 21
; CHECK-BE-NEXT: .byte 0
; CHECK-BE-NEXT: .byte 1
; CHECK-BE-NEXT: .byte 24
; CHECK-BE-NEXT: .byte 25
; CHECK-BE-NEXT: .byte 26
; CHECK-BE-NEXT: .byte 27
; CHECK-BE-NEXT: .byte 28
; CHECK-BE-NEXT: .byte 29
; CHECK-BE-NEXT: .byte 2
; CHECK-BE-NEXT: .byte 3
; CHECK-BE: addi [[REG1:r[0-9]+]], {{r[0-9]+}}, .LCPI2_0@toc@l
; CHECK-BE: lxvx [[REG2:v[0-9]+]], 0, [[REG1]]
; CHECK-BE: vperm [[REG3:v[0-9]+]], {{v[0-9]+}}, {{v[0-9]+}}, [[REG2]]
; CHECK-BE: xvcvuxddp {{vs[0-9]+}}, [[REG3]]
}
define void @stest8(<8 x double>* nocapture %Sink, <8 x i16>* nocapture readonly %SrcPtr) {
entry:
%0 = load <8 x i16>, <8 x i16>* %SrcPtr, align 16
%1 = sitofp <8 x i16> %0 to <8 x double>
store <8 x double> %1, <8 x double>* %Sink, align 16
ret void
; CHECK-P9-LABEL: @stest8
; CHECK-P9: vperm
; CHECK-P9: vextsh2d
; CHECK-P9: xvcvsxddp
; CHECK-P9: vperm
; CHECK-P9: vextsh2d
; CHECK-P9: xvcvsxddp
; CHECK-P9: vperm
; CHECK-P9: vextsh2d
; CHECK-P9: xvcvsxddp
; CHECK-P9: vperm
; CHECK-P9: vextsh2d
; CHECK-P9: xvcvsxddp
}
define void @stest4(<4 x double>* nocapture %Sink, <4 x i16>* nocapture readonly %SrcPtr) {
entry:
%0 = load <4 x i16>, <4 x i16>* %SrcPtr, align 16
%1 = sitofp <4 x i16> %0 to <4 x double>
store <4 x double> %1, <4 x double>* %Sink, align 16
ret void
; CHECK-P9-LABEL: @stest4
; CHECK-P9: vperm
; CHECK-P9: vextsh2d
; CHECK-P9: xvcvsxddp
; CHECK-P9: vperm
; CHECK-P9: vextsh2d
; CHECK-P9: xvcvsxddp
}
define void @stest2(<2 x double>* nocapture %Sink, <2 x i16>* nocapture readonly %SrcPtr) {
entry:
%0 = load <2 x i16>, <2 x i16>* %SrcPtr, align 16
%1 = sitofp <2 x i16> %0 to <2 x double>
store <2 x double> %1, <2 x double>* %Sink, align 16
ret void
; CHECK-P9-LABEL: .LCPI5_0:
; CHECK-P9-NEXT: .byte 31
; CHECK-P9-NEXT: .byte 30
; CHECK-P9-NEXT: .byte 31
; CHECK-P9-NEXT: .byte 31
; CHECK-P9-NEXT: .byte 31
; CHECK-P9-NEXT: .byte 31
; CHECK-P9-NEXT: .byte 31
; CHECK-P9-NEXT: .byte 31
; CHECK-P9-NEXT: .byte 29
; CHECK-P9-NEXT: .byte 28
; CHECK-P9-NEXT: .byte 31
; CHECK-P9-NEXT: .byte 31
; CHECK-P9-NEXT: .byte 31
; CHECK-P9-NEXT: .byte 31
; CHECK-P9-NEXT: .byte 31
; CHECK-P9-NEXT: .byte 31
; CHECK-P9: vperm [[REG1:v[0-9]+]]
; CHECK-P9: vextsh2d [[REG2:v[0-9]+]], [[REG1]]
; CHECK-P9: xvcvsxddp {{vs[0-9]+}}, [[REG2]]
; CHECK-BE-LABEL: .LCPI5_0:
; CHECK-BE-NEXT: .byte 0
; CHECK-BE-NEXT: .byte 0
; CHECK-BE-NEXT: .byte 0
; CHECK-BE-NEXT: .byte 0
; CHECK-BE-NEXT: .byte 0
; CHECK-BE-NEXT: .byte 0
; CHECK-BE-NEXT: .byte 0
; CHECK-BE-NEXT: .byte 1
; CHECK-BE-NEXT: .byte 0
; CHECK-BE-NEXT: .byte 0
; CHECK-BE-NEXT: .byte 0
; CHECK-BE-NEXT: .byte 0
; CHECK-BE-NEXT: .byte 0
; CHECK-BE-NEXT: .byte 0
; CHECK-BE-NEXT: .byte 2
; CHECK-BE-NEXT: .byte 3
; CHECK-BE: addi [[REG1:r[0-9]+]], {{r[0-9]+}}, .LCPI5_0@toc@l
; CHECK-BE: lxvx [[REG2:v[0-9]+]], 0, [[REG1]]
; CHECK-BE: vperm [[REG3:v[0-9]+]], {{v[0-9]+}}, {{v[0-9]+}}, [[REG2]]
; CHECK-BE: vextsh2d [[REG4:v[0-9]+]], [[REG3]]
; CHECK-BE: xvcvsxddp {{vs[0-9]+}}, [[REG4]]
}