El jue, 15 ene 2026 a las 1:11, YunQiang Su (<[email protected]>) escribió:
>
> David Guillen Fandos <[email protected]> 于2026年1月15日周四 07:45写道:
> >
> > gcc/ChangeLog:
> >
> >         * config/mips/mips.h (ISA_HAS_FMIN_FMAX): Add R5900.
> >
> > Signed-off-by: David Guillen Fandos <[email protected]>
> > ---
> >  gcc/config/mips/mips.h | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
> > index bafcb761871..f52d0d2358c 100644
> > --- a/gcc/config/mips/mips.h
> > +++ b/gcc/config/mips/mips.h
> > @@ -1278,7 +1278,8 @@ struct mips_cpu_info {
> >  #define ISA_HAS_9BIT_DISPLACEMENT      (mips_isa_rev >= 6              \
> >                                          || ISA_HAS_MIPS16E2)
> >
> > -#define ISA_HAS_FMIN_FMAX      (mips_isa_rev >= 6)
> > +#define ISA_HAS_FMIN_FMAX      (mips_isa_rev >= 6                      \
> > +                                || TARGET_MIPS5900)
> >
>
> Is there any document showing the behavior of max.s/min.s of R5900 on
>     sNaN vs NUM
>    +0 vs -0
>    qNaN vs NUM
>    sNaN vs qNAN
>    sNaN vs sNaN

Yeah, the manual indicates that NaNs are not properly handled. The R5900
doesn't have proper IEEE754 handling (for all its FP instructions, like
"c.eq.s").
IEEE754 compliance is mostly broken on that CPU unless you use soft-fp.
I would add a "flag_finite_math_only" or similar in there for R5900, but
since most of the other instructions are also broken, it feels a bit pointless.

There's this old thread, back when Jürgen sent his patches that gives a good
idea how poorly NaNs are supported:

https://gcc.gnu.org/pipermail/gcc-patches/2013-January/356715.html

Thanks for the quick review!

>
> >  #define ISA_HAS_FRINT          (mips_isa_rev >= 6)
> >
> > --
> > 2.52.0
> >

Reply via email to