NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-mips/57680: printf("%.1f") shows wrong results on R3000mipseb



The following reply was made to PR port-mips/57680; it has been noted by GNATS.

From: Izumi Tsutsui <tsutsui%ceres.dti.ne.jp@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: tsutsui%ceres.dti.ne.jp@localhost
Subject: Re: port-mips/57680: printf("%.1f") shows wrong results on R3000mipseb
Date: Fri, 3 Nov 2023 21:43:51 +0900

 > --- a/lib/libc/gdtoa/Makefile.inc
 > +++ b/lib/libc/gdtoa/Makefile.inc
 > @@ -4,7 +4,8 @@
 >  .PATH: ${.CURDIR}/gdtoa
 >  CPPFLAGS+=-I${.CURDIR}/gdtoa -I${.CURDIR}/locale
 >  
 > -.if ${MACHINE_ARCH} == "vax"
 > +.if ${MACHINE_ARCH} == "vax" || \
 > +    ${MACHINE_CPU} == "mips"
 >  CPPFLAGS+=-DNO_FENV_H
 >  .else
 >  CPPFLAGS+=-DHonor_FLT_ROUNDS
 > 
 > ---
 
 The following change also makes printf "%.1f" work
 on NWS-3470 (R3000+R3010):
 
 ---
 --- a/lib/libc/gdtoa/gdtoaimp.h
 +++ b/lib/libc/gdtoa/gdtoaimp.h
 @@ -202,8 +202,12 @@ THIS SOFTWARE.
  #include <fenv.h>
  __unused __weakref_visible int __libc_fegetround_ref(void)
    __weak_reference(fegetround);
 +#if 0
  #define fegetround()							\
  	(__libc_fegetround_ref ? __libc_fegetround_ref() : FE_TONEAREST)
 +#else
 +#define fegetround() FE_TOWARDZERO
 +#endif
  #endif
  
  #ifdef DEBUG
 ---
 
 MIPS1 (R3010) has a different default round mode?
 
 ---
 Izumi Tsutsui
 


Home | Main Index | Thread Index | Old Index