Skip to content

Commit b8b1246

Browse files
committed
[Test] Add and update tests for lrint
A number of backends are missing either all tests for lrint, or specifically those for f16 which currently crashes for `softPromoteHalf` targets. For a number of popular backends, do the following: * Ensure f16, f32, f64, and f128 are all covered * Ensure both a 32- and 64-bit target are tested, if relevant * Add `nounwind` to clean up CFI output * Add a test covering the above if one did not exist Squashed from commits on other branches: Update existing vector tests Add f128 to vector tests Add a vector test to arm nounwind for vector tests since cfi directives are causing CI failures
1 parent 7f0e407 commit b8b1246

28 files changed

+34257
-1274
lines changed

llvm/test/CodeGen/AArch64/sve-fixed-vector-llrint.ll

Lines changed: 655 additions & 27 deletions
Large diffs are not rendered by default.

llvm/test/CodeGen/AArch64/sve-fixed-vector-lrint.ll

Lines changed: 1082 additions & 53 deletions
Large diffs are not rendered by default.

llvm/test/CodeGen/AArch64/vector-llrint.ll

Lines changed: 519 additions & 18 deletions
Large diffs are not rendered by default.

llvm/test/CodeGen/AArch64/vector-lrint.ll

Lines changed: 937 additions & 18 deletions
Large diffs are not rendered by default.

llvm/test/CodeGen/ARM/llrint-conv.ll

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
; RUN: llc < %s -mtriple=arm-eabi -float-abi=soft | FileCheck %s --check-prefix=SOFTFP
22
; RUN: llc < %s -mtriple=arm-eabi -float-abi=hard | FileCheck %s --check-prefix=HARDFP
33

4+
; SOFTFP-LABEL: testmsxh_builtin:
5+
; SOFTFP: bl llrintf
6+
; HARDFP-LABEL: testmsxh_builtin:
7+
; HARDFP: bl llrintf
8+
define i64 @testmsxh_builtin(half %x) {
9+
entry:
10+
%0 = tail call i64 @llvm.llrint.f16(half %x)
11+
ret i64 %0
12+
}
13+
414
; SOFTFP-LABEL: testmsxs_builtin:
515
; SOFTFP: bl llrintf
616
; HARDFP-LABEL: testmsxs_builtin:
@@ -21,5 +31,16 @@ entry:
2131
ret i64 %0
2232
}
2333

34+
; FIXME(#44744): incorrect libcall
35+
; SOFTFP-LABEL: testmsxq_builtin:
36+
; SOFTFP: bl llrintl
37+
; HARDFP-LABEL: testmsxq_builtin:
38+
; HARDFP: bl llrintl
39+
define i64 @testmsxq_builtin(fp128 %x) {
40+
entry:
41+
%0 = tail call i64 @llvm.llrint.f128(fp128 %x)
42+
ret i64 %0
43+
}
44+
2445
declare i64 @llvm.llrint.f32(float) nounwind readnone
2546
declare i64 @llvm.llrint.f64(double) nounwind readnone

llvm/test/CodeGen/ARM/lrint-conv.ll

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
; RUN: llc < %s -mtriple=arm-eabi -float-abi=soft | FileCheck %s --check-prefix=SOFTFP
22
; RUN: llc < %s -mtriple=arm-eabi -float-abi=hard | FileCheck %s --check-prefix=HARDFP
33

4+
; FIXME: crash
5+
; define i32 @testmswh_builtin(half %x) {
6+
; entry:
7+
; %0 = tail call i32 @llvm.lrint.i32.f16(half %x)
8+
; ret i32 %0
9+
; }
10+
411
; SOFTFP-LABEL: testmsws_builtin:
512
; SOFTFP: bl lrintf
613
; HARDFP-LABEL: testmsws_builtin:
@@ -21,5 +28,16 @@ entry:
2128
ret i32 %0
2229
}
2330

31+
; FIXME(#44744): incorrect libcall
32+
; SOFTFP-LABEL: testmswq_builtin:
33+
; SOFTFP: bl lrintl
34+
; HARDFP-LABEL: testmswq_builtin:
35+
; HARDFP: bl lrintl
36+
define i32 @testmswq_builtin(fp128 %x) {
37+
entry:
38+
%0 = tail call i32 @llvm.lrint.i32.f128(fp128 %x)
39+
ret i32 %0
40+
}
41+
2442
declare i32 @llvm.lrint.i32.f32(float) nounwind readnone
2543
declare i32 @llvm.lrint.i32.f64(double) nounwind readnone

0 commit comments

Comments
 (0)