pow-cbrt.ll
4.22 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
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -instcombine -S | FileCheck %s
define double @pow_intrinsic_third_fast(double %x) {
; CHECK-LABEL: @pow_intrinsic_third_fast(
; CHECK-NEXT: [[POW:%.*]] = call fast double @llvm.pow.f64(double [[X:%.*]], double 0x3FD5555555555555)
; CHECK-NEXT: ret double [[POW]]
;
%pow = call fast double @llvm.pow.f64(double %x, double 0x3fd5555555555555)
ret double %pow
}
define float @powf_intrinsic_third_fast(float %x) {
; CHECK-LABEL: @powf_intrinsic_third_fast(
; CHECK-NEXT: [[POW:%.*]] = call fast float @llvm.pow.f32(float [[X:%.*]], float 0x3FD5555560000000)
; CHECK-NEXT: ret float [[POW]]
;
%pow = call fast float @llvm.pow.f32(float %x, float 0x3fd5555560000000)
ret float %pow
}
define double @pow_intrinsic_third_approx(double %x) {
; CHECK-LABEL: @pow_intrinsic_third_approx(
; CHECK-NEXT: [[POW:%.*]] = call afn double @llvm.pow.f64(double [[X:%.*]], double 0x3FD5555555555555)
; CHECK-NEXT: ret double [[POW]]
;
%pow = call afn double @llvm.pow.f64(double %x, double 0x3fd5555555555555)
ret double %pow
}
define float @powf_intrinsic_third_approx(float %x) {
; CHECK-LABEL: @powf_intrinsic_third_approx(
; CHECK-NEXT: [[POW:%.*]] = call afn float @llvm.pow.f32(float [[X:%.*]], float 0x3FD5555560000000)
; CHECK-NEXT: ret float [[POW]]
;
%pow = call afn float @llvm.pow.f32(float %x, float 0x3fd5555560000000)
ret float %pow
}
define double @pow_libcall_third_fast(double %x) {
; CHECK-LABEL: @pow_libcall_third_fast(
; CHECK-NEXT: [[POW:%.*]] = call fast double @pow(double [[X:%.*]], double 0x3FD5555555555555)
; CHECK-NEXT: ret double [[POW]]
;
%pow = call fast double @pow(double %x, double 0x3fd5555555555555)
ret double %pow
}
define float @powf_libcall_third_fast(float %x) {
; CHECK-LABEL: @powf_libcall_third_fast(
; CHECK-NEXT: [[POW:%.*]] = call fast float @powf(float [[X:%.*]], float 0x3FD5555560000000)
; CHECK-NEXT: ret float [[POW]]
;
%pow = call fast float @powf(float %x, float 0x3fd5555560000000)
ret float %pow
}
define double @pow_intrinsic_negthird_fast(double %x) {
; CHECK-LABEL: @pow_intrinsic_negthird_fast(
; CHECK-NEXT: [[POW:%.*]] = call fast double @llvm.pow.f64(double [[X:%.*]], double 0xBFD5555555555555)
; CHECK-NEXT: ret double [[POW]]
;
%pow = call fast double @llvm.pow.f64(double %x, double 0xbfd5555555555555)
ret double %pow
}
define float @powf_intrinsic_negthird_fast(float %x) {
; CHECK-LABEL: @powf_intrinsic_negthird_fast(
; CHECK-NEXT: [[POW:%.*]] = call fast float @llvm.pow.f32(float [[X:%.*]], float 0xBFD5555560000000)
; CHECK-NEXT: ret float [[POW]]
;
%pow = call fast float @llvm.pow.f32(float %x, float 0xbfd5555560000000)
ret float %pow
}
define double @pow_intrinsic_negthird_approx(double %x) {
; CHECK-LABEL: @pow_intrinsic_negthird_approx(
; CHECK-NEXT: [[POW:%.*]] = call afn double @llvm.pow.f64(double [[X:%.*]], double 0xBFD5555555555555)
; CHECK-NEXT: ret double [[POW]]
;
%pow = call afn double @llvm.pow.f64(double %x, double 0xbfd5555555555555)
ret double %pow
}
define float @powf_intrinsic_negthird_approx(float %x) {
; CHECK-LABEL: @powf_intrinsic_negthird_approx(
; CHECK-NEXT: [[POW:%.*]] = call afn float @llvm.pow.f32(float [[X:%.*]], float 0xBFD5555560000000)
; CHECK-NEXT: ret float [[POW]]
;
%pow = call afn float @llvm.pow.f32(float %x, float 0xbfd5555560000000)
ret float %pow
}
define double @pow_libcall_negthird_fast(double %x) {
; CHECK-LABEL: @pow_libcall_negthird_fast(
; CHECK-NEXT: [[POW:%.*]] = call fast double @pow(double [[X:%.*]], double 0xBFD5555555555555)
; CHECK-NEXT: ret double [[POW]]
;
%pow = call fast double @pow(double %x, double 0xbfd5555555555555)
ret double %pow
}
define float @powf_libcall_negthird_fast(float %x) {
; CHECK-LABEL: @powf_libcall_negthird_fast(
; CHECK-NEXT: [[POW:%.*]] = call fast float @powf(float [[X:%.*]], float 0xBFD5555560000000)
; CHECK-NEXT: ret float [[POW]]
;
%pow = call fast float @powf(float %x, float 0xbfd5555560000000)
ret float %pow
}
declare double @llvm.pow.f64(double, double) #0
declare float @llvm.pow.f32(float, float) #0
declare double @pow(double, double)
declare float @powf(float, float)
attributes #0 = { nounwind readnone speculatable }