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 R3000 mipseb



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

From: RVP <rvp%SDF.ORG@localhost>
To: Taylor R Campbell <riastradh%NetBSD.org@localhost>
Cc: gnats-bugs%netbsd.org@localhost
Subject: Re: port-mips/57680: printf("%.1f") shows wrong results on R3000
 mipseb
Date: Tue, 7 Nov 2023 03:11:51 +0000 (UTC)

 On Tue, 7 Nov 2023, Taylor R Campbell wrote:
 
 > So while maybe we ought to set noat and noreorder, and maybe we ought
 > to add a nop in the asm, that doesn't seem to be the source of the
 > problem.
 >
 
 Looking at the dump, I see that in the inline case, we have:
 
          .type   __dtoa, @function
   __dtoa:
  	[...]
  	.set    reorder
  	[...]
  	cfc1 $2,$31
  	andi    $2,$2,0x3
  	[...]
 
 while in the non-inline case, it is:
 
          .type   __dtoa, @function
   __dtoa:
  	[...]
          .set    noreorder
  	[...]
          .reloc  1f,R_MIPS_JALR,__libc_fegetround_ref
   1:     jalr    $25
  	[...]
 
 which would mean that here the fegetround() (which does its own
 `.set noreorder') -> __rfs() instructions are all strictly ordered.
 Whereas in the present (inlined) case, all those instructions may be
 ordered differently.
 
 Can't say if this would make a difference (no MIPS experience--not even
 as a student).
 
 -RVP
 


Home | Main Index | Thread Index | Old Index