diff options
author | Jakub Jelinek <jakub@redhat.com> | 2006-01-06 21:55:58 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2006-01-06 21:55:58 +0000 |
commit | 8c45a85e617c71cf0279c4118d3811018626b45e (patch) | |
tree | 3fb19ed3bee25ce0505cf576057b8308f8c4bc06 /soft-fp | |
parent | dd486f53ee367e1667c61ec1fffdb59f9a8130e9 (diff) |
Updated to fedora-glibc-20060106T2148
Diffstat (limited to 'soft-fp')
-rw-r--r-- | soft-fp/Makefile | 13 | ||||
-rw-r--r-- | soft-fp/double.h | 1 | ||||
-rw-r--r-- | soft-fp/extended.h | 1 | ||||
-rw-r--r-- | soft-fp/floatundidf.c | 38 | ||||
-rw-r--r-- | soft-fp/floatundisf.c | 38 | ||||
-rw-r--r-- | soft-fp/floatunditf.c | 38 | ||||
-rw-r--r-- | soft-fp/floatunsidf.c | 38 | ||||
-rw-r--r-- | soft-fp/floatunsisf.c | 38 | ||||
-rw-r--r-- | soft-fp/floatunsitf.c | 38 | ||||
-rw-r--r-- | soft-fp/op-common.h | 54 | ||||
-rw-r--r-- | soft-fp/quad.h | 1 | ||||
-rw-r--r-- | soft-fp/single.h | 1 | ||||
-rw-r--r-- | soft-fp/unorddf2.c | 36 | ||||
-rw-r--r-- | soft-fp/unordsf2.c | 37 | ||||
-rw-r--r-- | soft-fp/unordtf2.c | 37 |
15 files changed, 369 insertions, 40 deletions
diff --git a/soft-fp/Makefile b/soft-fp/Makefile index e0a3cfb0df..8eb89c5e51 100644 --- a/soft-fp/Makefile +++ b/soft-fp/Makefile @@ -23,17 +23,18 @@ subdir := soft-fp gcc-single-routines := negsf2 addsf3 subsf3 mulsf3 divsf3 eqsf2 \ - lesf2 gesf2 fixsfsi fixunssfsi floatsisf fixsfdi \ - fixunssfdi floatdisf sqrtsf2 + lesf2 gesf2 unordsf2 fixsfsi fixunssfsi floatsisf fixsfdi \ + fixunssfdi floatdisf sqrtsf2 floatunsisf floatundisf gcc-double-routines := negdf2 adddf3 subdf3 muldf3 divdf3 eqdf2 \ - ledf2 gedf2 fixdfsi fixunsdfsi floatsidf fixdfdi \ - fixunsdfdi floatdidf extendsfdf2 truncdfsf2 sqrtdf2 + ledf2 gedf2 unorddf2 fixdfsi fixunsdfsi floatsidf fixdfdi \ + fixunsdfdi floatdidf extendsfdf2 truncdfsf2 sqrtdf2 floatunsidf \ + floatundidf gcc-quad-routines := negtf2 addtf3 subtf3 multf3 divtf3 eqtf2 \ - letf2 getf2 fixtfsi fixunstfsi floatsitf fixtfdi \ + letf2 getf2 unordtf2 fixtfsi fixunstfsi floatsitf fixtfdi \ fixunstfdi floatditf extendsftf2 trunctfsf2 extenddftf2 \ - trunctfdf2 sqrttf2 + trunctfdf2 sqrttf2 floatunsitf floatunditf distribute := double.h op-1.h op-2.h op-4.h op-common.h quad.h \ single.h soft-fp.h extended.h Banner op-8.h testit.c \ diff --git a/soft-fp/double.h b/soft-fp/double.h index c659adec62..77d439b466 100644 --- a/soft-fp/double.h +++ b/soft-fp/double.h @@ -113,6 +113,7 @@ union _FP_UNION_D #define FP_CMP_D(r,X,Y,un) _FP_CMP(D,2,r,X,Y,un) #define FP_CMP_EQ_D(r,X,Y) _FP_CMP_EQ(D,2,r,X,Y) +#define FP_CMP_UNORD_D(r,X,Y) _FP_CMP_UNORD(D,2,r,X,Y) #define FP_TO_INT_D(r,X,rsz,rsg) _FP_TO_INT(D,2,r,X,rsz,rsg) #define FP_FROM_INT_D(X,r,rs,rt) _FP_FROM_INT(D,2,X,r,rs,rt) diff --git a/soft-fp/extended.h b/soft-fp/extended.h index 2edcbd05f0..a1f54ccceb 100644 --- a/soft-fp/extended.h +++ b/soft-fp/extended.h @@ -224,6 +224,7 @@ union _FP_UNION_E #define FP_CMP_E(r,X,Y,un) _FP_CMP(E,4,r,X,Y,un) #define FP_CMP_EQ_E(r,X,Y) _FP_CMP_EQ(E,4,r,X,Y) +#define FP_CMP_UNORD_E(r,X,Y) _FP_CMP_UNORD(E,4,r,X,Y) #define FP_TO_INT_E(r,X,rsz,rsg) _FP_TO_INT(E,4,r,X,rsz,rsg) #define FP_FROM_INT_E(X,r,rs,rt) _FP_FROM_INT(E,4,X,r,rs,rt) diff --git a/soft-fp/floatundidf.c b/soft-fp/floatundidf.c new file mode 100644 index 0000000000..03bda04e62 --- /dev/null +++ b/soft-fp/floatundidf.c @@ -0,0 +1,38 @@ +/* Software floating-point emulation. + Convert a 64bit unsigned integer to IEEE double + Copyright (C) 1997,1999, 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include "soft-fp.h" +#include "double.h" + +double +__floatundidf(UDItype i) +{ + FP_DECL_EX; + FP_DECL_D(A); + double a; + + FP_FROM_INT_D(A, i, 64, long long); + FP_PACK_D(a, A); + FP_HANDLE_EXCEPTIONS; + + return a; +} diff --git a/soft-fp/floatundisf.c b/soft-fp/floatundisf.c new file mode 100644 index 0000000000..68aa90fbf7 --- /dev/null +++ b/soft-fp/floatundisf.c @@ -0,0 +1,38 @@ +/* Software floating-point emulation. + Convert a 64bit unsigned integer to IEEE single + Copyright (C) 1997,1999, 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include "soft-fp.h" +#include "single.h" + +float +__floatundisf(UDItype i) +{ + FP_DECL_EX; + FP_DECL_S(A); + float a; + + FP_FROM_INT_S(A, i, 64, long long); + FP_PACK_S(a, A); + FP_HANDLE_EXCEPTIONS; + + return a; +} diff --git a/soft-fp/floatunditf.c b/soft-fp/floatunditf.c new file mode 100644 index 0000000000..2f53f7d6e4 --- /dev/null +++ b/soft-fp/floatunditf.c @@ -0,0 +1,38 @@ +/* Software floating-point emulation. + Convert a 64bit unsigned integer to IEEE quad + Copyright (C) 1997,1999, 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include "soft-fp.h" +#include "quad.h" + +long double +__floatunditf(UDItype i) +{ + FP_DECL_EX; + FP_DECL_Q(A); + long double a; + + FP_FROM_INT_Q(A, i, 64, long long); + FP_PACK_Q(a, A); + FP_HANDLE_EXCEPTIONS; + + return a; +} diff --git a/soft-fp/floatunsidf.c b/soft-fp/floatunsidf.c new file mode 100644 index 0000000000..2649adcb6d --- /dev/null +++ b/soft-fp/floatunsidf.c @@ -0,0 +1,38 @@ +/* Software floating-point emulation. + Convert a 32bit unsigned integer to IEEE double + Copyright (C) 1997,1999, 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include "soft-fp.h" +#include "double.h" + +double +__floatunsidf(USItype i) +{ + FP_DECL_EX; + FP_DECL_D(A); + double a; + + FP_FROM_INT_D(A, i, 32, int); + FP_PACK_D(a, A); + FP_HANDLE_EXCEPTIONS; + + return a; +} diff --git a/soft-fp/floatunsisf.c b/soft-fp/floatunsisf.c new file mode 100644 index 0000000000..a7f21ca68b --- /dev/null +++ b/soft-fp/floatunsisf.c @@ -0,0 +1,38 @@ +/* Software floating-point emulation. + Convert a 32bit unsigned integer to IEEE single + Copyright (C) 1997,1999, 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include "soft-fp.h" +#include "single.h" + +float +__floatunsisf(USItype i) +{ + FP_DECL_EX; + FP_DECL_S(A); + float a; + + FP_FROM_INT_S(A, i, 32, int); + FP_PACK_S(a, A); + FP_HANDLE_EXCEPTIONS; + + return a; +} diff --git a/soft-fp/floatunsitf.c b/soft-fp/floatunsitf.c new file mode 100644 index 0000000000..efb66e9f0a --- /dev/null +++ b/soft-fp/floatunsitf.c @@ -0,0 +1,38 @@ +/* Software floating-point emulation. + Convert a 32bit unsigned integer to IEEE quad + Copyright (C) 1997,1999, 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include "soft-fp.h" +#include "quad.h" + +long double +__floatunsitf(USItype i) +{ + FP_DECL_EX; + FP_DECL_Q(A); + long double a; + + FP_FROM_INT_Q(A, i, 32, int); + FP_PACK_Q(a, A); + FP_HANDLE_EXCEPTIONS; + + return a; +} diff --git a/soft-fp/op-common.h b/soft-fp/op-common.h index 3abafa14a8..f30260ede4 100644 --- a/soft-fp/op-common.h +++ b/soft-fp/op-common.h @@ -1,5 +1,5 @@ /* Software floating-point emulation. Common operations. - Copyright (C) 1997,1998,1999 Free Software Foundation, Inc. + Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com), Jakub Jelinek (jj@ultra.linux.cz), @@ -553,6 +553,14 @@ do { \ } \ } while (0) +/* Version to test unordered. */ + +#define _FP_CMP_UNORD(fs, wc, ret, X, Y) \ + do { \ + ret = ((X##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(X)) \ + || (Y##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(Y))); \ + } while (0) + /* * Main square root routine. The input value should be cooked. */ @@ -725,40 +733,18 @@ do { \ /* Count leading zeros in a word. */ #ifndef __FP_CLZ -#if _FP_W_TYPE_SIZE < 64 -/* this is just to shut the compiler up about shifts > word length -- PMM 02/1998 */ -#define __FP_CLZ(r, x) \ - do { \ - _FP_W_TYPE _t = (x); \ - r = _FP_W_TYPE_SIZE - 1; \ - if (_t > 0xffff) r -= 16; \ - if (_t > 0xffff) _t >>= 16; \ - if (_t > 0xff) r -= 8; \ - if (_t > 0xff) _t >>= 8; \ - if (_t & 0xf0) r -= 4; \ - if (_t & 0xf0) _t >>= 4; \ - if (_t & 0xc) r -= 2; \ - if (_t & 0xc) _t >>= 2; \ - if (_t & 0x2) r -= 1; \ - } while (0) -#else /* not _FP_W_TYPE_SIZE < 64 */ -#define __FP_CLZ(r, x) \ - do { \ - _FP_W_TYPE _t = (x); \ - r = _FP_W_TYPE_SIZE - 1; \ - if (_t > 0xffffffff) r -= 32; \ - if (_t > 0xffffffff) _t >>= 32; \ - if (_t > 0xffff) r -= 16; \ - if (_t > 0xffff) _t >>= 16; \ - if (_t > 0xff) r -= 8; \ - if (_t > 0xff) _t >>= 8; \ - if (_t & 0xf0) r -= 4; \ - if (_t & 0xf0) _t >>= 4; \ - if (_t & 0xc) r -= 2; \ - if (_t & 0xc) _t >>= 2; \ - if (_t & 0x2) r -= 1; \ +/* GCC 3.4 and later provide the builtins for us. */ +#define __FP_CLZ(r, x) \ + do { \ + if (sizeof (_FP_W_TYPE) == sizeof (unsigned int)) \ + r = __builtin_clz (x); \ + else if (sizeof (_FP_W_TYPE) == sizeof (unsigned long)) \ + r = __builtin_clzl (x); \ + else if (sizeof (_FP_W_TYPE) == sizeof (unsigned long long)) \ + r = __builtin_clzll (x); \ + else \ + abort (); \ } while (0) -#endif /* not _FP_W_TYPE_SIZE < 64 */ #endif /* ndef __FP_CLZ */ #define _FP_DIV_HELP_imm(q, r, n, d) \ diff --git a/soft-fp/quad.h b/soft-fp/quad.h index 33ee4d4b20..b03063bc05 100644 --- a/soft-fp/quad.h +++ b/soft-fp/quad.h @@ -119,6 +119,7 @@ union _FP_UNION_Q #define FP_CMP_Q(r,X,Y,un) _FP_CMP(Q,4,r,X,Y,un) #define FP_CMP_EQ_Q(r,X,Y) _FP_CMP_EQ(Q,4,r,X,Y) +#define FP_CMP_UNORD_Q(r,X,Y) _FP_CMP_UNORD(Q,4,r,X,Y) #define FP_TO_INT_Q(r,X,rsz,rsg) _FP_TO_INT(Q,4,r,X,rsz,rsg) #define FP_FROM_INT_Q(X,r,rs,rt) _FP_FROM_INT(Q,4,X,r,rs,rt) diff --git a/soft-fp/single.h b/soft-fp/single.h index b571d5058a..094dc3c484 100644 --- a/soft-fp/single.h +++ b/soft-fp/single.h @@ -102,6 +102,7 @@ union _FP_UNION_S #define FP_CMP_S(r,X,Y,un) _FP_CMP(S,1,r,X,Y,un) #define FP_CMP_EQ_S(r,X,Y) _FP_CMP_EQ(S,1,r,X,Y) +#define FP_CMP_UNORD_S(r,X,Y) _FP_CMP_UNORD(S,1,r,X,Y) #define FP_TO_INT_S(r,X,rsz,rsg) _FP_TO_INT(S,1,r,X,rsz,rsg) #define FP_FROM_INT_S(X,r,rs,rt) _FP_FROM_INT(S,1,X,r,rs,rt) diff --git a/soft-fp/unorddf2.c b/soft-fp/unorddf2.c new file mode 100644 index 0000000000..35f3e673db --- /dev/null +++ b/soft-fp/unorddf2.c @@ -0,0 +1,36 @@ +/* Software floating-point emulation. + Return 1 iff a or b is a NaN, 0 otherwise. + Copyright (C) 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Joseph Myers (joseph@codesourcery.com). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include "soft-fp.h" +#include "double.h" + +int +__unorddf2(double a, double b) +{ + FP_DECL_D(A); FP_DECL_D(B); + int r; + + FP_UNPACK_RAW_D(A, a); + FP_UNPACK_RAW_D(B, b); + FP_CMP_UNORD_D(r, A, B); + + return r; +} diff --git a/soft-fp/unordsf2.c b/soft-fp/unordsf2.c new file mode 100644 index 0000000000..e741b794c1 --- /dev/null +++ b/soft-fp/unordsf2.c @@ -0,0 +1,37 @@ +/* Software floating-point emulation. + Return 1 iff a or b is a NaN, 0 otherwise. + Copyright (C) 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Joseph Myers (joseph@codesourcery.com). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include "soft-fp.h" +#include "single.h" + +int +__unordsf2(float a, float b) +{ + FP_DECL_S(A); + FP_DECL_S(B); + int r; + + FP_UNPACK_RAW_S(A, a); + FP_UNPACK_RAW_S(B, b); + FP_CMP_UNORD_S(r, A, B); + + return r; +} diff --git a/soft-fp/unordtf2.c b/soft-fp/unordtf2.c new file mode 100644 index 0000000000..5e30ddb8d2 --- /dev/null +++ b/soft-fp/unordtf2.c @@ -0,0 +1,37 @@ +/* Software floating-point emulation. + Return 1 iff a or b is a NaN, 0 otherwise. + Copyright (C) 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Joseph Myers (joseph@codesourcery.com). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include "soft-fp.h" +#include "quad.h" + +int +__unordtf2(long double a, long double b) +{ + FP_DECL_Q(A); + FP_DECL_Q(B); + int r; + + FP_UNPACK_RAW_Q(A, a); + FP_UNPACK_RAW_Q(B, b); + FP_CMP_UNORD_Q(r, A, B); + + return r; +} |