Skip to content

Commit 16bbd56

Browse files
committed
more testcases
1 parent 2308ecc commit 16bbd56

File tree

1 file changed

+173
-9
lines changed

1 file changed

+173
-9
lines changed
Lines changed: 173 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,200 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2-
; RUN: opt -S -passes=early-cse < %s | FileCheck %s
2+
; RUN: opt -S -passes=instsimplify < %s | FileCheck %s
33

4-
define double @test_sinh() {
5-
; CHECK-LABEL: define double @test_sinh() {
6-
; CHECK-NEXT: ret double 0.000000e+00
4+
define double @test_sinh_0() {
5+
; CHECK-LABEL: define double @test_sinh_0() {
6+
; CHECK-NEXT: [[RESULT:%.*]] = call double @llvm.sinh.f64(double 0.000000e+00)
7+
; CHECK-NEXT: ret double [[RESULT]]
78
;
89
%result = call double @llvm.sinh.f64(double 0.0)
910
ret double %result
1011
}
1112

13+
define double @test_sinh_ln2() {
14+
; CHECK-LABEL: define double @test_sinh_ln2() {
15+
; CHECK-NEXT: [[RES:%.*]] = call double @llvm.sinh.f64(double 0x3FE62E42FEFA3BDC)
16+
; CHECK-NEXT: ret double [[RES]]
17+
;
18+
%res = call double @llvm.sinh.f64(double 0.69314718056)
19+
ret double %res
20+
}
21+
22+
define double @test_sinh_ln5() {
23+
; CHECK-LABEL: define double @test_sinh_ln5() {
24+
; CHECK-NEXT: [[RES:%.*]] = call double @llvm.sinh.f64(double 0x3FF9C041F7ED4511)
25+
; CHECK-NEXT: ret double [[RES]]
26+
;
27+
%res = call double @llvm.sinh.f64(double 1.60943791243)
28+
ret double %res
29+
}
30+
1231
define <2 x double> @test_sinh_v2() {
1332
; CHECK-LABEL: define <2 x double> @test_sinh_v2() {
14-
; CHECK-NEXT: ret <2 x double> zeroinitializer
33+
; CHECK-NEXT: [[RESULT:%.*]] = call <2 x double> @llvm.sinh.v2f64(<2 x double> zeroinitializer)
34+
; CHECK-NEXT: ret <2 x double> [[RESULT]]
1535
;
1636
%result = call <2 x double> @llvm.sinh.v2f64(<2 x double> zeroinitializer)
1737
ret <2 x double> %result
1838
}
1939

20-
define double @test_cosh() {
21-
; CHECK-LABEL: define double @test_cosh() {
22-
; CHECK-NEXT: ret double 1.000000e+00
40+
define double @test_sinh_neg0() {
41+
; CHECK-LABEL: define double @test_sinh_neg0() {
42+
; CHECK-NEXT: [[RES:%.*]] = call double @llvm.sinh.f64(double -0.000000e+00)
43+
; CHECK-NEXT: ret double [[RES]]
44+
;
45+
%res = call double @llvm.sinh.f64(double -0.0)
46+
ret double %res
47+
}
48+
49+
define double @test_sinh_poison() {
50+
; CHECK-LABEL: define double @test_sinh_poison() {
51+
; CHECK-NEXT: [[RES:%.*]] = call double @llvm.sinh.f64(double poison)
52+
; CHECK-NEXT: ret double [[RES]]
53+
;
54+
%res = call double @llvm.sinh.f64(double poison)
55+
ret double %res
56+
}
57+
58+
define double @test_sinh_undef() {
59+
; CHECK-LABEL: define double @test_sinh_undef() {
60+
; CHECK-NEXT: [[RES:%.*]] = call double @llvm.sinh.f64(double undef)
61+
; CHECK-NEXT: ret double [[RES]]
62+
;
63+
%res = call double @llvm.sinh.f64(double undef)
64+
ret double %res
65+
}
66+
67+
define double @test_sinh_snan() {
68+
; CHECK-LABEL: define double @test_sinh_snan() {
69+
; CHECK-NEXT: [[RES:%.*]] = call double @llvm.sinh.f64(double 0x7FF0000000000001)
70+
; CHECK-NEXT: ret double [[RES]]
71+
;
72+
%res = call double @llvm.sinh.f64(double 0x7ff0000000000001)
73+
ret double %res
74+
}
75+
76+
define double @test_sinh_qnan() {
77+
; CHECK-LABEL: define double @test_sinh_qnan() {
78+
; CHECK-NEXT: [[RES:%.*]] = call double @llvm.sinh.f64(double 0x7FF8000000000000)
79+
; CHECK-NEXT: ret double [[RES]]
80+
;
81+
%res = call double @llvm.sinh.f64(double 0x7ff8000000000000)
82+
ret double %res
83+
}
84+
85+
define double @test_sinh_pos_inf() {
86+
; CHECK-LABEL: define double @test_sinh_pos_inf() {
87+
; CHECK-NEXT: [[RES:%.*]] = call double @llvm.sinh.f64(double 0x7FF0000000000000)
88+
; CHECK-NEXT: ret double [[RES]]
89+
;
90+
%res = call double @llvm.sinh.f64(double 0x7ff0000000000000)
91+
ret double %res
92+
}
93+
94+
define double @test_sinh_neg_inf() {
95+
; CHECK-LABEL: define double @test_sinh_neg_inf() {
96+
; CHECK-NEXT: [[RES:%.*]] = call double @llvm.sinh.f64(double 0xFFF0000000000000)
97+
; CHECK-NEXT: ret double [[RES]]
98+
;
99+
%res = call double @llvm.sinh.f64(double 0xfff0000000000000)
100+
ret double %res
101+
}
102+
103+
define double @test_cosh_0() {
104+
; CHECK-LABEL: define double @test_cosh_0() {
105+
; CHECK-NEXT: [[RESULT:%.*]] = call double @llvm.cosh.f64(double 0.000000e+00)
106+
; CHECK-NEXT: ret double [[RESULT]]
23107
;
24108
%result = call double @llvm.cosh.f64(double 0.0)
25109
ret double %result
26110
}
27111

112+
define double @test_cosh_ln2() {
113+
; CHECK-LABEL: define double @test_cosh_ln2() {
114+
; CHECK-NEXT: [[RES:%.*]] = call double @llvm.cosh.f64(double 0x3FE62E42FEFA3BDC)
115+
; CHECK-NEXT: ret double [[RES]]
116+
;
117+
%res = call double @llvm.cosh.f64(double 0.69314718056)
118+
ret double %res
119+
}
120+
121+
define double @test_cosh_ln5() {
122+
; CHECK-LABEL: define double @test_cosh_ln5() {
123+
; CHECK-NEXT: [[RES:%.*]] = call double @llvm.cosh.f64(double 0x3FF9C041F7ED4511)
124+
; CHECK-NEXT: ret double [[RES]]
125+
;
126+
%res = call double @llvm.cosh.f64(double 1.60943791243)
127+
ret double %res
128+
}
129+
28130
define <2 x double> @test_cosh_v2() {
29131
; CHECK-LABEL: define <2 x double> @test_cosh_v2() {
30-
; CHECK-NEXT: ret <2 x double> splat (double 1.000000e+00)
132+
; CHECK-NEXT: [[RESULT:%.*]] = call <2 x double> @llvm.cosh.v2f64(<2 x double> zeroinitializer)
133+
; CHECK-NEXT: ret <2 x double> [[RESULT]]
31134
;
32135
%result = call <2 x double> @llvm.cosh.v2f64(<2 x double> zeroinitializer)
33136
ret <2 x double> %result
34137
}
35138

139+
define double @test_cosh_neg0() {
140+
; CHECK-LABEL: define double @test_cosh_neg0() {
141+
; CHECK-NEXT: [[RES:%.*]] = call double @llvm.cosh.f64(double -0.000000e+00)
142+
; CHECK-NEXT: ret double [[RES]]
143+
;
144+
%res = call double @llvm.cosh.f64(double -0.0)
145+
ret double %res
146+
}
147+
148+
define double @test_cosh_poison() {
149+
; CHECK-LABEL: define double @test_cosh_poison() {
150+
; CHECK-NEXT: [[RES:%.*]] = call double @llvm.cosh.f64(double poison)
151+
; CHECK-NEXT: ret double [[RES]]
152+
;
153+
%res = call double @llvm.cosh.f64(double poison)
154+
ret double %res
155+
}
156+
157+
define double @test_cosh_undef() {
158+
; CHECK-LABEL: define double @test_cosh_undef() {
159+
; CHECK-NEXT: [[RES:%.*]] = call double @llvm.cosh.f64(double undef)
160+
; CHECK-NEXT: ret double [[RES]]
161+
;
162+
%res = call double @llvm.cosh.f64(double undef)
163+
ret double %res
164+
}
36165

166+
define double @test_cosh_snan() {
167+
; CHECK-LABEL: define double @test_cosh_snan() {
168+
; CHECK-NEXT: [[RES:%.*]] = call double @llvm.cosh.f64(double 0x7FF0000000000001)
169+
; CHECK-NEXT: ret double [[RES]]
170+
;
171+
%res = call double @llvm.cosh.f64(double 0x7ff0000000000001)
172+
ret double %res
173+
}
174+
175+
define double @test_cosh_qnan() {
176+
; CHECK-LABEL: define double @test_cosh_qnan() {
177+
; CHECK-NEXT: [[RES:%.*]] = call double @llvm.cosh.f64(double 0x7FF8000000000000)
178+
; CHECK-NEXT: ret double [[RES]]
179+
;
180+
%res = call double @llvm.cosh.f64(double 0x7ff8000000000000)
181+
ret double %res
182+
}
183+
184+
define double @test_cosh_pos_inf() {
185+
; CHECK-LABEL: define double @test_cosh_pos_inf() {
186+
; CHECK-NEXT: [[RES:%.*]] = call double @llvm.cosh.f64(double 0x7FF0000000000000)
187+
; CHECK-NEXT: ret double [[RES]]
188+
;
189+
%res = call double @llvm.cosh.f64(double 0x7ff0000000000000)
190+
ret double %res
191+
}
192+
193+
define double @test_cosh_neg_inf() {
194+
; CHECK-LABEL: define double @test_cosh_neg_inf() {
195+
; CHECK-NEXT: [[RES:%.*]] = call double @llvm.cosh.f64(double 0xFFF0000000000000)
196+
; CHECK-NEXT: ret double [[RES]]
197+
;
198+
%res = call double @llvm.cosh.f64(double 0xfff0000000000000)
199+
ret double %res
200+
}

0 commit comments

Comments
 (0)