source:
scripts/patches/glibc-vfp.patch@
0801e7a
Last change on this file since 0801e7a was 7f65c0e, checked in by , 19 years ago | |
---|---|
|
|
File size: 5.0 KB |
-
sysdeps/arm/bits/endian.h
# Source: http://sources.redhat.com/ml/crossgcc/2004-02/msg00104.html # # From: Dan Kegel <dank at kegel dot com> # To: Nicolas Pitre <nico at cam dot org> # Cc: add <addsub at eyou dot com>, Richard dot Earnshaw at arm dot com, # rearnsha at arm dot com, crossgcc at sources dot redhat dot com, # linux-arm at lists dot arm dot linux dot org dot uk # Date: Mon, 16 Feb 2004 22:49:35 -0800 # Subject: Re: problem while building arm vfp softfloat gcc # # Attached is a patch from addsub@eyou.com that he says patches glibc and # makes printf("%f", 1.0) work again. I haven't tested it, just wanted # to give Nico a chance to have a look at it. Not sure if addsub wrote # this himself or whether it's suitable for glibc mainline (I've asked him). # - Dan diff -uNrp glibc.old/sysdeps/arm/bits/endian.h glibc.new/sysdeps/arm/bits/endian.h
old new 9 9 #else 10 10 #define __BYTE_ORDER __LITTLE_ENDIAN 11 11 #endif 12 13 #ifdef __VFP_FP__ 14 #define __FLOAT_WORD_ORDER __BYTE_ORDER 15 #else 12 16 #define __FLOAT_WORD_ORDER __BIG_ENDIAN 17 #endif -
sysdeps/arm/gmp-mparam.h
diff -uNrp glibc.old/sysdeps/arm/gmp-mparam.h glibc.new/sysdeps/arm/gmp-mparam.h
old new MA 02111-1307, USA. */ 26 26 #define BITS_PER_SHORTINT 16 27 27 #define BITS_PER_CHAR 8 28 28 29 #define IEEE_DOUBLE_BIG_ENDIAN 0 30 #define IEEE_DOUBLE_MIXED_ENDIAN 1 29 #if defined(__ARMEB__) 30 # define IEEE_DOUBLE_MIXED_ENDIAN 0 31 # define IEEE_DOUBLE_BIG_ENDIAN 1 32 #elif defined(__VFP_FP__) 33 # define IEEE_DOUBLE_MIXED_ENDIAN 0 34 # define IEEE_DOUBLE_BIG_ENDIAN 0 35 #else 36 # define IEEE_DOUBLE_BIG_ENDIAN 0 37 # define IEEE_DOUBLE_MIXED_ENDIAN 1 38 #endif -
sysdeps/arm/ieee754.h
diff -uNrp glibc.old/sysdeps/arm/ieee754.h glibc.new/sysdeps/arm/ieee754.h
old new 1 /* Copyright (C) 1992, 1995, 1996, 1998 Free Software Foundation, Inc.2 This file is part of the GNU C Library.3 4 The GNU C Library is free software; you can redistribute it and/or5 modify it under the terms of the GNU Lesser General Public6 License as published by the Free Software Foundation; either7 version 2.1 of the License, or (at your option) any later version.8 9 The GNU C Library is distributed in the hope that it will be useful,10 but WITHOUT ANY WARRANTY; without even the implied warranty of11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU12 Lesser General Public License for more details.13 14 You should have received a copy of the GNU Lesser General Public15 License along with the GNU C Library; if not, write to the Free16 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA17 02111-1307 USA. */18 19 #ifndef _IEEE754_H20 21 #define _IEEE754_H 122 #include <features.h>23 24 #include <endian.h>25 26 __BEGIN_DECLS27 28 union ieee754_float29 {30 float f;31 32 /* This is the IEEE 754 single-precision format. */33 struct34 {35 unsigned int mantissa:23;36 unsigned int exponent:8;37 unsigned int negative:1;38 } ieee;39 40 /* This format makes it easier to see if a NaN is a signalling NaN. */41 struct42 {43 unsigned int mantissa:22;44 unsigned int quiet_nan:1;45 unsigned int exponent:8;46 unsigned int negative:1;47 } ieee_nan;48 };49 50 #define IEEE754_FLOAT_BIAS 0x7f /* Added to exponent. */51 52 53 union ieee754_double54 {55 double d;56 57 /* This is the IEEE 754 double-precision format. */58 struct59 {60 unsigned int mantissa0:20;61 unsigned int exponent:11;62 unsigned int negative:1;63 unsigned int mantissa1:32;64 } ieee;65 66 /* This format makes it easier to see if a NaN is a signalling NaN. */67 struct68 {69 unsigned int mantissa0:19;70 unsigned int quiet_nan:1;71 unsigned int exponent:11;72 unsigned int negative:1;73 unsigned int mantissa1:32;74 } ieee_nan;75 };76 77 #define IEEE754_DOUBLE_BIAS 0x3ff /* Added to exponent. */78 79 80 /* The following two structures are correct for `new' floating point systems but81 wrong for the old FPPC. The only solution seems to be to avoid their use on82 old hardware. */83 84 union ieee854_long_double85 {86 long double d;87 88 /* This is the IEEE 854 double-extended-precision format. */89 struct90 {91 unsigned int exponent:15;92 unsigned int empty:16;93 unsigned int negative:1;94 unsigned int mantissa1:32;95 unsigned int mantissa0:32;96 } ieee;97 98 /* This is for NaNs in the IEEE 854 double-extended-precision format. */99 struct100 {101 unsigned int exponent:15;102 unsigned int empty:16;103 unsigned int negative:1;104 unsigned int mantissa1:32;105 unsigned int mantissa0:30;106 unsigned int quiet_nan:1;107 unsigned int one:1;108 } ieee_nan;109 };110 111 #define IEEE854_LONG_DOUBLE_BIAS 0x3fff112 113 __END_DECLS114 115 #endif /* ieee754.h */
Note:
See TracBrowser
for help on using the repository browser.