[llvm] ISel/AArch64/SVE: custom lower vector ISD::[L]LRINT (PR #89035)
David Sherwood via llvm-commits
llvm-commits at lists.llvm.org
Thu May 9 03:50:04 PDT 2024
================
@@ -0,0 +1,492 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc < %s -mtriple=aarch64 -mattr=+sve | FileCheck %s
+
+define <vscale x 1 x i64> @lrint_v1f16(<vscale x 1 x half> %x) {
+; CHECK-LABEL: lrint_v1f16:
+; CHECK: // %bb.0:
+; CHECK-NEXT: ptrue p0.d
+; CHECK-NEXT: fcvtzs z0.d, p0/m, z0.h
----------------
david-arm wrote:
I don't think this looks right because the man page for the lrint libm routine says:
`The lrint() and llrint() functions return the integral value nearest to x (according to the prevailing rounding mode)`
but fcvtzs always rounds to zero. I think it needs to be a sequence of frintx, fcvts like the scalar and NEON variants.
https://github.com/llvm/llvm-project/pull/89035
More information about the llvm-commits
mailing list