summaryrefslogtreecommitdiff
path: root/soft-fp/sysdeps/sparc/sparc32
diff options
context:
space:
mode:
Diffstat (limited to 'soft-fp/sysdeps/sparc/sparc32')
-rw-r--r--soft-fp/sysdeps/sparc/sparc32/q_qtod.c45
-rw-r--r--soft-fp/sysdeps/sparc/sparc32/q_qtoi.c38
-rw-r--r--soft-fp/sysdeps/sparc/sparc32/q_qtos.c45
-rw-r--r--soft-fp/sysdeps/sparc/sparc32/q_qtoui.c38
-rw-r--r--soft-fp/sysdeps/sparc/sparc32/q_qtoux.c38
-rw-r--r--soft-fp/sysdeps/sparc/sparc32/q_qtox.c38
-rw-r--r--soft-fp/sysdeps/sparc/sparc32/q_sqrt.c38
-rw-r--r--soft-fp/sysdeps/sparc/sparc32/q_stoq.c43
-rw-r--r--soft-fp/sysdeps/sparc/sparc32/q_sub.c39
-rw-r--r--soft-fp/sysdeps/sparc/sparc32/q_uitoq.c38
-rw-r--r--soft-fp/sysdeps/sparc/sparc32/q_util.c57
-rw-r--r--soft-fp/sysdeps/sparc/sparc32/q_uxtoq.c38
-rw-r--r--soft-fp/sysdeps/sparc/sparc32/q_xtoq.c38
-rw-r--r--soft-fp/sysdeps/sparc/sparc32/sfp-machine.h221
14 files changed, 0 insertions, 754 deletions
diff --git a/soft-fp/sysdeps/sparc/sparc32/q_qtod.c b/soft-fp/sysdeps/sparc/sparc32/q_qtod.c
deleted file mode 100644
index 92874502ea..0000000000
--- a/soft-fp/sysdeps/sparc/sparc32/q_qtod.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Software floating-point emulation.
- Return (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 Library General Public License as
- published by the Free Software Foundation; either version 2 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. 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"
-#include "quad.h"
-
-double _Q_qtod(const long double a)
-{
- FP_DECL_EX;
- FP_DECL_Q(A);
- FP_DECL_D(R);
- double r;
-
- FP_INIT_ROUNDMODE;
- FP_UNPACK_Q(A, a);
-#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
- FP_CONV(D,Q,2,4,R,A);
-#else
- FP_CONV(D,Q,1,2,R,A);
-#endif
- FP_PACK_D(r, R);
- FP_HANDLE_EXCEPTIONS;
-
- return r;
-}
diff --git a/soft-fp/sysdeps/sparc/sparc32/q_qtoi.c b/soft-fp/sysdeps/sparc/sparc32/q_qtoi.c
deleted file mode 100644
index b472364cdb..0000000000
--- a/soft-fp/sysdeps/sparc/sparc32/q_qtoi.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Software floating-point emulation.
- Return (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 Library General Public License as
- published by the Free Software Foundation; either version 2 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. 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"
-
-int _Q_qtoi(const long double a)
-{
- FP_DECL_EX;
- FP_DECL_Q(A);
- int r;
-
- FP_UNPACK_Q(A, a);
- FP_TO_INT_Q(r, A, 32, 1);
- FP_HANDLE_EXCEPTIONS;
-
- return r;
-}
diff --git a/soft-fp/sysdeps/sparc/sparc32/q_qtos.c b/soft-fp/sysdeps/sparc/sparc32/q_qtos.c
deleted file mode 100644
index b0945cb318..0000000000
--- a/soft-fp/sysdeps/sparc/sparc32/q_qtos.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Software floating-point emulation.
- Return (float)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 Library General Public License as
- published by the Free Software Foundation; either version 2 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. 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"
-#include "quad.h"
-
-float _Q_qtos(const long double a)
-{
- FP_DECL_EX;
- FP_DECL_Q(A);
- FP_DECL_S(R);
- float r;
-
- FP_INIT_ROUNDMODE;
- FP_UNPACK_Q(A, a);
-#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
- FP_CONV(S,Q,1,4,R,A);
-#else
- FP_CONV(S,Q,1,2,R,A);
-#endif
- FP_PACK_S(r, R);
- FP_HANDLE_EXCEPTIONS;
-
- return r;
-}
diff --git a/soft-fp/sysdeps/sparc/sparc32/q_qtoui.c b/soft-fp/sysdeps/sparc/sparc32/q_qtoui.c
deleted file mode 100644
index c2de37f15e..0000000000
--- a/soft-fp/sysdeps/sparc/sparc32/q_qtoui.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* 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 Library General Public License as
- published by the Free Software Foundation; either version 2 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. 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/soft-fp/sysdeps/sparc/sparc32/q_qtoux.c b/soft-fp/sysdeps/sparc/sparc32/q_qtoux.c
deleted file mode 100644
index ff1e1a9edb..0000000000
--- a/soft-fp/sysdeps/sparc/sparc32/q_qtoux.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* 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 Library General Public License as
- published by the Free Software Foundation; either version 2 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. 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/soft-fp/sysdeps/sparc/sparc32/q_qtox.c b/soft-fp/sysdeps/sparc/sparc32/q_qtox.c
deleted file mode 100644
index ba591606dc..0000000000
--- a/soft-fp/sysdeps/sparc/sparc32/q_qtox.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* 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 Library General Public License as
- published by the Free Software Foundation; either version 2 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. 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/soft-fp/sysdeps/sparc/sparc32/q_sqrt.c b/soft-fp/sysdeps/sparc/sparc32/q_sqrt.c
deleted file mode 100644
index 2f759284a0..0000000000
--- a/soft-fp/sysdeps/sparc/sparc32/q_sqrt.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Software floating-point emulation.
- Return sqrtl(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 Library General Public License as
- published by the Free Software Foundation; either version 2 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. 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_sqrt(const long double a)
-{
- FP_DECL_EX;
- FP_DECL_Q(A); FP_DECL_Q(C);
- long double c;
-
- FP_INIT_ROUNDMODE;
- FP_UNPACK_Q(A, a);
- FP_SQRT_Q(C, A);
- FP_PACK_Q(c, C);
- FP_HANDLE_EXCEPTIONS;
- return c;
-}
diff --git a/soft-fp/sysdeps/sparc/sparc32/q_stoq.c b/soft-fp/sysdeps/sparc/sparc32/q_stoq.c
deleted file mode 100644
index ad5153da3c..0000000000
--- a/soft-fp/sysdeps/sparc/sparc32/q_stoq.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* 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 Library General Public License as
- published by the Free Software Foundation; either version 2 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. 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"
-#include "quad.h"
-
-long double _Q_stoq(const float a)
-{
- FP_DECL_EX;
- FP_DECL_S(A);
- FP_DECL_Q(C);
- long double c;
-
- FP_UNPACK_S(A, a);
-#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
- FP_CONV(Q,S,4,1,C,A);
-#else
- FP_CONV(Q,S,2,1,C,A);
-#endif
- FP_PACK_Q(c, C);
- FP_HANDLE_EXCEPTIONS;
- return c;
-}
diff --git a/soft-fp/sysdeps/sparc/sparc32/q_sub.c b/soft-fp/sysdeps/sparc/sparc32/q_sub.c
deleted file mode 100644
index 2cfd49d26a..0000000000
--- a/soft-fp/sysdeps/sparc/sparc32/q_sub.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Software floating-point emulation.
- c = a - b
- 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 Library General Public License as
- published by the Free Software Foundation; either version 2 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. 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_sub(const long double a, const long double b)
-{
- FP_DECL_EX;
- FP_DECL_Q(A); FP_DECL_Q(B); FP_DECL_Q(C);
- long double c;
-
- FP_INIT_ROUNDMODE;
- FP_UNPACK_Q(A, a);
- FP_UNPACK_Q(B, b);
- FP_SUB_Q(C, A, B);
- FP_PACK_Q(c, C);
- FP_HANDLE_EXCEPTIONS;
- return c;
-}
diff --git a/soft-fp/sysdeps/sparc/sparc32/q_uitoq.c b/soft-fp/sysdeps/sparc/sparc32/q_uitoq.c
deleted file mode 100644
index 8a3c664f1d..0000000000
--- a/soft-fp/sysdeps/sparc/sparc32/q_uitoq.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* 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 Library General Public License as
- published by the Free Software Foundation; either version 2 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. 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/soft-fp/sysdeps/sparc/sparc32/q_util.c b/soft-fp/sysdeps/sparc/sparc32/q_util.c
deleted file mode 100644
index df4d16c019..0000000000
--- a/soft-fp/sysdeps/sparc/sparc32/q_util.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Software floating-point emulation.
- Helper routine for _Q_* routines.
- Simulate exceptions using double arithmetics.
- Copyright (C) 1999 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by 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 Library General Public License as
- published by the Free Software Foundation; either version 2 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If
- not, write to the Free Software Foundation, Inc.,
- 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include "soft-fp.h"
-
-unsigned long long ___Q_numbers [] = {
-0x0000000000000000ULL, /* Zero */
-0x0010100000000000ULL, /* Very tiny number */
-0x0010000000000000ULL, /* Minimum normalized number */
-0x7fef000000000000ULL, /* A huge double number */
-};
-
-double ___Q_simulate_exceptions(int exceptions)
-{
- double d, *p = (double *)___Q_numbers;
- if (exceptions & FP_EX_INVALID)
- d = p[0]/p[0];
- if (exceptions & FP_EX_OVERFLOW)
- {
- d = p[3] + p[3];
- exceptions &= ~FP_EX_INEXACT;
- }
- if (exceptions & FP_EX_UNDERFLOW)
- {
- if (exceptions & FP_EX_INEXACT)
- {
- d = p[2] * p[2];
- exceptions &= ~FP_EX_INEXACT;
- }
- else
- d = p[1] - p[2];
- }
- if (exceptions & FP_EX_DIVZERO)
- d = 1.0/p[0];
- if (exceptions & FP_EX_INEXACT)
- d = p[3] - p[2];
- return d;
-}
diff --git a/soft-fp/sysdeps/sparc/sparc32/q_uxtoq.c b/soft-fp/sysdeps/sparc/sparc32/q_uxtoq.c
deleted file mode 100644
index ee68ca2563..0000000000
--- a/soft-fp/sysdeps/sparc/sparc32/q_uxtoq.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* 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 Library General Public License as
- published by the Free Software Foundation; either version 2 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. 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/soft-fp/sysdeps/sparc/sparc32/q_xtoq.c b/soft-fp/sysdeps/sparc/sparc32/q_xtoq.c
deleted file mode 100644
index 3dd70b9329..0000000000
--- a/soft-fp/sysdeps/sparc/sparc32/q_xtoq.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* 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 Library General Public License as
- published by the Free Software Foundation; either version 2 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. 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/soft-fp/sysdeps/sparc/sparc32/sfp-machine.h b/soft-fp/sysdeps/sparc/sparc32/sfp-machine.h
deleted file mode 100644
index d3713b96d7..0000000000
--- a/soft-fp/sysdeps/sparc/sparc32/sfp-machine.h
+++ /dev/null
@@ -1,221 +0,0 @@
-/* Machine-dependent software floating-point definitions.
- Sparc userland (_Q_*) version.
- Copyright (C) 1997,1998,1999 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
- David S. Miller (davem@redhat.com).
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If
- not, write to the Free Software Foundation, Inc.,
- 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include <fpu_control.h>
-
-#define _FP_W_TYPE_SIZE 32
-#define _FP_W_TYPE unsigned long
-#define _FP_WS_TYPE signed long
-#define _FP_I_TYPE long
-
-#define _FP_MUL_MEAT_S(R,X,Y) \
- _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
-#define _FP_MUL_MEAT_D(R,X,Y) \
- _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
-#define _FP_MUL_MEAT_Q(R,X,Y) \
- _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
-
-#define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_udiv(S,R,X,Y)
-#define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_2_udiv(D,R,X,Y)
-#define _FP_DIV_MEAT_Q(R,X,Y) _FP_DIV_MEAT_4_udiv(Q,R,X,Y)
-
-#define _FP_NANFRAC_S ((_FP_QNANBIT_S << 1) - 1)
-#define _FP_NANFRAC_D ((_FP_QNANBIT_D << 1) - 1), -1
-#define _FP_NANFRAC_Q ((_FP_QNANBIT_Q << 1) - 1), -1, -1, -1
-#define _FP_NANSIGN_S 0
-#define _FP_NANSIGN_D 0
-#define _FP_NANSIGN_Q 0
-
-#define _FP_KEEPNANFRACP 1
-
-/* If one NaN is signaling and the other is not,
- * we choose that one, otherwise we choose X.
- */
-/* For _Qp_* and _Q_*, this should prefer X, for
- * CPU instruction emulation this should prefer Y.
- * (see SPAMv9 B.2.2 section).
- */
-#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \
- do { \
- if ((_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs) \
- && !(_FP_FRAC_HIGH_RAW_##fs(Y) & _FP_QNANBIT_##fs)) \
- { \
- R##_s = Y##_s; \
- _FP_FRAC_COPY_##wc(R,Y); \
- } \
- else \
- { \
- R##_s = X##_s; \
- _FP_FRAC_COPY_##wc(R,X); \
- } \
- R##_c = FP_CLS_NAN; \
- } while (0)
-
-/* Some assembly to speed things up. */
-#define __FP_FRAC_ADD_3(r2,r1,r0,x2,x1,x0,y2,y1,y0) \
- __asm__ ("addcc %r7,%8,%2
- addxcc %r5,%6,%1
- addx %r3,%4,%0" \
- : "=r" ((USItype)(r2)), \
- "=&r" ((USItype)(r1)), \
- "=&r" ((USItype)(r0)) \
- : "%rJ" ((USItype)(x2)), \
- "rI" ((USItype)(y2)), \
- "%rJ" ((USItype)(x1)), \
- "rI" ((USItype)(y1)), \
- "%rJ" ((USItype)(x0)), \
- "rI" ((USItype)(y0)) \
- : "cc")
-
-#define __FP_FRAC_SUB_3(r2,r1,r0,x2,x1,x0,y2,y1,y0) \
- __asm__ ("subcc %r7,%8,%2
- subxcc %r5,%6,%1
- subx %r3,%4,%0" \
- : "=r" ((USItype)(r2)), \
- "=&r" ((USItype)(r1)), \
- "=&r" ((USItype)(r0)) \
- : "%rJ" ((USItype)(x2)), \
- "rI" ((USItype)(y2)), \
- "%rJ" ((USItype)(x1)), \
- "rI" ((USItype)(y1)), \
- "%rJ" ((USItype)(x0)), \
- "rI" ((USItype)(y0)) \
- : "cc")
-
-#define __FP_FRAC_ADD_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0) \
- do { \
- /* We need to fool gcc, as we need to pass more than 10 \
- input/outputs. */ \
- register USItype _t1 __asm__ ("g1"), _t2 __asm__ ("g2"); \
- __asm__ __volatile__ ("
- addcc %r8,%9,%1
- addxcc %r6,%7,%0
- addxcc %r4,%5,%%g2
- addx %r2,%3,%%g1" \
- : "=&r" ((USItype)(r1)), \
- "=&r" ((USItype)(r0)) \
- : "%rJ" ((USItype)(x3)), \
- "rI" ((USItype)(y3)), \
- "%rJ" ((USItype)(x2)), \
- "rI" ((USItype)(y2)), \
- "%rJ" ((USItype)(x1)), \
- "rI" ((USItype)(y1)), \
- "%rJ" ((USItype)(x0)), \
- "rI" ((USItype)(y0)) \
- : "cc", "g1", "g2"); \
- __asm__ __volatile__ ("" : "=r" (_t1), "=r" (_t2)); \
- r3 = _t1; r2 = _t2; \
- } while (0)
-
-#define __FP_FRAC_SUB_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0) \
- do { \
- /* We need to fool gcc, as we need to pass more than 10 \
- input/outputs. */ \
- register USItype _t1 __asm__ ("g1"), _t2 __asm__ ("g2"); \
- __asm__ __volatile__ ("
- subcc %r8,%9,%1
- subxcc %r6,%7,%0
- subxcc %r4,%5,%%g2
- subx %r2,%3,%%g1" \
- : "=&r" ((USItype)(r1)), \
- "=&r" ((USItype)(r0)) \
- : "%rJ" ((USItype)(x3)), \
- "rI" ((USItype)(y3)), \
- "%rJ" ((USItype)(x2)), \
- "rI" ((USItype)(y2)), \
- "%rJ" ((USItype)(x1)), \
- "rI" ((USItype)(y1)), \
- "%rJ" ((USItype)(x0)), \
- "rI" ((USItype)(y0)) \
- : "cc", "g1", "g2"); \
- __asm__ __volatile__ ("" : "=r" (_t1), "=r" (_t2)); \
- r3 = _t1; r2 = _t2; \
- } while (0)
-
-#define __FP_FRAC_DEC_3(x2,x1,x0,y2,y1,y0) __FP_FRAC_SUB_3(x2,x1,x0,x2,x1,x0,y2,y1,y0)
-
-#define __FP_FRAC_DEC_4(x3,x2,x1,x0,y3,y2,y1,y0) __FP_FRAC_SUB_4(x3,x2,x1,x0,x3,x2,x1,x0,y3,y2,y1,y0)
-
-#define __FP_FRAC_ADDI_4(x3,x2,x1,x0,i) \
- __asm__ ("addcc %3,%4,%3
- addxcc %2,%%g0,%2
- addxcc %1,%%g0,%1
- addx %0,%%g0,%0" \
- : "=&r" ((USItype)(x3)), \
- "=&r" ((USItype)(x2)), \
- "=&r" ((USItype)(x1)), \
- "=&r" ((USItype)(x0)) \
- : "rI" ((USItype)(i)), \
- "0" ((USItype)(x3)), \
- "1" ((USItype)(x2)), \
- "2" ((USItype)(x1)), \
- "3" ((USItype)(x0)) \
- : "cc")
-
-/* Obtain the current rounding mode. */
-#ifndef FP_ROUNDMODE
-#define FP_ROUNDMODE ((_fcw >> 30) & 0x3)
-#endif
-
-/* Exception flags. */
-#define FP_EX_INVALID (1 << 4)
-#define FP_EX_OVERFLOW (1 << 3)
-#define FP_EX_UNDERFLOW (1 << 2)
-#define FP_EX_DIVZERO (1 << 1)
-#define FP_EX_INEXACT (1 << 0)
-
-#define _FP_DECL_EX fpu_control_t _fcw
-
-#define FP_INIT_ROUNDMODE \
-do { \
- _FPU_GETCW(_fcw); \
-} while (0)
-
-/* Simulate exceptions using double arithmetics. */
-extern double ___Q_simulate_exceptions(int exc);
-
-#define FP_HANDLE_EXCEPTIONS \
-do { \
- if (!_fex) \
- { \
- /* This is the common case, so we do it inline. \
- * We need to clear cexc bits if any. \
- */ \
- extern unsigned long long ___Q_numbers[]; \
- __asm__ __volatile__("
- ldd [%0], %%f30
- faddd %%f30, %%f30, %%f30
- " : : "r" (___Q_numbers) : "f30"); \
- } \
- else \
- { \
- __asm__ __volatile__("
- mov %0, %%o0
- mov %%o7, %%g1
- call ___Q_simulate_exceptions
- mov %%g1, %%o7
- " : : "r" (_fex) : \
- "g1", "g2", "g3", "g4", "g5", "o0", \
- "o1", "o2", "o3", "o4", "o5", "cc"); \
- } \
-} while (0)