NetBSD-Bugs archive

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

Re: port-m68k/59616 (m68k softfloat nans and infs have to be preserved when changing sizes)



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

From: Nathanial Sloss <nathanialsloss%yahoo.com.au@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: port-m68k-maintainer%netbsd.org@localhost,
 netbsd-bugs%netbsd.org@localhost,
 gnats-admin%netbsd.org@localhost
Subject: Re: port-m68k/59616 (m68k softfloat nans and infs have to be preserved when changing sizes)
Date: Mon, 1 Sep 2025 11:04:21 +1000

 --Boundary-00=_WEPtonky77UfJie
 Content-Type: Text/Plain;
   charset="iso-8859-15"
 Content-Transfer-Encoding: 7bit
 
 Attached is a test program for reference:
 
 Best regards,
 
 Nat
 
 --Boundary-00=_WEPtonky77UfJie
 Content-Type: text/x-csrc;
   charset="ISO-8859-1";
   name="minus.c"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
 	filename="minus.c"
 
 #include <stdio.h>
 
 #define VAL (3.9e-10)
 #define VAL2 (+1.0/0.0)
 #define VAL3 (0.0/0.0)
 #define VAL4 (5.2e3)
 
 int
 main(void)
 {
 	float f = VAL;
 	double d = VAL;
 	long double l = VAL;
 
 	printf("MINUS  %le: %le %le %le\n", VAL, (double)(l - d),
 	    (double)(l - f), (double)(d - f));
 	printf("PLUS %le: %le %le %le\n", VAL, (double)(l + d),
 	    (double)(l + f), (double)(d + f));
 
 	if (l - d == 0)
 		printf("OK ");
 	if (l - f == 0)
 		printf("OK ");
 	if (d - f == 0)
 		printf("OK");
 	printf("\n");
 
 	f = VAL2;
 	d = VAL2;
 	l = VAL2;
 
 	printf("MINUS  %le: %le %le %le\n", VAL2, (double)(l - d),
 	    (double)(l - f), (double)(d - f));
 	printf("PLUS %le: %le %le %le\n", VAL2, (double)(l + d),
 	    (double)(l + f), (double)(d + f));
 
 	if (l - d == 0)
 		printf("OK ");
 	if (l - f == 0)
 		printf("OK ");
 	if (d - f == 0)
 		printf("OK");
 	printf("\n");
 
 	f = VAL3;
 	d = VAL3;
 	l = VAL3;
 
 	printf("MINUS  %le: %le %le %le\n", VAL3, (double)(l - d),
 	    (double)(l - f), (double)(d - f));
 	printf("PLUS %le: %le %le %le\n", VAL3, (double)(l + d),
 	    (double)(l + f), (double)(d + f));
 
 	if (l - d == 0)
 		printf("OK ");
 	if (l - f == 0)
 		printf("OK ");
 	if (d - f == 0)
 		printf("OK");
 	printf("\n");
 
 	f = VAL4;
 	d = VAL4;
 	l = VAL4;
 
 	printf("MINUS  %le: %le %le %le\n", VAL4, (double)(l - d),
 	    (double)(l - f), (double)(d - f));
 	printf("PLUS %le: %le %le %le\n", VAL4, (double)(l + d),
 	    (double)(l + f), (double)(d + f));
 
 	if (l - d == 0)
 		printf("OK ");
 	if (l - f == 0)
 		printf("OK ");
 	if (d - f == 0)
 		printf("OK");
 	printf("\n");
 
 	return 0;
 }
 
 --Boundary-00=_WEPtonky77UfJie--
 


Home | Main Index | Thread Index | Old Index