From: Pan Li Date: Thu, 9 Nov 2023 14:04:39 +0000 (+0800) Subject: Internal-fn: Add FLOATN support for l/ll round and rint [PR/112432] X-Git-Tag: basepoints/gcc-15~4832 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=907603d4b117e82dbbde2d58a04e33f3021908e7;p=thirdparty%2Fgcc.git Internal-fn: Add FLOATN support for l/ll round and rint [PR/112432] The defined DEF_EXT_LIB_FLOATN_NX_BUILTINS functions should also have DEF_INTERNAL_FLT_FLOATN_FN instead of DEF_INTERNAL_FLT_FN for the FLOATN support. According to the glibc API and gcc builtin, we have below table for the FLOATN is supported or not. +---------+-------+-------------------------------------+ | | glibc | gcc: DEF_EXT_LIB_FLOATN_NX_BUILTINS | +---------+-------+-------------------------------------+ | iceil | N | N | | ifloor | N | N | | irint | N | N | | iround | N | N | | lceil | N | N | | lfloor | N | N | | lrint | Y | Y | | lround | Y | Y | | llceil | N | N | | llfllor | N | N | | llrint | Y | Y | | llround | Y | Y | +---------+-------+-------------------------------------+ This patch would like to support FLOATN for: 1. lrint 2. lround 3. llrint 4. llround The below tests are passed within this patch: 1. x86 bootstrap and regression test. 2. aarch64 regression test. 3. riscv regression tests. PR target/112432 gcc/ChangeLog: * internal-fn.def (LRINT): Add FLOATN support. (LROUND): Ditto. (LLRINT): Ditto. (LLROUND): Ditto. Signed-off-by: Pan Li --- diff --git a/gcc/internal-fn.def b/gcc/internal-fn.def index ec72b3b0d9d3..319e0ab26cde 100644 --- a/gcc/internal-fn.def +++ b/gcc/internal-fn.def @@ -366,12 +366,12 @@ DEF_INTERNAL_FLT_FN (IRINT, ECF_CONST, lrint, unary_convert) DEF_INTERNAL_FLT_FN (IROUND, ECF_CONST, lround, unary_convert) DEF_INTERNAL_FLT_FN (LCEIL, ECF_CONST, lceil, unary_convert) DEF_INTERNAL_FLT_FN (LFLOOR, ECF_CONST, lfloor, unary_convert) -DEF_INTERNAL_FLT_FN (LRINT, ECF_CONST, lrint, unary_convert) -DEF_INTERNAL_FLT_FN (LROUND, ECF_CONST, lround, unary_convert) +DEF_INTERNAL_FLT_FLOATN_FN (LRINT, ECF_CONST, lrint, unary_convert) +DEF_INTERNAL_FLT_FLOATN_FN (LROUND, ECF_CONST, lround, unary_convert) DEF_INTERNAL_FLT_FN (LLCEIL, ECF_CONST, lceil, unary_convert) DEF_INTERNAL_FLT_FN (LLFLOOR, ECF_CONST, lfloor, unary_convert) -DEF_INTERNAL_FLT_FN (LLRINT, ECF_CONST, lrint, unary_convert) -DEF_INTERNAL_FLT_FN (LLROUND, ECF_CONST, lround, unary_convert) +DEF_INTERNAL_FLT_FLOATN_FN (LLRINT, ECF_CONST, lrint, unary_convert) +DEF_INTERNAL_FLT_FLOATN_FN (LLROUND, ECF_CONST, lround, unary_convert) /* FP rounding. */ DEF_INTERNAL_FLT_FLOATN_FN (CEIL, ECF_CONST, ceil, unary)