[PATCH] arm float endinanness

Paul Brook paul@codesourcery.com
Tue Jan 20 15:25:00 GMT 2004


Newlib doesn't seem to know about newer ARM floating point models.
The following patch fixes this.

Paul

2004-01-20  Paul Brook  <paul@codesourcery.com>

	* libc/include/machine/ieeefp.h: Set IEEE_{BIG,LITTLE} endian based on
	__VFP_FP__.

Index: ieeefp.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/machine/ieeefp.h,v
retrieving revision 1.18
diff -c -3 -p -r1.18 ieeefp.h
*** ieeefp.h	10 Jun 2003 15:32:27 -0000	1.18
--- ieeefp.h	20 Jan 2004 14:56:31 -0000
***************
*** 51,61 ****
  */
  
  #if (defined(__arm__) || defined(__thumb__)) && !defined(__MAVERICK__)
! /* ARM always has big-endian words.  Within those words the byte ordering
!    will be big or little endian depending upon the target.  */
! #define __IEEE_BIG_ENDIAN
! #ifdef __ARMEL__
! #define __IEEE_BYTES_LITTLE_ENDIAN
  #endif
  #endif
  
--- 51,71 ----
  */
  
  #if (defined(__arm__) || defined(__thumb__)) && !defined(__MAVERICK__)
! /* ARM traditionally used big-endian words; and within those words the
!    byte ordering was big or little endian depending upon the target.
!    Modern floating-point formats are naturally ordered; in this case
!    __VFP_FP__ will be defined, even if soft-float.  */
! #ifdef __VFP_FP__
! # ifdef __ARMEL__
! #  define __IEEE_LITTLE_ENDIAN
! # else
! #  define __IEEE_BIG_ENDIAN
! # endif
! #else
! # define __IEEE_BIG_ENDIAN
! # ifdef __ARMEL__
! #  define __IEEE_BYTES_LITTLE_ENDIAN
! # endif
  #endif
  #endif
  



More information about the Newlib mailing list