Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit 4d8909c

Browse files
committed
[SystemZ] Add a couple of missing tests
A few fp128 tests were omitted from test/CodeGen/SystemZ/fp-round-01.ll since in early days, LLVM couldn't handle implicitly generated library calls to functions with long double arguments on SystemZ. This deficiency was actually long since fixed, but those tests are still missing. This patch adds the missing tests. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346541 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 80691e1 commit 4d8909c

File tree

1 file changed

+55
-10
lines changed

1 file changed

+55
-10
lines changed

test/CodeGen/SystemZ/fp-round-01.ll

Lines changed: 55 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,17 @@ define double @f5(double %f) {
5454
ret double %res
5555
}
5656

57-
; Test nearbyint for f128: omitted for now because we cannot handle
58-
; indirect arguments.
57+
; Test nearbyint for f128.
58+
declare fp128 @llvm.nearbyint.f128(fp128 %f)
59+
define void @f6(fp128 *%ptr) {
60+
; CHECK-LABEL: f6:
61+
; CHECK: brasl %r14, nearbyintl@PLT
62+
; CHECK: br %r14
63+
%src = load fp128, fp128 *%ptr
64+
%res = call fp128 @llvm.nearbyint.f128(fp128 %src)
65+
store fp128 %res, fp128 *%ptr
66+
ret void
67+
}
5968

6069
; Test floor for f32.
6170
declare float @llvm.floor.f32(float %f)
@@ -77,8 +86,17 @@ define double @f8(double %f) {
7786
ret double %res
7887
}
7988

80-
; Test floor for f128: omitted for now because we cannot handle
81-
; indirect arguments.
89+
; Test floor for f128.
90+
declare fp128 @llvm.floor.f128(fp128 %f)
91+
define void @f9(fp128 *%ptr) {
92+
; CHECK-LABEL: f9:
93+
; CHECK: brasl %r14, floorl@PLT
94+
; CHECK: br %r14
95+
%src = load fp128, fp128 *%ptr
96+
%res = call fp128 @llvm.floor.f128(fp128 %src)
97+
store fp128 %res, fp128 *%ptr
98+
ret void
99+
}
82100

83101
; Test ceil for f32.
84102
declare float @llvm.ceil.f32(float %f)
@@ -100,8 +118,17 @@ define double @f11(double %f) {
100118
ret double %res
101119
}
102120

103-
; Test ceil for f128: omitted for now because we cannot handle
104-
; indirect arguments.
121+
; Test ceil for f128.
122+
declare fp128 @llvm.ceil.f128(fp128 %f)
123+
define void @f12(fp128 *%ptr) {
124+
; CHECK-LABEL: f12:
125+
; CHECK: brasl %r14, ceill@PLT
126+
; CHECK: br %r14
127+
%src = load fp128, fp128 *%ptr
128+
%res = call fp128 @llvm.ceil.f128(fp128 %src)
129+
store fp128 %res, fp128 *%ptr
130+
ret void
131+
}
105132

106133
; Test trunc for f32.
107134
declare float @llvm.trunc.f32(float %f)
@@ -123,8 +150,17 @@ define double @f14(double %f) {
123150
ret double %res
124151
}
125152

126-
; Test trunc for f128: omitted for now because we cannot handle
127-
; indirect arguments.
153+
; Test trunc for f128.
154+
declare fp128 @llvm.trunc.f128(fp128 %f)
155+
define void @f15(fp128 *%ptr) {
156+
; CHECK-LABEL: f15:
157+
; CHECK: brasl %r14, truncl@PLT
158+
; CHECK: br %r14
159+
%src = load fp128, fp128 *%ptr
160+
%res = call fp128 @llvm.trunc.f128(fp128 %src)
161+
store fp128 %res, fp128 *%ptr
162+
ret void
163+
}
128164

129165
; Test round for f32.
130166
declare float @llvm.round.f32(float %f)
@@ -146,5 +182,14 @@ define double @f17(double %f) {
146182
ret double %res
147183
}
148184

149-
; Test round for f128: omitted for now because we cannot handle
150-
; indirect arguments.
185+
; Test round for f128.
186+
declare fp128 @llvm.round.f128(fp128 %f)
187+
define void @f18(fp128 *%ptr) {
188+
; CHECK-LABEL: f18:
189+
; CHECK: brasl %r14, roundl@PLT
190+
; CHECK: br %r14
191+
%src = load fp128, fp128 *%ptr
192+
%res = call fp128 @llvm.round.f128(fp128 %src)
193+
store fp128 %res, fp128 *%ptr
194+
ret void
195+
}

0 commit comments

Comments
 (0)