Bug 25650 - fdlibm fails to recognize endianness (AIX + POWER)
Summary: fdlibm fails to recognize endianness (AIX + POWER)
Status: RESOLVED FIXED
Alias: None
Product: classpath
Classification: Unclassified
Component: classpath (show other bugs)
Version: unspecified
: P3 normal
Target Milestone: 0.91
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-03 11:30 UTC by Riccardo Mottola
Modified: 2006-04-19 17:55 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-01-03 14:03:14


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Riccardo Mottola 2006-01-03 11:30:35 UTC
I used the following patch in CP under kaffe

Index: libraries/javalib/external/classpath/native/fdlibm/ieeefp.h
===================================================================
RCS file: /cvs/kaffe/kaffe/libraries/javalib/external/classpath/native/fdlibm/ieeefp.h,v
retrieving revision 1.2
diff -u -r1.2 ieeefp.h
--- libraries/javalib/external/classpath/native/fdlibm/ieeefp.h	19 Dec 2005 00:12:05 -0000	1.2
+++ libraries/javalib/external/classpath/native/fdlibm/ieeefp.h	26 Dec 2005 01:50:26 -0000
@@ -123,7 +123,7 @@
 #define __IEEE_LITTLE_ENDIAN
 #endif
 
-#if defined (__PPC__) || defined (__ppc__) || defined (__powerpc__) || defined (__ppc64__)
+#if defined (__PPC__) || defined (__ppc__) || defined (__powerpc__) || defined (__ppc64__) || defined(_POWER)
 #if (defined(_BIG_ENDIAN) && _BIG_ENDIAN) || (defined(_AIX) && _AIX) || defined (__BIG_ENDIAN__)|| defined (__APPLE__)
 #define __IEEE_BIG_ENDIAN
 #else
Comment 1 Andrew Pinski 2006-01-03 14:03:14 UTC
The correct full test (from gcc/GMP's longlong.h) is:
#if (defined (_ARCH_PPC)        /* AIX */                               \
     || defined (_ARCH_PWR)     /* AIX */                               \
     || defined (_ARCH_COM)     /* AIX */                               \
     || defined (__powerpc__)   /* gcc */                               \
     || defined (__POWERPC__)   /* BEOS */                              \
     || defined (__ppc__)       /* Darwin */                            \
     || (defined (PPC) && ! defined (CPU_FAMILY)) /* gcc 2.7.x GNU&SysV */    \
     || (defined (PPC) && defined (CPU_FAMILY)    /* VxWorks */               \
         && CPU_FAMILY == PPC)                                                \
     )

Confirmed.
Comment 2 Andrew Pinski 2006-01-03 14:04:10 UTC
(In reply to comment #1)
> The correct full test (from gcc/GMP's longlong.h) is:

I should also mention the reason for the weirdness in the test is because of PR 13873, well and VxWorks being funny.
Comment 3 Tom Tromey 2006-04-19 17:55:42 UTC
I checked in the patch from PR 27062.
This isn't identical but I think it suffices.
Comment 4 cvs-commit@developer.classpath.org 2006-04-19 18:01:41 UTC
Subject: Bug 25650

CVSROOT:	/cvsroot/classpath
Module name:	classpath
Branch: 	
Changes by:	Tom Tromey <tromey@savannah.gnu.org>	06/04/19 17:55:15

Modified files:
	native/fdlibm  : ieeefp.h 
	.              : ChangeLog 

Log message:
	2006-04-19  Riccardo Mottola  <multix@gmail.com>
	
	PR classpath/27062, PR classpath/25650:
	* native/fdlibm/ieeefp.h: Check for _POWER and _IBMR2.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/native/fdlibm/ieeefp.h.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/ChangeLog.diff?tr1=1.7152&tr2=1.7153&r1=text&r2=text