Skip to content

Commit d7bb072

Browse files
authored
InstCombine: Emit ldexp intrinsic in exp2->ldexp combine (llvm#92039)
Prefer to emit the intrinsic over a libcall in the intrinsic or no-math-errno case.
1 parent 0980f71 commit d7bb072

File tree

3 files changed

+272
-18
lines changed

3 files changed

+272
-18
lines changed

llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp

+13-4
Original file line numberDiff line numberDiff line change
@@ -2389,12 +2389,21 @@ Value *LibCallSimplifier::optimizeExp2(CallInst *CI, IRBuilderBase &B) {
23892389
if ((isa<SIToFPInst>(Op) || isa<UIToFPInst>(Op)) &&
23902390
hasFloatFn(M, TLI, Ty, LibFunc_ldexp, LibFunc_ldexpf, LibFunc_ldexpl)) {
23912391
if (Value *Exp = getIntToFPVal(Op, B, TLI->getIntSize())) {
2392+
Constant *One = ConstantFP::get(Ty, 1.0);
2393+
2394+
// TODO: Emitting the intrinsic should not depend on whether the libcall
2395+
// is available.
2396+
if (CI->doesNotAccessMemory()) {
2397+
return copyFlags(*CI, B.CreateIntrinsic(Intrinsic::ldexp,
2398+
{Ty, Exp->getType()},
2399+
{One, Exp}, CI));
2400+
}
2401+
23922402
IRBuilderBase::FastMathFlagGuard Guard(B);
23932403
B.setFastMathFlags(CI->getFastMathFlags());
2394-
return copyFlags(
2395-
*CI, emitBinaryFloatFnCall(ConstantFP::get(Ty, 1.0), Exp, TLI,
2396-
LibFunc_ldexp, LibFunc_ldexpf,
2397-
LibFunc_ldexpl, B, AttributeList()));
2404+
return copyFlags(*CI, emitBinaryFloatFnCall(
2405+
One, Exp, TLI, LibFunc_ldexp, LibFunc_ldexpf,
2406+
LibFunc_ldexpl, B, AttributeList()));
23982407
}
23992408
}
24002409

llvm/test/Transforms/InstCombine/exp2-1.ll

+109-14
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ declare float @exp2f(float)
1414
declare double @llvm.exp2.f64(double)
1515
declare float @llvm.exp2.f32(float)
1616
declare <2 x float> @llvm.exp2.v2f32(<2 x float>)
17+
declare fp128 @exp2l(fp128)
1718

1819

1920
; Check exp2(sitofp(x)) -> ldexp(1.0, sext(x)).
@@ -227,18 +228,18 @@ define float @test_simplify8(i8 zeroext %x) {
227228
define double @test_simplify9(i8 zeroext %x) {
228229
; LDEXP32-LABEL: @test_simplify9(
229230
; LDEXP32-NEXT: [[TMP1:%.*]] = zext i8 [[X:%.*]] to i32
230-
; LDEXP32-NEXT: [[LDEXP:%.*]] = call double @ldexp(double 1.000000e+00, i32 [[TMP1]])
231-
; LDEXP32-NEXT: ret double [[LDEXP]]
231+
; LDEXP32-NEXT: [[RET:%.*]] = call double @llvm.ldexp.f64.i32(double 1.000000e+00, i32 [[TMP1]])
232+
; LDEXP32-NEXT: ret double [[RET]]
232233
;
233234
; LDEXP16-LABEL: @test_simplify9(
234235
; LDEXP16-NEXT: [[TMP1:%.*]] = zext i8 [[X:%.*]] to i16
235-
; LDEXP16-NEXT: [[LDEXP:%.*]] = call double @ldexp(double 1.000000e+00, i16 [[TMP1]])
236-
; LDEXP16-NEXT: ret double [[LDEXP]]
236+
; LDEXP16-NEXT: [[RET:%.*]] = call double @llvm.ldexp.f64.i16(double 1.000000e+00, i16 [[TMP1]])
237+
; LDEXP16-NEXT: ret double [[RET]]
237238
;
238239
; NOLDEXPF-LABEL: @test_simplify9(
239240
; NOLDEXPF-NEXT: [[TMP1:%.*]] = zext i8 [[X:%.*]] to i32
240-
; NOLDEXPF-NEXT: [[LDEXP:%.*]] = call double @ldexp(double 1.000000e+00, i32 [[TMP1]])
241-
; NOLDEXPF-NEXT: ret double [[LDEXP]]
241+
; NOLDEXPF-NEXT: [[RET:%.*]] = call double @llvm.ldexp.f64.i32(double 1.000000e+00, i32 [[TMP1]])
242+
; NOLDEXPF-NEXT: ret double [[RET]]
242243
;
243244
; NOLDEXP-LABEL: @test_simplify9(
244245
; NOLDEXP-NEXT: [[CONV:%.*]] = uitofp i8 [[X:%.*]] to double
@@ -253,13 +254,13 @@ define double @test_simplify9(i8 zeroext %x) {
253254
define float @test_simplify10(i8 zeroext %x) {
254255
; LDEXP32-LABEL: @test_simplify10(
255256
; LDEXP32-NEXT: [[TMP1:%.*]] = zext i8 [[X:%.*]] to i32
256-
; LDEXP32-NEXT: [[LDEXPF:%.*]] = call float @ldexpf(float 1.000000e+00, i32 [[TMP1]])
257-
; LDEXP32-NEXT: ret float [[LDEXPF]]
257+
; LDEXP32-NEXT: [[RET:%.*]] = call float @llvm.ldexp.f32.i32(float 1.000000e+00, i32 [[TMP1]])
258+
; LDEXP32-NEXT: ret float [[RET]]
258259
;
259260
; LDEXP16-LABEL: @test_simplify10(
260261
; LDEXP16-NEXT: [[TMP1:%.*]] = zext i8 [[X:%.*]] to i16
261-
; LDEXP16-NEXT: [[LDEXPF:%.*]] = call float @ldexpf(float 1.000000e+00, i16 [[TMP1]])
262-
; LDEXP16-NEXT: ret float [[LDEXPF]]
262+
; LDEXP16-NEXT: [[RET:%.*]] = call float @llvm.ldexp.f32.i16(float 1.000000e+00, i16 [[TMP1]])
263+
; LDEXP16-NEXT: ret float [[RET]]
263264
;
264265
; NOLDEXPF-LABEL: @test_simplify10(
265266
; NOLDEXPF-NEXT: [[CONV:%.*]] = uitofp i8 [[X:%.*]] to float
@@ -279,13 +280,13 @@ define float @test_simplify10(i8 zeroext %x) {
279280
define float @sitofp_scalar_intrinsic_with_FMF(i8 %x) {
280281
; LDEXP32-LABEL: @sitofp_scalar_intrinsic_with_FMF(
281282
; LDEXP32-NEXT: [[TMP1:%.*]] = sext i8 [[X:%.*]] to i32
282-
; LDEXP32-NEXT: [[LDEXPF:%.*]] = tail call nnan float @ldexpf(float 1.000000e+00, i32 [[TMP1]])
283-
; LDEXP32-NEXT: ret float [[LDEXPF]]
283+
; LDEXP32-NEXT: [[R:%.*]] = tail call nnan float @llvm.ldexp.f32.i32(float 1.000000e+00, i32 [[TMP1]])
284+
; LDEXP32-NEXT: ret float [[R]]
284285
;
285286
; LDEXP16-LABEL: @sitofp_scalar_intrinsic_with_FMF(
286287
; LDEXP16-NEXT: [[TMP1:%.*]] = sext i8 [[X:%.*]] to i16
287-
; LDEXP16-NEXT: [[LDEXPF:%.*]] = tail call nnan float @ldexpf(float 1.000000e+00, i16 [[TMP1]])
288-
; LDEXP16-NEXT: ret float [[LDEXPF]]
288+
; LDEXP16-NEXT: [[R:%.*]] = tail call nnan float @llvm.ldexp.f32.i16(float 1.000000e+00, i16 [[TMP1]])
289+
; LDEXP16-NEXT: ret float [[R]]
289290
;
290291
; NOLDEXPF-LABEL: @sitofp_scalar_intrinsic_with_FMF(
291292
; NOLDEXPF-NEXT: [[S:%.*]] = sitofp i8 [[X:%.*]] to float
@@ -330,3 +331,97 @@ define <2 x float> @sitofp_vector_intrinsic_with_FMF(<2 x i8> %x) {
330331
%r = call nnan <2 x float> @llvm.exp2.v2f32(<2 x float> %s)
331332
ret <2 x float> %r
332333
}
334+
335+
define double @test_readonly_exp2_f64_of_sitofp(i32 %x) {
336+
; LDEXP32-LABEL: @test_readonly_exp2_f64_of_sitofp(
337+
; LDEXP32-NEXT: [[LDEXP:%.*]] = call double @ldexp(double 1.000000e+00, i32 [[X:%.*]])
338+
; LDEXP32-NEXT: ret double [[LDEXP]]
339+
;
340+
; LDEXP16-LABEL: @test_readonly_exp2_f64_of_sitofp(
341+
; LDEXP16-NEXT: [[CONV:%.*]] = sitofp i32 [[X:%.*]] to double
342+
; LDEXP16-NEXT: [[RET:%.*]] = call double @exp2(double [[CONV]]) #[[ATTR2:[0-9]+]]
343+
; LDEXP16-NEXT: ret double [[RET]]
344+
;
345+
; NOLDEXPF-LABEL: @test_readonly_exp2_f64_of_sitofp(
346+
; NOLDEXPF-NEXT: [[LDEXP:%.*]] = call double @ldexp(double 1.000000e+00, i32 [[X:%.*]])
347+
; NOLDEXPF-NEXT: ret double [[LDEXP]]
348+
;
349+
; NOLDEXP-LABEL: @test_readonly_exp2_f64_of_sitofp(
350+
; NOLDEXP-NEXT: [[CONV:%.*]] = sitofp i32 [[X:%.*]] to double
351+
; NOLDEXP-NEXT: [[RET:%.*]] = call double @exp2(double [[CONV]]) #[[ATTR1:[0-9]+]]
352+
; NOLDEXP-NEXT: ret double [[RET]]
353+
;
354+
%conv = sitofp i32 %x to double
355+
%ret = call double @exp2(double %conv) readonly
356+
ret double %ret
357+
}
358+
359+
define float @test_readonly_exp2f_f32_of_sitofp(i32 %x) {
360+
; LDEXP32-LABEL: @test_readonly_exp2f_f32_of_sitofp(
361+
; LDEXP32-NEXT: [[LDEXPF:%.*]] = call float @ldexpf(float 1.000000e+00, i32 [[X:%.*]])
362+
; LDEXP32-NEXT: ret float [[LDEXPF]]
363+
;
364+
; LDEXP16-LABEL: @test_readonly_exp2f_f32_of_sitofp(
365+
; LDEXP16-NEXT: [[CONV:%.*]] = sitofp i32 [[X:%.*]] to float
366+
; LDEXP16-NEXT: [[RET:%.*]] = call float @exp2f(float [[CONV]]) #[[ATTR2]]
367+
; LDEXP16-NEXT: ret float [[RET]]
368+
;
369+
; NOLDEXPF-LABEL: @test_readonly_exp2f_f32_of_sitofp(
370+
; NOLDEXPF-NEXT: [[CONV:%.*]] = sitofp i32 [[X:%.*]] to float
371+
; NOLDEXPF-NEXT: [[RET:%.*]] = call float @exp2f(float [[CONV]]) #[[ATTR2:[0-9]+]]
372+
; NOLDEXPF-NEXT: ret float [[RET]]
373+
;
374+
; NOLDEXP-LABEL: @test_readonly_exp2f_f32_of_sitofp(
375+
; NOLDEXP-NEXT: [[CONV:%.*]] = sitofp i32 [[X:%.*]] to float
376+
; NOLDEXP-NEXT: [[RET:%.*]] = call float @exp2f(float [[CONV]]) #[[ATTR1]]
377+
; NOLDEXP-NEXT: ret float [[RET]]
378+
;
379+
%conv = sitofp i32 %x to float
380+
%ret = call float @exp2f(float %conv) readonly
381+
ret float %ret
382+
}
383+
384+
define fp128 @test_readonly_exp2l_fp128_of_sitofp(i32 %x) {
385+
; LDEXP32-LABEL: @test_readonly_exp2l_fp128_of_sitofp(
386+
; LDEXP32-NEXT: [[LDEXPL:%.*]] = call fp128 @ldexpl(fp128 0xL00000000000000003FFF000000000000, i32 [[X:%.*]])
387+
; LDEXP32-NEXT: ret fp128 [[LDEXPL]]
388+
;
389+
; LDEXP16-LABEL: @test_readonly_exp2l_fp128_of_sitofp(
390+
; LDEXP16-NEXT: [[CONV:%.*]] = sitofp i32 [[X:%.*]] to fp128
391+
; LDEXP16-NEXT: [[RET:%.*]] = call fp128 @exp2l(fp128 [[CONV]]) #[[ATTR2]]
392+
; LDEXP16-NEXT: ret fp128 [[RET]]
393+
;
394+
; NOLDEXP-LABEL: @test_readonly_exp2l_fp128_of_sitofp(
395+
; NOLDEXP-NEXT: [[CONV:%.*]] = sitofp i32 [[X:%.*]] to fp128
396+
; NOLDEXP-NEXT: [[RET:%.*]] = call fp128 @exp2l(fp128 [[CONV]]) #[[ATTR1]]
397+
; NOLDEXP-NEXT: ret fp128 [[RET]]
398+
;
399+
%conv = sitofp i32 %x to fp128
400+
%ret = call fp128 @exp2l(fp128 %conv) readonly
401+
ret fp128 %ret
402+
}
403+
404+
define float @test_readonly_exp2f_f32_of_sitofp_flags(i32 %x) {
405+
; LDEXP32-LABEL: @test_readonly_exp2f_f32_of_sitofp_flags(
406+
; LDEXP32-NEXT: [[LDEXPF:%.*]] = call nnan ninf float @ldexpf(float 1.000000e+00, i32 [[X:%.*]])
407+
; LDEXP32-NEXT: ret float [[LDEXPF]]
408+
;
409+
; LDEXP16-LABEL: @test_readonly_exp2f_f32_of_sitofp_flags(
410+
; LDEXP16-NEXT: [[CONV:%.*]] = sitofp i32 [[X:%.*]] to float
411+
; LDEXP16-NEXT: [[RET:%.*]] = call nnan ninf float @exp2f(float [[CONV]]) #[[ATTR2]]
412+
; LDEXP16-NEXT: ret float [[RET]]
413+
;
414+
; NOLDEXPF-LABEL: @test_readonly_exp2f_f32_of_sitofp_flags(
415+
; NOLDEXPF-NEXT: [[CONV:%.*]] = sitofp i32 [[X:%.*]] to float
416+
; NOLDEXPF-NEXT: [[RET:%.*]] = call nnan ninf float @exp2f(float [[CONV]]) #[[ATTR2]]
417+
; NOLDEXPF-NEXT: ret float [[RET]]
418+
;
419+
; NOLDEXP-LABEL: @test_readonly_exp2f_f32_of_sitofp_flags(
420+
; NOLDEXP-NEXT: [[CONV:%.*]] = sitofp i32 [[X:%.*]] to float
421+
; NOLDEXP-NEXT: [[RET:%.*]] = call nnan ninf float @exp2f(float [[CONV]]) #[[ATTR1]]
422+
; NOLDEXP-NEXT: ret float [[RET]]
423+
;
424+
%conv = sitofp i32 %x to float
425+
%ret = call nnan ninf float @exp2f(float %conv) readonly
426+
ret float %ret
427+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
2+
; RUN: opt -S -passes=instcombine %s | FileCheck -check-prefixes=CHECK,LDEXP %s
3+
; RUN: opt -S -passes=instcombine -disable-builtin=ldexpf -disable-builtin=ldexp -disable-builtin=ldexpl %s | FileCheck -check-prefixes=CHECK,NOLDEXP %s
4+
5+
define float @exp2_f32_sitofp_i8(i8 %x) {
6+
; LDEXP-LABEL: define float @exp2_f32_sitofp_i8(
7+
; LDEXP-SAME: i8 [[X:%.*]]) {
8+
; LDEXP-NEXT: [[TMP1:%.*]] = sext i8 [[X]] to i32
9+
; LDEXP-NEXT: [[LDEXPF:%.*]] = call float @llvm.ldexp.f32.i32(float 1.000000e+00, i32 [[TMP1]])
10+
; LDEXP-NEXT: ret float [[LDEXPF]]
11+
;
12+
; NOLDEXP-LABEL: define float @exp2_f32_sitofp_i8(
13+
; NOLDEXP-SAME: i8 [[X:%.*]]) {
14+
; NOLDEXP-NEXT: [[ITOFP:%.*]] = sitofp i8 [[X]] to float
15+
; NOLDEXP-NEXT: [[EXP2:%.*]] = call float @llvm.exp2.f32(float [[ITOFP]])
16+
; NOLDEXP-NEXT: ret float [[EXP2]]
17+
;
18+
%itofp = sitofp i8 %x to float
19+
%exp2 = call float @llvm.exp2.f32(float %itofp)
20+
ret float %exp2
21+
}
22+
23+
define float @exp2_f32_sitofp_i8_flags(i8 %x) {
24+
; LDEXP-LABEL: define float @exp2_f32_sitofp_i8_flags(
25+
; LDEXP-SAME: i8 [[X:%.*]]) {
26+
; LDEXP-NEXT: [[TMP1:%.*]] = sext i8 [[X]] to i32
27+
; LDEXP-NEXT: [[LDEXPF:%.*]] = call nnan ninf float @llvm.ldexp.f32.i32(float 1.000000e+00, i32 [[TMP1]])
28+
; LDEXP-NEXT: ret float [[LDEXPF]]
29+
;
30+
; NOLDEXP-LABEL: define float @exp2_f32_sitofp_i8_flags(
31+
; NOLDEXP-SAME: i8 [[X:%.*]]) {
32+
; NOLDEXP-NEXT: [[ITOFP:%.*]] = sitofp i8 [[X]] to float
33+
; NOLDEXP-NEXT: [[EXP2:%.*]] = call nnan ninf float @llvm.exp2.f32(float [[ITOFP]])
34+
; NOLDEXP-NEXT: ret float [[EXP2]]
35+
;
36+
%itofp = sitofp i8 %x to float
37+
%exp2 = call nnan ninf float @llvm.exp2.f32(float %itofp)
38+
ret float %exp2
39+
}
40+
41+
define <2 x float> @exp2_v2f32_sitofp_v2i8(<2 x i8> %x) {
42+
; CHECK-LABEL: define <2 x float> @exp2_v2f32_sitofp_v2i8(
43+
; CHECK-SAME: <2 x i8> [[X:%.*]]) {
44+
; CHECK-NEXT: [[ITOFP:%.*]] = sitofp <2 x i8> [[X]] to <2 x float>
45+
; CHECK-NEXT: [[EXP2:%.*]] = call <2 x float> @llvm.exp2.v2f32(<2 x float> [[ITOFP]])
46+
; CHECK-NEXT: ret <2 x float> [[EXP2]]
47+
;
48+
%itofp = sitofp <2 x i8> %x to <2 x float>
49+
%exp2 = call <2 x float> @llvm.exp2.v2f32(<2 x float> %itofp)
50+
ret <2 x float> %exp2
51+
}
52+
53+
define float @exp2_f32_uitofp_i8(i8 %x) {
54+
; LDEXP-LABEL: define float @exp2_f32_uitofp_i8(
55+
; LDEXP-SAME: i8 [[X:%.*]]) {
56+
; LDEXP-NEXT: [[TMP1:%.*]] = zext i8 [[X]] to i32
57+
; LDEXP-NEXT: [[LDEXPF:%.*]] = call float @llvm.ldexp.f32.i32(float 1.000000e+00, i32 [[TMP1]])
58+
; LDEXP-NEXT: ret float [[LDEXPF]]
59+
;
60+
; NOLDEXP-LABEL: define float @exp2_f32_uitofp_i8(
61+
; NOLDEXP-SAME: i8 [[X:%.*]]) {
62+
; NOLDEXP-NEXT: [[ITOFP:%.*]] = uitofp i8 [[X]] to float
63+
; NOLDEXP-NEXT: [[EXP2:%.*]] = call float @llvm.exp2.f32(float [[ITOFP]])
64+
; NOLDEXP-NEXT: ret float [[EXP2]]
65+
;
66+
%itofp = uitofp i8 %x to float
67+
%exp2 = call float @llvm.exp2.f32(float %itofp)
68+
ret float %exp2
69+
}
70+
71+
define half @exp2_f16_sitofp_i8(i8 %x) {
72+
; CHECK-LABEL: define half @exp2_f16_sitofp_i8(
73+
; CHECK-SAME: i8 [[X:%.*]]) {
74+
; CHECK-NEXT: [[ITOFP:%.*]] = sitofp i8 [[X]] to half
75+
; CHECK-NEXT: [[EXP2:%.*]] = call half @llvm.exp2.f16(half [[ITOFP]])
76+
; CHECK-NEXT: ret half [[EXP2]]
77+
;
78+
%itofp = sitofp i8 %x to half
79+
%exp2 = call half @llvm.exp2.f16(half %itofp)
80+
ret half %exp2
81+
}
82+
83+
define double @exp2_f64_sitofp_i8(i8 %x) {
84+
; LDEXP-LABEL: define double @exp2_f64_sitofp_i8(
85+
; LDEXP-SAME: i8 [[X:%.*]]) {
86+
; LDEXP-NEXT: [[TMP1:%.*]] = sext i8 [[X]] to i32
87+
; LDEXP-NEXT: [[LDEXP:%.*]] = call double @llvm.ldexp.f64.i32(double 1.000000e+00, i32 [[TMP1]])
88+
; LDEXP-NEXT: ret double [[LDEXP]]
89+
;
90+
; NOLDEXP-LABEL: define double @exp2_f64_sitofp_i8(
91+
; NOLDEXP-SAME: i8 [[X:%.*]]) {
92+
; NOLDEXP-NEXT: [[ITOFP:%.*]] = sitofp i8 [[X]] to double
93+
; NOLDEXP-NEXT: [[EXP2:%.*]] = call double @llvm.exp2.f64(double [[ITOFP]])
94+
; NOLDEXP-NEXT: ret double [[EXP2]]
95+
;
96+
%itofp = sitofp i8 %x to double
97+
%exp2 = call double @llvm.exp2.f64(double %itofp)
98+
ret double %exp2
99+
}
100+
101+
define fp128 @exp2_fp128_sitofp_i8(i8 %x) {
102+
; LDEXP-LABEL: define fp128 @exp2_fp128_sitofp_i8(
103+
; LDEXP-SAME: i8 [[X:%.*]]) {
104+
; LDEXP-NEXT: [[TMP1:%.*]] = sext i8 [[X]] to i32
105+
; LDEXP-NEXT: [[LDEXPL:%.*]] = call fp128 @llvm.ldexp.f128.i32(fp128 0xL00000000000000003FFF000000000000, i32 [[TMP1]])
106+
; LDEXP-NEXT: ret fp128 [[LDEXPL]]
107+
;
108+
; NOLDEXP-LABEL: define fp128 @exp2_fp128_sitofp_i8(
109+
; NOLDEXP-SAME: i8 [[X:%.*]]) {
110+
; NOLDEXP-NEXT: [[ITOFP:%.*]] = sitofp i8 [[X]] to fp128
111+
; NOLDEXP-NEXT: [[EXP2:%.*]] = call fp128 @llvm.exp2.f128(fp128 [[ITOFP]])
112+
; NOLDEXP-NEXT: ret fp128 [[EXP2]]
113+
;
114+
%itofp = sitofp i8 %x to fp128
115+
%exp2 = call fp128 @llvm.exp2.fp128(fp128 %itofp)
116+
ret fp128 %exp2
117+
}
118+
119+
define <vscale x 4 x float> @exp2_nxv4f32_sitofp_i8(<vscale x 4 x i8> %x) {
120+
; CHECK-LABEL: define <vscale x 4 x float> @exp2_nxv4f32_sitofp_i8(
121+
; CHECK-SAME: <vscale x 4 x i8> [[X:%.*]]) {
122+
; CHECK-NEXT: [[ITOFP:%.*]] = sitofp <vscale x 4 x i8> [[X]] to <vscale x 4 x float>
123+
; CHECK-NEXT: [[EXP2:%.*]] = call <vscale x 4 x float> @llvm.exp2.nxv4f32(<vscale x 4 x float> [[ITOFP]])
124+
; CHECK-NEXT: ret <vscale x 4 x float> [[EXP2]]
125+
;
126+
%itofp = sitofp <vscale x 4 x i8> %x to <vscale x 4 x float>
127+
%exp2 = call <vscale x 4 x float> @llvm.exp2.nxv4f32(<vscale x 4 x float> %itofp)
128+
ret <vscale x 4 x float> %exp2
129+
}
130+
131+
; FIXME: This asserts
132+
; define bfloat @exp2_bf16_sitofp_i8(i8 %x) {
133+
; %itofp = sitofp i8 %x to bfloat
134+
; %exp2 = call bfloat @llvm.exp2.bf16(bfloat %itofp)
135+
; ret bfloat %exp2
136+
; }
137+
138+
; FIXME: This asserts
139+
; define ppc_fp128 @exp2_ppc_fp128_sitofp_i8(i8 %x) {
140+
; %itofp = sitofp i8 %x to ppc_fp128
141+
; %exp2 = call ppc_fp128 @llvm.exp2.ppcf128(ppc_fp128 %itofp)
142+
; ret ppc_fp128 %exp2
143+
; }
144+
145+
; FIXME: This asserts
146+
; define x86_fp80 @exp2_x86_fp80_sitofp_i8(i8 %x) {
147+
; %itofp = sitofp i8 %x to x86_fp80
148+
; %exp2 = call x86_fp80 @llvm.exp2.f80(x86_fp80 %itofp)
149+
; ret x86_fp80 %exp2
150+
; }

0 commit comments

Comments
 (0)