Re: [Tinycc-devel] aarch64: subnormal double to long double conversion bug

2020-07-16 Thread Christian JULLIEN
I tested latest patches on Rpi Fedora 32 (aarch64) and I confirm it now pass 
all mpfr tests on this platform.Many thanks.

C.
 Le :16 juillet 2020 à 02:13 (GMT +02:00)
De :"Vincent Lefevre" vinc...@vinc17.net
À :"tinycc-devel@nongnu.org" tinycc-devel@nongnu.org
Objet :Re: [Tinycc-devel] aarch64: subnormal double to long double
 conversion bug


On 2020-07-15 23:15:59 +0200, Michael Matz wrote:
 Hello,
 
 On Wed, 15 Jul 2020, Vincent Lefevre wrote:
 
  With TCC mob on aarch64, the double to long double conversion
  is buggy on subnormal values. This makes a MPFR test fail
  (reported by Christian Jullien).
 
 Thanks for the report, it was indeed unhandled in the support routines. I
 fixed this in mob for riscv64, but the routines are shared with aarch64 so
 it's likely also fixed there, please check.

Thanks. Everything is fine now.

-- 
Vincent Lefèvre vinc...@vinc17.net - Web: 
https://www.vinc17.net/;
100% accessible validated (X)HTML - Blog: https://www.vinc17.net/blog/;
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] aarch64: subnormal double to long double conversion bug

2020-07-15 Thread Vincent Lefevre
On 2020-07-15 23:15:59 +0200, Michael Matz wrote:
> Hello,
> 
> On Wed, 15 Jul 2020, Vincent Lefevre wrote:
> 
> > With TCC mob on aarch64, the double to long double conversion
> > is buggy on subnormal values. This makes a MPFR test fail
> > (reported by Christian Jullien).
> 
> Thanks for the report, it was indeed unhandled in the support routines. I
> fixed this in mob for riscv64, but the routines are shared with aarch64 so
> it's likely also fixed there, please check.

Thanks. Everything is fine now.

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] aarch64: subnormal double to long double conversion bug

2020-07-15 Thread Michael Matz

Hello,

On Wed, 15 Jul 2020, Vincent Lefevre wrote:


With TCC mob on aarch64, the double to long double conversion
is buggy on subnormal values. This makes a MPFR test fail
(reported by Christian Jullien).


Thanks for the report, it was indeed unhandled in the support routines. 
I fixed this in mob for riscv64, but the routines are shared with aarch64 
so it's likely also fixed there, please check.



Ciao,
Michael.

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


[Tinycc-devel] aarch64: subnormal double to long double conversion bug

2020-07-15 Thread Vincent Lefevre
With TCC mob on aarch64, the double to long double conversion
is buggy on subnormal values. This makes a MPFR test fail
(reported by Christian Jullien).

Testcase:

#include 

int main (void)
{
  volatile double d = 0x0.88p-1022;  /* subnormal */
  printf ("d = %a\n", d);
  printf ("d = %.40g\n", d);
  volatile long double x = d;
  printf ("x = %La\n", x);
  printf ("x = %.40Lg\n", x);
  return 0;
}

With GCC (correct):

d = 0x0.88p-1022
d = 1.182070487331950734766686131082839659116e-308
x = 0x1.1p-1023
x = 1.182070487331950734766686131082839659116e-308

With TCC (incorrect):

d = 0x0.88p-1022
d = 1.182070487331950734766686131082839659116e-308
x = 0x1.88p-1023
x = 1.703572172919576058928459424207621861668e-308

I suspect that the code adds the usual implicit bit 1, but there is
no such bit with subnormals.

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel