mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-31 15:31:11 +08:00
Remove unused functions, take 2.
2016-12-19 Janne Blomqvist <jb@gcc.gnu.org> * Actually remove files that should have been removed by r243799. This line, and those below, will be ignored-- M libgfortran/ChangeLog D libgfortran/generated/exponent_r10.c D libgfortran/generated/exponent_r16.c D libgfortran/generated/exponent_r4.c D libgfortran/generated/exponent_r8.c D libgfortran/generated/fraction_r10.c D libgfortran/generated/fraction_r16.c D libgfortran/generated/fraction_r4.c D libgfortran/generated/fraction_r8.c D libgfortran/generated/nearest_r10.c D libgfortran/generated/nearest_r16.c D libgfortran/generated/nearest_r4.c D libgfortran/generated/nearest_r8.c D libgfortran/generated/rrspacing_r10.c D libgfortran/generated/rrspacing_r16.c D libgfortran/generated/rrspacing_r4.c D libgfortran/generated/rrspacing_r8.c D libgfortran/generated/set_exponent_r10.c D libgfortran/generated/set_exponent_r16.c D libgfortran/generated/set_exponent_r4.c D libgfortran/generated/set_exponent_r8.c D libgfortran/generated/spacing_r10.c D libgfortran/generated/spacing_r16.c D libgfortran/generated/spacing_r4.c D libgfortran/generated/spacing_r8.c D libgfortran/generated/transpose_c10.c D libgfortran/generated/transpose_c16.c D libgfortran/generated/transpose_c4.c D libgfortran/generated/transpose_c8.c D libgfortran/generated/transpose_i16.c D libgfortran/generated/transpose_i4.c D libgfortran/generated/transpose_i8.c D libgfortran/generated/transpose_r10.c D libgfortran/generated/transpose_r16.c D libgfortran/generated/transpose_r4.c D libgfortran/generated/transpose_r8.c D libgfortran/intrinsics/malloc.c D libgfortran/intrinsics/transpose_generic.c D libgfortran/m4/exponent.m4 D libgfortran/m4/fraction.m4 D libgfortran/m4/nearest.m4 D libgfortran/m4/rrspacing.m4 D libgfortran/m4/set_exponent.m4 D libgfortran/m4/spacing.m4 D libgfortran/m4/transpose.m4 From-SVN: r243804
This commit is contained in:
parent
03506f8cc3
commit
4daecdb623
@ -1,3 +1,7 @@
|
||||
2016-12-19 Janne Blomqvist <jb@gcc.gnu.org>
|
||||
|
||||
* Actually remove files that should have been removed by r243799.
|
||||
|
||||
2016-12-19 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
|
||||
|
||||
* gfortran.map: Remove _gfortran_stop_numeric_f08.
|
||||
|
@ -1,45 +0,0 @@
|
||||
/* Implementation of the EXPONENT intrinsic
|
||||
Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
||||
Contributed by Richard Henderson <rth@redhat.com>.
|
||||
|
||||
This file is part of the GNU Fortran 95 runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
|
||||
|
||||
|
||||
#define MATHFUNC(funcname) funcname ## l
|
||||
|
||||
#if defined (HAVE_GFC_REAL_10) && defined (HAVE_FREXPL)
|
||||
|
||||
extern GFC_INTEGER_4 exponent_r10 (GFC_REAL_10 s);
|
||||
export_proto(exponent_r10);
|
||||
|
||||
GFC_INTEGER_4
|
||||
exponent_r10 (GFC_REAL_10 s)
|
||||
{
|
||||
int ret;
|
||||
MATHFUNC(frexp) (s, &ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif
|
@ -1,49 +0,0 @@
|
||||
/* Implementation of the EXPONENT intrinsic
|
||||
Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
||||
Contributed by Richard Henderson <rth@redhat.com>.
|
||||
|
||||
This file is part of the GNU Fortran 95 runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
|
||||
|
||||
|
||||
#if defined(GFC_REAL_16_IS_FLOAT128)
|
||||
#define MATHFUNC(funcname) funcname ## q
|
||||
#else
|
||||
#define MATHFUNC(funcname) funcname ## l
|
||||
#endif
|
||||
|
||||
#if defined (HAVE_GFC_REAL_16) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_FREXPL))
|
||||
|
||||
extern GFC_INTEGER_4 exponent_r16 (GFC_REAL_16 s);
|
||||
export_proto(exponent_r16);
|
||||
|
||||
GFC_INTEGER_4
|
||||
exponent_r16 (GFC_REAL_16 s)
|
||||
{
|
||||
int ret;
|
||||
MATHFUNC(frexp) (s, &ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif
|
@ -1,45 +0,0 @@
|
||||
/* Implementation of the EXPONENT intrinsic
|
||||
Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
||||
Contributed by Richard Henderson <rth@redhat.com>.
|
||||
|
||||
This file is part of the GNU Fortran 95 runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
|
||||
|
||||
|
||||
#define MATHFUNC(funcname) funcname ## f
|
||||
|
||||
#if defined (HAVE_GFC_REAL_4) && defined (HAVE_FREXPF)
|
||||
|
||||
extern GFC_INTEGER_4 exponent_r4 (GFC_REAL_4 s);
|
||||
export_proto(exponent_r4);
|
||||
|
||||
GFC_INTEGER_4
|
||||
exponent_r4 (GFC_REAL_4 s)
|
||||
{
|
||||
int ret;
|
||||
MATHFUNC(frexp) (s, &ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif
|
@ -1,45 +0,0 @@
|
||||
/* Implementation of the EXPONENT intrinsic
|
||||
Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
||||
Contributed by Richard Henderson <rth@redhat.com>.
|
||||
|
||||
This file is part of the GNU Fortran 95 runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
|
||||
|
||||
|
||||
#define MATHFUNC(funcname) funcname
|
||||
|
||||
#if defined (HAVE_GFC_REAL_8) && defined (HAVE_FREXP)
|
||||
|
||||
extern GFC_INTEGER_4 exponent_r8 (GFC_REAL_8 s);
|
||||
export_proto(exponent_r8);
|
||||
|
||||
GFC_INTEGER_4
|
||||
exponent_r8 (GFC_REAL_8 s)
|
||||
{
|
||||
int ret;
|
||||
MATHFUNC(frexp) (s, &ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif
|
@ -1,44 +0,0 @@
|
||||
/* Implementation of the FRACTION intrinsic
|
||||
Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
||||
Contributed by Richard Henderson <rth@redhat.com>.
|
||||
|
||||
This file is part of the GNU Fortran 95 runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
|
||||
|
||||
|
||||
#define MATHFUNC(funcname) funcname ## l
|
||||
|
||||
#if defined (HAVE_GFC_REAL_10) && defined (HAVE_FREXPL)
|
||||
|
||||
extern GFC_REAL_10 fraction_r10 (GFC_REAL_10 s);
|
||||
export_proto(fraction_r10);
|
||||
|
||||
GFC_REAL_10
|
||||
fraction_r10 (GFC_REAL_10 s)
|
||||
{
|
||||
int dummy_exp;
|
||||
return MATHFUNC(frexp) (s, &dummy_exp);
|
||||
}
|
||||
|
||||
#endif
|
@ -1,48 +0,0 @@
|
||||
/* Implementation of the FRACTION intrinsic
|
||||
Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
||||
Contributed by Richard Henderson <rth@redhat.com>.
|
||||
|
||||
This file is part of the GNU Fortran 95 runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
|
||||
|
||||
|
||||
#if defined(GFC_REAL_16_IS_FLOAT128)
|
||||
#define MATHFUNC(funcname) funcname ## q
|
||||
#else
|
||||
#define MATHFUNC(funcname) funcname ## l
|
||||
#endif
|
||||
|
||||
#if defined (HAVE_GFC_REAL_16) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_FREXPL))
|
||||
|
||||
extern GFC_REAL_16 fraction_r16 (GFC_REAL_16 s);
|
||||
export_proto(fraction_r16);
|
||||
|
||||
GFC_REAL_16
|
||||
fraction_r16 (GFC_REAL_16 s)
|
||||
{
|
||||
int dummy_exp;
|
||||
return MATHFUNC(frexp) (s, &dummy_exp);
|
||||
}
|
||||
|
||||
#endif
|
@ -1,44 +0,0 @@
|
||||
/* Implementation of the FRACTION intrinsic
|
||||
Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
||||
Contributed by Richard Henderson <rth@redhat.com>.
|
||||
|
||||
This file is part of the GNU Fortran 95 runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
|
||||
|
||||
|
||||
#define MATHFUNC(funcname) funcname ## f
|
||||
|
||||
#if defined (HAVE_GFC_REAL_4) && defined (HAVE_FREXPF)
|
||||
|
||||
extern GFC_REAL_4 fraction_r4 (GFC_REAL_4 s);
|
||||
export_proto(fraction_r4);
|
||||
|
||||
GFC_REAL_4
|
||||
fraction_r4 (GFC_REAL_4 s)
|
||||
{
|
||||
int dummy_exp;
|
||||
return MATHFUNC(frexp) (s, &dummy_exp);
|
||||
}
|
||||
|
||||
#endif
|
@ -1,44 +0,0 @@
|
||||
/* Implementation of the FRACTION intrinsic
|
||||
Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
||||
Contributed by Richard Henderson <rth@redhat.com>.
|
||||
|
||||
This file is part of the GNU Fortran 95 runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
|
||||
|
||||
|
||||
#define MATHFUNC(funcname) funcname
|
||||
|
||||
#if defined (HAVE_GFC_REAL_8) && defined (HAVE_FREXP)
|
||||
|
||||
extern GFC_REAL_8 fraction_r8 (GFC_REAL_8 s);
|
||||
export_proto(fraction_r8);
|
||||
|
||||
GFC_REAL_8
|
||||
fraction_r8 (GFC_REAL_8 s)
|
||||
{
|
||||
int dummy_exp;
|
||||
return MATHFUNC(frexp) (s, &dummy_exp);
|
||||
}
|
||||
|
||||
#endif
|
@ -1,51 +0,0 @@
|
||||
/* Implementation of the NEAREST intrinsic
|
||||
Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
||||
Contributed by Richard Henderson <rth@redhat.com>.
|
||||
|
||||
This file is part of the GNU Fortran 95 runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
|
||||
|
||||
|
||||
#define MATHFUNC(funcname) funcname ## l
|
||||
|
||||
#if defined (HAVE_GFC_REAL_10) && defined (HAVE_COPYSIGNL) && defined (HAVE_NEXTAFTERL)
|
||||
|
||||
extern GFC_REAL_10 nearest_r10 (GFC_REAL_10 s, GFC_REAL_10 dir);
|
||||
export_proto(nearest_r10);
|
||||
|
||||
GFC_REAL_10
|
||||
nearest_r10 (GFC_REAL_10 s, GFC_REAL_10 dir)
|
||||
{
|
||||
dir = MATHFUNC(copysign) (MATHFUNC(__builtin_inf) (), dir);
|
||||
if (FLT_EVAL_METHOD != 0)
|
||||
{
|
||||
/* ??? Work around glibc bug on x86. */
|
||||
volatile GFC_REAL_10 r = MATHFUNC(nextafter) (s, dir);
|
||||
return r;
|
||||
}
|
||||
else
|
||||
return MATHFUNC(nextafter) (s, dir);
|
||||
}
|
||||
|
||||
#endif
|
@ -1,55 +0,0 @@
|
||||
/* Implementation of the NEAREST intrinsic
|
||||
Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
||||
Contributed by Richard Henderson <rth@redhat.com>.
|
||||
|
||||
This file is part of the GNU Fortran 95 runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
|
||||
|
||||
|
||||
#if defined(GFC_REAL_16_IS_FLOAT128)
|
||||
#define MATHFUNC(funcname) funcname ## q
|
||||
#else
|
||||
#define MATHFUNC(funcname) funcname ## l
|
||||
#endif
|
||||
|
||||
#if defined (HAVE_GFC_REAL_16) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_COPYSIGNL)) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_NEXTAFTERL))
|
||||
|
||||
extern GFC_REAL_16 nearest_r16 (GFC_REAL_16 s, GFC_REAL_16 dir);
|
||||
export_proto(nearest_r16);
|
||||
|
||||
GFC_REAL_16
|
||||
nearest_r16 (GFC_REAL_16 s, GFC_REAL_16 dir)
|
||||
{
|
||||
dir = MATHFUNC(copysign) (MATHFUNC(__builtin_inf) (), dir);
|
||||
if (FLT_EVAL_METHOD != 0)
|
||||
{
|
||||
/* ??? Work around glibc bug on x86. */
|
||||
volatile GFC_REAL_16 r = MATHFUNC(nextafter) (s, dir);
|
||||
return r;
|
||||
}
|
||||
else
|
||||
return MATHFUNC(nextafter) (s, dir);
|
||||
}
|
||||
|
||||
#endif
|
@ -1,51 +0,0 @@
|
||||
/* Implementation of the NEAREST intrinsic
|
||||
Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
||||
Contributed by Richard Henderson <rth@redhat.com>.
|
||||
|
||||
This file is part of the GNU Fortran 95 runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
|
||||
|
||||
|
||||
#define MATHFUNC(funcname) funcname ## f
|
||||
|
||||
#if defined (HAVE_GFC_REAL_4) && defined (HAVE_COPYSIGNF) && defined (HAVE_NEXTAFTERF)
|
||||
|
||||
extern GFC_REAL_4 nearest_r4 (GFC_REAL_4 s, GFC_REAL_4 dir);
|
||||
export_proto(nearest_r4);
|
||||
|
||||
GFC_REAL_4
|
||||
nearest_r4 (GFC_REAL_4 s, GFC_REAL_4 dir)
|
||||
{
|
||||
dir = MATHFUNC(copysign) (MATHFUNC(__builtin_inf) (), dir);
|
||||
if (FLT_EVAL_METHOD != 0)
|
||||
{
|
||||
/* ??? Work around glibc bug on x86. */
|
||||
volatile GFC_REAL_4 r = MATHFUNC(nextafter) (s, dir);
|
||||
return r;
|
||||
}
|
||||
else
|
||||
return MATHFUNC(nextafter) (s, dir);
|
||||
}
|
||||
|
||||
#endif
|
@ -1,51 +0,0 @@
|
||||
/* Implementation of the NEAREST intrinsic
|
||||
Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
||||
Contributed by Richard Henderson <rth@redhat.com>.
|
||||
|
||||
This file is part of the GNU Fortran 95 runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
|
||||
|
||||
|
||||
#define MATHFUNC(funcname) funcname
|
||||
|
||||
#if defined (HAVE_GFC_REAL_8) && defined (HAVE_COPYSIGN) && defined (HAVE_NEXTAFTER)
|
||||
|
||||
extern GFC_REAL_8 nearest_r8 (GFC_REAL_8 s, GFC_REAL_8 dir);
|
||||
export_proto(nearest_r8);
|
||||
|
||||
GFC_REAL_8
|
||||
nearest_r8 (GFC_REAL_8 s, GFC_REAL_8 dir)
|
||||
{
|
||||
dir = MATHFUNC(copysign) (MATHFUNC(__builtin_inf) (), dir);
|
||||
if (FLT_EVAL_METHOD != 0)
|
||||
{
|
||||
/* ??? Work around glibc bug on x86. */
|
||||
volatile GFC_REAL_8 r = MATHFUNC(nextafter) (s, dir);
|
||||
return r;
|
||||
}
|
||||
else
|
||||
return MATHFUNC(nextafter) (s, dir);
|
||||
}
|
||||
|
||||
#endif
|
@ -1,54 +0,0 @@
|
||||
/* Implementation of the RRSPACING intrinsic
|
||||
Copyright (C) 2006-2016 Free Software Foundation, Inc.
|
||||
Contributed by Steven G. Kargl <kargl@gcc.gnu.org>
|
||||
|
||||
This file is part of the GNU Fortran 95 runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
|
||||
|
||||
|
||||
#define MATHFUNC(funcname) funcname ## l
|
||||
|
||||
#if defined (HAVE_GFC_REAL_10) && defined (HAVE_FABSL) && defined (HAVE_FREXPL)
|
||||
|
||||
extern GFC_REAL_10 rrspacing_r10 (GFC_REAL_10 s, int p);
|
||||
export_proto(rrspacing_r10);
|
||||
|
||||
GFC_REAL_10
|
||||
rrspacing_r10 (GFC_REAL_10 s, int p)
|
||||
{
|
||||
int e;
|
||||
GFC_REAL_10 x;
|
||||
x = MATHFUNC(fabs) (s);
|
||||
if (x == 0.)
|
||||
return 0.;
|
||||
MATHFUNC(frexp) (s, &e);
|
||||
#if defined (HAVE_LDEXPL)
|
||||
return MATHFUNC(ldexp) (x, p - e);
|
||||
#else
|
||||
return MATHFUNC(scalbn) (x, p - e);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endif
|
@ -1,58 +0,0 @@
|
||||
/* Implementation of the RRSPACING intrinsic
|
||||
Copyright (C) 2006-2016 Free Software Foundation, Inc.
|
||||
Contributed by Steven G. Kargl <kargl@gcc.gnu.org>
|
||||
|
||||
This file is part of the GNU Fortran 95 runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
|
||||
|
||||
|
||||
#if defined(GFC_REAL_16_IS_FLOAT128)
|
||||
#define MATHFUNC(funcname) funcname ## q
|
||||
#else
|
||||
#define MATHFUNC(funcname) funcname ## l
|
||||
#endif
|
||||
|
||||
#if defined (HAVE_GFC_REAL_16) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_FABSL)) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_FREXPL))
|
||||
|
||||
extern GFC_REAL_16 rrspacing_r16 (GFC_REAL_16 s, int p);
|
||||
export_proto(rrspacing_r16);
|
||||
|
||||
GFC_REAL_16
|
||||
rrspacing_r16 (GFC_REAL_16 s, int p)
|
||||
{
|
||||
int e;
|
||||
GFC_REAL_16 x;
|
||||
x = MATHFUNC(fabs) (s);
|
||||
if (x == 0.)
|
||||
return 0.;
|
||||
MATHFUNC(frexp) (s, &e);
|
||||
#if (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_LDEXPL))
|
||||
return MATHFUNC(ldexp) (x, p - e);
|
||||
#else
|
||||
return MATHFUNC(scalbn) (x, p - e);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endif
|
@ -1,54 +0,0 @@
|
||||
/* Implementation of the RRSPACING intrinsic
|
||||
Copyright (C) 2006-2016 Free Software Foundation, Inc.
|
||||
Contributed by Steven G. Kargl <kargl@gcc.gnu.org>
|
||||
|
||||
This file is part of the GNU Fortran 95 runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
|
||||
|
||||
|
||||
#define MATHFUNC(funcname) funcname ## f
|
||||
|
||||
#if defined (HAVE_GFC_REAL_4) && defined (HAVE_FABSF) && defined (HAVE_FREXPF)
|
||||
|
||||
extern GFC_REAL_4 rrspacing_r4 (GFC_REAL_4 s, int p);
|
||||
export_proto(rrspacing_r4);
|
||||
|
||||
GFC_REAL_4
|
||||
rrspacing_r4 (GFC_REAL_4 s, int p)
|
||||
{
|
||||
int e;
|
||||
GFC_REAL_4 x;
|
||||
x = MATHFUNC(fabs) (s);
|
||||
if (x == 0.)
|
||||
return 0.;
|
||||
MATHFUNC(frexp) (s, &e);
|
||||
#if defined (HAVE_LDEXPF)
|
||||
return MATHFUNC(ldexp) (x, p - e);
|
||||
#else
|
||||
return MATHFUNC(scalbn) (x, p - e);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endif
|
@ -1,54 +0,0 @@
|
||||
/* Implementation of the RRSPACING intrinsic
|
||||
Copyright (C) 2006-2016 Free Software Foundation, Inc.
|
||||
Contributed by Steven G. Kargl <kargl@gcc.gnu.org>
|
||||
|
||||
This file is part of the GNU Fortran 95 runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
|
||||
|
||||
|
||||
#define MATHFUNC(funcname) funcname
|
||||
|
||||
#if defined (HAVE_GFC_REAL_8) && defined (HAVE_FABS) && defined (HAVE_FREXP)
|
||||
|
||||
extern GFC_REAL_8 rrspacing_r8 (GFC_REAL_8 s, int p);
|
||||
export_proto(rrspacing_r8);
|
||||
|
||||
GFC_REAL_8
|
||||
rrspacing_r8 (GFC_REAL_8 s, int p)
|
||||
{
|
||||
int e;
|
||||
GFC_REAL_8 x;
|
||||
x = MATHFUNC(fabs) (s);
|
||||
if (x == 0.)
|
||||
return 0.;
|
||||
MATHFUNC(frexp) (s, &e);
|
||||
#if defined (HAVE_LDEXP)
|
||||
return MATHFUNC(ldexp) (x, p - e);
|
||||
#else
|
||||
return MATHFUNC(scalbn) (x, p - e);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endif
|
@ -1,44 +0,0 @@
|
||||
/* Implementation of the SET_EXPONENT intrinsic
|
||||
Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
||||
Contributed by Richard Henderson <rth@redhat.com>.
|
||||
|
||||
This file is part of the GNU Fortran 95 runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
|
||||
|
||||
|
||||
#define MATHFUNC(funcname) funcname ## l
|
||||
|
||||
#if defined (HAVE_GFC_REAL_10) && defined (HAVE_SCALBNL) && defined (HAVE_FREXPL)
|
||||
|
||||
extern GFC_REAL_10 set_exponent_r10 (GFC_REAL_10 s, GFC_INTEGER_4 i);
|
||||
export_proto(set_exponent_r10);
|
||||
|
||||
GFC_REAL_10
|
||||
set_exponent_r10 (GFC_REAL_10 s, GFC_INTEGER_4 i)
|
||||
{
|
||||
int dummy_exp;
|
||||
return MATHFUNC(scalbn) (MATHFUNC(frexp) (s, &dummy_exp), i);
|
||||
}
|
||||
|
||||
#endif
|
@ -1,48 +0,0 @@
|
||||
/* Implementation of the SET_EXPONENT intrinsic
|
||||
Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
||||
Contributed by Richard Henderson <rth@redhat.com>.
|
||||
|
||||
This file is part of the GNU Fortran 95 runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
|
||||
|
||||
|
||||
#if defined(GFC_REAL_16_IS_FLOAT128)
|
||||
#define MATHFUNC(funcname) funcname ## q
|
||||
#else
|
||||
#define MATHFUNC(funcname) funcname ## l
|
||||
#endif
|
||||
|
||||
#if defined (HAVE_GFC_REAL_16) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_SCALBNL)) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_FREXPL))
|
||||
|
||||
extern GFC_REAL_16 set_exponent_r16 (GFC_REAL_16 s, GFC_INTEGER_4 i);
|
||||
export_proto(set_exponent_r16);
|
||||
|
||||
GFC_REAL_16
|
||||
set_exponent_r16 (GFC_REAL_16 s, GFC_INTEGER_4 i)
|
||||
{
|
||||
int dummy_exp;
|
||||
return MATHFUNC(scalbn) (MATHFUNC(frexp) (s, &dummy_exp), i);
|
||||
}
|
||||
|
||||
#endif
|
@ -1,44 +0,0 @@
|
||||
/* Implementation of the SET_EXPONENT intrinsic
|
||||
Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
||||
Contributed by Richard Henderson <rth@redhat.com>.
|
||||
|
||||
This file is part of the GNU Fortran 95 runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
|
||||
|
||||
|
||||
#define MATHFUNC(funcname) funcname ## f
|
||||
|
||||
#if defined (HAVE_GFC_REAL_4) && defined (HAVE_SCALBNF) && defined (HAVE_FREXPF)
|
||||
|
||||
extern GFC_REAL_4 set_exponent_r4 (GFC_REAL_4 s, GFC_INTEGER_4 i);
|
||||
export_proto(set_exponent_r4);
|
||||
|
||||
GFC_REAL_4
|
||||
set_exponent_r4 (GFC_REAL_4 s, GFC_INTEGER_4 i)
|
||||
{
|
||||
int dummy_exp;
|
||||
return MATHFUNC(scalbn) (MATHFUNC(frexp) (s, &dummy_exp), i);
|
||||
}
|
||||
|
||||
#endif
|
@ -1,44 +0,0 @@
|
||||
/* Implementation of the SET_EXPONENT intrinsic
|
||||
Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
||||
Contributed by Richard Henderson <rth@redhat.com>.
|
||||
|
||||
This file is part of the GNU Fortran 95 runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
|
||||
|
||||
|
||||
#define MATHFUNC(funcname) funcname
|
||||
|
||||
#if defined (HAVE_GFC_REAL_8) && defined (HAVE_SCALBN) && defined (HAVE_FREXP)
|
||||
|
||||
extern GFC_REAL_8 set_exponent_r8 (GFC_REAL_8 s, GFC_INTEGER_4 i);
|
||||
export_proto(set_exponent_r8);
|
||||
|
||||
GFC_REAL_8
|
||||
set_exponent_r8 (GFC_REAL_8 s, GFC_INTEGER_4 i)
|
||||
{
|
||||
int dummy_exp;
|
||||
return MATHFUNC(scalbn) (MATHFUNC(frexp) (s, &dummy_exp), i);
|
||||
}
|
||||
|
||||
#endif
|
@ -1,53 +0,0 @@
|
||||
/* Implementation of the SPACING intrinsic
|
||||
Copyright (C) 2006-2016 Free Software Foundation, Inc.
|
||||
Contributed by Steven G. Kargl <kargl@gcc.gnu.org>
|
||||
|
||||
This file is part of the GNU Fortran 95 runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
|
||||
|
||||
|
||||
#define MATHFUNC(funcname) funcname ## l
|
||||
|
||||
#if defined (HAVE_GFC_REAL_10) && defined (HAVE_FREXPL)
|
||||
|
||||
extern GFC_REAL_10 spacing_r10 (GFC_REAL_10 s, int p, int emin, GFC_REAL_10 tiny);
|
||||
export_proto(spacing_r10);
|
||||
|
||||
GFC_REAL_10
|
||||
spacing_r10 (GFC_REAL_10 s, int p, int emin, GFC_REAL_10 tiny)
|
||||
{
|
||||
int e;
|
||||
if (s == 0.)
|
||||
return tiny;
|
||||
MATHFUNC(frexp) (s, &e);
|
||||
e = e - p;
|
||||
e = e > emin ? e : emin;
|
||||
#if defined (HAVE_LDEXPL)
|
||||
return MATHFUNC(ldexp) (1., e);
|
||||
#else
|
||||
return MATHFUNC(scalbn) (1., e);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
@ -1,57 +0,0 @@
|
||||
/* Implementation of the SPACING intrinsic
|
||||
Copyright (C) 2006-2016 Free Software Foundation, Inc.
|
||||
Contributed by Steven G. Kargl <kargl@gcc.gnu.org>
|
||||
|
||||
This file is part of the GNU Fortran 95 runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
|
||||
|
||||
|
||||
#if defined(GFC_REAL_16_IS_FLOAT128)
|
||||
#define MATHFUNC(funcname) funcname ## q
|
||||
#else
|
||||
#define MATHFUNC(funcname) funcname ## l
|
||||
#endif
|
||||
|
||||
#if defined (HAVE_GFC_REAL_16) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_FREXPL))
|
||||
|
||||
extern GFC_REAL_16 spacing_r16 (GFC_REAL_16 s, int p, int emin, GFC_REAL_16 tiny);
|
||||
export_proto(spacing_r16);
|
||||
|
||||
GFC_REAL_16
|
||||
spacing_r16 (GFC_REAL_16 s, int p, int emin, GFC_REAL_16 tiny)
|
||||
{
|
||||
int e;
|
||||
if (s == 0.)
|
||||
return tiny;
|
||||
MATHFUNC(frexp) (s, &e);
|
||||
e = e - p;
|
||||
e = e > emin ? e : emin;
|
||||
#if (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_LDEXPL))
|
||||
return MATHFUNC(ldexp) (1., e);
|
||||
#else
|
||||
return MATHFUNC(scalbn) (1., e);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
@ -1,53 +0,0 @@
|
||||
/* Implementation of the SPACING intrinsic
|
||||
Copyright (C) 2006-2016 Free Software Foundation, Inc.
|
||||
Contributed by Steven G. Kargl <kargl@gcc.gnu.org>
|
||||
|
||||
This file is part of the GNU Fortran 95 runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
|
||||
|
||||
|
||||
#define MATHFUNC(funcname) funcname ## f
|
||||
|
||||
#if defined (HAVE_GFC_REAL_4) && defined (HAVE_FREXPF)
|
||||
|
||||
extern GFC_REAL_4 spacing_r4 (GFC_REAL_4 s, int p, int emin, GFC_REAL_4 tiny);
|
||||
export_proto(spacing_r4);
|
||||
|
||||
GFC_REAL_4
|
||||
spacing_r4 (GFC_REAL_4 s, int p, int emin, GFC_REAL_4 tiny)
|
||||
{
|
||||
int e;
|
||||
if (s == 0.)
|
||||
return tiny;
|
||||
MATHFUNC(frexp) (s, &e);
|
||||
e = e - p;
|
||||
e = e > emin ? e : emin;
|
||||
#if defined (HAVE_LDEXPF)
|
||||
return MATHFUNC(ldexp) (1., e);
|
||||
#else
|
||||
return MATHFUNC(scalbn) (1., e);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
@ -1,53 +0,0 @@
|
||||
/* Implementation of the SPACING intrinsic
|
||||
Copyright (C) 2006-2016 Free Software Foundation, Inc.
|
||||
Contributed by Steven G. Kargl <kargl@gcc.gnu.org>
|
||||
|
||||
This file is part of the GNU Fortran 95 runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
|
||||
|
||||
|
||||
#define MATHFUNC(funcname) funcname
|
||||
|
||||
#if defined (HAVE_GFC_REAL_8) && defined (HAVE_FREXP)
|
||||
|
||||
extern GFC_REAL_8 spacing_r8 (GFC_REAL_8 s, int p, int emin, GFC_REAL_8 tiny);
|
||||
export_proto(spacing_r8);
|
||||
|
||||
GFC_REAL_8
|
||||
spacing_r8 (GFC_REAL_8 s, int p, int emin, GFC_REAL_8 tiny)
|
||||
{
|
||||
int e;
|
||||
if (s == 0.)
|
||||
return tiny;
|
||||
MATHFUNC(frexp) (s, &e);
|
||||
e = e - p;
|
||||
e = e > emin ? e : emin;
|
||||
#if defined (HAVE_LDEXP)
|
||||
return MATHFUNC(ldexp) (1., e);
|
||||
#else
|
||||
return MATHFUNC(scalbn) (1., e);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
@ -1,115 +0,0 @@
|
||||
/* Implementation of the TRANSPOSE intrinsic
|
||||
Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
||||
Contributed by Tobias Schlüter
|
||||
|
||||
This file is part of the GNU Fortran runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
#include <assert.h>
|
||||
|
||||
|
||||
#if defined (HAVE_GFC_COMPLEX_10)
|
||||
|
||||
extern void transpose_c10 (gfc_array_c10 * const restrict ret,
|
||||
gfc_array_c10 * const restrict source);
|
||||
export_proto(transpose_c10);
|
||||
|
||||
void
|
||||
transpose_c10 (gfc_array_c10 * const restrict ret,
|
||||
gfc_array_c10 * const restrict source)
|
||||
{
|
||||
/* r.* indicates the return array. */
|
||||
index_type rxstride, rystride;
|
||||
GFC_COMPLEX_10 * restrict rptr;
|
||||
/* s.* indicates the source array. */
|
||||
index_type sxstride, systride;
|
||||
const GFC_COMPLEX_10 *sptr;
|
||||
|
||||
index_type xcount, ycount;
|
||||
index_type x, y;
|
||||
|
||||
assert (GFC_DESCRIPTOR_RANK (source) == 2);
|
||||
|
||||
if (ret->base_addr == NULL)
|
||||
{
|
||||
assert (GFC_DESCRIPTOR_RANK (ret) == 2);
|
||||
assert (ret->dtype == source->dtype);
|
||||
|
||||
GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
|
||||
1);
|
||||
|
||||
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
|
||||
GFC_DESCRIPTOR_EXTENT(source, 1));
|
||||
|
||||
ret->base_addr = xmallocarray (size0 ((array_t *) ret),
|
||||
sizeof (GFC_COMPLEX_10));
|
||||
ret->offset = 0;
|
||||
} else if (unlikely (compile_options.bounds_check))
|
||||
{
|
||||
index_type ret_extent, src_extent;
|
||||
|
||||
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
|
||||
src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
|
||||
|
||||
if (src_extent != ret_extent)
|
||||
runtime_error ("Incorrect extent in return value of TRANSPOSE"
|
||||
" intrinsic in dimension 1: is %ld,"
|
||||
" should be %ld", (long int) src_extent,
|
||||
(long int) ret_extent);
|
||||
|
||||
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
|
||||
src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
|
||||
|
||||
if (src_extent != ret_extent)
|
||||
runtime_error ("Incorrect extent in return value of TRANSPOSE"
|
||||
" intrinsic in dimension 2: is %ld,"
|
||||
" should be %ld", (long int) src_extent,
|
||||
(long int) ret_extent);
|
||||
|
||||
}
|
||||
|
||||
sxstride = GFC_DESCRIPTOR_STRIDE(source,0);
|
||||
systride = GFC_DESCRIPTOR_STRIDE(source,1);
|
||||
xcount = GFC_DESCRIPTOR_EXTENT(source,0);
|
||||
ycount = GFC_DESCRIPTOR_EXTENT(source,1);
|
||||
|
||||
rxstride = GFC_DESCRIPTOR_STRIDE(ret,0);
|
||||
rystride = GFC_DESCRIPTOR_STRIDE(ret,1);
|
||||
|
||||
rptr = ret->base_addr;
|
||||
sptr = source->base_addr;
|
||||
|
||||
for (y=0; y < ycount; y++)
|
||||
{
|
||||
for (x=0; x < xcount; x++)
|
||||
{
|
||||
*rptr = *sptr;
|
||||
|
||||
sptr += sxstride;
|
||||
rptr += rystride;
|
||||
}
|
||||
sptr += systride - (sxstride * xcount);
|
||||
rptr += rxstride - (rystride * xcount);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
@ -1,115 +0,0 @@
|
||||
/* Implementation of the TRANSPOSE intrinsic
|
||||
Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
||||
Contributed by Tobias Schlüter
|
||||
|
||||
This file is part of the GNU Fortran runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
#include <assert.h>
|
||||
|
||||
|
||||
#if defined (HAVE_GFC_COMPLEX_16)
|
||||
|
||||
extern void transpose_c16 (gfc_array_c16 * const restrict ret,
|
||||
gfc_array_c16 * const restrict source);
|
||||
export_proto(transpose_c16);
|
||||
|
||||
void
|
||||
transpose_c16 (gfc_array_c16 * const restrict ret,
|
||||
gfc_array_c16 * const restrict source)
|
||||
{
|
||||
/* r.* indicates the return array. */
|
||||
index_type rxstride, rystride;
|
||||
GFC_COMPLEX_16 * restrict rptr;
|
||||
/* s.* indicates the source array. */
|
||||
index_type sxstride, systride;
|
||||
const GFC_COMPLEX_16 *sptr;
|
||||
|
||||
index_type xcount, ycount;
|
||||
index_type x, y;
|
||||
|
||||
assert (GFC_DESCRIPTOR_RANK (source) == 2);
|
||||
|
||||
if (ret->base_addr == NULL)
|
||||
{
|
||||
assert (GFC_DESCRIPTOR_RANK (ret) == 2);
|
||||
assert (ret->dtype == source->dtype);
|
||||
|
||||
GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
|
||||
1);
|
||||
|
||||
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
|
||||
GFC_DESCRIPTOR_EXTENT(source, 1));
|
||||
|
||||
ret->base_addr = xmallocarray (size0 ((array_t *) ret),
|
||||
sizeof (GFC_COMPLEX_16));
|
||||
ret->offset = 0;
|
||||
} else if (unlikely (compile_options.bounds_check))
|
||||
{
|
||||
index_type ret_extent, src_extent;
|
||||
|
||||
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
|
||||
src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
|
||||
|
||||
if (src_extent != ret_extent)
|
||||
runtime_error ("Incorrect extent in return value of TRANSPOSE"
|
||||
" intrinsic in dimension 1: is %ld,"
|
||||
" should be %ld", (long int) src_extent,
|
||||
(long int) ret_extent);
|
||||
|
||||
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
|
||||
src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
|
||||
|
||||
if (src_extent != ret_extent)
|
||||
runtime_error ("Incorrect extent in return value of TRANSPOSE"
|
||||
" intrinsic in dimension 2: is %ld,"
|
||||
" should be %ld", (long int) src_extent,
|
||||
(long int) ret_extent);
|
||||
|
||||
}
|
||||
|
||||
sxstride = GFC_DESCRIPTOR_STRIDE(source,0);
|
||||
systride = GFC_DESCRIPTOR_STRIDE(source,1);
|
||||
xcount = GFC_DESCRIPTOR_EXTENT(source,0);
|
||||
ycount = GFC_DESCRIPTOR_EXTENT(source,1);
|
||||
|
||||
rxstride = GFC_DESCRIPTOR_STRIDE(ret,0);
|
||||
rystride = GFC_DESCRIPTOR_STRIDE(ret,1);
|
||||
|
||||
rptr = ret->base_addr;
|
||||
sptr = source->base_addr;
|
||||
|
||||
for (y=0; y < ycount; y++)
|
||||
{
|
||||
for (x=0; x < xcount; x++)
|
||||
{
|
||||
*rptr = *sptr;
|
||||
|
||||
sptr += sxstride;
|
||||
rptr += rystride;
|
||||
}
|
||||
sptr += systride - (sxstride * xcount);
|
||||
rptr += rxstride - (rystride * xcount);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
@ -1,115 +0,0 @@
|
||||
/* Implementation of the TRANSPOSE intrinsic
|
||||
Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
||||
Contributed by Tobias Schlüter
|
||||
|
||||
This file is part of the GNU Fortran runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
#include <assert.h>
|
||||
|
||||
|
||||
#if defined (HAVE_GFC_COMPLEX_4)
|
||||
|
||||
extern void transpose_c4 (gfc_array_c4 * const restrict ret,
|
||||
gfc_array_c4 * const restrict source);
|
||||
export_proto(transpose_c4);
|
||||
|
||||
void
|
||||
transpose_c4 (gfc_array_c4 * const restrict ret,
|
||||
gfc_array_c4 * const restrict source)
|
||||
{
|
||||
/* r.* indicates the return array. */
|
||||
index_type rxstride, rystride;
|
||||
GFC_COMPLEX_4 * restrict rptr;
|
||||
/* s.* indicates the source array. */
|
||||
index_type sxstride, systride;
|
||||
const GFC_COMPLEX_4 *sptr;
|
||||
|
||||
index_type xcount, ycount;
|
||||
index_type x, y;
|
||||
|
||||
assert (GFC_DESCRIPTOR_RANK (source) == 2);
|
||||
|
||||
if (ret->base_addr == NULL)
|
||||
{
|
||||
assert (GFC_DESCRIPTOR_RANK (ret) == 2);
|
||||
assert (ret->dtype == source->dtype);
|
||||
|
||||
GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
|
||||
1);
|
||||
|
||||
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
|
||||
GFC_DESCRIPTOR_EXTENT(source, 1));
|
||||
|
||||
ret->base_addr = xmallocarray (size0 ((array_t *) ret),
|
||||
sizeof (GFC_COMPLEX_4));
|
||||
ret->offset = 0;
|
||||
} else if (unlikely (compile_options.bounds_check))
|
||||
{
|
||||
index_type ret_extent, src_extent;
|
||||
|
||||
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
|
||||
src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
|
||||
|
||||
if (src_extent != ret_extent)
|
||||
runtime_error ("Incorrect extent in return value of TRANSPOSE"
|
||||
" intrinsic in dimension 1: is %ld,"
|
||||
" should be %ld", (long int) src_extent,
|
||||
(long int) ret_extent);
|
||||
|
||||
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
|
||||
src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
|
||||
|
||||
if (src_extent != ret_extent)
|
||||
runtime_error ("Incorrect extent in return value of TRANSPOSE"
|
||||
" intrinsic in dimension 2: is %ld,"
|
||||
" should be %ld", (long int) src_extent,
|
||||
(long int) ret_extent);
|
||||
|
||||
}
|
||||
|
||||
sxstride = GFC_DESCRIPTOR_STRIDE(source,0);
|
||||
systride = GFC_DESCRIPTOR_STRIDE(source,1);
|
||||
xcount = GFC_DESCRIPTOR_EXTENT(source,0);
|
||||
ycount = GFC_DESCRIPTOR_EXTENT(source,1);
|
||||
|
||||
rxstride = GFC_DESCRIPTOR_STRIDE(ret,0);
|
||||
rystride = GFC_DESCRIPTOR_STRIDE(ret,1);
|
||||
|
||||
rptr = ret->base_addr;
|
||||
sptr = source->base_addr;
|
||||
|
||||
for (y=0; y < ycount; y++)
|
||||
{
|
||||
for (x=0; x < xcount; x++)
|
||||
{
|
||||
*rptr = *sptr;
|
||||
|
||||
sptr += sxstride;
|
||||
rptr += rystride;
|
||||
}
|
||||
sptr += systride - (sxstride * xcount);
|
||||
rptr += rxstride - (rystride * xcount);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
@ -1,115 +0,0 @@
|
||||
/* Implementation of the TRANSPOSE intrinsic
|
||||
Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
||||
Contributed by Tobias Schlüter
|
||||
|
||||
This file is part of the GNU Fortran runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
#include <assert.h>
|
||||
|
||||
|
||||
#if defined (HAVE_GFC_COMPLEX_8)
|
||||
|
||||
extern void transpose_c8 (gfc_array_c8 * const restrict ret,
|
||||
gfc_array_c8 * const restrict source);
|
||||
export_proto(transpose_c8);
|
||||
|
||||
void
|
||||
transpose_c8 (gfc_array_c8 * const restrict ret,
|
||||
gfc_array_c8 * const restrict source)
|
||||
{
|
||||
/* r.* indicates the return array. */
|
||||
index_type rxstride, rystride;
|
||||
GFC_COMPLEX_8 * restrict rptr;
|
||||
/* s.* indicates the source array. */
|
||||
index_type sxstride, systride;
|
||||
const GFC_COMPLEX_8 *sptr;
|
||||
|
||||
index_type xcount, ycount;
|
||||
index_type x, y;
|
||||
|
||||
assert (GFC_DESCRIPTOR_RANK (source) == 2);
|
||||
|
||||
if (ret->base_addr == NULL)
|
||||
{
|
||||
assert (GFC_DESCRIPTOR_RANK (ret) == 2);
|
||||
assert (ret->dtype == source->dtype);
|
||||
|
||||
GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
|
||||
1);
|
||||
|
||||
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
|
||||
GFC_DESCRIPTOR_EXTENT(source, 1));
|
||||
|
||||
ret->base_addr = xmallocarray (size0 ((array_t *) ret),
|
||||
sizeof (GFC_COMPLEX_8));
|
||||
ret->offset = 0;
|
||||
} else if (unlikely (compile_options.bounds_check))
|
||||
{
|
||||
index_type ret_extent, src_extent;
|
||||
|
||||
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
|
||||
src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
|
||||
|
||||
if (src_extent != ret_extent)
|
||||
runtime_error ("Incorrect extent in return value of TRANSPOSE"
|
||||
" intrinsic in dimension 1: is %ld,"
|
||||
" should be %ld", (long int) src_extent,
|
||||
(long int) ret_extent);
|
||||
|
||||
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
|
||||
src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
|
||||
|
||||
if (src_extent != ret_extent)
|
||||
runtime_error ("Incorrect extent in return value of TRANSPOSE"
|
||||
" intrinsic in dimension 2: is %ld,"
|
||||
" should be %ld", (long int) src_extent,
|
||||
(long int) ret_extent);
|
||||
|
||||
}
|
||||
|
||||
sxstride = GFC_DESCRIPTOR_STRIDE(source,0);
|
||||
systride = GFC_DESCRIPTOR_STRIDE(source,1);
|
||||
xcount = GFC_DESCRIPTOR_EXTENT(source,0);
|
||||
ycount = GFC_DESCRIPTOR_EXTENT(source,1);
|
||||
|
||||
rxstride = GFC_DESCRIPTOR_STRIDE(ret,0);
|
||||
rystride = GFC_DESCRIPTOR_STRIDE(ret,1);
|
||||
|
||||
rptr = ret->base_addr;
|
||||
sptr = source->base_addr;
|
||||
|
||||
for (y=0; y < ycount; y++)
|
||||
{
|
||||
for (x=0; x < xcount; x++)
|
||||
{
|
||||
*rptr = *sptr;
|
||||
|
||||
sptr += sxstride;
|
||||
rptr += rystride;
|
||||
}
|
||||
sptr += systride - (sxstride * xcount);
|
||||
rptr += rxstride - (rystride * xcount);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
@ -1,115 +0,0 @@
|
||||
/* Implementation of the TRANSPOSE intrinsic
|
||||
Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
||||
Contributed by Tobias Schlüter
|
||||
|
||||
This file is part of the GNU Fortran runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
#include <assert.h>
|
||||
|
||||
|
||||
#if defined (HAVE_GFC_INTEGER_16)
|
||||
|
||||
extern void transpose_i16 (gfc_array_i16 * const restrict ret,
|
||||
gfc_array_i16 * const restrict source);
|
||||
export_proto(transpose_i16);
|
||||
|
||||
void
|
||||
transpose_i16 (gfc_array_i16 * const restrict ret,
|
||||
gfc_array_i16 * const restrict source)
|
||||
{
|
||||
/* r.* indicates the return array. */
|
||||
index_type rxstride, rystride;
|
||||
GFC_INTEGER_16 * restrict rptr;
|
||||
/* s.* indicates the source array. */
|
||||
index_type sxstride, systride;
|
||||
const GFC_INTEGER_16 *sptr;
|
||||
|
||||
index_type xcount, ycount;
|
||||
index_type x, y;
|
||||
|
||||
assert (GFC_DESCRIPTOR_RANK (source) == 2);
|
||||
|
||||
if (ret->base_addr == NULL)
|
||||
{
|
||||
assert (GFC_DESCRIPTOR_RANK (ret) == 2);
|
||||
assert (ret->dtype == source->dtype);
|
||||
|
||||
GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
|
||||
1);
|
||||
|
||||
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
|
||||
GFC_DESCRIPTOR_EXTENT(source, 1));
|
||||
|
||||
ret->base_addr = xmallocarray (size0 ((array_t *) ret),
|
||||
sizeof (GFC_INTEGER_16));
|
||||
ret->offset = 0;
|
||||
} else if (unlikely (compile_options.bounds_check))
|
||||
{
|
||||
index_type ret_extent, src_extent;
|
||||
|
||||
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
|
||||
src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
|
||||
|
||||
if (src_extent != ret_extent)
|
||||
runtime_error ("Incorrect extent in return value of TRANSPOSE"
|
||||
" intrinsic in dimension 1: is %ld,"
|
||||
" should be %ld", (long int) src_extent,
|
||||
(long int) ret_extent);
|
||||
|
||||
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
|
||||
src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
|
||||
|
||||
if (src_extent != ret_extent)
|
||||
runtime_error ("Incorrect extent in return value of TRANSPOSE"
|
||||
" intrinsic in dimension 2: is %ld,"
|
||||
" should be %ld", (long int) src_extent,
|
||||
(long int) ret_extent);
|
||||
|
||||
}
|
||||
|
||||
sxstride = GFC_DESCRIPTOR_STRIDE(source,0);
|
||||
systride = GFC_DESCRIPTOR_STRIDE(source,1);
|
||||
xcount = GFC_DESCRIPTOR_EXTENT(source,0);
|
||||
ycount = GFC_DESCRIPTOR_EXTENT(source,1);
|
||||
|
||||
rxstride = GFC_DESCRIPTOR_STRIDE(ret,0);
|
||||
rystride = GFC_DESCRIPTOR_STRIDE(ret,1);
|
||||
|
||||
rptr = ret->base_addr;
|
||||
sptr = source->base_addr;
|
||||
|
||||
for (y=0; y < ycount; y++)
|
||||
{
|
||||
for (x=0; x < xcount; x++)
|
||||
{
|
||||
*rptr = *sptr;
|
||||
|
||||
sptr += sxstride;
|
||||
rptr += rystride;
|
||||
}
|
||||
sptr += systride - (sxstride * xcount);
|
||||
rptr += rxstride - (rystride * xcount);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
@ -1,115 +0,0 @@
|
||||
/* Implementation of the TRANSPOSE intrinsic
|
||||
Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
||||
Contributed by Tobias Schlüter
|
||||
|
||||
This file is part of the GNU Fortran runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
#include <assert.h>
|
||||
|
||||
|
||||
#if defined (HAVE_GFC_INTEGER_4)
|
||||
|
||||
extern void transpose_i4 (gfc_array_i4 * const restrict ret,
|
||||
gfc_array_i4 * const restrict source);
|
||||
export_proto(transpose_i4);
|
||||
|
||||
void
|
||||
transpose_i4 (gfc_array_i4 * const restrict ret,
|
||||
gfc_array_i4 * const restrict source)
|
||||
{
|
||||
/* r.* indicates the return array. */
|
||||
index_type rxstride, rystride;
|
||||
GFC_INTEGER_4 * restrict rptr;
|
||||
/* s.* indicates the source array. */
|
||||
index_type sxstride, systride;
|
||||
const GFC_INTEGER_4 *sptr;
|
||||
|
||||
index_type xcount, ycount;
|
||||
index_type x, y;
|
||||
|
||||
assert (GFC_DESCRIPTOR_RANK (source) == 2);
|
||||
|
||||
if (ret->base_addr == NULL)
|
||||
{
|
||||
assert (GFC_DESCRIPTOR_RANK (ret) == 2);
|
||||
assert (ret->dtype == source->dtype);
|
||||
|
||||
GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
|
||||
1);
|
||||
|
||||
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
|
||||
GFC_DESCRIPTOR_EXTENT(source, 1));
|
||||
|
||||
ret->base_addr = xmallocarray (size0 ((array_t *) ret),
|
||||
sizeof (GFC_INTEGER_4));
|
||||
ret->offset = 0;
|
||||
} else if (unlikely (compile_options.bounds_check))
|
||||
{
|
||||
index_type ret_extent, src_extent;
|
||||
|
||||
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
|
||||
src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
|
||||
|
||||
if (src_extent != ret_extent)
|
||||
runtime_error ("Incorrect extent in return value of TRANSPOSE"
|
||||
" intrinsic in dimension 1: is %ld,"
|
||||
" should be %ld", (long int) src_extent,
|
||||
(long int) ret_extent);
|
||||
|
||||
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
|
||||
src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
|
||||
|
||||
if (src_extent != ret_extent)
|
||||
runtime_error ("Incorrect extent in return value of TRANSPOSE"
|
||||
" intrinsic in dimension 2: is %ld,"
|
||||
" should be %ld", (long int) src_extent,
|
||||
(long int) ret_extent);
|
||||
|
||||
}
|
||||
|
||||
sxstride = GFC_DESCRIPTOR_STRIDE(source,0);
|
||||
systride = GFC_DESCRIPTOR_STRIDE(source,1);
|
||||
xcount = GFC_DESCRIPTOR_EXTENT(source,0);
|
||||
ycount = GFC_DESCRIPTOR_EXTENT(source,1);
|
||||
|
||||
rxstride = GFC_DESCRIPTOR_STRIDE(ret,0);
|
||||
rystride = GFC_DESCRIPTOR_STRIDE(ret,1);
|
||||
|
||||
rptr = ret->base_addr;
|
||||
sptr = source->base_addr;
|
||||
|
||||
for (y=0; y < ycount; y++)
|
||||
{
|
||||
for (x=0; x < xcount; x++)
|
||||
{
|
||||
*rptr = *sptr;
|
||||
|
||||
sptr += sxstride;
|
||||
rptr += rystride;
|
||||
}
|
||||
sptr += systride - (sxstride * xcount);
|
||||
rptr += rxstride - (rystride * xcount);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
@ -1,115 +0,0 @@
|
||||
/* Implementation of the TRANSPOSE intrinsic
|
||||
Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
||||
Contributed by Tobias Schlüter
|
||||
|
||||
This file is part of the GNU Fortran runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
#include <assert.h>
|
||||
|
||||
|
||||
#if defined (HAVE_GFC_INTEGER_8)
|
||||
|
||||
extern void transpose_i8 (gfc_array_i8 * const restrict ret,
|
||||
gfc_array_i8 * const restrict source);
|
||||
export_proto(transpose_i8);
|
||||
|
||||
void
|
||||
transpose_i8 (gfc_array_i8 * const restrict ret,
|
||||
gfc_array_i8 * const restrict source)
|
||||
{
|
||||
/* r.* indicates the return array. */
|
||||
index_type rxstride, rystride;
|
||||
GFC_INTEGER_8 * restrict rptr;
|
||||
/* s.* indicates the source array. */
|
||||
index_type sxstride, systride;
|
||||
const GFC_INTEGER_8 *sptr;
|
||||
|
||||
index_type xcount, ycount;
|
||||
index_type x, y;
|
||||
|
||||
assert (GFC_DESCRIPTOR_RANK (source) == 2);
|
||||
|
||||
if (ret->base_addr == NULL)
|
||||
{
|
||||
assert (GFC_DESCRIPTOR_RANK (ret) == 2);
|
||||
assert (ret->dtype == source->dtype);
|
||||
|
||||
GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
|
||||
1);
|
||||
|
||||
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
|
||||
GFC_DESCRIPTOR_EXTENT(source, 1));
|
||||
|
||||
ret->base_addr = xmallocarray (size0 ((array_t *) ret),
|
||||
sizeof (GFC_INTEGER_8));
|
||||
ret->offset = 0;
|
||||
} else if (unlikely (compile_options.bounds_check))
|
||||
{
|
||||
index_type ret_extent, src_extent;
|
||||
|
||||
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
|
||||
src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
|
||||
|
||||
if (src_extent != ret_extent)
|
||||
runtime_error ("Incorrect extent in return value of TRANSPOSE"
|
||||
" intrinsic in dimension 1: is %ld,"
|
||||
" should be %ld", (long int) src_extent,
|
||||
(long int) ret_extent);
|
||||
|
||||
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
|
||||
src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
|
||||
|
||||
if (src_extent != ret_extent)
|
||||
runtime_error ("Incorrect extent in return value of TRANSPOSE"
|
||||
" intrinsic in dimension 2: is %ld,"
|
||||
" should be %ld", (long int) src_extent,
|
||||
(long int) ret_extent);
|
||||
|
||||
}
|
||||
|
||||
sxstride = GFC_DESCRIPTOR_STRIDE(source,0);
|
||||
systride = GFC_DESCRIPTOR_STRIDE(source,1);
|
||||
xcount = GFC_DESCRIPTOR_EXTENT(source,0);
|
||||
ycount = GFC_DESCRIPTOR_EXTENT(source,1);
|
||||
|
||||
rxstride = GFC_DESCRIPTOR_STRIDE(ret,0);
|
||||
rystride = GFC_DESCRIPTOR_STRIDE(ret,1);
|
||||
|
||||
rptr = ret->base_addr;
|
||||
sptr = source->base_addr;
|
||||
|
||||
for (y=0; y < ycount; y++)
|
||||
{
|
||||
for (x=0; x < xcount; x++)
|
||||
{
|
||||
*rptr = *sptr;
|
||||
|
||||
sptr += sxstride;
|
||||
rptr += rystride;
|
||||
}
|
||||
sptr += systride - (sxstride * xcount);
|
||||
rptr += rxstride - (rystride * xcount);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
@ -1,115 +0,0 @@
|
||||
/* Implementation of the TRANSPOSE intrinsic
|
||||
Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
||||
Contributed by Tobias Schlüter
|
||||
|
||||
This file is part of the GNU Fortran runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
#include <assert.h>
|
||||
|
||||
|
||||
#if defined (HAVE_GFC_REAL_10)
|
||||
|
||||
extern void transpose_r10 (gfc_array_r10 * const restrict ret,
|
||||
gfc_array_r10 * const restrict source);
|
||||
export_proto(transpose_r10);
|
||||
|
||||
void
|
||||
transpose_r10 (gfc_array_r10 * const restrict ret,
|
||||
gfc_array_r10 * const restrict source)
|
||||
{
|
||||
/* r.* indicates the return array. */
|
||||
index_type rxstride, rystride;
|
||||
GFC_REAL_10 * restrict rptr;
|
||||
/* s.* indicates the source array. */
|
||||
index_type sxstride, systride;
|
||||
const GFC_REAL_10 *sptr;
|
||||
|
||||
index_type xcount, ycount;
|
||||
index_type x, y;
|
||||
|
||||
assert (GFC_DESCRIPTOR_RANK (source) == 2);
|
||||
|
||||
if (ret->base_addr == NULL)
|
||||
{
|
||||
assert (GFC_DESCRIPTOR_RANK (ret) == 2);
|
||||
assert (ret->dtype == source->dtype);
|
||||
|
||||
GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
|
||||
1);
|
||||
|
||||
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
|
||||
GFC_DESCRIPTOR_EXTENT(source, 1));
|
||||
|
||||
ret->base_addr = xmallocarray (size0 ((array_t *) ret),
|
||||
sizeof (GFC_REAL_10));
|
||||
ret->offset = 0;
|
||||
} else if (unlikely (compile_options.bounds_check))
|
||||
{
|
||||
index_type ret_extent, src_extent;
|
||||
|
||||
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
|
||||
src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
|
||||
|
||||
if (src_extent != ret_extent)
|
||||
runtime_error ("Incorrect extent in return value of TRANSPOSE"
|
||||
" intrinsic in dimension 1: is %ld,"
|
||||
" should be %ld", (long int) src_extent,
|
||||
(long int) ret_extent);
|
||||
|
||||
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
|
||||
src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
|
||||
|
||||
if (src_extent != ret_extent)
|
||||
runtime_error ("Incorrect extent in return value of TRANSPOSE"
|
||||
" intrinsic in dimension 2: is %ld,"
|
||||
" should be %ld", (long int) src_extent,
|
||||
(long int) ret_extent);
|
||||
|
||||
}
|
||||
|
||||
sxstride = GFC_DESCRIPTOR_STRIDE(source,0);
|
||||
systride = GFC_DESCRIPTOR_STRIDE(source,1);
|
||||
xcount = GFC_DESCRIPTOR_EXTENT(source,0);
|
||||
ycount = GFC_DESCRIPTOR_EXTENT(source,1);
|
||||
|
||||
rxstride = GFC_DESCRIPTOR_STRIDE(ret,0);
|
||||
rystride = GFC_DESCRIPTOR_STRIDE(ret,1);
|
||||
|
||||
rptr = ret->base_addr;
|
||||
sptr = source->base_addr;
|
||||
|
||||
for (y=0; y < ycount; y++)
|
||||
{
|
||||
for (x=0; x < xcount; x++)
|
||||
{
|
||||
*rptr = *sptr;
|
||||
|
||||
sptr += sxstride;
|
||||
rptr += rystride;
|
||||
}
|
||||
sptr += systride - (sxstride * xcount);
|
||||
rptr += rxstride - (rystride * xcount);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
@ -1,115 +0,0 @@
|
||||
/* Implementation of the TRANSPOSE intrinsic
|
||||
Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
||||
Contributed by Tobias Schlüter
|
||||
|
||||
This file is part of the GNU Fortran runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
#include <assert.h>
|
||||
|
||||
|
||||
#if defined (HAVE_GFC_REAL_16)
|
||||
|
||||
extern void transpose_r16 (gfc_array_r16 * const restrict ret,
|
||||
gfc_array_r16 * const restrict source);
|
||||
export_proto(transpose_r16);
|
||||
|
||||
void
|
||||
transpose_r16 (gfc_array_r16 * const restrict ret,
|
||||
gfc_array_r16 * const restrict source)
|
||||
{
|
||||
/* r.* indicates the return array. */
|
||||
index_type rxstride, rystride;
|
||||
GFC_REAL_16 * restrict rptr;
|
||||
/* s.* indicates the source array. */
|
||||
index_type sxstride, systride;
|
||||
const GFC_REAL_16 *sptr;
|
||||
|
||||
index_type xcount, ycount;
|
||||
index_type x, y;
|
||||
|
||||
assert (GFC_DESCRIPTOR_RANK (source) == 2);
|
||||
|
||||
if (ret->base_addr == NULL)
|
||||
{
|
||||
assert (GFC_DESCRIPTOR_RANK (ret) == 2);
|
||||
assert (ret->dtype == source->dtype);
|
||||
|
||||
GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
|
||||
1);
|
||||
|
||||
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
|
||||
GFC_DESCRIPTOR_EXTENT(source, 1));
|
||||
|
||||
ret->base_addr = xmallocarray (size0 ((array_t *) ret),
|
||||
sizeof (GFC_REAL_16));
|
||||
ret->offset = 0;
|
||||
} else if (unlikely (compile_options.bounds_check))
|
||||
{
|
||||
index_type ret_extent, src_extent;
|
||||
|
||||
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
|
||||
src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
|
||||
|
||||
if (src_extent != ret_extent)
|
||||
runtime_error ("Incorrect extent in return value of TRANSPOSE"
|
||||
" intrinsic in dimension 1: is %ld,"
|
||||
" should be %ld", (long int) src_extent,
|
||||
(long int) ret_extent);
|
||||
|
||||
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
|
||||
src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
|
||||
|
||||
if (src_extent != ret_extent)
|
||||
runtime_error ("Incorrect extent in return value of TRANSPOSE"
|
||||
" intrinsic in dimension 2: is %ld,"
|
||||
" should be %ld", (long int) src_extent,
|
||||
(long int) ret_extent);
|
||||
|
||||
}
|
||||
|
||||
sxstride = GFC_DESCRIPTOR_STRIDE(source,0);
|
||||
systride = GFC_DESCRIPTOR_STRIDE(source,1);
|
||||
xcount = GFC_DESCRIPTOR_EXTENT(source,0);
|
||||
ycount = GFC_DESCRIPTOR_EXTENT(source,1);
|
||||
|
||||
rxstride = GFC_DESCRIPTOR_STRIDE(ret,0);
|
||||
rystride = GFC_DESCRIPTOR_STRIDE(ret,1);
|
||||
|
||||
rptr = ret->base_addr;
|
||||
sptr = source->base_addr;
|
||||
|
||||
for (y=0; y < ycount; y++)
|
||||
{
|
||||
for (x=0; x < xcount; x++)
|
||||
{
|
||||
*rptr = *sptr;
|
||||
|
||||
sptr += sxstride;
|
||||
rptr += rystride;
|
||||
}
|
||||
sptr += systride - (sxstride * xcount);
|
||||
rptr += rxstride - (rystride * xcount);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
@ -1,115 +0,0 @@
|
||||
/* Implementation of the TRANSPOSE intrinsic
|
||||
Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
||||
Contributed by Tobias Schlüter
|
||||
|
||||
This file is part of the GNU Fortran runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
#include <assert.h>
|
||||
|
||||
|
||||
#if defined (HAVE_GFC_REAL_4)
|
||||
|
||||
extern void transpose_r4 (gfc_array_r4 * const restrict ret,
|
||||
gfc_array_r4 * const restrict source);
|
||||
export_proto(transpose_r4);
|
||||
|
||||
void
|
||||
transpose_r4 (gfc_array_r4 * const restrict ret,
|
||||
gfc_array_r4 * const restrict source)
|
||||
{
|
||||
/* r.* indicates the return array. */
|
||||
index_type rxstride, rystride;
|
||||
GFC_REAL_4 * restrict rptr;
|
||||
/* s.* indicates the source array. */
|
||||
index_type sxstride, systride;
|
||||
const GFC_REAL_4 *sptr;
|
||||
|
||||
index_type xcount, ycount;
|
||||
index_type x, y;
|
||||
|
||||
assert (GFC_DESCRIPTOR_RANK (source) == 2);
|
||||
|
||||
if (ret->base_addr == NULL)
|
||||
{
|
||||
assert (GFC_DESCRIPTOR_RANK (ret) == 2);
|
||||
assert (ret->dtype == source->dtype);
|
||||
|
||||
GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
|
||||
1);
|
||||
|
||||
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
|
||||
GFC_DESCRIPTOR_EXTENT(source, 1));
|
||||
|
||||
ret->base_addr = xmallocarray (size0 ((array_t *) ret),
|
||||
sizeof (GFC_REAL_4));
|
||||
ret->offset = 0;
|
||||
} else if (unlikely (compile_options.bounds_check))
|
||||
{
|
||||
index_type ret_extent, src_extent;
|
||||
|
||||
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
|
||||
src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
|
||||
|
||||
if (src_extent != ret_extent)
|
||||
runtime_error ("Incorrect extent in return value of TRANSPOSE"
|
||||
" intrinsic in dimension 1: is %ld,"
|
||||
" should be %ld", (long int) src_extent,
|
||||
(long int) ret_extent);
|
||||
|
||||
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
|
||||
src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
|
||||
|
||||
if (src_extent != ret_extent)
|
||||
runtime_error ("Incorrect extent in return value of TRANSPOSE"
|
||||
" intrinsic in dimension 2: is %ld,"
|
||||
" should be %ld", (long int) src_extent,
|
||||
(long int) ret_extent);
|
||||
|
||||
}
|
||||
|
||||
sxstride = GFC_DESCRIPTOR_STRIDE(source,0);
|
||||
systride = GFC_DESCRIPTOR_STRIDE(source,1);
|
||||
xcount = GFC_DESCRIPTOR_EXTENT(source,0);
|
||||
ycount = GFC_DESCRIPTOR_EXTENT(source,1);
|
||||
|
||||
rxstride = GFC_DESCRIPTOR_STRIDE(ret,0);
|
||||
rystride = GFC_DESCRIPTOR_STRIDE(ret,1);
|
||||
|
||||
rptr = ret->base_addr;
|
||||
sptr = source->base_addr;
|
||||
|
||||
for (y=0; y < ycount; y++)
|
||||
{
|
||||
for (x=0; x < xcount; x++)
|
||||
{
|
||||
*rptr = *sptr;
|
||||
|
||||
sptr += sxstride;
|
||||
rptr += rystride;
|
||||
}
|
||||
sptr += systride - (sxstride * xcount);
|
||||
rptr += rxstride - (rystride * xcount);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
@ -1,115 +0,0 @@
|
||||
/* Implementation of the TRANSPOSE intrinsic
|
||||
Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
||||
Contributed by Tobias Schlüter
|
||||
|
||||
This file is part of the GNU Fortran runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
#include <assert.h>
|
||||
|
||||
|
||||
#if defined (HAVE_GFC_REAL_8)
|
||||
|
||||
extern void transpose_r8 (gfc_array_r8 * const restrict ret,
|
||||
gfc_array_r8 * const restrict source);
|
||||
export_proto(transpose_r8);
|
||||
|
||||
void
|
||||
transpose_r8 (gfc_array_r8 * const restrict ret,
|
||||
gfc_array_r8 * const restrict source)
|
||||
{
|
||||
/* r.* indicates the return array. */
|
||||
index_type rxstride, rystride;
|
||||
GFC_REAL_8 * restrict rptr;
|
||||
/* s.* indicates the source array. */
|
||||
index_type sxstride, systride;
|
||||
const GFC_REAL_8 *sptr;
|
||||
|
||||
index_type xcount, ycount;
|
||||
index_type x, y;
|
||||
|
||||
assert (GFC_DESCRIPTOR_RANK (source) == 2);
|
||||
|
||||
if (ret->base_addr == NULL)
|
||||
{
|
||||
assert (GFC_DESCRIPTOR_RANK (ret) == 2);
|
||||
assert (ret->dtype == source->dtype);
|
||||
|
||||
GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
|
||||
1);
|
||||
|
||||
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
|
||||
GFC_DESCRIPTOR_EXTENT(source, 1));
|
||||
|
||||
ret->base_addr = xmallocarray (size0 ((array_t *) ret),
|
||||
sizeof (GFC_REAL_8));
|
||||
ret->offset = 0;
|
||||
} else if (unlikely (compile_options.bounds_check))
|
||||
{
|
||||
index_type ret_extent, src_extent;
|
||||
|
||||
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
|
||||
src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
|
||||
|
||||
if (src_extent != ret_extent)
|
||||
runtime_error ("Incorrect extent in return value of TRANSPOSE"
|
||||
" intrinsic in dimension 1: is %ld,"
|
||||
" should be %ld", (long int) src_extent,
|
||||
(long int) ret_extent);
|
||||
|
||||
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
|
||||
src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
|
||||
|
||||
if (src_extent != ret_extent)
|
||||
runtime_error ("Incorrect extent in return value of TRANSPOSE"
|
||||
" intrinsic in dimension 2: is %ld,"
|
||||
" should be %ld", (long int) src_extent,
|
||||
(long int) ret_extent);
|
||||
|
||||
}
|
||||
|
||||
sxstride = GFC_DESCRIPTOR_STRIDE(source,0);
|
||||
systride = GFC_DESCRIPTOR_STRIDE(source,1);
|
||||
xcount = GFC_DESCRIPTOR_EXTENT(source,0);
|
||||
ycount = GFC_DESCRIPTOR_EXTENT(source,1);
|
||||
|
||||
rxstride = GFC_DESCRIPTOR_STRIDE(ret,0);
|
||||
rystride = GFC_DESCRIPTOR_STRIDE(ret,1);
|
||||
|
||||
rptr = ret->base_addr;
|
||||
sptr = source->base_addr;
|
||||
|
||||
for (y=0; y < ycount; y++)
|
||||
{
|
||||
for (x=0; x < xcount; x++)
|
||||
{
|
||||
*rptr = *sptr;
|
||||
|
||||
sptr += sxstride;
|
||||
rptr += rystride;
|
||||
}
|
||||
sptr += systride - (sxstride * xcount);
|
||||
rptr += rxstride - (rystride * xcount);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
@ -1,51 +0,0 @@
|
||||
/* Implementation of the MALLOC and FREE intrinsics
|
||||
Copyright (C) 2005-2016 Free Software Foundation, Inc.
|
||||
Contributed by François-Xavier Coudert <coudert@clipper.ens.fr>
|
||||
|
||||
This file is part of the GNU Fortran runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
/* The runtime MALLOC and FREE are kept here until the libgfortran ABI
|
||||
is broken. The front-end now emits direct calls to the GCC's malloc()
|
||||
and free() built-ins. */
|
||||
|
||||
extern void PREFIX(free) (void **);
|
||||
export_proto_np(PREFIX(free));
|
||||
|
||||
void
|
||||
PREFIX(free) (void ** ptr)
|
||||
{
|
||||
free (*ptr);
|
||||
}
|
||||
|
||||
|
||||
extern void * PREFIX(malloc) (size_t *);
|
||||
export_proto_np(PREFIX(malloc));
|
||||
|
||||
void *
|
||||
PREFIX(malloc) (size_t * size)
|
||||
{
|
||||
return malloc (*size);
|
||||
}
|
@ -1,151 +0,0 @@
|
||||
/* Implementation of the TRANSPOSE intrinsic
|
||||
Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
||||
Contributed by Tobias Schlüter
|
||||
|
||||
This file is part of the GNU Fortran runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
extern void transpose (gfc_array_char *, gfc_array_char *);
|
||||
export_proto(transpose);
|
||||
|
||||
static void
|
||||
transpose_internal (gfc_array_char *ret, gfc_array_char *source)
|
||||
{
|
||||
/* r.* indicates the return array. */
|
||||
index_type rxstride, rystride;
|
||||
char *rptr;
|
||||
/* s.* indicates the source array. */
|
||||
index_type sxstride, systride;
|
||||
const char *sptr;
|
||||
|
||||
index_type xcount, ycount;
|
||||
index_type x, y;
|
||||
index_type size;
|
||||
|
||||
assert (GFC_DESCRIPTOR_RANK (source) == 2
|
||||
&& GFC_DESCRIPTOR_RANK (ret) == 2);
|
||||
|
||||
size = GFC_DESCRIPTOR_SIZE(ret);
|
||||
|
||||
if (ret->base_addr == NULL)
|
||||
{
|
||||
assert (ret->dtype == source->dtype);
|
||||
|
||||
GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
|
||||
1);
|
||||
|
||||
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
|
||||
GFC_DESCRIPTOR_EXTENT(source, 1));
|
||||
|
||||
ret->base_addr = xmallocarray (size0 ((array_t*)ret), size);
|
||||
ret->offset = 0;
|
||||
}
|
||||
else if (unlikely (compile_options.bounds_check))
|
||||
{
|
||||
index_type ret_extent, src_extent;
|
||||
|
||||
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
|
||||
src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
|
||||
|
||||
if (src_extent != ret_extent)
|
||||
runtime_error ("Incorrect extent in return value of TRANSPOSE"
|
||||
" intrinsic in dimension 1: is %ld,"
|
||||
" should be %ld", (long int) src_extent,
|
||||
(long int) ret_extent);
|
||||
|
||||
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
|
||||
src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
|
||||
|
||||
if (src_extent != ret_extent)
|
||||
runtime_error ("Incorrect extent in return value of TRANSPOSE"
|
||||
" intrinsic in dimension 2: is %ld,"
|
||||
" should be %ld", (long int) src_extent,
|
||||
(long int) ret_extent);
|
||||
|
||||
}
|
||||
|
||||
sxstride = GFC_DESCRIPTOR_STRIDE_BYTES(source,0);
|
||||
systride = GFC_DESCRIPTOR_STRIDE_BYTES(source,1);
|
||||
xcount = GFC_DESCRIPTOR_EXTENT(source,0);
|
||||
ycount = GFC_DESCRIPTOR_EXTENT(source,1);
|
||||
|
||||
rxstride = GFC_DESCRIPTOR_STRIDE_BYTES(ret,0);
|
||||
rystride = GFC_DESCRIPTOR_STRIDE_BYTES(ret,1);
|
||||
|
||||
rptr = ret->base_addr;
|
||||
sptr = source->base_addr;
|
||||
|
||||
for (y = 0; y < ycount; y++)
|
||||
{
|
||||
for (x = 0; x < xcount; x++)
|
||||
{
|
||||
memcpy (rptr, sptr, size);
|
||||
|
||||
sptr += sxstride;
|
||||
rptr += rystride;
|
||||
}
|
||||
sptr += systride - (sxstride * xcount);
|
||||
rptr += rxstride - (rystride * xcount);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
extern void transpose (gfc_array_char *, gfc_array_char *);
|
||||
export_proto(transpose);
|
||||
|
||||
void
|
||||
transpose (gfc_array_char *ret, gfc_array_char *source)
|
||||
{
|
||||
transpose_internal (ret, source);
|
||||
}
|
||||
|
||||
|
||||
extern void transpose_char (gfc_array_char *, GFC_INTEGER_4,
|
||||
gfc_array_char *, GFC_INTEGER_4);
|
||||
export_proto(transpose_char);
|
||||
|
||||
void
|
||||
transpose_char (gfc_array_char *ret,
|
||||
GFC_INTEGER_4 ret_length __attribute__((unused)),
|
||||
gfc_array_char *source,
|
||||
GFC_INTEGER_4 source_length __attribute__((unused)))
|
||||
{
|
||||
transpose_internal (ret, source);
|
||||
}
|
||||
|
||||
|
||||
extern void transpose_char4 (gfc_array_char *, GFC_INTEGER_4,
|
||||
gfc_array_char *, GFC_INTEGER_4);
|
||||
export_proto(transpose_char4);
|
||||
|
||||
void
|
||||
transpose_char4 (gfc_array_char *ret,
|
||||
GFC_INTEGER_4 ret_length __attribute__((unused)),
|
||||
gfc_array_char *source,
|
||||
GFC_INTEGER_4 source_length __attribute__((unused)))
|
||||
{
|
||||
transpose_internal (ret, source);
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
`/* Implementation of the EXPONENT intrinsic
|
||||
Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
||||
Contributed by Richard Henderson <rth@redhat.com>.
|
||||
|
||||
This file is part of the GNU Fortran 95 runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"'
|
||||
|
||||
include(`mtype.m4')dnl
|
||||
|
||||
mathfunc_macro
|
||||
|
||||
`#if defined (HAVE_'real_type`) && 'hasmathfunc(frexp)`
|
||||
|
||||
extern GFC_INTEGER_4 exponent_r'kind` ('real_type` s);
|
||||
export_proto(exponent_r'kind`);
|
||||
|
||||
GFC_INTEGER_4
|
||||
exponent_r'kind` ('real_type` s)
|
||||
{
|
||||
int ret;
|
||||
MATHFUNC(frexp) (s, &ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif'
|
@ -1,44 +0,0 @@
|
||||
`/* Implementation of the FRACTION intrinsic
|
||||
Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
||||
Contributed by Richard Henderson <rth@redhat.com>.
|
||||
|
||||
This file is part of the GNU Fortran 95 runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"'
|
||||
|
||||
include(`mtype.m4')dnl
|
||||
|
||||
mathfunc_macro
|
||||
|
||||
`#if defined (HAVE_'real_type`) && 'hasmathfunc(frexp)`
|
||||
|
||||
extern 'real_type` fraction_r'kind` ('real_type` s);
|
||||
export_proto(fraction_r'kind`);
|
||||
|
||||
'real_type`
|
||||
fraction_r'kind` ('real_type` s)
|
||||
{
|
||||
int dummy_exp;
|
||||
return MATHFUNC(frexp) (s, &dummy_exp);
|
||||
}
|
||||
|
||||
#endif'
|
@ -1,51 +0,0 @@
|
||||
`/* Implementation of the NEAREST intrinsic
|
||||
Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
||||
Contributed by Richard Henderson <rth@redhat.com>.
|
||||
|
||||
This file is part of the GNU Fortran 95 runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"'
|
||||
|
||||
include(`mtype.m4')dnl
|
||||
|
||||
mathfunc_macro
|
||||
|
||||
`#if defined (HAVE_'real_type`) && 'hasmathfunc(copysign) && hasmathfunc(nextafter)`
|
||||
|
||||
extern 'real_type` nearest_r'kind` ('real_type` s, 'real_type` dir);
|
||||
export_proto(nearest_r'kind`);
|
||||
|
||||
'real_type`
|
||||
nearest_r'kind` ('real_type` s, 'real_type` dir)
|
||||
{
|
||||
dir = MATHFUNC(copysign) (MATHFUNC(__builtin_inf) (), dir);
|
||||
if (FLT_EVAL_METHOD != 0)
|
||||
{
|
||||
/* ??? Work around glibc bug on x86. */
|
||||
volatile 'real_type` r = MATHFUNC(nextafter) (s, dir);
|
||||
return r;
|
||||
}
|
||||
else
|
||||
return MATHFUNC(nextafter) (s, dir);
|
||||
}
|
||||
|
||||
#endif'
|
@ -1,54 +0,0 @@
|
||||
`/* Implementation of the RRSPACING intrinsic
|
||||
Copyright (C) 2006-2016 Free Software Foundation, Inc.
|
||||
Contributed by Steven G. Kargl <kargl@gcc.gnu.org>
|
||||
|
||||
This file is part of the GNU Fortran 95 runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"'
|
||||
|
||||
include(`mtype.m4')dnl
|
||||
|
||||
mathfunc_macro
|
||||
|
||||
`#if defined (HAVE_'real_type`) && 'hasmathfunc(fabs) && hasmathfunc(frexp)`
|
||||
|
||||
extern 'real_type` rrspacing_r'kind` ('real_type` s, int p);
|
||||
export_proto(rrspacing_r'kind`);
|
||||
|
||||
'real_type`
|
||||
rrspacing_r'kind` ('real_type` s, int p)
|
||||
{
|
||||
int e;
|
||||
'real_type` x;
|
||||
x = MATHFUNC(fabs) (s);
|
||||
if (x == 0.)
|
||||
return 0.;
|
||||
MATHFUNC(frexp) (s, &e);
|
||||
#if 'hasmathfunc(ldexp)`
|
||||
return MATHFUNC(ldexp) (x, p - e);
|
||||
#else
|
||||
return MATHFUNC(scalbn) (x, p - e);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endif'
|
@ -1,44 +0,0 @@
|
||||
`/* Implementation of the SET_EXPONENT intrinsic
|
||||
Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
||||
Contributed by Richard Henderson <rth@redhat.com>.
|
||||
|
||||
This file is part of the GNU Fortran 95 runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"'
|
||||
|
||||
include(`mtype.m4')dnl
|
||||
|
||||
mathfunc_macro
|
||||
|
||||
`#if defined (HAVE_'real_type`) && 'hasmathfunc(scalbn) && hasmathfunc(frexp)`
|
||||
|
||||
extern 'real_type` set_exponent_r'kind` ('real_type` s, GFC_INTEGER_4 i);
|
||||
export_proto(set_exponent_r'kind`);
|
||||
|
||||
'real_type`
|
||||
set_exponent_r'kind` ('real_type` s, GFC_INTEGER_4 i)
|
||||
{
|
||||
int dummy_exp;
|
||||
return MATHFUNC(scalbn) (MATHFUNC(frexp) (s, &dummy_exp), i);
|
||||
}
|
||||
|
||||
#endif'
|
@ -1,53 +0,0 @@
|
||||
`/* Implementation of the SPACING intrinsic
|
||||
Copyright (C) 2006-2016 Free Software Foundation, Inc.
|
||||
Contributed by Steven G. Kargl <kargl@gcc.gnu.org>
|
||||
|
||||
This file is part of the GNU Fortran 95 runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"'
|
||||
|
||||
include(`mtype.m4')dnl
|
||||
|
||||
mathfunc_macro
|
||||
|
||||
`#if defined (HAVE_'real_type`) && 'hasmathfunc(frexp)`
|
||||
|
||||
extern 'real_type` spacing_r'kind` ('real_type` s, int p, int emin, 'real_type` tiny);
|
||||
export_proto(spacing_r'kind`);
|
||||
|
||||
'real_type`
|
||||
spacing_r'kind` ('real_type` s, int p, int emin, 'real_type` tiny)
|
||||
{
|
||||
int e;
|
||||
if (s == 0.)
|
||||
return tiny;
|
||||
MATHFUNC(frexp) (s, &e);
|
||||
e = e - p;
|
||||
e = e > emin ? e : emin;
|
||||
#if 'hasmathfunc(ldexp)`
|
||||
return MATHFUNC(ldexp) (1., e);
|
||||
#else
|
||||
return MATHFUNC(scalbn) (1., e);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif'
|
@ -1,116 +0,0 @@
|
||||
`/* Implementation of the TRANSPOSE intrinsic
|
||||
Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
||||
Contributed by Tobias Schlüter
|
||||
|
||||
This file is part of the GNU Fortran runtime library (libgfortran).
|
||||
|
||||
Libgfortran is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Libgfortran 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 General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "libgfortran.h"
|
||||
#include <assert.h>'
|
||||
|
||||
include(iparm.m4)dnl
|
||||
|
||||
`#if defined (HAVE_'rtype_name`)
|
||||
|
||||
extern void transpose_'rtype_code` ('rtype` * const restrict ret,
|
||||
'rtype` * const restrict source);
|
||||
export_proto(transpose_'rtype_code`);
|
||||
|
||||
void
|
||||
transpose_'rtype_code` ('rtype` * const restrict ret,
|
||||
'rtype` * const restrict source)
|
||||
{
|
||||
/* r.* indicates the return array. */
|
||||
index_type rxstride, rystride;
|
||||
'rtype_name` * restrict rptr;
|
||||
/* s.* indicates the source array. */
|
||||
index_type sxstride, systride;
|
||||
const 'rtype_name` *sptr;
|
||||
|
||||
index_type xcount, ycount;
|
||||
index_type x, y;
|
||||
|
||||
assert (GFC_DESCRIPTOR_RANK (source) == 2);
|
||||
|
||||
if (ret->base_addr == NULL)
|
||||
{
|
||||
assert (GFC_DESCRIPTOR_RANK (ret) == 2);
|
||||
assert (ret->dtype == source->dtype);
|
||||
|
||||
GFC_DIMENSION_SET(ret->dim[0], 0, GFC_DESCRIPTOR_EXTENT(source,1) - 1,
|
||||
1);
|
||||
|
||||
GFC_DIMENSION_SET(ret->dim[1], 0, GFC_DESCRIPTOR_EXTENT(source,0) - 1,
|
||||
GFC_DESCRIPTOR_EXTENT(source, 1));
|
||||
|
||||
ret->base_addr = xmallocarray (size0 ((array_t *) ret),
|
||||
sizeof ('rtype_name`));
|
||||
ret->offset = 0;
|
||||
} else if (unlikely (compile_options.bounds_check))
|
||||
{
|
||||
index_type ret_extent, src_extent;
|
||||
|
||||
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
|
||||
src_extent = GFC_DESCRIPTOR_EXTENT(source,1);
|
||||
|
||||
if (src_extent != ret_extent)
|
||||
runtime_error ("Incorrect extent in return value of TRANSPOSE"
|
||||
" intrinsic in dimension 1: is %ld,"
|
||||
" should be %ld", (long int) src_extent,
|
||||
(long int) ret_extent);
|
||||
|
||||
ret_extent = GFC_DESCRIPTOR_EXTENT(ret,1);
|
||||
src_extent = GFC_DESCRIPTOR_EXTENT(source,0);
|
||||
|
||||
if (src_extent != ret_extent)
|
||||
runtime_error ("Incorrect extent in return value of TRANSPOSE"
|
||||
" intrinsic in dimension 2: is %ld,"
|
||||
" should be %ld", (long int) src_extent,
|
||||
(long int) ret_extent);
|
||||
|
||||
}
|
||||
|
||||
sxstride = GFC_DESCRIPTOR_STRIDE(source,0);
|
||||
systride = GFC_DESCRIPTOR_STRIDE(source,1);
|
||||
xcount = GFC_DESCRIPTOR_EXTENT(source,0);
|
||||
ycount = GFC_DESCRIPTOR_EXTENT(source,1);
|
||||
|
||||
rxstride = GFC_DESCRIPTOR_STRIDE(ret,0);
|
||||
rystride = GFC_DESCRIPTOR_STRIDE(ret,1);
|
||||
|
||||
rptr = ret->base_addr;
|
||||
sptr = source->base_addr;
|
||||
|
||||
for (y=0; y < ycount; y++)
|
||||
{
|
||||
for (x=0; x < xcount; x++)
|
||||
{
|
||||
*rptr = *sptr;
|
||||
|
||||
sptr += sxstride;
|
||||
rptr += rystride;
|
||||
}
|
||||
sptr += systride - (sxstride * xcount);
|
||||
rptr += rxstride - (rystride * xcount);
|
||||
}
|
||||
}
|
||||
|
||||
#endif'
|
Loading…
x
Reference in New Issue
Block a user