public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH v3, rs6000] Implemented f[min/max]_optab by xs[min/max]dp [PR103605]
@ 2022-05-18  8:52 HAO CHEN GUI
  2022-05-30  1:24 ` Ping " HAO CHEN GUI
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: HAO CHEN GUI @ 2022-05-18  8:52 UTC (permalink / raw)
  To: gcc-patches; +Cc: Segher Boessenkool, David, Kewen.Lin, Peter Bergner

Hi,
  This patch implements optab f[min/max]_optab by xs[min/max]dp on rs6000.
Tests show that outputs of xs[min/max]dp are consistent with the standard
of C99 fmin/max.

  This patch also binds __builtin_vsx_xs[min/max]dp to fmin/max instead
of smin/max. So the builtins always generate xs[min/max]dp on all
platforms.

  Bootstrapped and tested on ppc64 Linux BE and LE with no regressions.
Is this okay for trunk? Any recommendations? Thanks a lot.

ChangeLog
2022-05-18 Haochen Gui <guihaoc@linux.ibm.com>

gcc/
	PR target/103605
	* rs6000.md (FMINMAX): New.
	(minmax_op): New.
	(f<minmax_op><mode>3): New pattern by UNSPEC_FMAX and UNSPEC_FMIN.
	* rs6000-builtins.def (__builtin_vsx_xsmaxdp): Set pattern to fmaxdf3.
	(__builtin_vsx_xsmindp): Set pattern to fmindf3.

gcc/testsuite/
	PR target/103605
	* gcc.dg/pr103605.c: New.

patch.diff
diff --git a/gcc/config/rs6000/rs6000-builtins.def b/gcc/config/rs6000/rs6000-builtins.def
index f4a9f24bcc5..8b735493b40 100644
--- a/gcc/config/rs6000/rs6000-builtins.def
+++ b/gcc/config/rs6000/rs6000-builtins.def
@@ -1613,10 +1613,10 @@
     XSCVSPDP vsx_xscvspdp {}

   const double __builtin_vsx_xsmaxdp (double, double);
-    XSMAXDP smaxdf3 {}
+    XSMAXDP fmaxdf3 {}

   const double __builtin_vsx_xsmindp (double, double);
-    XSMINDP smindf3 {}
+    XSMINDP fmindf3 {}

   const double __builtin_vsx_xsrdpi (double);
     XSRDPI vsx_xsrdpi {}
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index bf85baa5370..197de0838ee 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -158,6 +158,8 @@ (define_c_enum "unspec"
    UNSPEC_HASHCHK
    UNSPEC_XXSPLTIDP_CONST
    UNSPEC_XXSPLTIW_CONST
+   UNSPEC_FMAX
+   UNSPEC_FMIN
   ])

 ;;
@@ -5341,6 +5343,22 @@ (define_insn_and_split "*s<minmax><mode>3_fpr"
   DONE;
 })

+
+(define_int_iterator FMINMAX [UNSPEC_FMAX UNSPEC_FMIN])
+
+(define_int_attr  minmax_op [(UNSPEC_FMAX "max")
+			     (UNSPEC_FMIN "min")])
+
+(define_insn "f<minmax_op><mode>3"
+  [(set (match_operand:SFDF 0 "vsx_register_operand" "=wa")
+	(unspec:SFDF [(match_operand:SFDF 1 "vsx_register_operand" "wa")
+		      (match_operand:SFDF 2 "vsx_register_operand" "wa")]
+		      FMINMAX))]
+"TARGET_VSX"
+"xs<minmax_op>dp %x0,%x1,%x2"
+[(set_attr "type" "fp")]
+)
+
 (define_expand "mov<mode>cc"
    [(set (match_operand:GPR 0 "gpc_reg_operand")
 	 (if_then_else:GPR (match_operand 1 "comparison_operator")
diff --git a/gcc/testsuite/gcc.target/powerpc/pr103605.c b/gcc/testsuite/gcc.target/powerpc/pr103605.c
new file mode 100644
index 00000000000..e43ac40c2d1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr103605.c
@@ -0,0 +1,37 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-O1 -mvsx" } */
+/* { dg-final { scan-assembler-times {\mxsmaxdp\M} 3 } } */
+/* { dg-final { scan-assembler-times {\mxsmindp\M} 3 } } */
+
+#include <math.h>
+
+double test1 (double d0, double d1)
+{
+  return fmin (d0, d1);
+}
+
+float test2 (float d0, float d1)
+{
+  return fmin (d0, d1);
+}
+
+double test3 (double d0, double d1)
+{
+  return fmax (d0, d1);
+}
+
+float test4 (float d0, float d1)
+{
+  return fmax (d0, d1);
+}
+
+double test5 (double d0, double d1)
+{
+  return __builtin_vsx_xsmindp (d0, d1);
+}
+
+double test6 (double d0, double d1)
+{
+  return __builtin_vsx_xsmaxdp (d0, d1);
+}

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

* Ping [PATCH v3, rs6000] Implemented f[min/max]_optab by xs[min/max]dp [PR103605]
  2022-05-18  8:52 [PATCH v3, rs6000] Implemented f[min/max]_optab by xs[min/max]dp [PR103605] HAO CHEN GUI
@ 2022-05-30  1:24 ` HAO CHEN GUI
  2022-05-30  9:56 ` Kewen.Lin
  2022-06-01 21:01 ` Segher Boessenkool
  2 siblings, 0 replies; 6+ messages in thread
