Many 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 * Always specify the integer type in intrinsic calls There are quite a few FIXMEs here, especially for `f16`, but much of this will be resolved in the near future.
44 lines
1.1 KiB
LLVM
44 lines
1.1 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
; RUN: llc < %s -mtriple=avr -mcpu=atmega328p | FileCheck %s
|
|
|
|
; FIXME: crash "Input type needs to be promoted!"
|
|
; define i64 @testmsxh_builtin(half %x) {
|
|
; entry:
|
|
; %0 = tail call i64 @llvm.llrint.i64.f16(half %x)
|
|
; ret i64 %0
|
|
; }
|
|
|
|
define i64 @testmsxs_builtin(float %x) {
|
|
; CHECK-LABEL: testmsxs_builtin:
|
|
; CHECK: ; %bb.0: ; %entry
|
|
; CHECK-NEXT: call llrintf
|
|
; CHECK-NEXT: ret
|
|
entry:
|
|
%0 = tail call i64 @llvm.llrint.i64.f32(float %x)
|
|
ret i64 %0
|
|
}
|
|
|
|
define i64 @testmsxd_builtin(double %x) {
|
|
; CHECK-LABEL: testmsxd_builtin:
|
|
; CHECK: ; %bb.0: ; %entry
|
|
; CHECK-NEXT: call llrint
|
|
; CHECK-NEXT: ret
|
|
entry:
|
|
%0 = tail call i64 @llvm.llrint.i64.f64(double %x)
|
|
ret i64 %0
|
|
}
|
|
|
|
; FIXME(#44744): incorrect libcall
|
|
define i64 @testmsxq_builtin(fp128 %x) {
|
|
; CHECK-LABEL: testmsxq_builtin:
|
|
; CHECK: ; %bb.0: ; %entry
|
|
; CHECK-NEXT: call llrintl
|
|
; CHECK-NEXT: ret
|
|
entry:
|
|
%0 = tail call i64 @llvm.llrint.i64.fp128(fp128 %x)
|
|
ret i64 %0
|
|
}
|
|
|
|
declare i64 @llvm.llrint.i64.f32(float) nounwind readnone
|
|
declare i64 @llvm.llrint.i64.f64(double) nounwind readnone
|