Skip to content

[Test] Add and update tests for lrint/llrint (NFC) #152662

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Aug 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
364 changes: 337 additions & 27 deletions llvm/test/CodeGen/AArch64/sve-fixed-vector-llrint.ll

Large diffs are not rendered by default.

602 changes: 549 additions & 53 deletions llvm/test/CodeGen/AArch64/sve-fixed-vector-lrint.ll

Large diffs are not rendered by default.

279 changes: 261 additions & 18 deletions llvm/test/CodeGen/AArch64/vector-llrint.ll

Large diffs are not rendered by default.

484 changes: 466 additions & 18 deletions llvm/test/CodeGen/AArch64/vector-lrint.ll

Large diffs are not rendered by default.

29 changes: 25 additions & 4 deletions llvm/test/CodeGen/ARM/llrint-conv.ll
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
; RUN: llc < %s -mtriple=arm-eabi -float-abi=soft | FileCheck %s --check-prefix=SOFTFP
; RUN: llc < %s -mtriple=arm-eabi -float-abi=hard | FileCheck %s --check-prefix=HARDFP

; SOFTFP-LABEL: testmsxh_builtin:
; SOFTFP: bl llrintf
; HARDFP-LABEL: testmsxh_builtin:
; HARDFP: bl llrintf
define i64 @testmsxh_builtin(half %x) {
entry:
%0 = tail call i64 @llvm.llrint.i64.f16(half %x)
ret i64 %0
}

; SOFTFP-LABEL: testmsxs_builtin:
; SOFTFP: bl llrintf
; HARDFP-LABEL: testmsxs_builtin:
; HARDFP: bl llrintf
define i64 @testmsxs_builtin(float %x) {
entry:
%0 = tail call i64 @llvm.llrint.f32(float %x)
%0 = tail call i64 @llvm.llrint.i64.f32(float %x)
ret i64 %0
}

Expand All @@ -17,9 +27,20 @@ entry:
; HARDFP: bl llrint
define i64 @testmsxd_builtin(double %x) {
entry:
%0 = tail call i64 @llvm.llrint.f64(double %x)
%0 = tail call i64 @llvm.llrint.i64.f64(double %x)
ret i64 %0
}

; FIXME(#44744): incorrect libcall
; SOFTFP-LABEL: testmsxq_builtin:
; SOFTFP: bl llrintl
; HARDFP-LABEL: testmsxq_builtin:
; HARDFP: bl llrintl
define i64 @testmsxq_builtin(fp128 %x) {
entry:
%0 = tail call i64 @llvm.llrint.i64.f128(fp128 %x)
ret i64 %0
}

declare i64 @llvm.llrint.f32(float) nounwind readnone
declare i64 @llvm.llrint.f64(double) nounwind readnone
declare i64 @llvm.llrint.i64.f32(float) nounwind readnone
declare i64 @llvm.llrint.i64.f64(double) nounwind readnone
18 changes: 18 additions & 0 deletions llvm/test/CodeGen/ARM/lrint-conv.ll
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
; RUN: llc < %s -mtriple=arm-eabi -float-abi=soft | FileCheck %s --check-prefix=SOFTFP
; RUN: llc < %s -mtriple=arm-eabi -float-abi=hard | FileCheck %s --check-prefix=HARDFP

; FIXME: crash
; define i32 @testmswh_builtin(half %x) {
; entry:
; %0 = tail call i32 @llvm.lrint.i32.f16(half %x)
; ret i32 %0
; }

; SOFTFP-LABEL: testmsws_builtin:
; SOFTFP: bl lrintf
; HARDFP-LABEL: testmsws_builtin:
Expand All @@ -21,5 +28,16 @@ entry:
ret i32 %0
}

; FIXME(#44744): incorrect libcall
; SOFTFP-LABEL: testmswq_builtin:
; SOFTFP: bl lrintl
; HARDFP-LABEL: testmswq_builtin:
; HARDFP: bl lrintl
define i32 @testmswq_builtin(fp128 %x) {
entry:
%0 = tail call i32 @llvm.lrint.i32.f128(fp128 %x)
ret i32 %0
}

declare i32 @llvm.lrint.i32.f32(float) nounwind readnone
declare i32 @llvm.lrint.i32.f64(double) nounwind readnone
Loading