This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH][stage2 project] Sub-Target specific math routines library
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 17 Jan 2006 17:53:18 +0100 (CET)
- Subject: [PATCH][stage2 project] Sub-Target specific math routines library
This is a preview-post and overview of the stage2 project named
"Sub-Target specific math routines library". The features it will enable
are SSE(2) ABI (and implementation) transcendental functions for ia32
and vectorized transcendental functions (i.e sin(v2df), etc.) for x86_64.
A new toplevel library is added which is expected to host architecture
and/or gcc specific math routines, thus I named it libgccm (originally
it was called libsse2, which you may remember). The structure of the
library is as follows
libgccm/
flt-32/
C source for math transcendentals, from glibc
dbl-64/
C source for math transcendentals, from glibc
i386/
i386 architecture specific routines and makefiles. Here the
SSE(2) ABI math routines are built (currently) from the source
in flt-32 and dbl-64.
x86_64/
x86_64 architecture specific routines and makefiles. Here the
vectorized intrinsics will be built from assembly and C support
files.
There's only a toplevel configure which decides which directories to
build in. The subdirs build convenience libraries that are linked
together by the toplevel make to libgccm and get versioned there.
What I know is still to be done is add proper copyright notices to
the flt-32 and dbl-64 files, where they are missing, likewise for the
i386 wrappers.
The following patch includes the toplevel and gcc/ changes and the
main parts of libgccm (but only one sample file from flt-32 and dbl-64
to make the patch smaller). The x86_64 parts are missing for now,
they will be posted separately with the patch utilizing the vectorized
intrinsics. A tarball with a drop-in for the libgccm toplevel directory
is placed at http://www.suse.de/~rguenther/libgccm.tgz
I really like to have some feedback on the overall structure of the
library and the SSE2 ABI parts. A patch enabling the use of the SSE2
ABI routines will follow.
Thanks,
Richard.
2006-01-17 Richard Guenther <rguenther@suse.de>
* gcc.c (LINK_GCCM_SPEC): Define.
(LINK_COMMAND_SPEC): Add %(link_gccm).
(link_gccm_spec): New global static.
(static_specs): Add link_gccm_spec.
* Makefile.def (target_modules): Add libgccm target module.
* configure.in (target_libraries): Add libgccm target library.
(--enable-libgccm): New configure switch.
* libgccm: New toplevel directory.
* configure.ac: New file.
* Makefile.am: Likewise.
* flt-32/*: Import from glibc.
* dbl-64/*: Likewise.
* i386: New subdirectory.
* i386/sse_*.c: New files wrapping flt-32.
* i386/sse2_*.c: New files wrapping dbl-64.
* i386/sse2.map: Linker script for SSE2 ABI math intrinsics.
Index: gcc/gcc.c
===================================================================
*** gcc/gcc.c (revision 109816)
--- gcc/gcc.c (working copy)
*************** proper position among the other output f
*** 679,684 ****
--- 679,688 ----
#endif
#endif
+ #ifndef LINK_GCCM_SPEC
+ #define LINK_GCCM_SPEC ""
+ #endif
+
#ifndef LINK_PIE_SPEC
#ifdef HAVE_LD_PIE
#define LINK_PIE_SPEC "%{pie:-pie} "
*************** proper position among the other output f
*** 700,706 ****
%{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
%{static:} %{L*} %(mfwrap) %(link_libgcc) %o %(mflib)\
%{fprofile-arcs|fprofile-generate|coverage:-lgcov}\
! %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}\
%{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}"
#endif
--- 704,710 ----
%{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
%{static:} %{L*} %(mfwrap) %(link_libgcc) %o %(mflib)\
%{fprofile-arcs|fprofile-generate|coverage:-lgcov}\
! %{!nostdlib:%{!nodefaultlibs:%(link_gccm) %(link_ssp) %(link_gcc_c_sequence)}}\
%{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}"
#endif
*************** static const char *cc1_spec = CC1_SPEC;
*** 731,736 ****
--- 735,741 ----
static const char *cc1plus_spec = CC1PLUS_SPEC;
static const char *link_gcc_c_sequence_spec = LINK_GCC_C_SEQUENCE_SPEC;
static const char *link_ssp_spec = LINK_SSP_SPEC;
+ static const char *link_gccm_spec = LINK_GCCM_SPEC;
static const char *asm_spec = ASM_SPEC;
static const char *asm_final_spec = ASM_FINAL_SPEC;
static const char *link_spec = LINK_SPEC;
*************** static struct spec_list static_specs[] =
*** 1529,1534 ****
--- 1534,1540 ----
INIT_STATIC_SPEC ("cc1plus", &cc1plus_spec),
INIT_STATIC_SPEC ("link_gcc_c_sequence", &link_gcc_c_sequence_spec),
INIT_STATIC_SPEC ("link_ssp", &link_ssp_spec),
+ INIT_STATIC_SPEC ("link_gccm", &link_gccm_spec),
INIT_STATIC_SPEC ("endfile", &endfile_spec),
INIT_STATIC_SPEC ("link", &link_spec),
INIT_STATIC_SPEC ("lib", &lib_spec),
Index: Makefile.def
===================================================================
*** Makefile.def (revision 109816)
--- Makefile.def (working copy)
*************** host_modules= { module= gnattools; };
*** 117,122 ****
--- 117,123 ----
target_modules = { module= libstdc++-v3; lib_path=.libs; raw_cxx=true; };
target_modules = { module= libmudflap; lib_path=.libs; };
target_modules = { module= libssp; lib_path=.libs; };
+ target_modules = { module= libgccm; lib_path=.libs; };
target_modules = { module= newlib; };
target_modules = { module= libgfortran; };
target_modules = { module= libobjc; };
Index: configure.in
===================================================================
*** configure.in (revision 109816)
--- configure.in (working copy)
*************** target_libraries="target-libiberty \
*** 148,153 ****
--- 148,154 ----
target-libstdc++-v3 \
target-libmudflap \
target-libssp \
+ target-libgccm \
target-libgfortran \
${libgcj} \
target-libobjc \
*************** if test "${ENABLE_LIBSSP}" != "yes" ; th
*** 315,320 ****
--- 316,338 ----
noconfigdirs="$noconfigdirs target-libssp"
fi
+ # Set the default so we build libgccm for ix86 and x86_64
+ case "${target}" in
+ i?86-*)
+ libgccmdefault=yes ;;
+ x86_64-*)
+ libgccmdefault=yes ;;
+ *)
+ libgccmdefault=no ;;
+ esac
+ AC_ARG_ENABLE(libgccm,
+ [ --enable-libgccm Builds libgccm directory],
+ ENABLE_LIBGCCM=$enableval,
+ ENABLE_LIBGCCM=$libgccmdefault)
+ if test "${ENABLE_LIBGCCM}" != "yes"; then
+ noconfigdirs="$noconfigdirs target-libgccm"
+ fi
+
# Save it here so that, even in case of --enable-libgcj, if the Java
# front-end isn't enabled, we still get libgcj disabled.
libgcj_saved=$libgcj
Index: libgccm/configure.ac
===================================================================
*** libgccm/configure.ac (revision 0)
--- libgccm/configure.ac (revision 0)
***************
*** 0 ****
--- 1,153 ----
+ # Process this file with autoconf to produce a configure script, like so:
+ # aclocal && autoconf && autoheader && automake
+
+ AC_PREREQ(2.59)
+ AC_INIT(libgccm, 1.0)
+ AC_CONFIG_SRCDIR(configure.ac)
+ AC_CANONICAL_SYSTEM
+
+ AM_INIT_AUTOMAKE
+
+ AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
+ AC_ARG_ENABLE(version-specific-runtime-libs,
+ [ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
+ [case "$enableval" in
+ yes) version_specific_libs=yes ;;
+ no) version_specific_libs=no ;;
+ *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
+ esac],
+ [version_specific_libs=no])
+ AC_MSG_RESULT($version_specific_libs)
+
+ AM_MAINTAINER_MODE
+ AC_EXEEXT
+
+ AM_ENABLE_MULTILIB(, ..)
+
+ target_alias=${target_alias-$host_alias}
+ AC_SUBST(target_alias)
+
+ AC_CONFIG_HEADERS(config.h)
+
+ AC_LANG_C
+ # The same as in boehm-gc and libstdc++. Have to borrow it from there.
+ # We must force CC to /not/ be precious variables; otherwise
+ # the wrong, non-multilib-adjusted value will be used in multilibs.
+ # As a side effect, we have to subst CFLAGS ourselves.
+
+ m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
+ m4_define([_AC_ARG_VAR_PRECIOUS],[])
+ AC_PROG_CC
+ m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
+
+ AC_SUBST(CFLAGS)
+
+ if test "x$GCC" != "xyes"; then
+ AC_MSG_ERROR([libgccm must be built with GCC])
+ fi
+ AC_PROG_CPP
+ AM_PROG_AS
+
+ AC_MSG_CHECKING([whether hidden visibility is supported])
+ AC_TRY_COMPILE([
+ void __attribute__((visibility ("hidden"))) bar (void) {}],,
+ [gccm_hidden=yes],[gccm_hidden=no])
+ AC_MSG_RESULT($gccm_hidden)
+ if test x$gccm_hidden = xyes; then
+ AC_DEFINE([HAVE_HIDDEN_VISIBILITY],[1],[__attribute__((visibility ("hidden"))) supported])
+ fi
+
+ AC_MSG_CHECKING([whether symbol versioning is supported])
+ cat > conftest.map <<EOF
+ FOO_1.0 {
+ global: *foo*; bar; local: *;
+ };
+ EOF
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared -Wl,--version-script,./conftest.map"
+ AC_TRY_LINK([int foo;],[],[gccm_use_symver=yes],[gccm_use_symver=no])
+ LDFLAGS="$save_LDFLAGS"
+ AC_MSG_RESULT($gccm_use_symver)
+ AM_CONDITIONAL(LIBGCCM_USE_SYMVER, [test "x$gccm_use_symver" = xyes])
+
+ AC_MSG_CHECKING([whether we are a 32bit target])
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="-O2"
+ AC_TRY_LINK(,[
+ if (sizeof(int) == 4 && sizeof(long) == 4 && sizeof(void *) == 4)
+ ;
+ else
+ undefined_function ();
+ ],
+ target_ilp32=yes,
+ target_ilp32=no)
+ CFLAGS="$save_CFLAGS"
+ AM_CONDITIONAL(TARGET_ILP32, [test "x$target_ilp32" = xyes])
+
+
+ AM_PROG_LIBTOOL
+ AC_SUBST(enable_shared)
+ AC_SUBST(enable_static)
+
+ # Calculate toolexeclibdir
+ # Also toolexecdir, though it's only used in toolexeclibdir
+ case ${version_specific_libs} in
+ yes)
+ # Need the gcc compiler version to know where to install libraries
+ # and header files if --enable-version-specific-runtime-libs option
+ # is selected.
+ toolexecdir='$(libdir)/gcc/$(target_alias)'
+ toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
+ ;;
+ no)
+ if test -n "$with_cross_host" &&
+ test x"$with_cross_host" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+ toolexeclibdir='$(toolexecdir)/lib'
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+ fi
+ multi_os_directory=`$CC -print-multi-os-directory`
+ case $multi_os_directory in
+ .) ;; # Avoid trailing /.
+ *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
+ esac
+ ;;
+ esac
+ AC_SUBST(toolexecdir)
+ AC_SUBST(toolexeclibdir)
+
+ if test ${multilib} = yes; then
+ multilib_arg="--enable-multilib"
+ else
+ multilib_arg=
+ fi
+
+
+ # Now check which parts we include in the library.
+
+ arch_subdirs=
+ case "${target}" in
+ i?86-* | x86_64-* )
+ # Handle multilib cases
+ if test "x$target_ilp32" = xyes; then
+ arch_subdirs="i386"
+ arch_libraries="i386/libsse2.la"
+ arch_maps="i386/sse2.map"
+ else
+ arch_subdirs="x86_64"
+ arch_libraries="x86_64/libmv.la"
+ arch_maps="x86_64/mv.map"
+ fi ;;
+ *)
+ ;;
+ esac
+ AC_SUBST(arch_subdirs)
+ AC_SUBST(arch_libraries)
+ AC_SUBST(arch_maps)
+
+
+ AC_CONFIG_FILES([Makefile i386/Makefile x86_64/Makefile])
+ AC_OUTPUT
Index: libgccm/flt-32/e_acosf.c
===================================================================
*** libgccm/flt-32/e_acosf.c (revision 0)
--- libgccm/flt-32/e_acosf.c (revision 0)
***************
*** 0 ****
--- 1,89 ----
+ /* e_acosf.c -- float version of e_acos.c.
+ * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
+ */
+
+ /*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+ #if defined(LIBM_SCCS) && !defined(lint)
+ static char rcsid[] = "$NetBSD: e_acosf.c,v 1.5 1995/05/12 04:57:16 jtc Exp $";
+ #endif
+
+ #include "math.h"
+ #include "math_private.h"
+
+ #ifdef __STDC__
+ static const float
+ #else
+ static float
+ #endif
+ one = 1.0000000000e+00, /* 0x3F800000 */
+ pi = 3.1415925026e+00, /* 0x40490fda */
+ pio2_hi = 1.5707962513e+00, /* 0x3fc90fda */
+ pio2_lo = 7.5497894159e-08, /* 0x33a22168 */
+ pS0 = 1.6666667163e-01, /* 0x3e2aaaab */
+ pS1 = -3.2556581497e-01, /* 0xbea6b090 */
+ pS2 = 2.0121252537e-01, /* 0x3e4e0aa8 */
+ pS3 = -4.0055535734e-02, /* 0xbd241146 */
+ pS4 = 7.9153501429e-04, /* 0x3a4f7f04 */
+ pS5 = 3.4793309169e-05, /* 0x3811ef08 */
+ qS1 = -2.4033949375e+00, /* 0xc019d139 */
+ qS2 = 2.0209457874e+00, /* 0x4001572d */
+ qS3 = -6.8828397989e-01, /* 0xbf303361 */
+ qS4 = 7.7038154006e-02; /* 0x3d9dc62e */
+
+ #ifdef __STDC__
+ float __ieee754_acosf(float x)
+ #else
+ float __ieee754_acosf(x)
+ float x;
+ #endif
+ {
+ float z,p,q,r,w,s,c,df;
+ int32_t hx,ix;
+ GET_FLOAT_WORD(hx,x);
+ ix = hx&0x7fffffff;
+ if(ix==0x3f800000) { /* |x|==1 */
+ if(hx>0) return 0.0; /* acos(1) = 0 */
+ else return pi+(float)2.0*pio2_lo; /* acos(-1)= pi */
+ } else if(ix>0x3f800000) { /* |x| >= 1 */
+ return (x-x)/(x-x); /* acos(|x|>1) is NaN */
+ }
+ if(ix<0x3f000000) { /* |x| < 0.5 */
+ if(ix<=0x23000000) return pio2_hi+pio2_lo;/*if|x|<2**-57*/
+ z = x*x;
+ p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5)))));
+ q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4)));
+ r = p/q;
+ return pio2_hi - (x - (pio2_lo-x*r));
+ } else if (hx<0) { /* x < -0.5 */
+ z = (one+x)*(float)0.5;
+ p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5)))));
+ q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4)));
+ s = __ieee754_sqrtf(z);
+ r = p/q;
+ w = r*s-pio2_lo;
+ return pi - (float)2.0*(s+w);
+ } else { /* x > 0.5 */
+ int32_t idf;
+ z = (one-x)*(float)0.5;
+ s = __ieee754_sqrtf(z);
+ df = s;
+ GET_FLOAT_WORD(idf,df);
+ SET_FLOAT_WORD(df,idf&0xfffff000);
+ c = (z-df*df)/(s+df);
+ p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5)))));
+ q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4)));
+ r = p/q;
+ w = r*s+c;
+ return (float)2.0*(df+w);
+ }
+ }
Index: libgccm/dbl-64/mpexp.h
===================================================================
*** libgccm/dbl-64/mpexp.h (revision 0)
--- libgccm/dbl-64/mpexp.h (revision 0)
***************
*** 0 ****
--- 1,135 ----
+ /*
+ * IBM Accurate Mathematical Library
+ * Written by International Business Machines Corp.
+ * Copyright (C) 2001 Free Software Foundation, Inc.
+ *
+ * This program 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.
+ *
+ * This program 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+ /******************************************************************/
+ /* */
+ /* MODULE_NAME:mpexp.h */
+ /* */
+ /* common data and variables prototype and definition */
+ /******************************************************************/
+
+ #ifndef MPEXP_H
+ #define MPEXP_H
+
+ #ifdef BIG_ENDI
+ static const number
+ twomm1[33] = { /* 2**-m1 */
+ /**/ {{0x00000000, 0x00000000} }, /* 0 */
+ /**/ {{0x00000000, 0x00000000} }, /* 0 */
+ /**/ {{0x00000000, 0x00000000} }, /* 0 */
+ /**/ {{0x00000000, 0x00000000} }, /* 0 */
+ /**/ {{0x3ee00000, 0x00000000} }, /* 2**-17 */
+ /**/ {{0x3e800000, 0x00000000} }, /* 2**-23 */
+ /**/ {{0x3e800000, 0x00000000} }, /* 2**-23 */
+ /**/ {{0x3e300000, 0x00000000} }, /* 2**-28 */
+ /**/ {{0x3e400000, 0x00000000} }, /* 2**-27 */
+ /**/ {{0x3d900000, 0x00000000} }, /* 2**-38 */
+ /**/ {{0x3d500000, 0x00000000} }, /* 2**-42 */
+ /**/ {{0x3d800000, 0x00000000} }, /* 2**-39 */
+ /**/ {{0x3d400000, 0x00000000} }, /* 2**-43 */
+ /**/ {{0x3d000000, 0x00000000} }, /* 2**-47 */
+ /**/ {{0x3d400000, 0x00000000} }, /* 2**-43 */
+ /**/ {{0x3d000000, 0x00000000} }, /* 2**-47 */
+ /**/ {{0x3cd00000, 0x00000000} }, /* 2**-50 */
+ /**/ {{0x3c900000, 0x00000000} }, /* 2**-54 */
+ /**/ {{0x3c600000, 0x00000000} }, /* 2**-57 */
+ /**/ {{0x3c300000, 0x00000000} }, /* 2**-60 */
+ /**/ {{0x3bf00000, 0x00000000} }, /* 2**-64 */
+ /**/ {{0x3bc00000, 0x00000000} }, /* 2**-67 */
+ /**/ {{0x3b800000, 0x00000000} }, /* 2**-71 */
+ /**/ {{0x3b500000, 0x00000000} }, /* 2**-74 */
+ /**/ {{0x3bb00000, 0x00000000} }, /* 2**-68 */
+ /**/ {{0x3b800000, 0x00000000} }, /* 2**-71 */
+ /**/ {{0x3b500000, 0x00000000} }, /* 2**-74 */
+ /**/ {{0x3b200000, 0x00000000} }, /* 2**-77 */
+ /**/ {{0x3b900000, 0x00000000} }, /* 2**-70 */
+ /**/ {{0x3b600000, 0x00000000} }, /* 2**-73 */
+ /**/ {{0x3b300000, 0x00000000} }, /* 2**-76 */
+ /**/ {{0x3b100000, 0x00000000} }, /* 2**-78 */
+ /**/ {{0x3ae00000, 0x00000000} }, /* 2**-81 */
+ };
+ static const number
+ nn[9]={ /* n */
+ /**/ {{0x00000000, 0x00000000} }, /* 0 */
+ /**/ {{0x3ff00000, 0x00000000} }, /* 1 */
+ /**/ {{0x40000000, 0x00000000} }, /* 2 */
+ /**/ {{0x40080000, 0x00000000} }, /* 3 */
+ /**/ {{0x40100000, 0x00000000} }, /* 4 */
+ /**/ {{0x40140000, 0x00000000} }, /* 5 */
+ /**/ {{0x40180000, 0x00000000} }, /* 6 */
+ /**/ {{0x401c0000, 0x00000000} }, /* 7 */
+ /**/ {{0x40200000, 0x00000000} }, /* 8 */
+ };
+
+ #else
+ #ifdef LITTLE_ENDI
+ static const number
+ twomm1[33] = { /* 2**-m1 */
+ /**/ {{0x00000000, 0x00000000} }, /* 0 */
+ /**/ {{0x00000000, 0x00000000} }, /* 0 */
+ /**/ {{0x00000000, 0x00000000} }, /* 0 */
+ /**/ {{0x00000000, 0x00000000} }, /* 0 */
+ /**/ {{0x00000000, 0x3ee00000} }, /* 2**-17 */
+ /**/ {{0x00000000, 0x3e800000} }, /* 2**-23 */
+ /**/ {{0x00000000, 0x3e800000} }, /* 2**-23 */
+ /**/ {{0x00000000, 0x3e300000} }, /* 2**-28 */
+ /**/ {{0x00000000, 0x3e400000} }, /* 2**-27 */
+ /**/ {{0x00000000, 0x3d900000} }, /* 2**-38 */
+ /**/ {{0x00000000, 0x3d500000} }, /* 2**-42 */
+ /**/ {{0x00000000, 0x3d800000} }, /* 2**-39 */
+ /**/ {{0x00000000, 0x3d400000} }, /* 2**-43 */
+ /**/ {{0x00000000, 0x3d000000} }, /* 2**-47 */
+ /**/ {{0x00000000, 0x3d400000} }, /* 2**-43 */
+ /**/ {{0x00000000, 0x3d000000} }, /* 2**-47 */
+ /**/ {{0x00000000, 0x3cd00000} }, /* 2**-50 */
+ /**/ {{0x00000000, 0x3c900000} }, /* 2**-54 */
+ /**/ {{0x00000000, 0x3c600000} }, /* 2**-57 */
+ /**/ {{0x00000000, 0x3c300000} }, /* 2**-60 */
+ /**/ {{0x00000000, 0x3bf00000} }, /* 2**-64 */
+ /**/ {{0x00000000, 0x3bc00000} }, /* 2**-67 */
+ /**/ {{0x00000000, 0x3b800000} }, /* 2**-71 */
+ /**/ {{0x00000000, 0x3b500000} }, /* 2**-74 */
+ /**/ {{0x00000000, 0x3bb00000} }, /* 2**-68 */
+ /**/ {{0x00000000, 0x3b800000} }, /* 2**-71 */
+ /**/ {{0x00000000, 0x3b500000} }, /* 2**-74 */
+ /**/ {{0x00000000, 0x3b200000} }, /* 2**-77 */
+ /**/ {{0x00000000, 0x3b900000} }, /* 2**-70 */
+ /**/ {{0x00000000, 0x3b600000} }, /* 2**-73 */
+ /**/ {{0x00000000, 0x3b300000} }, /* 2**-76 */
+ /**/ {{0x00000000, 0x3b100000} }, /* 2**-78 */
+ /**/ {{0x00000000, 0x3ae00000} }, /* 2**-81 */
+ };
+ static const number
+ nn[9]={ /* n */
+ /**/ {{0x00000000, 0x00000000} }, /* 0 */
+ /**/ {{0x00000000, 0x3ff00000} }, /* 1 */
+ /**/ {{0x00000000, 0x40000000} }, /* 2 */
+ /**/ {{0x00000000, 0x40080000} }, /* 3 */
+ /**/ {{0x00000000, 0x40100000} }, /* 4 */
+ /**/ {{0x00000000, 0x40140000} }, /* 5 */
+ /**/ {{0x00000000, 0x40180000} }, /* 6 */
+ /**/ {{0x00000000, 0x401c0000} }, /* 7 */
+ /**/ {{0x00000000, 0x40200000} }, /* 8 */
+ };
+
+ #endif
+ #endif
+
+ #endif
Index: libgccm/Makefile.am
===================================================================
*** libgccm/Makefile.am (revision 0)
--- libgccm/Makefile.am (revision 0)
***************
*** 0 ****
--- 1,86 ----
+ ## Makefile for the toplevel directory of the libgccm library.
+ ##
+ ## Copyright (C) 2005
+ ## Free Software Foundation, Inc.
+ ##
+
+ AUTOMAKE_OPTIONS = 1.9.5 foreign
+ ACLOCAL_AMFLAGS = -I .. -I ../config
+ MAINT_CHARSET = latin1
+
+ SUBDIRS = @arch_subdirs@
+
+ # May be used by various substitution variables.
+ gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
+
+ if LIBGCCM_USE_SYMVER
+ version_arg = -Wl,--version-script=gccm.map
+ version_dep = gccm.map
+ .PHONY: gccm.map
+ gccm.map:
+ rm -f gccm.map
+ for map in @arch_maps@; do \
+ cat $(srcdir)/$$map >> gccm.map; \
+ done
+ else
+ version_arg =
+ version_dep =
+ endif
+
+
+ toolexeclib_LTLIBRARIES = libgccm.la
+
+ libgccm_la_SOURCES =
+ libgccm_la_LIBADD = @arch_libraries@
+ libgccm_la_DEPENDENCIES = $(libgccm_la_LIBADD) $(version_dep)
+ libgccm_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
+ $(version_arg)
+
+
+ # XXX hack alert
+ # From libffi/Makefile.am
+
+ # Work around what appears to be a GNU make bug handling MAKEFLAGS
+ # values defined in terms of make variables, as is the case for CC and
+ # friends when we are called from the top level Makefile.
+ AM_MAKEFLAGS = \
+ "AR_FLAGS=$(AR_FLAGS)" \
+ "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
+ "CFLAGS=$(CFLAGS)" \
+ "CXXFLAGS=$(CXXFLAGS)" \
+ "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
+ "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
+ "INSTALL=$(INSTALL)" \
+ "INSTALL_DATA=$(INSTALL_DATA)" \
+ "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
+ "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
+ "JC1FLAGS=$(JC1FLAGS)" \
+ "LDFLAGS=$(LDFLAGS)" \
+ "LIBCFLAGS=$(LIBCFLAGS)" \
+ "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
+ "MAKE=$(MAKE)" \
+ "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
+ "PICFLAG=$(PICFLAG)" \
+ "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
+ "SHELL=$(SHELL)" \
+ "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
+ "exec_prefix=$(exec_prefix)" \
+ "infodir=$(infodir)" \
+ "libdir=$(libdir)" \
+ "prefix=$(prefix)" \
+ "includedir=$(includedir)" \
+ "AR=$(AR)" \
+ "AS=$(AS)" \
+ "CC=$(CC)" \
+ "CXX=$(CXX)" \
+ "LD=$(LD)" \
+ "LIBCFLAGS=$(LIBCFLAGS)" \
+ "NM=$(NM)" \
+ "PICFLAG=$(PICFLAG)" \
+ "RANLIB=$(RANLIB)" \
+ "DESTDIR=$(DESTDIR)"
+
+ MAKEOVERRIDES=
+
+ ## ################################################################
+
Index: libgccm/i386/sse_logf.c
===================================================================
*** libgccm/i386/sse_logf.c (revision 0)
--- libgccm/i386/sse_logf.c (revision 0)
***************
*** 0 ****
--- 1,2 ----
+ #include "sse2_defines.h"
+ #include "flt-32/e_logf.c"
Index: libgccm/i386/sse2_pow.c
===================================================================
*** libgccm/i386/sse2_pow.c (revision 0)
--- libgccm/i386/sse2_pow.c (revision 0)
***************
*** 0 ****
--- 1,2 ----
+ #include "sse2_defines.h"
+ #include "dbl-64/e_pow.c"
Index: libgccm/i386/endian.h
===================================================================
*** libgccm/i386/endian.h (revision 0)
--- libgccm/i386/endian.h (revision 0)
***************
*** 0 ****
--- 1,21 ----
+ #define __BIG_ENDIAN 4321
+ #define __LITTLE_ENDIAN 1234
+ #define BIG_ENDIAN 4321
+ #define LITTLE_ENDIAN 1234
+
+ #define __FLOAT_WORD_ORDER 1234
+ #define __BYTE_ORDER 1234
+
+ #if __FLOAT_WORD_ORDER == BIG_ENDIAN
+ # define BIG_ENDI 1
+ # undef LITTLE_ENDI
+ # define HIGH_HALF 0
+ # define LOW_HALF 1
+ #else
+ # if __FLOAT_WORD_ORDER == LITTLE_ENDIAN
+ # undef BIG_ENDI
+ # define LITTLE_ENDI 1
+ # define HIGH_HALF 1
+ # define LOW_HALF 0
+ # endif
+ #endif
Index: libgccm/i386/sse_atanf.c
===================================================================
*** libgccm/i386/sse_atanf.c (revision 0)
--- libgccm/i386/sse_atanf.c (revision 0)
***************
*** 0 ****
--- 1,2 ----
+ #include "sse2_defines.h"
+ #include "flt-32/s_atanf.c"
Index: libgccm/i386/sse_acosf.c
===================================================================
*** libgccm/i386/sse_acosf.c (revision 0)
--- libgccm/i386/sse_acosf.c (revision 0)
***************
*** 0 ****
--- 1,2 ----
+ #include "sse2_defines.h"
+ #include "flt-32/e_acosf.c"
Index: libgccm/i386/sse_k_rem_pio2f.c
===================================================================
*** libgccm/i386/sse_k_rem_pio2f.c (revision 0)
--- libgccm/i386/sse_k_rem_pio2f.c (revision 0)
***************
*** 0 ****
--- 1,3 ----
+ #include "sse2_defines.h"
+ #pragma GCC visibility push(hidden)
+ #include "flt-32/k_rem_pio2f.c"
Index: libgccm/i386/sse2.map
===================================================================
*** libgccm/i386/sse2.map (revision 0)
--- libgccm/i386/sse2.map (revision 0)
***************
*** 0 ****
--- 1,11 ----
+ LIBGCCM_1.0 {
+ global:
+ __libm_sse2_acos; __libm_sse2_asin; __libm_sse2_atan2; __libm_sse2_atan;
+ __libm_sse2_exp; __libm_sse2_log; __libm_sse2_log10; __libm_sse2_log;
+ __libm_sse2_pow; __libm_sse2_cos; __libm_sse2_sin; __libm_sse2_tan;
+ __libm_sse2_acosf; __libm_sse2_asinf; __libm_sse2_atan2f;
+ __libm_sse2_atanf; __libm_sse2_cosf; __libm_sse2_expf; __libm_sse2_log10f;
+ __libm_sse2_logf; __libm_sse2_powf; __libm_sse2_sinf; __libm_sse2_tanf;
+ local:
+ *;
+ };
Index: libgccm/i386/sse_sqrtf.c
===================================================================
*** libgccm/i386/sse_sqrtf.c (revision 0)
--- libgccm/i386/sse_sqrtf.c (revision 0)
***************
*** 0 ****
--- 1,3 ----
+ #include "sse2_defines.h"
+ #pragma GCC visibility push(hidden)
+ #include "flt-32/e_sqrtf.c"
Index: libgccm/i386/sse_sinf.c
===================================================================
*** libgccm/i386/sse_sinf.c (revision 0)
--- libgccm/i386/sse_sinf.c (revision 0)
***************
*** 0 ****
--- 1,2 ----
+ #include "sse2_defines.h"
+ #include "flt-32/s_sinf.c"
Index: libgccm/i386/sse2_branred.c
===================================================================
*** libgccm/i386/sse2_branred.c (revision 0)
--- libgccm/i386/sse2_branred.c (revision 0)
***************
*** 0 ****
--- 1,3 ----
+ #include "sse2_defines.h"
+ #pragma GCC visibility push(hidden)
+ #include "dbl-64/branred.c"
Index: libgccm/i386/sse2_doasin.c
===================================================================
*** libgccm/i386/sse2_doasin.c (revision 0)
--- libgccm/i386/sse2_doasin.c (revision 0)
***************
*** 0 ****
--- 1,3 ----
+ #include "sse2_defines.h"
+ #pragma GCC visibility push(hidden)
+ #include "dbl-64/doasin.c"
Index: libgccm/i386/sse2_mpa.c
===================================================================
*** libgccm/i386/sse2_mpa.c (revision 0)
--- libgccm/i386/sse2_mpa.c (revision 0)
***************
*** 0 ****
--- 1,10 ----
+ /* We might be able to make some of the functions static
+ to explore more optimization. */
+ #include "sse2_defines.h"
+ #include "dbl-64/mpa.c"
+ #include "dbl-64/mpatan2.c"
+ #include "dbl-64/mpatan.c"
+ #include "dbl-64/mpexp.c"
+ #include "dbl-64/mplog.c"
+ #include "dbl-64/mpsqrt.c"
+ #include "dbl-64/mptan.c"
Index: libgccm/i386/sse_expf.c
===================================================================
*** libgccm/i386/sse_expf.c (revision 0)
--- libgccm/i386/sse_expf.c (revision 0)
***************
*** 0 ****
--- 1,2 ----
+ #include "sse2_defines.h"
+ #include "flt-32/e_expf.c"
Index: libgccm/i386/sse_k_tanf.c
===================================================================
*** libgccm/i386/sse_k_tanf.c (revision 0)
--- libgccm/i386/sse_k_tanf.c (revision 0)
***************
*** 0 ****
--- 1,3 ----
+ #include "sse2_defines.h"
+ #pragma GCC visibility push(hidden)
+ #include "flt-32/k_tanf.c"
Index: libgccm/i386/sse2_defines.h
===================================================================
*** libgccm/i386/sse2_defines.h (revision 0)
--- libgccm/i386/sse2_defines.h (revision 0)
***************
*** 0 ****
--- 1,64 ----
+ #include "libc-symbols.h"
+
+ #undef weak_alias
+ #undef strong_alias
+ #undef hidden_def
+ #define weak_alias(a,b)
+ #define strong_alias(a,b)
+ #define hidden_def(a)
+
+ /* s_atanf.c */
+ #define __atanf __libm_sse2_atanf
+
+ /* e_asinf.c */
+ #define __ieee754_acosf __libm_sse2_acosf
+ #define __ieee754_asinf __libm_sse2_asinf
+
+ /* e_atan2f.c */
+ #define __ieee754_atan2f __libm_sse2_atan2f
+ #define __ieee754_expf __libm_sse2_expf
+
+ /* e_log10f.c */
+ #define __ieee754_log10f __libm_sse2_log10f
+
+ /* e_logf.c */
+ #define __ieee754_logf __libm_sse2_logf
+
+ /* e_powf.c */
+ #define __ieee754_powf __libm_sse2_powf
+
+ /* s_sinf.c */
+ #define __sinf __libm_sse2_sinf
+ #define __cosf __libm_sse2_cosf
+
+ /* s_tanf.c */
+ #define __tanf __libm_sse2_tanf
+
+ /* s_atan.c */
+ #define atan __libm_sse2_atan
+
+ /* e_asin.c */
+ #define __ieee754_acos __libm_sse2_acos
+ #define __ieee754_asin __libm_sse2_asin
+
+ /* e_atan2.c */
+ #define __ieee754_atan2 __libm_sse2_atan2
+
+ /* e_exp.c */
+ #define __ieee754_exp __libm_sse2_exp
+
+ /* e_log10.c */
+ #define __ieee754_log10 __libm_sse2_log10
+
+ /* e_log.c */
+ #define __ieee754_log __libm_sse2_log
+
+ /* e_pow.c */
+ #define __ieee754_pow __libm_sse2_pow
+
+ /* s_sin.c */
+ #define __cos __libm_sse2_cos
+ #define __sin __libm_sse2_sin
+
+ /* s_tan.c */
+ #define tan __libm_sse2_tan
Index: libgccm/i386/sse_k_cosf.c
===================================================================
*** libgccm/i386/sse_k_cosf.c (revision 0)
--- libgccm/i386/sse_k_cosf.c (revision 0)
***************
*** 0 ****
--- 1,3 ----
+ #include "sse2_defines.h"
+ #pragma GCC visibility push(hidden)
+ #include "flt-32/k_cosf.c"
Index: libgccm/i386/sse2_k_rem_pio2.c
===================================================================
*** libgccm/i386/sse2_k_rem_pio2.c (revision 0)
--- libgccm/i386/sse2_k_rem_pio2.c (revision 0)
***************
*** 0 ****
--- 1,3 ----
+ #include "sse2_defines.h"
+ #pragma GCC visibility push(hidden)
+ #include "dbl-64/k_rem_pio2.c"
Index: libgccm/i386/sse_powf.c
===================================================================
*** libgccm/i386/sse_powf.c (revision 0)
--- libgccm/i386/sse_powf.c (revision 0)
***************
*** 0 ****
--- 1,2 ----
+ #include "sse2_defines.h"
+ #include "flt-32/e_powf.c"
Index: libgccm/i386/sse2_halfulp.c
===================================================================
*** libgccm/i386/sse2_halfulp.c (revision 0)
--- libgccm/i386/sse2_halfulp.c (revision 0)
***************
*** 0 ****
--- 1,3 ----
+ #include "sse2_defines.h"
+ #pragma GCC visibility push(hidden)
+ #include "dbl-64/halfulp.c"
Index: libgccm/i386/math_private.h
===================================================================
*** libgccm/i386/math_private.h (revision 0)
--- libgccm/i386/math_private.h (revision 0)
***************
*** 0 ****
--- 1,322 ----
+ /*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+ /*
+ * from: @(#)fdlibm.h 5.1 93/09/24
+ * $Id: math_private.h,v 1.18 2003/08/28 00:10:15 drepper Exp $
+ */
+
+ #ifndef _MATH_PRIVATE_H_
+ #define _MATH_PRIVATE_H_
+
+ #include <endian.h>
+ #include <sys/types.h>
+
+ /* The original fdlibm code used statements like:
+ n0 = ((*(int*)&one)>>29)^1; * index of high word *
+ ix0 = *(n0+(int*)&x); * high word of x *
+ ix1 = *((1-n0)+(int*)&x); * low word of x *
+ to dig two 32 bit words out of the 64 bit IEEE floating point
+ value. That is non-ANSI, and, moreover, the gcc instruction
+ scheduler gets it wrong. We instead use the following macros.
+ Unlike the original code, we determine the endianness at compile
+ time, not at run time; I don't see much benefit to selecting
+ endianness at run time. */
+
+ /* A union which permits us to convert between a double and two 32 bit
+ ints. */
+
+ #if __FLOAT_WORD_ORDER == BIG_ENDIAN
+
+ typedef union
+ {
+ double value;
+ struct
+ {
+ u_int32_t msw;
+ u_int32_t lsw;
+ } parts;
+ } ieee_double_shape_type;
+
+ #endif
+
+ #if __FLOAT_WORD_ORDER == LITTLE_ENDIAN
+
+ typedef union
+ {
+ double value;
+ struct
+ {
+ u_int32_t lsw;
+ u_int32_t msw;
+ } parts;
+ } ieee_double_shape_type;
+
+ #endif
+
+ /* Get two 32 bit ints from a double. */
+
+ #define EXTRACT_WORDS(ix0,ix1,d) \
+ do { \
+ ieee_double_shape_type ew_u; \
+ ew_u.value = (d); \
+ (ix0) = ew_u.parts.msw; \
+ (ix1) = ew_u.parts.lsw; \
+ } while (0)
+
+ /* Get the more significant 32 bit int from a double. */
+
+ #define GET_HIGH_WORD(i,d) \
+ do { \
+ ieee_double_shape_type gh_u; \
+ gh_u.value = (d); \
+ (i) = gh_u.parts.msw; \
+ } while (0)
+
+ /* Get the less significant 32 bit int from a double. */
+
+ #define GET_LOW_WORD(i,d) \
+ do { \
+ ieee_double_shape_type gl_u; \
+ gl_u.value = (d); \
+ (i) = gl_u.parts.lsw; \
+ } while (0)
+
+ /* Set a double from two 32 bit ints. */
+
+ #define INSERT_WORDS(d,ix0,ix1) \
+ do { \
+ ieee_double_shape_type iw_u; \
+ iw_u.parts.msw = (ix0); \
+ iw_u.parts.lsw = (ix1); \
+ (d) = iw_u.value; \
+ } while (0)
+
+ /* Set the more significant 32 bits of a double from an int. */
+
+ #define SET_HIGH_WORD(d,v) \
+ do { \
+ ieee_double_shape_type sh_u; \
+ sh_u.value = (d); \
+ sh_u.parts.msw = (v); \
+ (d) = sh_u.value; \
+ } while (0)
+
+ /* Set the less significant 32 bits of a double from an int. */
+
+ #define SET_LOW_WORD(d,v) \
+ do { \
+ ieee_double_shape_type sl_u; \
+ sl_u.value = (d); \
+ sl_u.parts.lsw = (v); \
+ (d) = sl_u.value; \
+ } while (0)
+
+ /* A union which permits us to convert between a float and a 32 bit
+ int. */
+
+ typedef union
+ {
+ float value;
+ u_int32_t word;
+ } ieee_float_shape_type;
+
+ /* Get a 32 bit int from a float. */
+
+ #define GET_FLOAT_WORD(i,d) \
+ do { \
+ ieee_float_shape_type gf_u; \
+ gf_u.value = (d); \
+ (i) = gf_u.word; \
+ } while (0)
+
+ /* Set a float from a 32 bit int. */
+
+ #define SET_FLOAT_WORD(d,i) \
+ do { \
+ ieee_float_shape_type sf_u; \
+ sf_u.word = (i); \
+ (d) = sf_u.value; \
+ } while (0)
+
+ /* Get long double macros from a separate header. Not. */
+ #define NO_LONG_DOUBLE
+
+ /* ieee style elementary functions */
+ extern double __ieee754_sqrt (double);
+ extern double __ieee754_acos (double);
+ extern double __ieee754_acosh (double);
+ extern double __ieee754_log (double);
+ extern double __ieee754_atanh (double);
+ extern double __ieee754_asin (double);
+ extern double __ieee754_atan2 (double,double);
+ extern double __ieee754_exp (double);
+ extern double __ieee754_exp2 (double);
+ extern double __ieee754_exp10 (double);
+ extern double __ieee754_cosh (double);
+ extern double __ieee754_fmod (double,double);
+ extern double __ieee754_pow (double,double);
+ extern double __ieee754_lgamma_r (double,int *);
+ extern double __ieee754_gamma_r (double,int *);
+ extern double __ieee754_lgamma (double);
+ extern double __ieee754_gamma (double);
+ extern double __ieee754_log10 (double);
+ extern double __ieee754_log2 (double);
+ extern double __ieee754_sinh (double);
+ extern double __ieee754_hypot (double,double);
+ extern double __ieee754_j0 (double);
+ extern double __ieee754_j1 (double);
+ extern double __ieee754_y0 (double);
+ extern double __ieee754_y1 (double);
+ extern double __ieee754_jn (int,double);
+ extern double __ieee754_yn (int,double);
+ extern double __ieee754_remainder (double,double);
+ extern int32_t __ieee754_rem_pio2 (double,double*);
+ extern double __ieee754_scalb (double,double);
+
+ /* fdlibm kernel function */
+ extern double __kernel_standard (double,double,int);
+ extern double __kernel_sin (double,double,int);
+ extern double __kernel_cos (double,double);
+ extern double __kernel_tan (double,double,int);
+ extern int __kernel_rem_pio2 (double*,double*,int,int,int, const int32_t*);
+
+ /* internal functions. */
+ extern double __copysign (double x, double __y);
+
+
+ /* ieee style elementary float functions */
+ extern float __ieee754_sqrtf (float);
+ extern float __ieee754_acosf (float);
+ extern float __ieee754_acoshf (float);
+ extern float __ieee754_logf (float);
+ extern float __ieee754_atanhf (float);
+ extern float __ieee754_asinf (float);
+ extern float __ieee754_atan2f (float,float);
+ extern float __ieee754_expf (float);
+ extern float __ieee754_exp2f (float);
+ extern float __ieee754_exp10f (float);
+ extern float __ieee754_coshf (float);
+ extern float __ieee754_fmodf (float,float);
+ extern float __ieee754_powf (float,float);
+ extern float __ieee754_lgammaf_r (float,int *);
+ extern float __ieee754_gammaf_r (float,int *);
+ extern float __ieee754_lgammaf (float);
+ extern float __ieee754_gammaf (float);
+ extern float __ieee754_log10f (float);
+ extern float __ieee754_log2f (float);
+ extern float __ieee754_sinhf (float);
+ extern float __ieee754_hypotf (float,float);
+ extern float __ieee754_j0f (float);
+ extern float __ieee754_j1f (float);
+ extern float __ieee754_y0f (float);
+ extern float __ieee754_y1f (float);
+ extern float __ieee754_jnf (int,float);
+ extern float __ieee754_ynf (int,float);
+ extern float __ieee754_remainderf (float,float);
+ extern int32_t __ieee754_rem_pio2f (float,float*);
+ extern float __ieee754_scalbf (float,float);
+
+
+ /* float versions of fdlibm kernel functions */
+ extern float __kernel_sinf (float,float,int);
+ extern float __kernel_cosf (float,float);
+ extern float __kernel_tanf (float,float,int);
+ extern int __kernel_rem_pio2f (float*,float*,int,int,int, const int32_t*);
+
+ /* internal functions. */
+ extern float __copysignf (float x, float __y);
+
+
+ /* ieee style elementary long double functions */
+ extern long double __ieee754_sqrtl (long double);
+ extern long double __ieee754_acosl (long double);
+ extern long double __ieee754_acoshl (long double);
+ extern long double __ieee754_logl (long double);
+ extern long double __ieee754_atanhl (long double);
+ extern long double __ieee754_asinl (long double);
+ extern long double __ieee754_atan2l (long double,long double);
+ extern long double __ieee754_expl (long double);
+ extern long double __ieee754_exp2l (long double);
+ extern long double __ieee754_exp10l (long double);
+ extern long double __ieee754_coshl (long double);
+ extern long double __ieee754_fmodl (long double,long double);
+ extern long double __ieee754_powl (long double,long double);
+ extern long double __ieee754_lgammal_r (long double,int *);
+ extern long double __ieee754_gammal_r (long double,int *);
+ extern long double __ieee754_lgammal (long double);
+ extern long double __ieee754_gammal (long double);
+ extern long double __ieee754_log10l (long double);
+ extern long double __ieee754_log2l (long double);
+ extern long double __ieee754_sinhl (long double);
+ extern long double __ieee754_hypotl (long double,long double);
+ extern long double __ieee754_j0l (long double);
+ extern long double __ieee754_j1l (long double);
+ extern long double __ieee754_y0l (long double);
+ extern long double __ieee754_y1l (long double);
+ extern long double __ieee754_jnl (int,long double);
+ extern long double __ieee754_ynl (int,long double);
+ extern long double __ieee754_remainderl (long double,long double);
+ extern int __ieee754_rem_pio2l (long double,long double*);
+ extern long double __ieee754_scalbl (long double,long double);
+
+ /* long double versions of fdlibm kernel functions */
+ extern long double __kernel_sinl (long double,long double,int);
+ extern long double __kernel_cosl (long double,long double);
+ extern long double __kernel_tanl (long double,long double,int);
+ extern void __kernel_sincosl (long double,long double,
+ long double *,long double *, int);
+ extern int __kernel_rem_pio2l (long double*,long double*,int,int,
+ int,const int*);
+
+ #ifndef NO_LONG_DOUBLE
+ /* prototypes required to compile the ldbl-96 support without warnings */
+ extern int __finitel (long double);
+ extern int __ilogbl (long double);
+ extern int __isinfl (long double);
+ extern int __isnanl (long double);
+ extern long double __atanl (long double);
+ extern long double __copysignl (long double, long double);
+ extern long double __expm1l (long double);
+ extern long double __floorl (long double);
+ extern long double __frexpl (long double, int *);
+ extern long double __ldexpl (long double, int);
+ extern long double __log1pl (long double);
+ extern long double __nanl (const char *);
+ extern long double __rintl (long double);
+ extern long double __scalbnl (long double, int);
+ extern long double __sqrtl (long double x);
+ extern long double fabsl (long double x);
+ extern void __sincosl (long double, long double *, long double *);
+ extern long double __logbl (long double x);
+ extern long double __significandl (long double x);
+ #endif
+
+ /* Prototypes for functions of the IBM Accurate Mathematical Library. */
+ extern double __exp1 (double __x, double __xx, double __error);
+ extern double __sin (double __x);
+ extern double __cos (double __x);
+ extern int __branred (double __x, double *__a, double *__aa);
+ extern void __doasin (double __x, double __dx, double __v[]);
+ extern void __dubsin (double __x, double __dx, double __v[]);
+ extern void __dubcos (double __x, double __dx, double __v[]);
+ extern double __halfulp (double __x, double __y);
+ extern double __sin32 (double __x, double __res, double __res1);
+ extern double __cos32 (double __x, double __res, double __res1);
+ extern double __mpsin (double __x, double __dx);
+ extern double __mpcos (double __x, double __dx);
+ extern double __mpsin1 (double __x);
+ extern double __mpcos1 (double __x);
+ extern double __slowexp (double __x);
+ extern double __slowpow (double __x, double __y, double __z);
+ extern void __docos (double __x, double __dx, double __v[]);
+
+ #endif /* _MATH_PRIVATE_H_ */
Index: libgccm/i386/sse2_exp.c
===================================================================
*** libgccm/i386/sse2_exp.c (revision 0)
--- libgccm/i386/sse2_exp.c (revision 0)
***************
*** 0 ****
--- 1,2 ----
+ #include "sse2_defines.h"
+ #include "dbl-64/e_exp.c"
Index: libgccm/i386/sse_rem_pio2f.c
===================================================================
*** libgccm/i386/sse_rem_pio2f.c (revision 0)
--- libgccm/i386/sse_rem_pio2f.c (revision 0)
***************
*** 0 ****
--- 1,3 ----
+ #include "sse2_defines.h"
+ #pragma GCC visibility push(hidden)
+ #include "flt-32/e_rem_pio2f.c"
Index: libgccm/i386/sse2_sincos32.c
===================================================================
*** libgccm/i386/sse2_sincos32.c (revision 0)
--- libgccm/i386/sse2_sincos32.c (revision 0)
***************
*** 0 ****
--- 1,3 ----
+ #include "sse2_defines.h"
+ #pragma GCC visibility push(hidden)
+ #include "dbl-64/sincos32.c"
Index: libgccm/i386/sse2_atan2.c
===================================================================
*** libgccm/i386/sse2_atan2.c (revision 0)
--- libgccm/i386/sse2_atan2.c (revision 0)
***************
*** 0 ****
--- 1,2 ----
+ #include "sse2_defines.h"
+ #include "dbl-64/e_atan2.c"
Index: libgccm/i386/sse_tanf.c
===================================================================
*** libgccm/i386/sse_tanf.c (revision 0)
--- libgccm/i386/sse_tanf.c (revision 0)
***************
*** 0 ****
--- 1,2 ----
+ #include "sse2_defines.h"
+ #include "flt-32/s_tanf.c"
Index: libgccm/i386/sse_log10f.c
===================================================================
*** libgccm/i386/sse_log10f.c (revision 0)
--- libgccm/i386/sse_log10f.c (revision 0)
***************
*** 0 ****
--- 1,2 ----
+ #include "sse2_defines.h"
+ #include "flt-32/e_log10f.c"
Index: libgccm/i386/libc-symbols.h
===================================================================
*** libgccm/i386/libc-symbols.h (revision 0)
--- libgccm/i386/libc-symbols.h (revision 0)
***************
*** 0 ****
--- 1,20 ----
+ /* Define ALIASNAME as a strong alias for NAME. */
+ # define strong_alias(name, aliasname) _strong_alias(name, aliasname)
+ # define _strong_alias(name, aliasname) \
+ extern __typeof (name) aliasname __attribute__ ((alias (#name)));
+
+ /* This comes between the return type and function name in
+ a function definition to make that definition weak. */
+ # define weak_function __attribute__ ((weak))
+ # define weak_const_function __attribute__ ((weak, __const__))
+
+ /* Define ALIASNAME as a weak alias for NAME.
+ If weak aliases are not available, this defines a strong alias. */
+ # define weak_alias(name, aliasname) _weak_alias (name, aliasname)
+ # define _weak_alias(name, aliasname) \
+ extern __typeof (name) aliasname __attribute__ ((weak, alias (#name)));
+
+ /* Declare SYMBOL as weak undefined symbol (resolved to 0 if not defined). */
+ # define weak_extern(symbol) _weak_extern (weak symbol)
+ # define _weak_extern(expr) _Pragma (#expr)
+
Index: libgccm/i386/sse_cosf.c
===================================================================
*** libgccm/i386/sse_cosf.c (revision 0)
--- libgccm/i386/sse_cosf.c (revision 0)
***************
*** 0 ****
--- 1,2 ----
+ #include "sse2_defines.h"
+ #include "flt-32/s_cosf.c"
Index: libgccm/i386/sse2_slowpow.c
===================================================================
*** libgccm/i386/sse2_slowpow.c (revision 0)
--- libgccm/i386/sse2_slowpow.c (revision 0)
***************
*** 0 ****
--- 1,3 ----
+ #include "sse2_defines.h"
+ #pragma GCC visibility push(hidden)
+ #include "dbl-64/slowpow.c"
Index: libgccm/i386/sse2_rem_pio2.c
===================================================================
*** libgccm/i386/sse2_rem_pio2.c (revision 0)
--- libgccm/i386/sse2_rem_pio2.c (revision 0)
***************
*** 0 ****
--- 1,3 ----
+ #include "sse2_defines.h"
+ #pragma GCC visibility push(hidden)
+ #include "dbl-64/e_rem_pio2.c"
Index: libgccm/i386/sse_asinf.c
===================================================================
*** libgccm/i386/sse_asinf.c (revision 0)
--- libgccm/i386/sse_asinf.c (revision 0)
***************
*** 0 ****
--- 1,2 ----
+ #include "sse2_defines.h"
+ #include "flt-32/e_asinf.c"
Index: libgccm/i386/ieee754.h
===================================================================
*** libgccm/i386/ieee754.h (revision 0)
--- libgccm/i386/ieee754.h (revision 0)
***************
*** 0 ****
--- 1,126 ----
+ /* Copyright (C) 1992, 1995, 1996, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ 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. */
+
+ #ifndef _IEEE754_H
+
+ #define _IEEE754_H 1
+ #include <endian.h>
+
+ union ieee754_float
+ {
+ float f;
+
+ /* This is the IEEE 754 single-precision format. */
+ struct
+ {
+ #if __BYTE_ORDER == __BIG_ENDIAN
+ unsigned int negative:1;
+ unsigned int exponent:8;
+ unsigned int mantissa:23;
+ #endif /* Big endian. */
+ #if __BYTE_ORDER == __LITTLE_ENDIAN
+ unsigned int mantissa:23;
+ unsigned int exponent:8;
+ unsigned int negative:1;
+ #endif /* Little endian. */
+ } ieee;
+
+ /* This format makes it easier to see if a NaN is a signalling NaN. */
+ struct
+ {
+ #if __BYTE_ORDER == __BIG_ENDIAN
+ unsigned int negative:1;
+ unsigned int exponent:8;
+ unsigned int quiet_nan:1;
+ unsigned int mantissa:22;
+ #endif /* Big endian. */
+ #if __BYTE_ORDER == __LITTLE_ENDIAN
+ unsigned int mantissa:22;
+ unsigned int quiet_nan:1;
+ unsigned int exponent:8;
+ unsigned int negative:1;
+ #endif /* Little endian. */
+ } ieee_nan;
+ };
+
+ #define IEEE754_FLOAT_BIAS 0x7f /* Added to exponent. */
+
+
+ union ieee754_double
+ {
+ double d;
+
+ /* This is the IEEE 754 double-precision format. */
+ struct
+ {
+ #if __BYTE_ORDER == __BIG_ENDIAN
+ unsigned int negative:1;
+ unsigned int exponent:11;
+ /* Together these comprise the mantissa. */
+ unsigned int mantissa0:20;
+ unsigned int mantissa1:32;
+ #endif /* Big endian. */
+ #if __BYTE_ORDER == __LITTLE_ENDIAN
+ # if __FLOAT_WORD_ORDER == BIG_ENDIAN
+ unsigned int mantissa0:20;
+ unsigned int exponent:11;
+ unsigned int negative:1;
+ unsigned int mantissa1:32;
+ # else
+ /* Together these comprise the mantissa. */
+ unsigned int mantissa1:32;
+ unsigned int mantissa0:20;
+ unsigned int exponent:11;
+ unsigned int negative:1;
+ # endif
+ #endif /* Little endian. */
+ } ieee;
+
+ /* This format makes it easier to see if a NaN is a signalling NaN. */
+ struct
+ {
+ #if __BYTE_ORDER == __BIG_ENDIAN
+ unsigned int negative:1;
+ unsigned int exponent:11;
+ unsigned int quiet_nan:1;
+ /* Together these comprise the mantissa. */
+ unsigned int mantissa0:19;
+ unsigned int mantissa1:32;
+ #else
+ # if __FLOAT_WORD_ORDER == BIG_ENDIAN
+ unsigned int mantissa0:19;
+ unsigned int quiet_nan:1;
+ unsigned int exponent:11;
+ unsigned int negative:1;
+ unsigned int mantissa1:32;
+ # else
+ /* Together these comprise the mantissa. */
+ unsigned int mantissa1:32;
+ unsigned int mantissa0:19;
+ unsigned int quiet_nan:1;
+ unsigned int exponent:11;
+ unsigned int negative:1;
+ # endif
+ #endif
+ } ieee_nan;
+ };
+
+ #define IEEE754_DOUBLE_BIAS 0x3ff /* Added to exponent. */
+
+
+ #endif /* ieee754.h */
Index: libgccm/i386/sse2_dosincos.c
===================================================================
*** libgccm/i386/sse2_dosincos.c (revision 0)
--- libgccm/i386/sse2_dosincos.c (revision 0)
***************
*** 0 ****
--- 1,3 ----
+ #include "sse2_defines.h"
+ #pragma GCC visibility push(hidden)
+ #include "dbl-64/dosincos.c"
Index: libgccm/i386/sse2_log.c
===================================================================
*** libgccm/i386/sse2_log.c (revision 0)
--- libgccm/i386/sse2_log.c (revision 0)
***************
*** 0 ****
--- 1,2 ----
+ #include "sse2_defines.h"
+ #include "dbl-64/e_log.c"
Index: libgccm/i386/sse2_tan.c
===================================================================
*** libgccm/i386/sse2_tan.c (revision 0)
--- libgccm/i386/sse2_tan.c (revision 0)
***************
*** 0 ****
--- 1,2 ----
+ #include "sse2_defines.h"
+ #include "dbl-64/s_tan.c"
Index: libgccm/i386/sse2_log10.c
===================================================================
*** libgccm/i386/sse2_log10.c (revision 0)
--- libgccm/i386/sse2_log10.c (revision 0)
***************
*** 0 ****
--- 1,2 ----
+ #include "sse2_defines.h"
+ #include "dbl-64/e_log10.c"
Index: libgccm/i386/sse2_atan.c
===================================================================
*** libgccm/i386/sse2_atan.c (revision 0)
--- libgccm/i386/sse2_atan.c (revision 0)
***************
*** 0 ****
--- 1,2 ----
+ #include "sse2_defines.h"
+ #include "dbl-64/s_atan.c"
Index: libgccm/i386/sse_k_sinf.c
===================================================================
*** libgccm/i386/sse_k_sinf.c (revision 0)
--- libgccm/i386/sse_k_sinf.c (revision 0)
***************
*** 0 ****
--- 1,3 ----
+ #include "sse2_defines.h"
+ #pragma GCC visibility push(hidden)
+ #include "flt-32/k_sinf.c"
Index: libgccm/i386/sse2_sqrt.c
===================================================================
*** libgccm/i386/sse2_sqrt.c (revision 0)
--- libgccm/i386/sse2_sqrt.c (revision 0)
***************
*** 0 ****
--- 1,3 ----
+ #include "sse2_defines.h"
+ #pragma GCC visibility push(hidden)
+ #include "dbl-64/e_sqrt.c"
Index: libgccm/i386/sse2_sin.c
===================================================================
*** libgccm/i386/sse2_sin.c (revision 0)
--- libgccm/i386/sse2_sin.c (revision 0)
***************
*** 0 ****
--- 1,2 ----
+ #include "sse2_defines.h"
+ #include "dbl-64/s_sin.c"
Index: libgccm/i386/sse_atan2f.c
===================================================================
*** libgccm/i386/sse_atan2f.c (revision 0)
--- libgccm/i386/sse_atan2f.c (revision 0)
***************
*** 0 ****
--- 1,2 ----
+ #include "sse2_defines.h"
+ #include "flt-32/e_atan2f.c"
Index: libgccm/i386/sse2_asin.c
===================================================================
*** libgccm/i386/sse2_asin.c (revision 0)
--- libgccm/i386/sse2_asin.c (revision 0)
***************
*** 0 ****
--- 1,2 ----
+ #include "sse2_defines.h"
+ #include "dbl-64/e_asin.c"
Index: libgccm/i386/Makefile.am
===================================================================
*** libgccm/i386/Makefile.am (revision 0)
--- libgccm/i386/Makefile.am (revision 0)
***************
*** 0 ****
--- 1,75 ----
+ ## Makefile for the i386 directory of the libgccm library.
+ ##
+ ## Copyright (C) 2005
+ ## Free Software Foundation, Inc.
+ ##
+
+ # May be used by various substitution variables.
+ gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
+
+
+ AM_CFLAGS = -Wall -O2 -g -msse2 -msseregparm -mfpmath=sse -march=pentium3 \
+ -fno-math-errno -fno-trapping-math -ffinite-math-only \
+ -fno-rounding-math -fno-signaling-nans -D__NO_MATH_INLINES -I@srcdir@/..
+
+ noinst_LTLIBRARIES = libsse2.la
+
+ libsse2_la_SOURCES = \
+ sse2_asin.c sse2_atan2.c sse2_atan.c sse2_branred.c sse2_doasin.c \
+ sse2_dosincos.c sse2_exp.c sse2_halfulp.c sse2_k_rem_pio2.c \
+ sse2_log10.c sse2_log.c sse2_mpa.c sse2_pow.c \
+ sse2_rem_pio2.c sse2_sin.c sse2_sincos32.c sse2_slowexp.c \
+ sse2_slowpow.c sse2_sqrt.c sse2_tan.c sse_acosf.c sse_asinf.c sse_atan2f.c \
+ sse_atanf.c sse_cosf.c sse_expf.c \
+ sse_k_cosf.c sse_k_rem_pio2f.c sse_k_sinf.c \
+ sse_k_tanf.c sse_log10f.c sse_logf.c sse_powf.c sse_rem_pio2f.c \
+ sse_sinf.c sse_sqrtf.c sse_tanf.c sse_t_exp.c
+
+
+ # XXX hack alert
+ # From libffi/Makefile.am
+
+ # Work around what appears to be a GNU make bug handling MAKEFLAGS
+ # values defined in terms of make variables, as is the case for CC and
+ # friends when we are called from the top level Makefile.
+ AM_MAKEFLAGS = \
+ "AR_FLAGS=$(AR_FLAGS)" \
+ "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
+ "CFLAGS=$(CFLAGS)" \
+ "CXXFLAGS=$(CXXFLAGS)" \
+ "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
+ "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
+ "INSTALL=$(INSTALL)" \
+ "INSTALL_DATA=$(INSTALL_DATA)" \
+ "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
+ "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
+ "JC1FLAGS=$(JC1FLAGS)" \
+ "LDFLAGS=$(LDFLAGS)" \
+ "LIBCFLAGS=$(LIBCFLAGS)" \
+ "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
+ "MAKE=$(MAKE)" \
+ "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
+ "PICFLAG=$(PICFLAG)" \
+ "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
+ "SHELL=$(SHELL)" \
+ "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
+ "exec_prefix=$(exec_prefix)" \
+ "infodir=$(infodir)" \
+ "libdir=$(libdir)" \
+ "prefix=$(prefix)" \
+ "includedir=$(includedir)" \
+ "AR=$(AR)" \
+ "AS=$(AS)" \
+ "CC=$(CC)" \
+ "CXX=$(CXX)" \
+ "LD=$(LD)" \
+ "LIBCFLAGS=$(LIBCFLAGS)" \
+ "NM=$(NM)" \
+ "PICFLAG=$(PICFLAG)" \
+ "RANLIB=$(RANLIB)" \
+ "DESTDIR=$(DESTDIR)"
+
+ MAKEOVERRIDES=
+
+ ## ################################################################
+
Index: libgccm/i386/sse_t_exp.c
===================================================================
*** libgccm/i386/sse_t_exp.c (revision 0)
--- libgccm/i386/sse_t_exp.c (revision 0)
***************
*** 0 ****
--- 1 ----
+ #include "dbl-64/t_exp.c"
Index: libgccm/i386/sse2_slowexp.c
===================================================================
*** libgccm/i386/sse2_slowexp.c (revision 0)
--- libgccm/i386/sse2_slowexp.c (revision 0)
***************
*** 0 ****
--- 1,3 ----
+ #include "sse2_defines.h"
+ #pragma GCC visibility push(hidden)
+ #include "dbl-64/slowexp.c"