From: HAO CHEN GUI @ 2022-05-30  1:24 UTC (permalink / raw)
  To: gcc-patches; +Cc: Segher Boessenkool, David, Kewen.Lin, Peter Bergner

Hi,
   Gentle ping this:
https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595164.html
Thanks.

On 18/5/2022 下午 4:52, HAO CHEN GUI wrote:
> Hi,
>   This patch implements optab f[min/max]_optab by xs[min/max]dp on rs6000.
> Tests show that outputs of xs[min/max]dp are consistent with the standard
> of C99 fmin/max.
> 
>   This patch also binds __builtin_vsx_xs[min/max]dp to fmin/max instead
> of smin/max. So the builtins always generate xs[min/max]dp on all
> platforms.
> 
>   Bootstrapped and tested on ppc64 Linux BE and LE with no regressions.
> Is this okay for trunk? Any recommendations? Thanks a lot.
> 
> ChangeLog
> 2022-05-18 Haochen Gui <guihaoc@linux.ibm.com>
> 
> gcc/
> 	PR target/103605
> 	* rs6000.md (FMINMAX): New.
> 	(minmax_op): New.
> 	(f<minmax_op><mode>3): New pattern by UNSPEC_FMAX and UNSPEC_FMIN.
> 	* rs6000-builtins.def (__builtin_vsx_xsmaxdp): Set pattern to fmaxdf3.
> 	(__builtin_vsx_xsmindp): Set pattern to fmindf3.
> 
> gcc/testsuite/
> 	PR target/103605
> 	* gcc.dg/pr103605.c: New.
> 
> patch.diff
> diff --git a/gcc/config/rs6000/rs6000-builtins.def b/gcc/config/rs6000/rs6000-builtins.def
> index f4a9f24bcc5..8b735493b40 100644
> --- a/gcc/config/rs6000/rs6000-builtins.def
> +++ b/gcc/config/rs6000/rs6000-builtins.def
> @@ -1613,10 +1613,10 @@
>      XSCVSPDP vsx_xscvspdp {}
> 
>    const double __builtin_vsx_xsmaxdp (double, double);
> -    XSMAXDP smaxdf3 {}
> +    XSMAXDP fmaxdf3 {}
> 
>    const double __builtin_vsx_xsmindp (double, double);
> -    XSMINDP smindf3 {}
> +    XSMINDP fmindf3 {}
> 
>    const double __builtin_vsx_xsrdpi (double);
>      XSRDPI vsx_xsrdpi {}
> diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
> index bf85baa5370..197de0838ee 100644
> --- a/gcc/config/rs6000/rs6000.md
> +++ b/gcc/config/rs6000/rs6000.md
> @@ -158,6 +158,8 @@ (define_c_enum "unspec"
>     UNSPEC_HASHCHK
>     UNSPEC_XXSPLTIDP_CONST
>     UNSPEC_XXSPLTIW_CONST
> +   UNSPEC_FMAX
> +   UNSPEC_FMIN
>    ])
> 
>  ;;
> @@ -5341,6 +5343,22 @@ (define_insn_and_split "*s<minmax><mode>3_fpr"
>    DONE;
>  })
> 
> +
> +(define_int_iterator FMINMAX [UNSPEC_FMAX UNSPEC_FMIN])
> +
> +(define_int_attr  minmax_op [(UNSPEC_FMAX "max")
> +			     (UNSPEC_FMIN "min")])
> +
> +(define_insn "f<minmax_op><mode>3"
> +  [(set (match_operand:SFDF 0 "vsx_register_operand" "=wa")
> +	(unspec:SFDF [(match_operand:SFDF 1 "vsx_register_operand" "wa")
> +		      (match_operand:SFDF 2 "vsx_register_operand" "wa")]
> +		      FMINMAX))]
> +"TARGET_VSX"
> +"xs<minmax_op>dp %x0,%x1,%x2"
> +[(set_attr "type" "fp")]
> +)
> +
>  (define_expand "mov<mode>cc"
>     [(set (match_operand:GPR 0 "gpc_reg_operand")
>  	 (if_then_else:GPR (match_operand 1 "comparison_operator")
> diff --git a/gcc/testsuite/gcc.target/powerpc/pr103605.c b/gcc/testsuite/gcc.target/powerpc/pr103605.c
> new file mode 100644
> index 00000000000..e43ac40c2d1
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/powerpc/pr103605.c
> @@ -0,0 +1,37 @@
> +/* { dg-do compile } */
> +/* { dg-require-effective-target powerpc_vsx_ok } */
> +/* { dg-options "-O1 -mvsx" } */
> +/* { dg-final { scan-assembler-times {\mxsmaxdp\M} 3 } } */
> +/* { dg-final { scan-assembler-times {\mxsmindp\M} 3 } } */
> +
> +#include <math.h>
> +
> +double test1 (double d0, double d1)
> +{
> +  return fmin (d0, d1);
> +}
> +
> +float test2 (float d0, float d1)
> +{
> +  return fmin (d0, d1);
> +}
> +
> +double test3 (double d0, double d1)
> +{
> +  return fmax (d0, d1);
> +}
> +
> +float test4 (float d0, float d1)
> +{
> +  return fmax (d0, d1);
> +}
> +
> +double test5 (double d0, double d1)
> +{
> +  return __builtin_vsx_xsmindp (d0, d1);
> +}
> +
> +double test6 (double d0, double d1)
> +{
> +  return __builtin_vsx_xsmaxdp (d0, d1);
> +}

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

* Re: [PATCH v3, rs6000] Implemented f[min/max]_optab by xs[min/max]dp [PR103605]
  2022-05-18  8:52 [PATCH v3, rs6000] Implemented f[min/max]_optab by xs[min/max]dp [PR103605] HAO CHEN GUI
  2022-05-30  1:24 ` Ping " HAO CHEN GUI
@ 2022-05-30  9:56 ` Kewen.Lin
  2022-06-01 21:01 ` Segher Boessenkool
  2 siblings, 0 replies; 6+ messages in thread
From: Kewen.Lin @ 2022-05-30  9:56 UTC (permalink / raw)
  To: HAO CHEN GUI; +Cc: Segher Boessenkool, David, Peter Bergner, gcc-patches

Hi Haochen,

on 2022/5/18 16:52, HAO CHEN GUI wrote:
> Hi,
>   This patch implements optab f[min/max]_optab by xs[min/max]dp on rs6000.
> Tests show that outputs of xs[min/max]dp are consistent with the standard
> of C99 fmin/max.
> 
>   This patch also binds __builtin_vsx_xs[min/max]dp to fmin/max instead
> of smin/max. So the builtins always generate xs[min/max]dp on all
> platforms.
> 
>   Bootstrapped and tested on ppc64 Linux BE and LE with no regressions.
> Is this okay for trunk? Any recommendations? Thanks a lot.
> 
> ChangeLog
> 2022-05-18 Haochen Gui <guihaoc@linux.ibm.com>
> 
> gcc/
> 	PR target/103605
> 	* rs6000.md (FMINMAX): New.
> 	(minmax_op): New.
> 	(f<minmax_op><mode>3): New pattern by UNSPEC_FMAX and UNSPEC_FMIN.
> 	* rs6000-builtins.def (__builtin_vsx_xsmaxdp): Set pattern to fmaxdf3.
> 	(__builtin_vsx_xsmindp): Set pattern to fmindf3.
> 

These changelog entries look wrong to me, they miss the relative path names.

        * config/rs6000/rs6000-builtins.def ...
        * config/rs6000/rs6000.md ...

> gcc/testsuite/
> 	PR target/103605
> 	* gcc.dg/pr103605.c: New.

... and wrong path here.

        * gcc.target/powerpc/pr103605.c: New test.

OK with the changelog above fixed.  Thanks!

BR,
Kewen

> 
> patch.diff
> diff --git a/gcc/config/rs6000/rs6000-builtins.def b/gcc/config/rs6000/rs6000-builtins.def
> index f4a9f24bcc5..8b735493b40 100644
> --- a/gcc/config/rs6000/rs6000-builtins.def
> +++ b/gcc/config/rs6000/rs6000-builtins.def
> @@ -1613,10 +1613,10 @@
>      XSCVSPDP vsx_xscvspdp {}
> 
>    const double __builtin_vsx_xsmaxdp (double, double);
> -    XSMAXDP smaxdf3 {}
> +    XSMAXDP fmaxdf3 {}
> 
>    const double __builtin_vsx_xsmindp (double, double);
> -    XSMINDP smindf3 {}
> +    XSMINDP fmindf3 {}
> 
>    const double __builtin_vsx_xsrdpi (double);
>      XSRDPI vsx_xsrdpi {}
> diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
> index bf85baa5370..197de0838ee 100644
> --- a/gcc/config/rs6000/rs6000.md
> +++ b/gcc/config/rs6000/rs6000.md
> @@ -158,6 +158,8 @@ (define_c_enum "unspec"
>     UNSPEC_HASHCHK
>     UNSPEC_XXSPLTIDP_CONST
>     UNSPEC_XXSPLTIW_CONST
> +   UNSPEC_FMAX
> +   UNSPEC_FMIN
>    ])
> 
>  ;;
> @@ -5341,6 +5343,22 @@ (define_insn_and_split "*s<minmax><mode>3_fpr"
>    DONE;
>  })
> 
> +
> +(define_int_iterator FMINMAX [UNSPEC_FMAX UNSPEC_FMIN])
> +
> +(define_int_attr  minmax_op [(UNSPEC_FMAX "max")
> +			     (UNSPEC_FMIN "min")])
> +
> +(define_insn "f<minmax_op><mode>3"
> +  [(set (match_operand:SFDF 0 "vsx_register_operand" "=wa")
> +	(unspec:SFDF [(match_operand:SFDF 1 "vsx_register_operand" "wa")
> +		      (match_operand:SFDF 2 "vsx_register_operand" "wa")]
> +		      FMINMAX))]
> +"TARGET_VSX"
> +"xs<minmax_op>dp %x0,%x1,%x2"
> +[(set_attr "type" "fp")]
> +)
> +
>  (define_expand "mov<mode>cc"
>     [(set (match_operand:GPR 0 "gpc_reg_operand")
>  	 (if_then_else:GPR (match_operand 1 "comparison_operator")
> diff --git a/gcc/testsuite/gcc.target/powerpc/pr103605.c b/gcc/testsuite/gcc.target/powerpc/pr103605.c
> new file mode 100644
> index 00000000000..e43ac40c2d1
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/powerpc/pr103605.c
> @@ -0,0 +1,37 @@
> +/* { dg-do compile } */
> +/* { dg-require-effective-target powerpc_vsx_ok } */
> +/* { dg-options "-O1 -mvsx" } */
> +/* { dg-final { scan-assembler-times {\mxsmaxdp\M} 3 } } */
> +/* { dg-final { scan-assembler-times {\mxsmindp\M} 3 } } */
> +
> +#include <math.h>
> +
> +double test1 (double d0, double d1)
> +{
> +  return fmin (d0, d1);
> +}
> +
> +float test2 (float d0, float d1)
> +{
> +  return fmin (d0, d1);
> +}
> +
> +double test3 (double d0, double d1)
> +{
> +  return fmax (d0, d1);
> +}
> +
> +float test4 (float d0, float d1)
> +{
> +  return fmax (d0, d1);
> +}
> +
> +double test5 (double d0, double d1)
> +{
> +  return __builtin_vsx_xsmindp (d0, d1);
> +}
> +
> +double test6 (double d0, double d1)
> +{
> +  return __builtin_vsx_xsmaxdp (d0, d1);
> +}

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

* Re: [PATCH v3, rs6000] Implemented f[min/max]_optab by xs[min/max]dp [PR103605]
  2022-05-18  8:52 [PATCH v3, rs6000] Implemented f[min/max]_optab by xs[min/max]dp [PR103605] HAO CHEN GUI
  2022-05-30  1:24 ` Ping " HAO CHEN GUI
  2022-05-30  9:56 ` Kewen.Lin
@ 2022-06-01 21:01 ` Segher Boessenkool
  2022-06-07  1:51   ` HAO CHEN GUI
  2 siblings, 1 reply; 6+ messages in thread
From: Segher Boessenkool @ 2022-06-01 21:01 UTC (permalink / raw)
  To: HAO CHEN GUI; +Cc: gcc-patches, David, Kewen.Lin, Peter Bergner

Hi!

Some more nitpicking...

On Wed, May 18, 2022 at 04:52:26PM +0800, HAO CHEN GUI wrote:
>    const double __builtin_vsx_xsmaxdp (double, double);
> -    XSMAXDP smaxdf3 {}
> +    XSMAXDP fmaxdf3 {}
> 
>    const double __builtin_vsx_xsmindp (double, double);
> -    XSMINDP smindf3 {}
> +    XSMINDP fmindf3 {}

Are s{min,max}df3 still used after this?

> +   UNSPEC_FMAX
> +   UNSPEC_FMIN

Pity we have to do this as an unspec still, this should be handled by
some generic code, with some new operator (fmin/fmax would be obvious
names :-) )

> +(define_insn "f<minmax_op><mode>3"
> +  [(set (match_operand:SFDF 0 "vsx_register_operand" "=wa")
> +	(unspec:SFDF [(match_operand:SFDF 1 "vsx_register_operand" "wa")
> +		      (match_operand:SFDF 2 "vsx_register_operand" "wa")]
> +		      FMINMAX))]
> +"TARGET_VSX"
> +"xs<minmax_op>dp %x0,%x1,%x2"
> +[(set_attr "type" "fp")]
> +)

Indentation is broken here, correct is

(define_insn "f<minmax_op><mode>3"
  [(set (match_operand:SFDF 0 "vsx_register_operand" "=wa")
	(unspec:SFDF [(match_operand:SFDF 1 "vsx_register_operand" "wa")
		      (match_operand:SFDF 2 "vsx_register_operand" "wa")]
		     FMINMAX))]
  "TARGET_VSX"
  "xs<minmax_op>dp %x0,%x1,%x2"
  [(set_attr "type" "fp")])

(FMINMAX has the same indent as the preceding [, its sibling;
"TARGET_VSX" and the next two lines are indented like the same thing
before it at the same level (the "[(set"); the finishing ) does never
start a new line).


Segher

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

* Re: [PATCH v3, rs6000] Implemented f[min/max]_optab by xs[min/max]dp [PR103605]
  2022-06-01 21:01 ` Segher Boessenkool
@ 2022-06-07  1:51   ` HAO CHEN GUI
  2022-06-07 20:44     ` Segher Boessenkool
  0 siblings, 1 reply; 6+ messages in thread
From: HAO CHEN GUI @ 2022-06-07  1:51 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: gcc-patches, David, Kewen.Lin, Peter Bergner

Hi,

On 2/6/2022 上午 5:01, Segher Boessenkool wrote:
> Hi!
> 
> Some more nitpicking...
> 
> On Wed, May 18, 2022 at 04:52:26PM +0800, HAO CHEN GUI wrote:
>>    const double __builtin_vsx_xsmaxdp (double, double);
>> -    XSMAXDP smaxdf3 {}
>> +    XSMAXDP fmaxdf3 {}
>>
>>    const double __builtin_vsx_xsmindp (double, double);
>> -    XSMINDP smindf3 {}
>> +    XSMINDP fmindf3 {}
> 
> Are s{min,max}df3 still used after this?

Expands reduc_s[min|max]_scal are still using s[min|max]df3.

OPTAB_D (reduc_smax_scal_optab, "reduc_smax_scal_$a")
OPTAB_D (reduc_smin_scal_optab, "reduc_smin_scal_$a")

Also we could implement reduc_f[min|max]_scal after committing
this patch.

Thanks.
Gui Haochen

> 
>> +   UNSPEC_FMAX
>> +   UNSPEC_FMIN
> 
> Pity we have to do this as an unspec still, this should be handled by
> some generic code, with some new operator (fmin/fmax would be obvious
> names :-) )
> 
>> +(define_insn "f<minmax_op><mode>3"
>> +  [(set (match_operand:SFDF 0 "vsx_register_operand" "=wa")
>> +	(unspec:SFDF [(match_operand:SFDF 1 "vsx_register_operand" "wa")
>> +		      (match_operand:SFDF 2 "vsx_register_operand" "wa")]
>> +		      FMINMAX))]
>> +"TARGET_VSX"
>> +"xs<minmax_op>dp %x0,%x1,%x2"
>> +[(set_attr "type" "fp")]
>> +)
> 
> Indentation is broken here, correct is
> 
> (define_insn "f<minmax_op><mode>3"
>   [(set (match_operand:SFDF 0 "vsx_register_operand" "=wa")
> 	(unspec:SFDF [(match_operand:SFDF 1 "vsx_register_operand" "wa")
> 		      (match_operand:SFDF 2 "vsx_register_operand" "wa")]
> 		     FMINMAX))]
>   "TARGET_VSX"
>   "xs<minmax_op>dp %x0,%x1,%x2"
>   [(set_attr "type" "fp")])
> 
> (FMINMAX has the same indent as the preceding [, its sibling;
> "TARGET_VSX" and the next two lines are indented like the same thing
> before it at the same level (the "[(set"); the finishing ) does never
> start a new line).
> 
> 
> Segher

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

* Re: [PATCH v3, rs6000] Implemented f[min/max]_optab by xs[min/max]dp [PR103605]
  2022-06-07  1:51   ` HAO CHEN GUI
@ 2022-06-07 20:44     ` Segher Boessenkool
  0 siblings, 0 replies; 6+ messages in thread
From: Segher Boessenkool @ 2022-06-07 20:44 UTC (permalink / raw)
  To: HAO CHEN GUI; +Cc: gcc-patches, David, Kewen.Lin, Peter Bergner

Hi!

On Tue, Jun 07, 2022 at 09:51:43AM +0800, HAO CHEN GUI wrote:
> On 2/6/2022 上午 5:01, Segher Boessenkool wrote:
> > On Wed, May 18, 2022 at 04:52:26PM +0800, HAO CHEN GUI wrote:
> >>    const double __builtin_vsx_xsmaxdp (double, double);
> >> -    XSMAXDP smaxdf3 {}
> >> +    XSMAXDP fmaxdf3 {}
> >>
> >>    const double __builtin_vsx_xsmindp (double, double);
> >> -    XSMINDP smindf3 {}
> >> +    XSMINDP fmindf3 {}
> > 
> > Are s{min,max}df3 still used after this?
> 
> Expands reduc_s[min|max]_scal are still using s[min|max]df3.

Ah, and reduction is undefined for float unless fast-math anyway.  Okay.

> Also we could implement reduc_f[min|max]_scal after committing
> this patch.

Because fmin and fmax treat NaNs as missing data.  But you have to be
careful with SNaNs here, probably just skip most of this when
-fsignaling-nans is used.  It also still needs -fno-signed-zeros btw,
but not full -ffast-math indeed.


Segher

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

end of thread, other threads:[~2022-06-07 20:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-18  8:52 [PATCH v3, rs6000] Implemented f[min/max]_optab by xs[min/max]dp [PR103605] HAO CHEN GUI
2022-05-30  1:24 ` Ping " HAO CHEN GUI
2022-05-30  9:56 ` Kewen.Lin
2022-06-01 21:01 ` Segher Boessenkool
2022-06-07  1:51   ` HAO CHEN GUI
2022-06-07 20:44     ` Segher Boessenkool

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).