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
193
194
195
196
197
198
|
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -passes=amdgpu-simplifylib %s | FileCheck %s
declare <2 x float> @_Z5ldexpDv2_fi(<2 x float>, i32)
declare <3 x float> @_Z5ldexpDv3_fi(<3 x float>, i32)
declare <4 x float> @_Z5ldexpDv4_fi(<4 x float>, i32)
declare <8 x float> @_Z5ldexpDv8_fi(<8 x float>, i32)
declare <16 x float> @_Z5ldexpDv16_fi(<16 x float>, i32)
declare <2 x double> @_Z5ldexpDv2_di(<2 x double>, i32)
declare <3 x double> @_Z5ldexpDv3_di(<3 x double>, i32)
declare <4 x double> @_Z5ldexpDv4_di(<4 x double>, i32)
declare <8 x double> @_Z5ldexpDv8_di(<8 x double>, i32)
declare <16 x double> @_Z5ldexpDv16_di(<16 x double>, i32)
declare <2 x half> @_Z5ldexpDv2_Dhi(<2 x half>, i32)
declare <3 x half> @_Z5ldexpDv3_Dhi(<3 x half>, i32)
declare <4 x half> @_Z5ldexpDv4_Dhi(<4 x half>, i32)
declare <8 x half> @_Z5ldexpDv8_Dhi(<8 x half>, i32)
declare <16 x half> @_Z5ldexpDv16_Dhi(<16 x half>, i32)
define <2 x float> @test_ldexp_v2f32_i32(<2 x float> %x, i32 %y) {
; CHECK-LABEL: define <2 x float> @test_ldexp_v2f32_i32
; CHECK-SAME: (<2 x float> [[X:%.*]], i32 [[Y:%.*]]) {
; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <2 x i32> poison, i32 [[Y]], i64 0
; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <2 x i32> [[DOTSPLATINSERT]], <2 x i32> poison, <2 x i32> zeroinitializer
; CHECK-NEXT: [[LDEXP:%.*]] = tail call <2 x float> @llvm.ldexp.v2f32.v2i32(<2 x float> [[X]], <2 x i32> [[DOTSPLAT]])
; CHECK-NEXT: ret <2 x float> [[LDEXP]]
;
%ldexp = tail call <2 x float> @_Z5ldexpDv2_fi(<2 x float> %x, i32 %y)
ret <2 x float> %ldexp
}
define <3 x float> @test_ldexp_v3f32_i32(<3 x float> %x, i32 %y) {
; CHECK-LABEL: define <3 x float> @test_ldexp_v3f32_i32
; CHECK-SAME: (<3 x float> [[X:%.*]], i32 [[Y:%.*]]) {
; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <3 x i32> poison, i32 [[Y]], i64 0
; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <3 x i32> [[DOTSPLATINSERT]], <3 x i32> poison, <3 x i32> zeroinitializer
; CHECK-NEXT: [[LDEXP:%.*]] = tail call <3 x float> @llvm.ldexp.v3f32.v3i32(<3 x float> [[X]], <3 x i32> [[DOTSPLAT]])
; CHECK-NEXT: ret <3 x float> [[LDEXP]]
;
%ldexp = tail call <3 x float> @_Z5ldexpDv3_fi(<3 x float> %x, i32 %y)
ret <3 x float> %ldexp
}
define <4 x float> @test_ldexp_v4f32_i32(<4 x float> %x, i32 %y) {
; CHECK-LABEL: define <4 x float> @test_ldexp_v4f32_i32
; CHECK-SAME: (<4 x float> [[X:%.*]], i32 [[Y:%.*]]) {
; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x i32> poison, i32 [[Y]], i64 0
; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x i32> [[DOTSPLATINSERT]], <4 x i32> poison, <4 x i32> zeroinitializer
; CHECK-NEXT: [[LDEXP:%.*]] = tail call <4 x float> @llvm.ldexp.v4f32.v4i32(<4 x float> [[X]], <4 x i32> [[DOTSPLAT]])
; CHECK-NEXT: ret <4 x float> [[LDEXP]]
;
%ldexp = tail call <4 x float> @_Z5ldexpDv4_fi(<4 x float> %x, i32 %y)
ret <4 x float> %ldexp
}
define <8 x float> @test_ldexp_v8f32_i32(<8 x float> %x, i32 %y) {
; CHECK-LABEL: define <8 x float> @test_ldexp_v8f32_i32
; CHECK-SAME: (<8 x float> [[X:%.*]], i32 [[Y:%.*]]) {
; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x i32> poison, i32 [[Y]], i64 0
; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x i32> [[DOTSPLATINSERT]], <8 x i32> poison, <8 x i32> zeroinitializer
; CHECK-NEXT: [[LDEXP:%.*]] = tail call <8 x float> @llvm.ldexp.v8f32.v8i32(<8 x float> [[X]], <8 x i32> [[DOTSPLAT]])
; CHECK-NEXT: ret <8 x float> [[LDEXP]]
;
%ldexp = tail call <8 x float> @_Z5ldexpDv8_fi(<8 x float> %x, i32 %y)
ret <8 x float> %ldexp
}
define <16 x float> @test_ldexp_v16f32_i32(<16 x float> %x, i32 %y) {
; CHECK-LABEL: define <16 x float> @test_ldexp_v16f32_i32
; CHECK-SAME: (<16 x float> [[X:%.*]], i32 [[Y:%.*]]) {
; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <16 x i32> poison, i32 [[Y]], i64 0
; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <16 x i32> [[DOTSPLATINSERT]], <16 x i32> poison, <16 x i32> zeroinitializer
; CHECK-NEXT: [[LDEXP:%.*]] = tail call <16 x float> @llvm.ldexp.v16f32.v16i32(<16 x float> [[X]], <16 x i32> [[DOTSPLAT]])
; CHECK-NEXT: ret <16 x float> [[LDEXP]]
;
%ldexp = tail call <16 x float> @_Z5ldexpDv16_fi(<16 x float> %x, i32 %y)
ret <16 x float> %ldexp
}
define <2 x double> @test_ldexp_v2f64_i32(<2 x double> %x, i32 %y) {
; CHECK-LABEL: define <2 x double> @test_ldexp_v2f64_i32
; CHECK-SAME: (<2 x double> [[X:%.*]], i32 [[Y:%.*]]) {
; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <2 x i32> poison, i32 [[Y]], i64 0
; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <2 x i32> [[DOTSPLATINSERT]], <2 x i32> poison, <2 x i32> zeroinitializer
; CHECK-NEXT: [[LDEXP:%.*]] = tail call <2 x double> @llvm.ldexp.v2f64.v2i32(<2 x double> [[X]], <2 x i32> [[DOTSPLAT]])
; CHECK-NEXT: ret <2 x double> [[LDEXP]]
;
%ldexp = tail call <2 x double> @_Z5ldexpDv2_di(<2 x double> %x, i32 %y)
ret <2 x double> %ldexp
}
define <3 x double> @test_ldexp_v3f64_i32(<3 x double> %x, i32 %y) {
; CHECK-LABEL: define <3 x double> @test_ldexp_v3f64_i32
; CHECK-SAME: (<3 x double> [[X:%.*]], i32 [[Y:%.*]]) {
; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <3 x i32> poison, i32 [[Y]], i64 0
; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <3 x i32> [[DOTSPLATINSERT]], <3 x i32> poison, <3 x i32> zeroinitializer
; CHECK-NEXT: [[LDEXP:%.*]] = tail call <3 x double> @llvm.ldexp.v3f64.v3i32(<3 x double> [[X]], <3 x i32> [[DOTSPLAT]])
; CHECK-NEXT: ret <3 x double> [[LDEXP]]
;
%ldexp = tail call <3 x double> @_Z5ldexpDv3_di(<3 x double> %x, i32 %y)
ret <3 x double> %ldexp
}
define <4 x double> @test_ldexp_v4f64_i32(<4 x double> %x, i32 %y) {
; CHECK-LABEL: define <4 x double> @test_ldexp_v4f64_i32
; CHECK-SAME: (<4 x double> [[X:%.*]], i32 [[Y:%.*]]) {
; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x i32> poison, i32 [[Y]], i64 0
; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x i32> [[DOTSPLATINSERT]], <4 x i32> poison, <4 x i32> zeroinitializer
; CHECK-NEXT: [[LDEXP:%.*]] = tail call <4 x double> @llvm.ldexp.v4f64.v4i32(<4 x double> [[X]], <4 x i32> [[DOTSPLAT]])
; CHECK-NEXT: ret <4 x double> [[LDEXP]]
;
%ldexp = tail call <4 x double> @_Z5ldexpDv4_di(<4 x double> %x, i32 %y)
ret <4 x double> %ldexp
}
define <8 x double> @test_ldexp_v8f64_i32(<8 x double> %x, i32 %y) {
; CHECK-LABEL: define <8 x double> @test_ldexp_v8f64_i32
; CHECK-SAME: (<8 x double> [[X:%.*]], i32 [[Y:%.*]]) {
; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x i32> poison, i32 [[Y]], i64 0
; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x i32> [[DOTSPLATINSERT]], <8 x i32> poison, <8 x i32> zeroinitializer
; CHECK-NEXT: [[LDEXP:%.*]] = tail call <8 x double> @llvm.ldexp.v8f64.v8i32(<8 x double> [[X]], <8 x i32> [[DOTSPLAT]])
; CHECK-NEXT: ret <8 x double> [[LDEXP]]
;
%ldexp = tail call <8 x double> @_Z5ldexpDv8_di(<8 x double> %x, i32 %y)
ret <8 x double> %ldexp
}
define <16 x double> @test_ldexp_v16f64_i32(<16 x double> %x, i32 %y) {
; CHECK-LABEL: define <16 x double> @test_ldexp_v16f64_i32
; CHECK-SAME: (<16 x double> [[X:%.*]], i32 [[Y:%.*]]) {
; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <16 x i32> poison, i32 [[Y]], i64 0
; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <16 x i32> [[DOTSPLATINSERT]], <16 x i32> poison, <16 x i32> zeroinitializer
; CHECK-NEXT: [[LDEXP:%.*]] = tail call <16 x double> @llvm.ldexp.v16f64.v16i32(<16 x double> [[X]], <16 x i32> [[DOTSPLAT]])
; CHECK-NEXT: ret <16 x double> [[LDEXP]]
;
%ldexp = tail call <16 x double> @_Z5ldexpDv16_di(<16 x double> %x, i32 %y)
ret <16 x double> %ldexp
}
define <2 x half> @test_ldexp_v2f16_i32(<2 x half> %x, i32 %y) {
; CHECK-LABEL: define <2 x half> @test_ldexp_v2f16_i32
; CHECK-SAME: (<2 x half> [[X:%.*]], i32 [[Y:%.*]]) {
; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <2 x i32> poison, i32 [[Y]], i64 0
; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <2 x i32> [[DOTSPLATINSERT]], <2 x i32> poison, <2 x i32> zeroinitializer
; CHECK-NEXT: [[LDEXP:%.*]] = tail call <2 x half> @llvm.ldexp.v2f16.v2i32(<2 x half> [[X]], <2 x i32> [[DOTSPLAT]])
; CHECK-NEXT: ret <2 x half> [[LDEXP]]
;
%ldexp = tail call <2 x half> @_Z5ldexpDv2_Dhi(<2 x half> %x, i32 %y)
ret <2 x half> %ldexp
}
define <3 x half> @test_ldexp_v3f16_i32(<3 x half> %x, i32 %y) {
; CHECK-LABEL: define <3 x half> @test_ldexp_v3f16_i32
; CHECK-SAME: (<3 x half> [[X:%.*]], i32 [[Y:%.*]]) {
; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <3 x i32> poison, i32 [[Y]], i64 0
; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <3 x i32> [[DOTSPLATINSERT]], <3 x i32> poison, <3 x i32> zeroinitializer
; CHECK-NEXT: [[LDEXP:%.*]] = tail call <3 x half> @llvm.ldexp.v3f16.v3i32(<3 x half> [[X]], <3 x i32> [[DOTSPLAT]])
; CHECK-NEXT: ret <3 x half> [[LDEXP]]
;
%ldexp = tail call <3 x half> @_Z5ldexpDv3_Dhi(<3 x half> %x, i32 %y)
ret <3 x half> %ldexp
}
define <4 x half> @test_ldexp_v4f16_i32(<4 x half> %x, i32 %y) {
; CHECK-LABEL: define <4 x half> @test_ldexp_v4f16_i32
; CHECK-SAME: (<4 x half> [[X:%.*]], i32 [[Y:%.*]]) {
; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x i32> poison, i32 [[Y]], i64 0
; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x i32> [[DOTSPLATINSERT]], <4 x i32> poison, <4 x i32> zeroinitializer
; CHECK-NEXT: [[LDEXP:%.*]] = tail call <4 x half> @llvm.ldexp.v4f16.v4i32(<4 x half> [[X]], <4 x i32> [[DOTSPLAT]])
; CHECK-NEXT: ret <4 x half> [[LDEXP]]
;
%ldexp = tail call <4 x half> @_Z5ldexpDv4_Dhi(<4 x half> %x, i32 %y)
ret <4 x half> %ldexp
}
define <8 x half> @test_ldexp_v8f16_i32(<8 x half> %x, i32 %y) {
; CHECK-LABEL: define <8 x half> @test_ldexp_v8f16_i32
; CHECK-SAME: (<8 x half> [[X:%.*]], i32 [[Y:%.*]]) {
; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x i32> poison, i32 [[Y]], i64 0
; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x i32> [[DOTSPLATINSERT]], <8 x i32> poison, <8 x i32> zeroinitializer
; CHECK-NEXT: [[LDEXP:%.*]] = tail call <8 x half> @llvm.ldexp.v8f16.v8i32(<8 x half> [[X]], <8 x i32> [[DOTSPLAT]])
; CHECK-NEXT: ret <8 x half> [[LDEXP]]
;
%ldexp = tail call <8 x half> @_Z5ldexpDv8_Dhi(<8 x half> %x, i32 %y)
ret <8 x half> %ldexp
}
define <16 x half> @test_ldexp_v16f16_i32(<16 x half> %x, i32 %y) {
; CHECK-LABEL: define <16 x half> @test_ldexp_v16f16_i32
; CHECK-SAME: (<16 x half> [[X:%.*]], i32 [[Y:%.*]]) {
; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <16 x i32> poison, i32 [[Y]], i64 0
; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <16 x i32> [[DOTSPLATINSERT]], <16 x i32> poison, <16 x i32> zeroinitializer
; CHECK-NEXT: [[LDEXP:%.*]] = tail call <16 x half> @llvm.ldexp.v16f16.v16i32(<16 x half> [[X]], <16 x i32> [[DOTSPLAT]])
; CHECK-NEXT: ret <16 x half> [[LDEXP]]
;
%ldexp = tail call <16 x half> @_Z5ldexpDv16_Dhi(<16 x half> %x, i32 %y)
ret <16 x half> %ldexp
}
|