public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Xi Ruoyao <xry111@xry111.site>
To: Jie Mei <jie.mei@oss.cipunited.com>, gcc-patches@gcc.gnu.org
Cc: YunQiang Su <syq@gcc.gnu.org>
Subject: Re: [PATCH] MIPS: Add MIN/MAX.fmt instructions support for MIPS R6
Date: Thu, 21 Mar 2024 21:54:30 +0800	[thread overview]
Message-ID: <45df0c3a7777b9c6db4fb7083dce08fba0299105.camel@xry111.site> (raw)
In-Reply-To: <20240321021409.1135924-1-jie.mei@oss.cipunited.com>

On Thu, 2024-03-21 at 10:14 +0800, Jie Mei wrote:
> diff --git a/gcc/testsuite/gcc.target/mips/mips-minmax.c b/gcc/testsuite/gcc.target/mips/mips-minmax.c
> new file mode 100644
> index 00000000000..2d234ac4b1d
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/mips/mips-minmax.c
> @@ -0,0 +1,40 @@
> +/* { dg-do compile } */
> +/* { dg-options "-mhard-float -ffinite-math-only -march=mips32r6" } */

You may want to add fmin<mode>3 and fmax<mode>3 in addition to
smin<mode>3 and smax<mode>3 so it will work without -ffinite-math-only.

‘fminM3’, ‘fmaxM3’
     IEEE-conformant minimum and maximum operations.  If one operand is
     a quiet ‘NaN’, then the other operand is returned.  If both
     operands are quiet ‘NaN’, then a quiet ‘NaN’ is returned.  In the
     case when gcc supports signaling ‘NaN’ (-fsignaling-nans) an
     invalid floating point exception is raised and a quiet ‘NaN’ is
     returned.

And the MIPS 6.06 manual says:

Numbers are preferred to NaNs: if one input is a NaN, but not both, the
value of the numeric input is returned. If both are NaNs, the NaN in fs
is returned.

for MAX.fmt and MIN.fmt, so they matches fmin<mode>3 and fmax<mode>3.

> +/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */

-- 
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University

      reply	other threads:[~2024-03-21 13:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-21  2:14 Jie Mei
2024-03-21 13:54 ` Xi Ruoyao [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45df0c3a7777b9c6db4fb7083dce08fba0299105.camel@xry111.site \
    --to=xry111@xry111.site \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jie.mei@oss.cipunited.com \
    --cc=syq@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).