From a334319f6530564d22e775935d9c91663623a1b4 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 22 Dec 2004 20:10:10 +0000 Subject: (CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4. --- sysdeps/sparc/sparc32/soft-fp/Dist | 28 +++++++++++++++++++++ sysdeps/sparc/sparc32/soft-fp/Makefile | 20 ++++++++------- sysdeps/sparc/sparc32/soft-fp/Versions | 8 ------ sysdeps/sparc/sparc32/soft-fp/q_add.c | 8 +++--- sysdeps/sparc/sparc32/soft-fp/q_div.c | 4 +-- sysdeps/sparc/sparc32/soft-fp/q_dtoq.c | 10 ++++---- sysdeps/sparc/sparc32/soft-fp/q_itoq.c | 6 ++--- sysdeps/sparc/sparc32/soft-fp/q_lltoq.c | 38 ----------------------------- sysdeps/sparc/sparc32/soft-fp/q_qtod.c | 10 ++++---- sysdeps/sparc/sparc32/soft-fp/q_qtoi.c | 6 ++--- sysdeps/sparc/sparc32/soft-fp/q_qtoll.c | 38 ----------------------------- sysdeps/sparc/sparc32/soft-fp/q_qtos.c | 10 ++++---- sysdeps/sparc/sparc32/soft-fp/q_qtou.c | 38 ----------------------------- sysdeps/sparc/sparc32/soft-fp/q_qtoui.c | 38 +++++++++++++++++++++++++++++ sysdeps/sparc/sparc32/soft-fp/q_qtoull.c | 38 ----------------------------- sysdeps/sparc/sparc32/soft-fp/q_qtoux.c | 38 +++++++++++++++++++++++++++++ sysdeps/sparc/sparc32/soft-fp/q_qtox.c | 38 +++++++++++++++++++++++++++++ sysdeps/sparc/sparc32/soft-fp/q_sqrt.c | 3 +-- sysdeps/sparc/sparc32/soft-fp/q_stoq.c | 10 ++++---- sysdeps/sparc/sparc32/soft-fp/q_sub.c | 8 +++--- sysdeps/sparc/sparc32/soft-fp/q_uitoq.c | 38 +++++++++++++++++++++++++++++ sysdeps/sparc/sparc32/soft-fp/q_ulltoq.c | 38 ----------------------------- sysdeps/sparc/sparc32/soft-fp/q_utoq.c | 38 ----------------------------- sysdeps/sparc/sparc32/soft-fp/q_uxtoq.c | 38 +++++++++++++++++++++++++++++ sysdeps/sparc/sparc32/soft-fp/q_xtoq.c | 38 +++++++++++++++++++++++++++++ sysdeps/sparc/sparc32/soft-fp/sfp-machine.h | 14 ++++++++--- 26 files changed, 315 insertions(+), 286 deletions(-) create mode 100644 sysdeps/sparc/sparc32/soft-fp/Dist delete mode 100644 sysdeps/sparc/sparc32/soft-fp/Versions delete mode 100644 sysdeps/sparc/sparc32/soft-fp/q_lltoq.c delete mode 100644 sysdeps/sparc/sparc32/soft-fp/q_qtoll.c delete mode 100644 sysdeps/sparc/sparc32/soft-fp/q_qtou.c create mode 100644 sysdeps/sparc/sparc32/soft-fp/q_qtoui.c delete mode 100644 sysdeps/sparc/sparc32/soft-fp/q_qtoull.c create mode 100644 sysdeps/sparc/sparc32/soft-fp/q_qtoux.c create mode 100644 sysdeps/sparc/sparc32/soft-fp/q_qtox.c create mode 100644 sysdeps/sparc/sparc32/soft-fp/q_uitoq.c delete mode 100644 sysdeps/sparc/sparc32/soft-fp/q_ulltoq.c delete mode 100644 sysdeps/sparc/sparc32/soft-fp/q_utoq.c create mode 100644 sysdeps/sparc/sparc32/soft-fp/q_uxtoq.c create mode 100644 sysdeps/sparc/sparc32/soft-fp/q_xtoq.c (limited to 'sysdeps/sparc/sparc32/soft-fp') diff --git a/sysdeps/sparc/sparc32/soft-fp/Dist b/sysdeps/sparc/sparc32/soft-fp/Dist new file mode 100644 index 0000000000..b3c7344889 --- /dev/null +++ b/sysdeps/sparc/sparc32/soft-fp/Dist @@ -0,0 +1,28 @@ +q_add.c +q_cmp.c +q_cmpe.c +q_div.c +q_dtoq.c +q_feq.c +q_fge.c +q_fgt.c +q_fle.c +q_flt.c +q_fne.c +q_itoq.c +q_mul.c +q_neg.c +q_qtod.c +q_qtoi.c +q_qtos.c +q_qtoui.c +q_qtoux.c +q_qtox.c +q_sqrt.c +q_stoq.c +q_sub.c +q_uitoq.c +q_util.c +q_uxtoq.c +q_xtoq.c +sfp-machine.h diff --git a/sysdeps/sparc/sparc32/soft-fp/Makefile b/sysdeps/sparc/sparc32/soft-fp/Makefile index d447b48285..bba9bf7f86 100644 --- a/sysdeps/sparc/sparc32/soft-fp/Makefile +++ b/sysdeps/sparc/sparc32/soft-fp/Makefile @@ -1,6 +1,6 @@ # Software floating-point emulation. # Makefile for SPARC v8 long double utility functions (_Q_*). -# Copyright (C) 1999, 2000, 2006 Free Software Foundation, Inc. +# Copyright (C) 1999, 2000 Free Software Foundation, Inc. # This file is part of the GNU C Library. # Contributed by Jakub Jelinek (jj@ultra.linux.cz). # @@ -20,11 +20,13 @@ # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA # 02111-1307 USA. -ifeq ($(subdir),soft-fp) -sparc32-quad-routines := q_add q_cmp q_cmpe q_div q_dtoq q_feq q_fge \ - q_fgt q_fle q_flt q_fne q_itoq q_mul q_neg q_qtod q_qtoi \ - q_qtos q_qtou q_qtoull q_qtoll q_sqrt q_stoq q_sub q_utoq \ - q_ulltoq q_lltoq q_util -sysdep_routines += $(sparc32-quad-routines) - -endif +# Currently gcc does not support TFmode long double on sparc32 +# so these routines are not used. +#ifeq ($(subdir),soft-fp) +#sparc32-quad-routines := q_add q_cmp q_cmpe q_div q_dtoq q_feq q_fge \ +# q_fgt q_fle q_flt q_fne q_itoq q_mul q_neg q_qtod q_qtoi \ +# q_qtos q_qtoui q_qtoux q_qtox q_sqrt q_stoq q_sub q_uitoq \ +# q_uxtoq q_xtoq q_util +#sysdep_routines += $(sparc32-quad-routines) +# +#endif diff --git a/sysdeps/sparc/sparc32/soft-fp/Versions b/sysdeps/sparc/sparc32/soft-fp/Versions deleted file mode 100644 index 6a09249c46..0000000000 --- a/sysdeps/sparc/sparc32/soft-fp/Versions +++ /dev/null @@ -1,8 +0,0 @@ -libc { - GLIBC_2.4 { - _Q_add; _Q_cmp; _Q_cmpe; _Q_div; _Q_dtoq; _Q_feq; _Q_fge; _Q_fgt; - _Q_fle; _Q_flt; _Q_fne; _Q_itoq; _Q_mul; _Q_neg; _Q_qtod; _Q_qtoi; - _Q_qtos; _Q_qtou; _Q_qtoull; _Q_qtoll; _Q_sqrt; _Q_stoq; _Q_sub; - _Q_utoq; _Q_ulltoq; _Q_lltoq; - } -} diff --git a/sysdeps/sparc/sparc32/soft-fp/q_add.c b/sysdeps/sparc/sparc32/soft-fp/q_add.c index 987c725582..fb93461593 100644 --- a/sysdeps/sparc/sparc32/soft-fp/q_add.c +++ b/sysdeps/sparc/sparc32/soft-fp/q_add.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a + b - Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + Copyright (C) 1997,1999 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). @@ -30,10 +30,10 @@ long double _Q_add(const long double a, const long double b) long double c; FP_INIT_ROUNDMODE; - FP_UNPACK_SEMIRAW_Q(A, a); - FP_UNPACK_SEMIRAW_Q(B, b); + FP_UNPACK_Q(A, a); + FP_UNPACK_Q(B, b); FP_ADD_Q(C, A, B); - FP_PACK_SEMIRAW_Q(c, C); + FP_PACK_Q(c, C); FP_HANDLE_EXCEPTIONS; return c; } diff --git a/sysdeps/sparc/sparc32/soft-fp/q_div.c b/sysdeps/sparc/sparc32/soft-fp/q_div.c index 86db5ed9e9..bb4e697236 100644 --- a/sysdeps/sparc/sparc32/soft-fp/q_div.c +++ b/sysdeps/sparc/sparc32/soft-fp/q_div.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a / b - Copyright (C) 1997, 1999, 2006 Free Software Foundation, Inc. + Copyright (C) 1997,1999 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). @@ -35,5 +35,5 @@ long double _Q_div(const long double a, const long double b) FP_DIV_Q(C, A, B); FP_PACK_Q(c, C); FP_HANDLE_EXCEPTIONS; - return c; + return long double; } diff --git a/sysdeps/sparc/sparc32/soft-fp/q_dtoq.c b/sysdeps/sparc/sparc32/soft-fp/q_dtoq.c index 6b119f4501..5cac5c0840 100644 --- a/sysdeps/sparc/sparc32/soft-fp/q_dtoq.c +++ b/sysdeps/sparc/sparc32/soft-fp/q_dtoq.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return (long double)(a) - Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + Copyright (C) 1997,1999 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). @@ -32,13 +32,13 @@ long double _Q_dtoq(const double a) long double c; FP_INIT_ROUNDMODE; - FP_UNPACK_RAW_D(A, a); + FP_UNPACK_D(A, a); #if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q - FP_EXTEND(Q,D,4,2,C,A); + FP_CONV(Q,D,4,2,C,A); #else - FP_EXTEND(Q,D,2,1,C,A); + FP_CONV(Q,D,2,1,C,A); #endif - FP_PACK_RAW_Q(c, C); + FP_PACK_Q(c, C); FP_HANDLE_EXCEPTIONS; return c; } diff --git a/sysdeps/sparc/sparc32/soft-fp/q_itoq.c b/sysdeps/sparc/sparc32/soft-fp/q_itoq.c index b50942f75f..0010b3bcbf 100644 --- a/sysdeps/sparc/sparc32/soft-fp/q_itoq.c +++ b/sysdeps/sparc/sparc32/soft-fp/q_itoq.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return (long double)(a) - Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + Copyright (C) 1997,1999 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). @@ -30,8 +30,8 @@ long double _Q_itoq(const int a) int b = a; long double c; - FP_FROM_INT_Q(C, b, 32, unsigned int); - FP_PACK_RAW_Q(c, C); + FP_FROM_INT_Q(C, b, 32, int); + FP_PACK_Q(c, C); FP_CLEAR_EXCEPTIONS; FP_HANDLE_EXCEPTIONS; return c; diff --git a/sysdeps/sparc/sparc32/soft-fp/q_lltoq.c b/sysdeps/sparc/sparc32/soft-fp/q_lltoq.c deleted file mode 100644 index f977585e42..0000000000 --- a/sysdeps/sparc/sparc32/soft-fp/q_lltoq.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Software floating-point emulation. - Return (long double)a - 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 _Q_lltoq(const long long a) -{ - FP_DECL_EX; - FP_DECL_Q(C); - long double c; - long long b = a; - - FP_FROM_INT_Q(C, b, 64, unsigned long long); - FP_PACK_RAW_Q(c, C); - FP_CLEAR_EXCEPTIONS; - FP_HANDLE_EXCEPTIONS; - return c; -} diff --git a/sysdeps/sparc/sparc32/soft-fp/q_qtod.c b/sysdeps/sparc/sparc32/soft-fp/q_qtod.c index 82b01ec8a1..b0778476b8 100644 --- a/sysdeps/sparc/sparc32/soft-fp/q_qtod.c +++ b/sysdeps/sparc/sparc32/soft-fp/q_qtod.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return (double)a - Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + Copyright (C) 1997,1999 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). @@ -32,13 +32,13 @@ double _Q_qtod(const long double a) double r; FP_INIT_ROUNDMODE; - FP_UNPACK_SEMIRAW_Q(A, a); + FP_UNPACK_Q(A, a); #if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q - FP_TRUNC(D,Q,2,4,R,A); + FP_CONV(D,Q,2,4,R,A); #else - FP_TRUNC(D,Q,1,2,R,A); + FP_CONV(D,Q,1,2,R,A); #endif - FP_PACK_SEMIRAW_D(r, R); + FP_PACK_D(r, R); FP_HANDLE_EXCEPTIONS; return r; diff --git a/sysdeps/sparc/sparc32/soft-fp/q_qtoi.c b/sysdeps/sparc/sparc32/soft-fp/q_qtoi.c index 270ba9f677..0440e9abba 100644 --- a/sysdeps/sparc/sparc32/soft-fp/q_qtoi.c +++ b/sysdeps/sparc/sparc32/soft-fp/q_qtoi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return (int)a - Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + Copyright (C) 1997,1999 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). @@ -28,9 +28,9 @@ int _Q_qtoi(const long double a) { FP_DECL_EX; FP_DECL_Q(A); - unsigned int r; + int r; - FP_UNPACK_RAW_Q(A, a); + FP_UNPACK_Q(A, a); FP_TO_INT_Q(r, A, 32, 1); FP_HANDLE_EXCEPTIONS; diff --git a/sysdeps/sparc/sparc32/soft-fp/q_qtoll.c b/sysdeps/sparc/sparc32/soft-fp/q_qtoll.c deleted file mode 100644 index e0d29019b3..0000000000 --- a/sysdeps/sparc/sparc32/soft-fp/q_qtoll.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Software floating-point emulation. - Return (long long)a - 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. */ - -#define FP_ROUNDMODE FP_RND_ZERO -#include "soft-fp.h" -#include "quad.h" - -long long _Q_qtoll(const long double a) -{ - FP_DECL_EX; - FP_DECL_Q(A); - unsigned long long r; - - FP_UNPACK_RAW_Q(A, a); - FP_TO_INT_Q(r, A, 64, 1); - FP_HANDLE_EXCEPTIONS; - - return r; -} diff --git a/sysdeps/sparc/sparc32/soft-fp/q_qtos.c b/sysdeps/sparc/sparc32/soft-fp/q_qtos.c index 93daa23cac..31c8d6ac82 100644 --- a/sysdeps/sparc/sparc32/soft-fp/q_qtos.c +++ b/sysdeps/sparc/sparc32/soft-fp/q_qtos.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return (float)a - Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + Copyright (C) 1997,1999 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). @@ -32,13 +32,13 @@ float _Q_qtos(const long double a) float r; FP_INIT_ROUNDMODE; - FP_UNPACK_SEMIRAW_Q(A, a); + FP_UNPACK_Q(A, a); #if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q - FP_TRUNC(S,Q,1,4,R,A); + FP_CONV(S,Q,1,4,R,A); #else - FP_TRUNC(S,Q,1,2,R,A); + FP_CONV(S,Q,1,2,R,A); #endif - FP_PACK_SEMIRAW_S(r, R); + FP_PACK_S(r, R); FP_HANDLE_EXCEPTIONS; return r; diff --git a/sysdeps/sparc/sparc32/soft-fp/q_qtou.c b/sysdeps/sparc/sparc32/soft-fp/q_qtou.c deleted file mode 100644 index 812b4e06ea..0000000000 --- a/sysdeps/sparc/sparc32/soft-fp/q_qtou.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Software floating-point emulation. - Return (unsigned int)a - 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. */ - -#define FP_ROUNDMODE FP_RND_ZERO -#include "soft-fp.h" -#include "quad.h" - -unsigned int _Q_qtou(const long double a) -{ - FP_DECL_EX; - FP_DECL_Q(A); - unsigned int r; - - FP_UNPACK_RAW_Q(A, a); - FP_TO_INT_Q(r, A, 32, -1); - FP_HANDLE_EXCEPTIONS; - - return r; -} diff --git a/sysdeps/sparc/sparc32/soft-fp/q_qtoui.c b/sysdeps/sparc/sparc32/soft-fp/q_qtoui.c new file mode 100644 index 0000000000..bdbf052e09 --- /dev/null +++ b/sysdeps/sparc/sparc32/soft-fp/q_qtoui.c @@ -0,0 +1,38 @@ +/* Software floating-point emulation. + Return (unsigned int)a + Copyright (C) 1997,1999 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. */ + +#define FP_ROUNDMODE FP_RND_ZERO +#include "soft-fp.h" +#include "quad.h" + +unsigned int _Q_qtoui(const long double a) +{ + FP_DECL_EX; + FP_DECL_Q(A); + unsigned int r; + + FP_UNPACK_Q(A, a); + FP_TO_INT_Q(r, A, 32, -1); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/sysdeps/sparc/sparc32/soft-fp/q_qtoull.c b/sysdeps/sparc/sparc32/soft-fp/q_qtoull.c deleted file mode 100644 index 7a88c9f382..0000000000 --- a/sysdeps/sparc/sparc32/soft-fp/q_qtoull.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Software floating-point emulation. - Return (unsigned long long)a - 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. */ - -#define FP_ROUNDMODE FP_RND_ZERO -#include "soft-fp.h" -#include "quad.h" - -unsigned long long _Q_qtoull(const long double a) -{ - FP_DECL_EX; - FP_DECL_Q(A); - unsigned long long r; - - FP_UNPACK_RAW_Q(A, a); - FP_TO_INT_Q(r, A, 64, -1); - FP_HANDLE_EXCEPTIONS; - - return r; -} diff --git a/sysdeps/sparc/sparc32/soft-fp/q_qtoux.c b/sysdeps/sparc/sparc32/soft-fp/q_qtoux.c new file mode 100644 index 0000000000..3e6d40f220 --- /dev/null +++ b/sysdeps/sparc/sparc32/soft-fp/q_qtoux.c @@ -0,0 +1,38 @@ +/* Software floating-point emulation. + Return (unsigned long)a + Copyright (C) 1997,1999 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. */ + +#define FP_ROUNDMODE FP_RND_ZERO +#include "soft-fp.h" +#include "quad.h" + +unsigned long long _Q_qtoux(const long double a) +{ + FP_DECL_EX; + FP_DECL_Q(A); + unsigned long long r; + + FP_UNPACK_Q(A, a); + FP_TO_INT_Q(r, A, 64, -1); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/sysdeps/sparc/sparc32/soft-fp/q_qtox.c b/sysdeps/sparc/sparc32/soft-fp/q_qtox.c new file mode 100644 index 0000000000..108373328e --- /dev/null +++ b/sysdeps/sparc/sparc32/soft-fp/q_qtox.c @@ -0,0 +1,38 @@ +/* Software floating-point emulation. + Return (long)a + Copyright (C) 1997,1999 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. */ + +#define FP_ROUNDMODE FP_RND_ZERO +#include "soft-fp.h" +#include "quad.h" + +long long _Q_qtox(const long double a) +{ + FP_DECL_EX; + FP_DECL_Q(A); + long long r; + + FP_UNPACK_Q(A, a); + FP_TO_INT_Q(r, A, 64, 1); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/sysdeps/sparc/sparc32/soft-fp/q_sqrt.c b/sysdeps/sparc/sparc32/soft-fp/q_sqrt.c index 373d02a639..7516ed7c5c 100644 --- a/sysdeps/sparc/sparc32/soft-fp/q_sqrt.c +++ b/sysdeps/sparc/sparc32/soft-fp/q_sqrt.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return sqrtl(a) - Copyright (C) 1997, 1999, 2006 Free Software Foundation, Inc. + Copyright (C) 1997,1999 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). @@ -36,4 +36,3 @@ long double _Q_sqrt(const long double a) FP_HANDLE_EXCEPTIONS; return c; } -strong_alias (_Q_sqrt, __ieee754_sqrtl); diff --git a/sysdeps/sparc/sparc32/soft-fp/q_stoq.c b/sysdeps/sparc/sparc32/soft-fp/q_stoq.c index 714d880dd7..98609faf20 100644 --- a/sysdeps/sparc/sparc32/soft-fp/q_stoq.c +++ b/sysdeps/sparc/sparc32/soft-fp/q_stoq.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. c = (long double)(a) - Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + Copyright (C) 1997,1999 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). @@ -31,13 +31,13 @@ long double _Q_stoq(const float a) FP_DECL_Q(C); long double c; - FP_UNPACK_RAW_S(A, a); + FP_UNPACK_S(A, a); #if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q - FP_EXTEND(Q,S,4,1,C,A); + FP_CONV(Q,S,4,1,C,A); #else - FP_EXTEND(Q,S,2,1,C,A); + FP_CONV(Q,S,2,1,C,A); #endif - FP_PACK_RAW_Q(c, C); + FP_PACK_Q(c, C); FP_HANDLE_EXCEPTIONS; return c; } diff --git a/sysdeps/sparc/sparc32/soft-fp/q_sub.c b/sysdeps/sparc/sparc32/soft-fp/q_sub.c index 8616727bb1..1987aea480 100644 --- a/sysdeps/sparc/sparc32/soft-fp/q_sub.c +++ b/sysdeps/sparc/sparc32/soft-fp/q_sub.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. c = a - b - Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + Copyright (C) 1997,1999 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). @@ -30,10 +30,10 @@ long double _Q_sub(const long double a, const long double b) long double c; FP_INIT_ROUNDMODE; - FP_UNPACK_SEMIRAW_Q(A, a); - FP_UNPACK_SEMIRAW_Q(B, b); + FP_UNPACK_Q(A, a); + FP_UNPACK_Q(B, b); FP_SUB_Q(C, A, B); - FP_PACK_SEMIRAW_Q(c, C); + FP_PACK_Q(c, C); FP_HANDLE_EXCEPTIONS; return c; } diff --git a/sysdeps/sparc/sparc32/soft-fp/q_uitoq.c b/sysdeps/sparc/sparc32/soft-fp/q_uitoq.c new file mode 100644 index 0000000000..b716fabde2 --- /dev/null +++ b/sysdeps/sparc/sparc32/soft-fp/q_uitoq.c @@ -0,0 +1,38 @@ +/* Software floating-point emulation. + c = (long double)(a) + Copyright (C) 1997,1999 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 _Q_uitoq(const unsigned int a) +{ + FP_DECL_EX; + FP_DECL_Q(C); + long double c; + unsigned int b = a; + + FP_FROM_INT_Q(C, b, 32, int); + FP_PACK_Q(c, C); + FP_CLEAR_EXCEPTIONS; + FP_HANDLE_EXCEPTIONS; + return c; +} diff --git a/sysdeps/sparc/sparc32/soft-fp/q_ulltoq.c b/sysdeps/sparc/sparc32/soft-fp/q_ulltoq.c deleted file mode 100644 index 53c0add2d8..0000000000 --- a/sysdeps/sparc/sparc32/soft-fp/q_ulltoq.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Software floating-point emulation. - Return (long double)(a) - 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 _Q_ulltoq(const unsigned long long a) -{ - FP_DECL_EX; - FP_DECL_Q(C); - long double c; - unsigned long long b = a; - - FP_FROM_INT_Q(C, b, 64, unsigned long long); - FP_PACK_RAW_Q(c, C); - FP_CLEAR_EXCEPTIONS; - FP_HANDLE_EXCEPTIONS; - return c; -} diff --git a/sysdeps/sparc/sparc32/soft-fp/q_utoq.c b/sysdeps/sparc/sparc32/soft-fp/q_utoq.c deleted file mode 100644 index f902bf8397..0000000000 --- a/sysdeps/sparc/sparc32/soft-fp/q_utoq.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Software floating-point emulation. - c = (long double)(a) - 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 _Q_utoq(const unsigned int a) -{ - FP_DECL_EX; - FP_DECL_Q(C); - long double c; - unsigned int b = a; - - FP_FROM_INT_Q(C, b, 32, unsigned int); - FP_PACK_RAW_Q(c, C); - FP_CLEAR_EXCEPTIONS; - FP_HANDLE_EXCEPTIONS; - return c; -} diff --git a/sysdeps/sparc/sparc32/soft-fp/q_uxtoq.c b/sysdeps/sparc/sparc32/soft-fp/q_uxtoq.c new file mode 100644 index 0000000000..8944e9614d --- /dev/null +++ b/sysdeps/sparc/sparc32/soft-fp/q_uxtoq.c @@ -0,0 +1,38 @@ +/* Software floating-point emulation. + Return (long double)(a) + Copyright (C) 1997,1999 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 _Q_uxtoq(const unsigned long long a) +{ + FP_DECL_EX; + FP_DECL_Q(C); + long double c; + unsigned long long b = a; + + FP_FROM_INT_Q(C, b, 64, long long); + FP_PACK_Q(c, C); + FP_CLEAR_EXCEPTIONS; + FP_HANDLE_EXCEPTIONS; + return c; +} diff --git a/sysdeps/sparc/sparc32/soft-fp/q_xtoq.c b/sysdeps/sparc/sparc32/soft-fp/q_xtoq.c new file mode 100644 index 0000000000..867ef27131 --- /dev/null +++ b/sysdeps/sparc/sparc32/soft-fp/q_xtoq.c @@ -0,0 +1,38 @@ +/* Software floating-point emulation. + Return (long double)a + Copyright (C) 1997,1999 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 _Q_xtoq(const long long a) +{ + FP_DECL_EX; + FP_DECL_Q(C); + long double c; + long long b = a; + + FP_FROM_INT_Q(C, b, 64, long long); + FP_PACK_Q(c, C); + FP_CLEAR_EXCEPTIONS; + FP_HANDLE_EXCEPTIONS; + return c; +} diff --git a/sysdeps/sparc/sparc32/soft-fp/sfp-machine.h b/sysdeps/sparc/sparc32/soft-fp/sfp-machine.h index f1211705ef..40bcbb4762 100644 --- a/sysdeps/sparc/sparc32/soft-fp/sfp-machine.h +++ b/sysdeps/sparc/sparc32/soft-fp/sfp-machine.h @@ -1,6 +1,6 @@ /* Machine-dependent software floating-point definitions. Sparc userland (_Q_*) version. - Copyright (C) 1997,1998,1999, 2002, 2006 Free Software Foundation, Inc. + Copyright (C) 1997,1998,1999, 2002 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) and @@ -22,7 +22,6 @@ 02111-1307 USA. */ #include -#include #define _FP_W_TYPE_SIZE 32 #define _FP_W_TYPE unsigned long @@ -209,5 +208,14 @@ do { \ " : : "r" (___Q_numbers) : "f30"); \ } \ else \ - ___Q_simulate_exceptions (_fex); \ + { \ + __asm__ __volatile__("\ + mov %0, %%o0\n\ + mov %%o7, %%g1\n\ + call ___Q_simulate_exceptions\n\ + mov %%g1, %%o7\ + " : : "r" (_fex) : \ + "g1", "g2", "g3", "g4", "g5", "o0", \ + "o1", "o2", "o3", "o4", "o5", "cc"); \ + } \ } while (0) -- cgit v1.2.1