public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH v1] Internal-fn: Add FLOATN support for l/ll round and rint [PR/112432]
@ 2023-11-09 14:33 pan2.li
  2023-11-09 15:11 ` Richard Biener
  0 siblings, 1 reply; 3+ messages in thread
From: pan2.li @ 2023-11-09 14:33 UTC (permalink / raw)
  To: gcc-patches; +Cc: juzhe.zhong, kito.cheng, pan2.li, yanzhang.wang, rguenther

From: Pan Li <pan2.li@intel.com>

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 <pan2.li@intel.com>
---
 gcc/internal-fn.def | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gcc/internal-fn.def b/gcc/internal-fn.def
index 7f0e3759615..10f88e37bc9 100644
--- a/gcc/internal-fn.def
+++ b/gcc/internal-fn.def
@@ -365,12 +365,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)
-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] Internal-fn: Add FLOATN support for l/ll round and rint [PR/112432]
  2023-11-09 14:33 [PATCH v1] Internal-fn: Add FLOATN support for l/ll round and rint [PR/112432] pan2.li
@ 2023-11-09 15:11 ` Richard Biener
  2023-11-10  0:56   ` Li, Pan2
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Biener @ 2023-11-09 15:11 UTC (permalink / raw)
  To: pan2.li; +Cc: gcc-patches, juzhe.zhong, kito.cheng, yanzhang.wang



> Am 09.11.2023 um 15:34 schrieb pan2.li@intel.com:
> 
> From: Pan Li <pan2.li@intel.com>
> 
> 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.

Ok 

Richard 

>    PR target/112432
> 
> gcc/ChangeLog:
> 
>    * internal-fn.def (LRINT): Add FLOATN support.
>    (LROUND): Ditto.
>    (LLRINT): Ditto.
>    (LLROUND): Ditto.
> 
> Signed-off-by: Pan Li <pan2.li@intel.com>
> ---
> gcc/internal-fn.def | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/gcc/internal-fn.def b/gcc/internal-fn.def
> index 7f0e3759615..10f88e37bc9 100644
> --- a/gcc/internal-fn.def
> +++ b/gcc/internal-fn.def
> @@ -365,12 +365,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)
> -- 
> 2.34.1
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH v1] Internal-fn: Add FLOATN support for l/ll round and rint [PR/112432]
  2023-11-09 15:11 ` Richard Biener
@ 2023-11-10  0:56   ` Li, Pan2
  0 siblings, 0 replies; 3+ messages in thread
From: Li, Pan2 @ 2023-11-10  0:56 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches, juzhe.zhong, kito.cheng, Wang, Yanzhang

Committed, thanks Richard.

Pan

-----Original Message-----
From: Richard Biener <rguenther@suse.de> 
Sent: Thursday, November 9, 2023 11:12 PM
To: Li, Pan2 <pan2.li@intel.com>
Cc: gcc-patches@gcc.gnu.org; juzhe.zhong@rivai.ai; kito.cheng@sifive.com; Wang, Yanzhang <yanzhang.wang@intel.com>
Subject: Re: [PATCH v1] Internal-fn: Add FLOATN support for l/ll round and rint [PR/112432]



> Am 09.11.2023 um 15:34 schrieb pan2.li@intel.com:
> 
> From: Pan Li <pan2.li@intel.com>
> 
> 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.

Ok 

Richard 

>    PR target/112432
> 
> gcc/ChangeLog:
> 
>    * internal-fn.def (LRINT): Add FLOATN support.
>    (LROUND): Ditto.
>    (LLRINT): Ditto.
>    (LLROUND): Ditto.
> 
> Signed-off-by: Pan Li <pan2.li@intel.com>
> ---
> gcc/internal-fn.def | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/gcc/internal-fn.def b/gcc/internal-fn.def
> index 7f0e3759615..10f88e37bc9 100644
> --- a/gcc/internal-fn.def
> +++ b/gcc/internal-fn.def
> @@ -365,12 +365,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)
> -- 
> 2.34.1
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-11-10  0:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-09 14:33 [PATCH v1] Internal-fn: Add FLOATN support for l/ll round and rint [PR/112432] pan2.li
2023-11-09 15:11 ` Richard Biener
2023-11-10  0:56   ` Li, Pan2

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).