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: Taylor R Campbell <riastradh%NetBSD.org@localhost>
To: Izumi Tsutsui <tsutsui%ceres.dti.ne.jp@localhost>
Cc: gnats-bugs%netbsd.org@localhost, tsutsui%ceres.dti.ne.jp@localhost
Subject: Re: port-mips/57680: printf("%.1f") shows wrong results on R3000mipseb
Date: Tue, 14 Nov 2023 16:01:14 +0000

 > Date: Wed, 15 Nov 2023 00:50:36 +0900
 > From: Izumi Tsutsui <tsutsui%ceres.dti.ne.jp@localhost>
 > 
 > I wonder how many nops are actually required for the FP coprocessor
 > (i.e. from/to a different chip) registers..
 
 According to the manual I found at
 <https://cgi.cse.unsw.edu.au/~cs3231/doc/R3000.pdf#page=103>, only one
 delay instruction is needed (bottom of p. 8-8):
 
    The load operation has a delay of one clock, and (like loading to
    an integer register) this is not interlocked.  The compiler and/or
    assembler will usually take care of this; but it is invalid for an
    FP load to be immediately followed by an instruction using the
    loaded value.
 
 (I'm not saying this is absolutely true and applicable here -- just
 sharing it as the only documentation I could find that looks like it
 might be applicable.)
 
 > > It would be nice if we could isolate this to a smaller subroutine than
 > > dtoa, which is gigantic.
 > 
 > The following diff against dtoa.c reduces outputs a bit
 > (requires "DBG="-O2 -Wno-error=uninitialized -Wno-error=unused-variable
 >  -Wno-error=unused-but-set-variable -Wno-error=maybe-uninitialized
 >  -Wno-error=unused-label"):
 
 Just to be clear: Do you mean that (a) the diff to the .s files shows
 the difference between non-working printf (without the nops) and
 working printf (with the nops), and (b) there's nothing else different
 between non-working vs working printf?  Or did I misunderstand?
 Wasn't there a difference about inline vs non-inline __rfs, which
 should presumably affect where the cfc1 instruction is?
 


Home | Main Index | Thread Index | Old Index