* [Bug fortran/33197] Fortran 2008: math functions
2007-08-26 18:25 [Bug fortran/33197] New: Fortran 2008: gamma() and other small changes burnus at gcc dot gnu dot org
@ 2008-03-06 12:46 ` fxcoudert at gcc dot gnu dot org
2008-03-06 13:11 ` burnus at gcc dot gnu dot org
` (28 subsequent siblings)
29 siblings, 0 replies; 31+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2008-03-06 12:46 UTC (permalink / raw)
To: gcc-bugs
------- Comment #13 from fxcoudert at gcc dot gnu dot org 2008-03-06 12:45 -------
Remaining tasks in this PR: taking care of math functions that now accept
complex args (in particular, A{SIN,COS,TAN}{,H}), taking care of the two
arguments form of ATAN, and deal with the 3 args form of BESSEL_JN and
BESSEL_YN.
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|Fortran 2008: math functions|Fortran 2008: math functions
|and other small changes |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33197
^ permalink raw reply [flat|nested] 31+ messages in thread
* [Bug fortran/33197] Fortran 2008: math functions
2007-08-26 18:25 [Bug fortran/33197] New: Fortran 2008: gamma() and other small changes burnus at gcc dot gnu dot org
2008-03-06 12:46 ` [Bug fortran/33197] Fortran 2008: math functions fxcoudert at gcc dot gnu dot org
@ 2008-03-06 13:11 ` burnus at gcc dot gnu dot org
2008-03-06 13:16 ` fxcoudert at gcc dot gnu dot org
` (27 subsequent siblings)
29 siblings, 0 replies; 31+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-03-06 13:11 UTC (permalink / raw)
To: gcc-bugs
------- Comment #14 from burnus at gcc dot gnu dot org 2008-03-06 13:10 -------
> Remaining tasks in this PR: [...]
I think also missing are:
- Compile-time evaluation of erfc_scaled
- Implementation of NORM2
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33197
^ permalink raw reply [flat|nested] 31+ messages in thread
* [Bug fortran/33197] Fortran 2008: math functions
2007-08-26 18:25 [Bug fortran/33197] New: Fortran 2008: gamma() and other small changes burnus at gcc dot gnu dot org
2008-03-06 12:46 ` [Bug fortran/33197] Fortran 2008: math functions fxcoudert at gcc dot gnu dot org
2008-03-06 13:11 ` burnus at gcc dot gnu dot org
@ 2008-03-06 13:16 ` fxcoudert at gcc dot gnu dot org
2008-03-06 13:50 ` burnus at gcc dot gnu dot org
` (26 subsequent siblings)
29 siblings, 0 replies; 31+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2008-03-06 13:16 UTC (permalink / raw)
To: gcc-bugs
------- Comment #15 from fxcoudert at gcc dot gnu dot org 2008-03-06 13:15 -------
(In reply to comment #14)
> I think also missing are:
> - Compile-time evaluation of erfc_scaled
Right. A though one.
> - Implementation of NORM2
There are quite a few other new F2008 intrinsics, including other
transformational intrinsics, so I think it's better to focus this PR on math
intrinsics.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33197
^ permalink raw reply [flat|nested] 31+ messages in thread
* [Bug fortran/33197] Fortran 2008: math functions
2007-08-26 18:25 [Bug fortran/33197] New: Fortran 2008: gamma() and other small changes burnus at gcc dot gnu dot org
` (2 preceding siblings ...)
2008-03-06 13:16 ` fxcoudert at gcc dot gnu dot org
@ 2008-03-06 13:50 ` burnus at gcc dot gnu dot org
2008-03-11 16:54 ` fxcoudert at gcc dot gnu dot org
` (25 subsequent siblings)
29 siblings, 0 replies; 31+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-03-06 13:50 UTC (permalink / raw)
To: gcc-bugs
------- Comment #16 from burnus at gcc dot gnu dot org 2008-03-06 13:50 -------
(In reply to comment #15)
> > - Implementation of NORM2
> There are quite a few other new F2008 intrinsics, including other
> transformational intrinsics, so I think it's better to focus this PR on math
> intrinsics.
I would regard the L2 norm as mathematical
(http://mathworld.wolfram.com/L2-Norm.html)
y = NORM2(x) is for rank one arrays simply:
y = 0
do i=lbound(x,dim=1),ubound(x,dim=1)
y = y + x(i)**2
enddo
y = sqrt(y).
For a rank-one, size-two array it is the same as hypot(x(1),x(2)). Actually,
using hypot is an optimization one should do for size-2 arrays.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33197
^ permalink raw reply [flat|nested] 31+ messages in thread
* [Bug fortran/33197] Fortran 2008: math functions
2007-08-26 18:25 [Bug fortran/33197] New: Fortran 2008: gamma() and other small changes burnus at gcc dot gnu dot org
` (3 preceding siblings ...)
2008-03-06 13:50 ` burnus at gcc dot gnu dot org
@ 2008-03-11 16:54 ` fxcoudert at gcc dot gnu dot org
2008-06-15 15:11 ` fxcoudert at gcc dot gnu dot org
` (24 subsequent siblings)
29 siblings, 0 replies; 31+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2008-03-11 16:54 UTC (permalink / raw)
To: gcc-bugs
------- Comment #17 from fxcoudert at gcc dot gnu dot org 2008-03-11 16:53 -------
Adding a note: fallback formulas for systems that lack C99 complex functions
can be found in Cephes (http://www.netlib.org/cephes/)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33197
^ permalink raw reply [flat|nested] 31+ messages in thread
* [Bug fortran/33197] Fortran 2008: math functions
2007-08-26 18:25 [Bug fortran/33197] New: Fortran 2008: gamma() and other small changes burnus at gcc dot gnu dot org
` (4 preceding siblings ...)
2008-03-11 16:54 ` fxcoudert at gcc dot gnu dot org
@ 2008-06-15 15:11 ` fxcoudert at gcc dot gnu dot org
2009-02-17 20:59 ` burnus at gcc dot gnu dot org
` (23 subsequent siblings)
29 siblings, 0 replies; 31+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2008-06-15 15:11 UTC (permalink / raw)
To: gcc-bugs
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|fxcoudert at gcc dot gnu dot|unassigned at gcc dot gnu
|org |dot org
Status|ASSIGNED |NEW
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33197
^ permalink raw reply [flat|nested] 31+ messages in thread
* [Bug fortran/33197] Fortran 2008: math functions
2007-08-26 18:25 [Bug fortran/33197] New: Fortran 2008: gamma() and other small changes burnus at gcc dot gnu dot org
` (5 preceding siblings ...)
2008-06-15 15:11 ` fxcoudert at gcc dot gnu dot org
@ 2009-02-17 20:59 ` burnus at gcc dot gnu dot org
2009-05-02 13:47 ` fxcoudert at gcc dot gnu dot org
` (22 subsequent siblings)
29 siblings, 0 replies; 31+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-02-17 20:59 UTC (permalink / raw)
To: gcc-bugs
------- Comment #18 from burnus at gcc dot gnu dot org 2009-02-17 20:58 -------
Created an attachment (id=17315)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17315&action=view)
Complex (A)TAN(H), (A)COSH, (A)SINH, without no-C99 fallback & w/o tests
"Implementation" of the run-time version of (A)TAN(H), (A)COSH, (A)SINH with
complex arguments. Missing: (a) Fall back if libm does not have those C99
functions; (b) test cases; (c) compile-time evaluations -- this should use the
MPC library as soon as the middle end has support for it.
TODO (carried on from above):
- TAN(X,Y) (= TAN2(X,Y))
- BESSEL_JN and BESSEL_YN: Transitional form is missing
- ERFC_SCALED: compile-time version
- NORM2
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #15177|0 |1
is obsolete| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33197
^ permalink raw reply [flat|nested] 31+ messages in thread
* [Bug fortran/33197] Fortran 2008: math functions
2007-08-26 18:25 [Bug fortran/33197] New: Fortran 2008: gamma() and other small changes burnus at gcc dot gnu dot org
` (6 preceding siblings ...)
2009-02-17 20:59 ` burnus at gcc dot gnu dot org
@ 2009-05-02 13:47 ` fxcoudert at gcc dot gnu dot org
2009-05-16 17:33 ` fxcoudert at gcc dot gnu dot org
` (21 subsequent siblings)
29 siblings, 0 replies; 31+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2009-05-02 13:47 UTC (permalink / raw)
To: gcc-bugs
------- Comment #19 from fxcoudert at gcc dot gnu dot org 2009-05-02 13:46 -------
Patch submitted for review for the ERFC_SCALED compile-time version here:
http://gcc.gnu.org/ml/fortran/2009-05/msg00012.html
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |fxcoudert at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33197
^ permalink raw reply [flat|nested] 31+ messages in thread
* [Bug fortran/33197] Fortran 2008: math functions
2007-08-26 18:25 [Bug fortran/33197] New: Fortran 2008: gamma() and other small changes burnus at gcc dot gnu dot org
` (7 preceding siblings ...)
2009-05-02 13:47 ` fxcoudert at gcc dot gnu dot org
@ 2009-05-16 17:33 ` fxcoudert at gcc dot gnu dot org
2009-05-16 18:10 ` fxcoudert at gcc dot gnu dot org
` (20 subsequent siblings)
29 siblings, 0 replies; 31+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2009-05-16 17:33 UTC (permalink / raw)
To: gcc-bugs
------- Comment #20 from fxcoudert at gcc dot gnu dot org 2009-05-16 17:33 -------
Subject: Bug 33197
Author: fxcoudert
Date: Sat May 16 17:33:23 2009
New Revision: 147621
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=147621
Log:
PR fortran/33197
* intrinsic.c (add_functions): Use ERFC_SCALED simplification.
* intrinsic.h (gfc_simplify_erfc_scaled): New prototype.
* simplify.c (fullprec_erfc_scaled, asympt_erfc_scaled,
gfc_simplify_erfc_scaled): New functions.
* gfortran.dg/erf_2.F90: New test.
* gfortran.dg/erfc_scaled_2.f90: New test.
Added:
trunk/gcc/testsuite/gfortran.dg/erf_2.F90
trunk/gcc/testsuite/gfortran.dg/erfc_scaled_2.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/intrinsic.c
trunk/gcc/fortran/intrinsic.h
trunk/gcc/fortran/simplify.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33197
^ permalink raw reply [flat|nested] 31+ messages in thread
* [Bug fortran/33197] Fortran 2008: math functions
2007-08-26 18:25 [Bug fortran/33197] New: Fortran 2008: gamma() and other small changes burnus at gcc dot gnu dot org
` (8 preceding siblings ...)
2009-05-16 17:33 ` fxcoudert at gcc dot gnu dot org
@ 2009-05-16 18:10 ` fxcoudert at gcc dot gnu dot org
2009-07-10 11:46 ` burnus at gcc dot gnu dot org
` (19 subsequent siblings)
29 siblings, 0 replies; 31+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2009-05-16 18:10 UTC (permalink / raw)
To: gcc-bugs
------- Comment #21 from fxcoudert at gcc dot gnu dot org 2009-05-16 18:09 -------
ERFC_SCALED compile-time simplification was committed.
TODO (carried on from above):
- TAN(X,Y) (= TAN2(X,Y))
- BESSEL_JN and BESSEL_YN: Transitional form is missing
- NORM2
- Finish complex (A)TAN(H), (A)COSH, (A)SINH, from comment #18
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33197
^ permalink raw reply [flat|nested] 31+ messages in thread
* [Bug fortran/33197] Fortran 2008: math functions
2007-08-26 18:25 [Bug fortran/33197] New: Fortran 2008: gamma() and other small changes burnus at gcc dot gnu dot org
` (9 preceding siblings ...)
2009-05-16 18:10 ` fxcoudert at gcc dot gnu dot org
@ 2009-07-10 11:46 ` burnus at gcc dot gnu dot org
2009-07-10 15:45 ` burnus at gcc dot gnu dot org
` (18 subsequent siblings)
29 siblings, 0 replies; 31+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-07-10 11:46 UTC (permalink / raw)
To: gcc-bugs
------- Comment #22 from burnus at gcc dot gnu dot org 2009-07-10 11:46 -------
For z a complex number: Patch for tan(z), sinh(z), cosh(z), tanh(z) - see at
http://gcc.gnu.org/ml/fortran/2009-07/msg00071.html
Remark: atan(z), asin(z) and acos(z) are also missing besides a{sin,cos,tan}h.
Additionally, I think the description for ATAN2 in the gfortran manual is
wrong:
"ATAN2(Y, X) computes the arctangent of the complex number X + i Y"
while the standard has:
"The result has a value equal ... to the principal value of the argument of
the complex number (X, Y), expressed in radians."
That is: atan2(y, x) = Pr arg(x+iy) = Arg(x+iy) =/= ATAN(X+i Y).
* * *
Fallback implementations via complex logarithm: I have no idea about NaN, Inf
etc. nor about the precision (I do not know how precise the fall back needs to
be), but Abramowitz & Stegun has the following:
a{tan,sin,cos}: http://www.iopb.res.in/~somen/abramowitz_and_stegun/page_80.htm
and http://en.wikipedia.org/wiki/Arctangent#Logarithmic_forms
a{sin,tan,cos}h:
http://www.iopb.res.in/~somen/abramowitz_and_stegun/page_87.htm However, the
equations might need to be slightly for complex arguments as written at
http://en.wikipedia.org/wiki/Inverse_hyperbolic_function#Logarithmic_representation
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33197
^ permalink raw reply [flat|nested] 31+ messages in thread
* [Bug fortran/33197] Fortran 2008: math functions
2007-08-26 18:25 [Bug fortran/33197] New: Fortran 2008: gamma() and other small changes burnus at gcc dot gnu dot org
` (10 preceding siblings ...)
2009-07-10 11:46 ` burnus at gcc dot gnu dot org
@ 2009-07-10 15:45 ` burnus at gcc dot gnu dot org
2009-07-10 16:17 ` burnus at gcc dot gnu dot org
` (17 subsequent siblings)
29 siblings, 0 replies; 31+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-07-10 15:45 UTC (permalink / raw)
To: gcc-bugs
------- Comment #23 from burnus at gcc dot gnu dot org 2009-07-10 15:45 -------
Created an attachment (id=18173)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18173&action=view)
Test implementation in C for complex arc{tan,sin,cos}{,h}
> Fallback implementations via complex logarithm
Attached is an implementation of the complex arc{tan,sin,cos}{,h} using complex
log and complex sqrt; plus test cases comparing to libc version; plus result on
my system with Mathematica comparison).
The test show that the result is good unless either value is Inf. In that case,
NaN is returned instead of the proper result. The GLIBC also has problems,
often it returns "(something,Inf)" instead of "(0, Inf)".
The question is whether this is good enough for whether one needs a special
case for +/-Inf at the real/imaginary part. (Note: I only looked at (0,Inf),
(Inf,0), (Inf,Inf) and not at (Inf,finite) etc.)
FX: If you are interested in creating a fall-back version for libgfortran ...
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33197
^ permalink raw reply [flat|nested] 31+ messages in thread
* [Bug fortran/33197] Fortran 2008: math functions
2007-08-26 18:25 [Bug fortran/33197] New: Fortran 2008: gamma() and other small changes burnus at gcc dot gnu dot org
` (11 preceding siblings ...)
2009-07-10 15:45 ` burnus at gcc dot gnu dot org
@ 2009-07-10 16:17 ` burnus at gcc dot gnu dot org
2009-07-11 0:03 ` burnus at gcc dot gnu dot org
` (16 subsequent siblings)
29 siblings, 0 replies; 31+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-07-10 16:17 UTC (permalink / raw)
To: gcc-bugs
------- Comment #24 from burnus at gcc dot gnu dot org 2009-07-10 16:17 -------
Regarding expressions with Inf with x being finite according to Mathematica 7:
ArcSin (+/-Inf,x) = (0, -/+Inf)
ArcSin (x,+/-Inf) = (0, +/-Inf)
ArcCos (+/-Inf,x) = (0, +/-Inf)
ArcCos (x,+/-Inf) = (0, -/+Inf)
ArcTan (+/-Inf,x) = (+/-Pi/2, 0)
ArcTan (x,+/-Inf) = (+/-Pi/2, 0)
ArcSinh (+/-Inf,x) = (+/-Inf,0)
ArcSinh (x,+/-Inf) = (+/-Inf,0)
ArcSinh (Inf,+/-Inf) = (Inf,0)
ArcSinh (-Inf,+/-Inf) = (-Inf,0)
ArcCosh (+/-Inf,x) = (Inf,0)
ArcCosh (x,+/-Inf) = (Inf,0)
ArcTanh (+/-Inf,x) = (0,-/+Pi/2)
ArcTanh (x,+/-Inf) = (0,-/+Pi/2)
(For ArcSin, ArcCos, ArcTan, ArcCosh and ArcTanh an expression was returned for
(Inf,Inf).)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33197
^ permalink raw reply [flat|nested] 31+ messages in thread
* [Bug fortran/33197] Fortran 2008: math functions
2007-08-26 18:25 [Bug fortran/33197] New: Fortran 2008: gamma() and other small changes burnus at gcc dot gnu dot org
` (12 preceding siblings ...)
2009-07-10 16:17 ` burnus at gcc dot gnu dot org
@ 2009-07-11 0:03 ` burnus at gcc dot gnu dot org
2009-07-14 7:44 ` burnus at gcc dot gnu dot org
` (15 subsequent siblings)
29 siblings, 0 replies; 31+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-07-11 0:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #25 from burnus at gcc dot gnu dot org 2009-07-11 00:03 -------
Subject: Bug 33197
Author: burnus
Date: Sat Jul 11 00:03:07 2009
New Revision: 149503
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149503
Log:
2009-07-09 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* check.c (gfc_check_fn_rc2008): New function.
* intrinsic.h (gfc_check_fn_rc2008): New prototype.
* intrinsic.c (add_functions): Add complex tan, cosh, sinh,
and tanh.
2009-07-09 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gfortran.dg/complex_intrinsic_3.f90: New test.
* gfortran.dg/complex_intrinsic_4.f90: New test.
Added:
trunk/gcc/testsuite/gfortran.dg/complex_intrinsic_3.f90
trunk/gcc/testsuite/gfortran.dg/complex_intrinsic_4.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/check.c
trunk/gcc/fortran/intrinsic.c
trunk/gcc/fortran/intrinsic.h
trunk/gcc/fortran/intrinsic.texi
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33197
^ permalink raw reply [flat|nested] 31+ messages in thread
* [Bug fortran/33197] Fortran 2008: math functions
2007-08-26 18:25 [Bug fortran/33197] New: Fortran 2008: gamma() and other small changes burnus at gcc dot gnu dot org
` (13 preceding siblings ...)
2009-07-11 0:03 ` burnus at gcc dot gnu dot org
@ 2009-07-14 7:44 ` burnus at gcc dot gnu dot org
2009-07-15 2:37 ` kargl at gcc dot gnu dot org
` (14 subsequent siblings)
29 siblings, 0 replies; 31+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-07-14 7:44 UTC (permalink / raw)
To: gcc-bugs
------- Comment #26 from burnus at gcc dot gnu dot org 2009-07-14 07:43 -------
Patch: http://gcc.gnu.org/ml/gcc-patches/2009-07/msg00739.html
- MPC compile-time evaluation of complex tan and sinh/cosh/tanh
- Run-time complex a(sin,cos,tan)(h) with C99 fallback (for finite values only)
TODO:
- Check-in the patch above
- Support infinite arguments in the fallback?
- TAN(X,Y) (= TAN2(X,Y)) - and fix wrong TAN2 description in the docs
- BESSEL_JN and BESSEL_YN: Transitional form is missing
- NORM2
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33197
^ permalink raw reply [flat|nested] 31+ messages in thread
* [Bug fortran/33197] Fortran 2008: math functions
2007-08-26 18:25 [Bug fortran/33197] New: Fortran 2008: gamma() and other small changes burnus at gcc dot gnu dot org
` (14 preceding siblings ...)
2009-07-14 7:44 ` burnus at gcc dot gnu dot org
@ 2009-07-15 2:37 ` kargl at gcc dot gnu dot org
2009-07-15 6:08 ` burnus at gcc dot gnu dot org
` (13 subsequent siblings)
29 siblings, 0 replies; 31+ messages in thread
From: kargl at gcc dot gnu dot org @ 2009-07-15 2:37 UTC (permalink / raw)
To: gcc-bugs
------- Comment #27 from kargl at gcc dot gnu dot org 2009-07-15 02:36 -------
(In reply to comment #26)
> Patch: http://gcc.gnu.org/ml/gcc-patches/2009-07/msg00739.html
> - MPC compile-time evaluation of complex tan and sinh/cosh/tanh
> - Run-time complex a(sin,cos,tan)(h) with C99 fallback (for finite values only)
>
> TODO:
> - Check-in the patch above
If no one else gets to a review by the weekend, I try to get one
done. In a quick scan of the patch, I note that the mpfr versions
of the simplifications weren't in the patch. I'll do those later.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33197
^ permalink raw reply [flat|nested] 31+ messages in thread
* [Bug fortran/33197] Fortran 2008: math functions
2007-08-26 18:25 [Bug fortran/33197] New: Fortran 2008: gamma() and other small changes burnus at gcc dot gnu dot org
` (15 preceding siblings ...)
2009-07-15 2:37 ` kargl at gcc dot gnu dot org
@ 2009-07-15 6:08 ` burnus at gcc dot gnu dot org
2009-07-25 19:39 ` burnus at gcc dot gnu dot org
` (12 subsequent siblings)
29 siblings, 0 replies; 31+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-07-15 6:08 UTC (permalink / raw)
To: gcc-bugs
------- Comment #28 from burnus at gcc dot gnu dot org 2009-07-15 06:08 -------
> In a quick scan of the patch, I note that the mpfr versions
> of the simplifications weren't in the patch.
MPFR or MPC? The MPFR version should be there since years; the MPC version of
tan/sinh/cosh/tanh should be there (FX patch which is part of this patch) and
the MPC version of a{sin,cos,tan}{,h} does not exist, yet:
http://gforge.inria.fr/plugins/scmsvn/viewcvs.php/trunk/TODO?root=mpc&view=markup
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33197
^ permalink raw reply [flat|nested] 31+ messages in thread
* [Bug fortran/33197] Fortran 2008: math functions
2007-08-26 18:25 [Bug fortran/33197] New: Fortran 2008: gamma() and other small changes burnus at gcc dot gnu dot org
` (16 preceding siblings ...)
2009-07-15 6:08 ` burnus at gcc dot gnu dot org
@ 2009-07-25 19:39 ` burnus at gcc dot gnu dot org
2009-07-25 19:45 ` burnus at gcc dot gnu dot org
` (11 subsequent siblings)
29 siblings, 0 replies; 31+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-07-25 19:39 UTC (permalink / raw)
To: gcc-bugs
------- Comment #29 from burnus at gcc dot gnu dot org 2009-07-25 19:39 -------
Subject: Bug 33197
Author: burnus
Date: Sat Jul 25 19:39:07 2009
New Revision: 150087
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=150087
Log:
2009-07-25 Tobias Burnus <burnus@net-b.de>
Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/33197
* intrinsic.c (add_functions): Support complex arguments for
acos,acosh,asin,asinh,atan,atanh.
* invoke.texi (ACOS,ACOSH,ASIN,ASINH,ATAN,ATANH): Support
complex arguments.
* simplify.c (gfc_simplify_acos,gfc_simplify_acosh,
gfc_simplify_asin,gfc_simplify_asinh,gfc_simplify_atan,
gfc_simplify_atanh,gfc_simplify_atan,gfc_simplify_asinh,
gfc_simplify_acosh,gfc_simplify_atanh): Support
complex arguments.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* intrinsics/c99_functions.c (cacosf,cacos,cacosl,casinf,
casin,casind,catanf,catan,catanl,cacoshf,cacosh,cacoshl,
casinhf,casinh,casinhf,catanhf,catanh,catanhl): New functions.
* c99_protos.h: Add prototypes for those.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gfortran.dg/complex_intrinsic_5.f90: New test.
* gfortran.dg/complex_intrinsic_7.f90: New test.
Added:
trunk/gcc/testsuite/gfortran.dg/complex_intrinsic_5.f90
trunk/gcc/testsuite/gfortran.dg/complex_intrinsic_6.f90
trunk/gcc/testsuite/gfortran.dg/complex_intrinsic_7.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/intrinsic.c
trunk/gcc/fortran/intrinsic.texi
trunk/gcc/fortran/simplify.c
trunk/gcc/testsuite/ChangeLog
trunk/libgfortran/ChangeLog
trunk/libgfortran/c99_protos.h
trunk/libgfortran/intrinsics/c99_functions.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33197
^ permalink raw reply [flat|nested] 31+ messages in thread
* [Bug fortran/33197] Fortran 2008: math functions
2007-08-26 18:25 [Bug fortran/33197] New: Fortran 2008: gamma() and other small changes burnus at gcc dot gnu dot org
` (17 preceding siblings ...)
2009-07-25 19:39 ` burnus at gcc dot gnu dot org
@ 2009-07-25 19:45 ` burnus at gcc dot gnu dot org
2009-07-26 17:26 ` burnus at gcc dot gnu dot org
` (10 subsequent siblings)
29 siblings, 0 replies; 31+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-07-25 19:45 UTC (permalink / raw)
To: gcc-bugs
------- Comment #30 from burnus at gcc dot gnu dot org 2009-07-25 19:44 -------
(Patch was approved by Steve on IRC.)
TODO (carried on):
- Support inverse functions as initialization expressions, when MPC is ready
- TAN(X,Y) (= TAN2(X,Y)) - and fix wrong TAN2 description in intrinsic.texi
- BESSEL_JN and BESSEL_YN: Transitional form is missing
- NORM2 is missing
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33197
^ permalink raw reply [flat|nested] 31+ messages in thread
* [Bug fortran/33197] Fortran 2008: math functions
2007-08-26 18:25 [Bug fortran/33197] New: Fortran 2008: gamma() and other small changes burnus at gcc dot gnu dot org
` (18 preceding siblings ...)
2009-07-25 19:45 ` burnus at gcc dot gnu dot org
@ 2009-07-26 17:26 ` burnus at gcc dot gnu dot org
2009-10-02 3:52 ` ghazi at gcc dot gnu dot org
` (9 subsequent siblings)
29 siblings, 0 replies; 31+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-07-26 17:26 UTC (permalink / raw)
To: gcc-bugs
------- Comment #31 from burnus at gcc dot gnu dot org 2009-07-26 17:26 -------
Subject: Bug 33197
Author: burnus
Date: Sun Jul 26 17:25:56 2009
New Revision: 150100
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=150100
Log:
2009-07-26 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* intrinsic.c (make_generic): Remove assert as "atan" can be
both ISYM_ATAN and ISYM_ATAN2.
(add_functions): Add two-argument variant of ATAN.
* intrinsic.h (gfc_check_atan_2): Add check for it.
* intrinsic.texi (ATAN2): Correct and enhance description.
(ATAN): Describe two-argument variant of ATAN.
2009-07-26 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gfortran.dg/atan2_1.f90: New test
* gfortran.dg/atan2_2.f90: New test
Added:
trunk/gcc/testsuite/gfortran.dg/atan2_1.f90
trunk/gcc/testsuite/gfortran.dg/atan2_2.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/check.c
trunk/gcc/fortran/intrinsic.c
trunk/gcc/fortran/intrinsic.h
trunk/gcc/fortran/intrinsic.texi
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33197
^ permalink raw reply [flat|nested] 31+ messages in thread
* [Bug fortran/33197] Fortran 2008: math functions
2007-08-26 18:25 [Bug fortran/33197] New: Fortran 2008: gamma() and other small changes burnus at gcc dot gnu dot org
` (19 preceding siblings ...)
2009-07-26 17:26 ` burnus at gcc dot gnu dot org
@ 2009-10-02 3:52 ` ghazi at gcc dot gnu dot org
2010-05-02 8:48 ` dfranke at gcc dot gnu dot org
` (8 subsequent siblings)
29 siblings, 0 replies; 31+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2009-10-02 3:52 UTC (permalink / raw)
To: gcc-bugs
------- Comment #32 from ghazi at gcc dot gnu dot org 2009-10-02 03:52 -------
Subject: Bug 33197
Author: ghazi
Date: Fri Oct 2 03:52:05 2009
New Revision: 152394
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=152394
Log:
PR fortran/33197
* gfortran.h (HAVE_mpc_arc): Define.
* simplify.c (gfc_simplify_acos): Handle complex acos.
(gfc_simplify_acosh): Likewise for acosh.
(gfc_simplify_asin): Likewise for asin.
(gfc_simplify_asinh): Likewise for asinh.
(gfc_simplify_atan): Likewise for atan.
(gfc_simplify_atanh): Likewise for atanh.
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/gfortran.h
trunk/gcc/fortran/simplify.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33197
^ permalink raw reply [flat|nested] 31+ messages in thread
* [Bug fortran/33197] Fortran 2008: math functions
2007-08-26 18:25 [Bug fortran/33197] New: Fortran 2008: gamma() and other small changes burnus at gcc dot gnu dot org
` (20 preceding siblings ...)
2009-10-02 3:52 ` ghazi at gcc dot gnu dot org
@ 2010-05-02 8:48 ` dfranke at gcc dot gnu dot org
2010-08-19 7:28 ` burnus at gcc dot gnu dot org
` (7 subsequent siblings)
29 siblings, 0 replies; 31+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2010-05-02 8:48 UTC (permalink / raw)
To: gcc-bugs
------- Comment #33 from dfranke at gcc dot gnu dot org 2010-05-02 08:47 -------
TODO (carried on):
- BESSEL_JN and BESSEL_YN: Transitional form is missing (c.f. PR36096,
PR36158)
- NORM2 is missing
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33197
^ permalink raw reply [flat|nested] 31+ messages in thread
* [Bug fortran/33197] Fortran 2008: math functions
2007-08-26 18:25 [Bug fortran/33197] New: Fortran 2008: gamma() and other small changes burnus at gcc dot gnu dot org
` (21 preceding siblings ...)
2010-05-02 8:48 ` dfranke at gcc dot gnu dot org
@ 2010-08-19 7:28 ` burnus at gcc dot gnu dot org
2010-08-21 10:13 ` burnus at gcc dot gnu dot org
` (6 subsequent siblings)
29 siblings, 0 replies; 31+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-08-19 7:28 UTC (permalink / raw)
To: gcc-bugs
------- Comment #34 from burnus at gcc dot gnu dot org 2010-08-19 07:28 -------
Subject: Bug 33197
Author: burnus
Date: Thu Aug 19 07:28:17 2010
New Revision: 163364
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=163364
Log:
2010-08-19 Tobias Burnus <burnus@net-b.de>
PR fortran/36158
PR fortran/33197
* check.c (gfc_check_bessel_n2): New function.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_JN2 and GFC_ISYM_YN2.
* intrinsic.c (add_functions): Add transformational version
of the Bessel_jn/yn intrinsics.
* intrinsic.h (gfc_check_bessel_n2,gfc_simplify_bessel_jn2,
gfc_simplify_bessel_yn2): New prototypes.
* intrinsic.texi (Bessel_jn, Bessel_yn): Document
transformational variant.
* simplify.c (gfc_simplify_bessel_jn, gfc_simplify_bessel_yn):
Check for negative order.
(gfc_simplify_bessel_n2,gfc_simplify_bessel_jn2,
gfc_simplify_bessel_yn2): New functions.
2010-08-19 Tobias Burnus <burnus@net-b.de>
PR fortran/36158
PR fortran/33197
* gfortran.dg/bessel_3.f90: New.
* gfortran.dg/bessel_4.f90: New.
* gfortran.dg/bessel_5.f90: New.
Added:
trunk/gcc/testsuite/gfortran.dg/bessel_3.f90
trunk/gcc/testsuite/gfortran.dg/bessel_4.f90
trunk/gcc/testsuite/gfortran.dg/bessel_5.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/check.c
trunk/gcc/fortran/gfortran.h
trunk/gcc/fortran/intrinsic.c
trunk/gcc/fortran/intrinsic.h
trunk/gcc/fortran/intrinsic.texi
trunk/gcc/fortran/simplify.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33197
^ permalink raw reply [flat|nested] 31+ messages in thread
* [Bug fortran/33197] Fortran 2008: math functions
2007-08-26 18:25 [Bug fortran/33197] New: Fortran 2008: gamma() and other small changes burnus at gcc dot gnu dot org
` (22 preceding siblings ...)
2010-08-19 7:28 ` burnus at gcc dot gnu dot org
@ 2010-08-21 10:13 ` burnus at gcc dot gnu dot org
2010-08-21 10:35 ` burnus at gcc dot gnu dot org
` (5 subsequent siblings)
29 siblings, 0 replies; 31+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-08-21 10:13 UTC (permalink / raw)
To: gcc-bugs
------- Comment #35 from burnus at gcc dot gnu dot org 2010-08-21 10:13 -------
Subject: Bug 33197
Author: burnus
Date: Sat Aug 21 10:12:53 2010
New Revision: 163440
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=163440
Log:
2010-08-21 Tobias Burnus <burnus@net-b.de>
PR fortran/36158
PR fortran/33197
* intrinsic.c (add_sym): Init value attribute.
(set_attr_value): New function.
(add_functions) Use it and add JN/YN resolvers.
* symbol.c (gfc_copy_formal_args_intr): Copy value attr.
* intrinsic.h (gfc_resolve_bessel_n2): New prototype.
* gfortran.h (gfc_intrinsic_arg): Add value attribute.
* iresolve.c (gfc_resolve_bessel_n2): New function.
* trans-intrinsic.c (gfc_get_symbol_for_expr): Create
formal arg list.
(gfc_conv_intrinsic_function,gfc_is_intrinsic_libcall):
Add GFC_ISYM_JN2/GFC_ISYM_YN2 as case value.
* simplify.c (): For YN set to -INF if previous values
was -INF.
* trans-expr.c (gfc_conv_procedure_call): Don't crash
if sym->as is NULL.
* iresolve.c (gfc_resolve_extends_type_of): Set the
type of the dummy argument to the one of the actual.
2010-08-21 Tobias Burnus <burnus@net-b.de>
PR fortran/36158
PR fortran/33197
* m4/bessel.m4: Implement bessel_jn and bessel_yn.
* gfortran.map: Add the generated bessel_jn_r{4,8,10,16}
and bessel_yn_r{4,8,10,16}.
* Makefile.am: Add bessel.m4.
* Makefile.in: Regenerated.
* generated/bessel_r4.c: Generated.
* generated/bessel_r16.c: Generated.
* generated/bessel_r8.c: Generated.
* generated/bessel_r10.c: Generated.
2010-08-21 Tobias Burnus <burnus@net-b.de>
PR fortran/36158
PR fortran/33197
* gfortran.dg/bessel_6.f90: New.
* gfortran.dg/bessel_7.f90: New.
Added:
trunk/gcc/testsuite/gfortran.dg/bessel_6.f90
trunk/gcc/testsuite/gfortran.dg/bessel_7.f90
trunk/libgfortran/generated/bessel_r10.c
trunk/libgfortran/generated/bessel_r16.c
trunk/libgfortran/generated/bessel_r4.c
trunk/libgfortran/generated/bessel_r8.c
trunk/libgfortran/m4/bessel.m4
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/gfortran.h
trunk/gcc/fortran/intrinsic.c
trunk/gcc/fortran/intrinsic.h
trunk/gcc/fortran/iresolve.c
trunk/gcc/fortran/simplify.c
trunk/gcc/fortran/symbol.c
trunk/gcc/fortran/trans-expr.c
trunk/gcc/fortran/trans-intrinsic.c
trunk/gcc/testsuite/ChangeLog
trunk/libgfortran/ChangeLog
trunk/libgfortran/Makefile.am
trunk/libgfortran/Makefile.in
trunk/libgfortran/gfortran.map
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33197
^ permalink raw reply [flat|nested] 31+ messages in thread
* [Bug fortran/33197] Fortran 2008: math functions
2007-08-26 18:25 [Bug fortran/33197] New: Fortran 2008: gamma() and other small changes burnus at gcc dot gnu dot org
` (23 preceding siblings ...)
2010-08-21 10:13 ` burnus at gcc dot gnu dot org
@ 2010-08-21 10:35 ` burnus at gcc dot gnu dot org
2010-08-22 19:32 ` burnus at gcc dot gnu dot org
` (4 subsequent siblings)
29 siblings, 0 replies; 31+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-08-21 10:35 UTC (permalink / raw)
To: gcc-bugs
------- Comment #36 from burnus at gcc dot gnu dot org 2010-08-21 10:35 -------
TODO (carried on):
- NORM2 (L2 norm).
For size-2, one should simply call HYPOT.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33197
^ permalink raw reply [flat|nested] 31+ messages in thread
* [Bug fortran/33197] Fortran 2008: math functions
2007-08-26 18:25 [Bug fortran/33197] New: Fortran 2008: gamma() and other small changes burnus at gcc dot gnu dot org
` (24 preceding siblings ...)
2010-08-21 10:35 ` burnus at gcc dot gnu dot org
@ 2010-08-22 19:32 ` burnus at gcc dot gnu dot org
2010-08-22 19:34 ` burnus at gcc dot gnu dot org
` (3 subsequent siblings)
29 siblings, 0 replies; 31+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-08-22 19:32 UTC (permalink / raw)
To: gcc-bugs
------- Comment #37 from burnus at gcc dot gnu dot org 2010-08-22 19:32 -------
Created an attachment (id=21545)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21545&action=view)
Draft patch for NORM2 -- and draft run-time test, early PARITY patch
Draft patch for NORM2; as PARITY is essentially the same -- thus, an untested
PARITY implementation is included as well.
TODO
- There is some bug in converting the call for NORM2 - probably in
trans-intrinsic.c; result: a segfault for the run-time version at compile time
- Inline run-time version missing, cf. ISYM_SUM - possibly use lib version with
-Os?
- Test cases
- PARITY: What about logical kinds 1 and 2? Or how to handle this better? --
and the same issues as for NORM2.
Note, a simple conversion only works for scalars not for arrays - which require
would require a temporary. I could image that INTEGER(1) is often used due to
its smaller storage size.
PS: NORM2 is described as "careful calculation of Euclidean norm" in the BCS
slides and in the what's new in F2008 article. Currently, I use the trivial
brute-force method. Maybe something more careful should be done?
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #17315|0 |1
is obsolete| |
Attachment #18173|0 |1
is obsolete| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33197
^ permalink raw reply [flat|nested] 31+ messages in thread
* [Bug fortran/33197] Fortran 2008: math functions
2007-08-26 18:25 [Bug fortran/33197] New: Fortran 2008: gamma() and other small changes burnus at gcc dot gnu dot org
` (25 preceding siblings ...)
2010-08-22 19:32 ` burnus at gcc dot gnu dot org
@ 2010-08-22 19:34 ` burnus at gcc dot gnu dot org
2010-08-22 21:02 ` burnus at gcc dot gnu dot org
` (2 subsequent siblings)
29 siblings, 0 replies; 31+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-08-22 19:34 UTC (permalink / raw)
To: gcc-bugs
------- Comment #38 from burnus at gcc dot gnu dot org 2010-08-22 19:34 -------
(In reply to comment #37)
> - PARITY: ... and the same issues as for NORM2.
And PARITY documentation is missing.
Reminder: For NORM2's inline version, think also about hypot.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33197
^ permalink raw reply [flat|nested] 31+ messages in thread
* [Bug fortran/33197] Fortran 2008: math functions
2007-08-26 18:25 [Bug fortran/33197] New: Fortran 2008: gamma() and other small changes burnus at gcc dot gnu dot org
` (26 preceding siblings ...)
2010-08-22 19:34 ` burnus at gcc dot gnu dot org
@ 2010-08-22 21:02 ` burnus at gcc dot gnu dot org
2010-08-27 19:18 ` burnus at gcc dot gnu dot org
2010-08-27 19:21 ` burnus at gcc dot gnu dot org
29 siblings, 0 replies; 31+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-08-22 21:02 UTC (permalink / raw)
To: gcc-bugs
------- Comment #39 from burnus at gcc dot gnu dot org 2010-08-22 21:02 -------
(In reply to comment #37)
> PS: NORM2 is described as "careful calculation of Euclidean norm" in the BCS
> slides and in the what's new in F2008 article. Currently, I use the trivial
> brute-force method. Maybe something more careful should be done?
As Dominique points out - the algorithm can be made more robust by doing the
calculation as
tmp = max(abs(a))
NORM2(a) := tmp*sqrt(dot_product(a/tmp,a/tmp))
That helps a lot for "a" finite with (a^2 > huge(a)) [overflow] ;-)
However, there is a method which only requires a single pass, cf. p. 38/39 in
http://cpc.cs.qub.ac.uk/MRSN/higham.pdf. The algorithm by Sven Hammarling is
also used in BLAS, cf. http://www.netlib.org/blas/snrm2.f
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33197
^ permalink raw reply [flat|nested] 31+ messages in thread
* [Bug fortran/33197] Fortran 2008: math functions
2007-08-26 18:25 [Bug fortran/33197] New: Fortran 2008: gamma() and other small changes burnus at gcc dot gnu dot org
` (27 preceding siblings ...)
2010-08-22 21:02 ` burnus at gcc dot gnu dot org
@ 2010-08-27 19:18 ` burnus at gcc dot gnu dot org
2010-08-27 19:21 ` burnus at gcc dot gnu dot org
29 siblings, 0 replies; 31+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-08-27 19:18 UTC (permalink / raw)
To: gcc-bugs
------- Comment #40 from burnus at gcc dot gnu dot org 2010-08-27 19:18 -------
Subject: Bug 33197
Author: burnus
Date: Fri Aug 27 19:17:45 2010
New Revision: 163595
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=163595
Log:
gcc/fortran/
2010-08-27 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gcc/fortran/intrinsic.c (add_functions): Add norm2 and parity.
* gcc/fortran/intrinsic.h (gfc_check_norm2, gfc_check_parity):
gfc_simplify_norm2, gfc_simplify_parity, gfc_resolve_norm2,
gfc_resolve_parity): New prototypes.
* gcc/fortran/gfortran.h (gfc_isym_id): New enum items
GFC_ISYM_NORM2 and GFC_ISYM_PARITY.
* gcc/fortran/iresolve.c (gfc_resolve_norm2,
gfc_resolve_parity): New functions.
* gcc/fortran/check.c (gfc_check_norm2, gfc_check_parity):
New functions.
* gcc/fortran/trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function): Handle NORM2 and PARITY.
* gcc/fortran/intrinsic.texi (NORM2, PARITY): Add.
* gcc/fortran/simplify.c (simplify_transformation_to_array):
Add post-processing opterator.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_count,
gfc_simplify_product, gfc_simplify_sum): Update call.
(add_squared, do_sqrt, gfc_simplify_norm2, do_xor,
gfc_simplify_parity): New functions.
gcc/testsuite/
2010-08-27 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gcc/testsuite/gfortran.dg/norm2_1.f90: New.
* gcc/testsuite/gfortran.dg/norm2_2.f90: New.
* gcc/testsuite/gfortran.dg/norm2_3.f90: New.
* gcc/testsuite/gfortran.dg/norm2_4.f90: New.
* gcc/testsuite/gfortran.dg/parity_1.f90: New.
* gcc/testsuite/gfortran.dg/parity_2.f90: New.
* gcc/testsuite/gfortran.dg/parity_3.f90: New.
libgfortran/
2010-08-27 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* libgfortran/m4/ifunction.m4 (FINISH_ARRAY_FUNCTION,
ARRAY_FUNCTION): Allow expression after loop.
* libgfortran/m4/norm2.m4: New for _gfortran_norm2_r{4,8,10,16}.
* libgfortran/m4/parity.m4: New for
* _gfortran_parity_l{1,2,4,8,16}.
* libgfortran/gfortran.map: Add new functions.
* libgfortran/Makefile.am: Ditto.
* libgfortran/m4/minloc1.m4: Add empty argument for
* ARRAY_FUNCTION.
* libgfortran/m4/maxloc1.m4: Ditto.
* libgfortran/m4/all.m4: Ditto.
* libgfortran/m4/minval.m4: Ditto.
* libgfortran/m4/maxval.m4: Ditto.
* libgfortran/m4/count.m4: Ditto.
* libgfortran/m4/product.m4: Ditto.
* libgfortran/m4/any.m4: Ditto.
* Makefile.in: Regenerated.
* generated/minval_r8.c: Regenerated.
* generated/maxloc1_4_r8.c: Regenerated.
* generated/minloc1_16_r16.c: Regenerated.
* generated/norm2_r4.c: Regenerated.
* generated/sum_i8.c: Regenerated.
* generated/parity_l2.c: Regenerated.
* generated/any_l16.c: Regenerated.
* generated/maxval_i2.c: Regenerated.
* generated/any_l2.c: Regenerated.
* generated/product_r4.c: Regenerated.
* generated/maxloc1_8_i4.c: Regenerated.
* generated/parity_l16.c: Regenerated.
* generated/all_l1.c: Regenerated.
* generated/product_i2.c: Regenerated.
* generated/minloc1_8_r16.c: Regenerated.
* generated/maxloc1_8_r16.c: Regenerated.
* generated/sum_r16.c: Regenerated.
* generated/sum_i1.c: Regenerated.
* generated/minloc1_4_r8.c: Regenerated.
* generated/maxloc1_16_r16.c: Regenerated.
* generated/minloc1_16_i4.c: Regenerated.
* generated/maxloc1_16_i4.c: Regenerated.
* generated/maxval_r16.c: Regenerated.
* generated/product_c10.c: Regenerated.
* generated/minloc1_8_i4.c: Regenerated.
* generated/all_l2.c: Regenerated.
* generated/product_c4.c: Regenerated.
* generated/sum_r4.c: Regenerated.
* generated/all_l16.c: Regenerated.
* generated/minloc1_16_r10.c: Regenerated.
* generated/sum_i2.c: Regenerated.
* generated/maxloc1_8_r8.c: Regenerated.
* generated/minval_i16.c: Regenerated.
* generated/parity_l4.c: Regenerated.
* generated/maxval_i4.c: Regenerated.
* generated/any_l4.c: Regenerated.
* generated/minval_i8.c: Regenerated.
* generated/maxloc1_4_i8.c: Regenerated.
* generated/minloc1_4_i16.c: Regenerated.
* generated/maxloc1_4_i16.c: Regenerated.
* generated/minloc1_8_r10.c: Regenerated.
* generated/product_i4.c: Regenerated.
* generated/maxloc1_8_r10.c: Regenerated.
* generated/sum_c16.c: Regenerated.
* generated/minloc1_16_r8.c: Regenerated.
* generated/maxloc1_16_r8.c: Regenerated.
* generated/count_4_l.c: Regenerated.
* generated/sum_r10.c: Regenerated.
* generated/count_8_l.c: Regenerated.
* generated/sum_c4.c: Regenerated.
* generated/maxloc1_16_r10.c: Regenerated.
* generated/minloc1_8_r8.c: Regenerated.
* generated/maxval_r10.c: Regenerated.
* generated/minval_i1.c: Regenerated.
* generated/maxloc1_4_i1.c: Regenerated.
* generated/minloc1_4_i8.c: Regenerated.
* generated/product_i16.c: Regenerated.
* generated/all_l4.c: Regenerated.
* generated/norm2_r16.c: Regenerated.
* generated/minval_r4.c: Regenerated.
* generated/maxloc1_4_r4.c: Regenerated.
* generated/sum_i4.c: Regenerated.
* generated/maxval_r8.c: Regenerated.
* generated/norm2_r8.c: Regenerated.
* generated/minloc1_4_i1.c: Regenerated.
* generated/minval_r16.c: Regenerated.
* generated/minval_i2.c: Regenerated.
* generated/maxloc1_4_i2.c: Regenerated.
* generated/product_r8.c: Regenerated.
* generated/maxloc1_8_i8.c: Regenerated.
* generated/sum_c10.c: Regenerated.
* generated/minloc1_4_r16.c: Regenerated.
* generated/maxloc1_4_r16.c: Regenerated.
* generated/count_1_l.c: Regenerated.
* generated/minloc1_4_r4.c: Regenerated.
* generated/minloc1_16_i8.c: Regenerated.
* generated/maxloc1_16_i8.c: Regenerated.
* generated/minloc1_4_i2.c: Regenerated.
* generated/maxloc1_8_i1.c: Regenerated.
* generated/minloc1_8_i8.c: Regenerated.
* generated/product_r16.c: Regenerated.
* generated/product_c8.c: Regenerated.
* generated/sum_r8.c: Regenerated.
* generated/norm2_r10.c: Regenerated.
* generated/minloc1_16_i16.c: Regenerated.
* generated/maxloc1_8_r4.c: Regenerated.
* generated/minloc1_16_i1.c: Regenerated.
* generated/maxloc1_16_i1.c: Regenerated.
* generated/minval_r10.c: Regenerated.
* generated/count_16_l.c: Regenerated.
* generated/parity_l8.c: Regenerated.
* generated/minloc1_8_i1.c: Regenerated.
* generated/minval_i4.c: Regenerated.
* generated/maxloc1_4_i4.c: Regenerated.
* generated/maxloc1_8_i2.c: Regenerated.
* generated/maxval_i8.c: Regenerated.
* generated/any_l8.c: Regenerated.
* generated/minloc1_4_r10.c: Regenerated.
* generated/minloc1_8_i16.c: Regenerated.
* generated/maxloc1_4_r10.c: Regenerated.
* generated/maxloc1_8_i16.c: Regenerated.
* generated/minloc1_16_r4.c: Regenerated.
* generated/maxloc1_16_r4.c: Regenerated.
* generated/product_i8.c: Regenerated.
* generated/sum_i16.c: Regenerated.
* generated/count_2_l.c: Regenerated.
* generated/maxloc1_16_i16.c: Regenerated.
* generated/minloc1_8_r4.c: Regenerated.
* generated/sum_c8.c: Regenerated.
* generated/minloc1_16_i2.c: Regenerated.
* generated/maxloc1_16_i2.c: Regenerated.
* generated/parity_l1.c: Regenerated.
* generated/maxval_i16.c: Regenerated.
* generated/maxval_i1.c: Regenerated.
* generated/minloc1_4_i4.c: Regenerated.
* generated/any_l1.c: Regenerated.
* generated/minloc1_8_i2.c: Regenerated.
* generated/product_c16.c: Regenerated.
* generated/product_r10.c: Regenerated.
* generated/product_i1.c: Regenerated.
* generated/all_l8.c: Regenerated.
* generated/maxval_r4.c: Regenerated.
Added:
trunk/gcc/testsuite/gfortran.dg/norm2_1.f90
trunk/gcc/testsuite/gfortran.dg/norm2_2.f90
trunk/gcc/testsuite/gfortran.dg/norm2_3.f90
trunk/gcc/testsuite/gfortran.dg/norm_4.f90
trunk/gcc/testsuite/gfortran.dg/parity_1.f90
trunk/gcc/testsuite/gfortran.dg/parity_2.f90
trunk/gcc/testsuite/gfortran.dg/parity_3.f90
trunk/libgfortran/generated/norm2_r10.c
trunk/libgfortran/generated/norm2_r16.c
trunk/libgfortran/generated/norm2_r4.c
trunk/libgfortran/generated/norm2_r8.c
trunk/libgfortran/generated/parity_l1.c
trunk/libgfortran/generated/parity_l16.c
trunk/libgfortran/generated/parity_l2.c
trunk/libgfortran/generated/parity_l4.c
trunk/libgfortran/generated/parity_l8.c
trunk/libgfortran/m4/norm2.m4
trunk/libgfortran/m4/parity.m4
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/check.c
trunk/gcc/fortran/gfortran.h
trunk/gcc/fortran/intrinsic.c
trunk/gcc/fortran/intrinsic.h
trunk/gcc/fortran/intrinsic.texi
trunk/gcc/fortran/iresolve.c
trunk/gcc/fortran/simplify.c
trunk/gcc/fortran/trans-intrinsic.c
trunk/gcc/testsuite/ChangeLog
trunk/libgfortran/ChangeLog
trunk/libgfortran/Makefile.am
trunk/libgfortran/Makefile.in
trunk/libgfortran/generated/all_l1.c
trunk/libgfortran/generated/all_l16.c
trunk/libgfortran/generated/all_l2.c
trunk/libgfortran/generated/all_l4.c
trunk/libgfortran/generated/all_l8.c
trunk/libgfortran/generated/any_l1.c
trunk/libgfortran/generated/any_l16.c
trunk/libgfortran/generated/any_l2.c
trunk/libgfortran/generated/any_l4.c
trunk/libgfortran/generated/any_l8.c
trunk/libgfortran/generated/count_16_l.c
trunk/libgfortran/generated/count_1_l.c
trunk/libgfortran/generated/count_2_l.c
trunk/libgfortran/generated/count_4_l.c
trunk/libgfortran/generated/count_8_l.c
trunk/libgfortran/generated/maxloc1_16_i1.c
trunk/libgfortran/generated/maxloc1_16_i16.c
trunk/libgfortran/generated/maxloc1_16_i2.c
trunk/libgfortran/generated/maxloc1_16_i4.c
trunk/libgfortran/generated/maxloc1_16_i8.c
trunk/libgfortran/generated/maxloc1_16_r10.c
trunk/libgfortran/generated/maxloc1_16_r16.c
trunk/libgfortran/generated/maxloc1_16_r4.c
trunk/libgfortran/generated/maxloc1_16_r8.c
trunk/libgfortran/generated/maxloc1_4_i1.c
trunk/libgfortran/generated/maxloc1_4_i16.c
trunk/libgfortran/generated/maxloc1_4_i2.c
trunk/libgfortran/generated/maxloc1_4_i4.c
trunk/libgfortran/generated/maxloc1_4_i8.c
trunk/libgfortran/generated/maxloc1_4_r10.c
trunk/libgfortran/generated/maxloc1_4_r16.c
trunk/libgfortran/generated/maxloc1_4_r4.c
trunk/libgfortran/generated/maxloc1_4_r8.c
trunk/libgfortran/generated/maxloc1_8_i1.c
trunk/libgfortran/generated/maxloc1_8_i16.c
trunk/libgfortran/generated/maxloc1_8_i2.c
trunk/libgfortran/generated/maxloc1_8_i4.c
trunk/libgfortran/generated/maxloc1_8_i8.c
trunk/libgfortran/generated/maxloc1_8_r10.c
trunk/libgfortran/generated/maxloc1_8_r16.c
trunk/libgfortran/generated/maxloc1_8_r4.c
trunk/libgfortran/generated/maxloc1_8_r8.c
trunk/libgfortran/generated/maxval_i1.c
trunk/libgfortran/generated/maxval_i16.c
trunk/libgfortran/generated/maxval_i2.c
trunk/libgfortran/generated/maxval_i4.c
trunk/libgfortran/generated/maxval_i8.c
trunk/libgfortran/generated/maxval_r10.c
trunk/libgfortran/generated/maxval_r16.c
trunk/libgfortran/generated/maxval_r4.c
trunk/libgfortran/generated/maxval_r8.c
trunk/libgfortran/generated/minloc1_16_i1.c
trunk/libgfortran/generated/minloc1_16_i16.c
trunk/libgfortran/generated/minloc1_16_i2.c
trunk/libgfortran/generated/minloc1_16_i4.c
trunk/libgfortran/generated/minloc1_16_i8.c
trunk/libgfortran/generated/minloc1_16_r10.c
trunk/libgfortran/generated/minloc1_16_r16.c
trunk/libgfortran/generated/minloc1_16_r4.c
trunk/libgfortran/generated/minloc1_16_r8.c
trunk/libgfortran/generated/minloc1_4_i1.c
trunk/libgfortran/generated/minloc1_4_i16.c
trunk/libgfortran/generated/minloc1_4_i2.c
trunk/libgfortran/generated/minloc1_4_i4.c
trunk/libgfortran/generated/minloc1_4_i8.c
trunk/libgfortran/generated/minloc1_4_r10.c
trunk/libgfortran/generated/minloc1_4_r16.c
trunk/libgfortran/generated/minloc1_4_r4.c
trunk/libgfortran/generated/minloc1_4_r8.c
trunk/libgfortran/generated/minloc1_8_i1.c
trunk/libgfortran/generated/minloc1_8_i16.c
trunk/libgfortran/generated/minloc1_8_i2.c
trunk/libgfortran/generated/minloc1_8_i4.c
trunk/libgfortran/generated/minloc1_8_i8.c
trunk/libgfortran/generated/minloc1_8_r10.c
trunk/libgfortran/generated/minloc1_8_r16.c
trunk/libgfortran/generated/minloc1_8_r4.c
trunk/libgfortran/generated/minloc1_8_r8.c
trunk/libgfortran/generated/minval_i1.c
trunk/libgfortran/generated/minval_i16.c
trunk/libgfortran/generated/minval_i2.c
trunk/libgfortran/generated/minval_i4.c
trunk/libgfortran/generated/minval_i8.c
trunk/libgfortran/generated/minval_r10.c
trunk/libgfortran/generated/minval_r16.c
trunk/libgfortran/generated/minval_r4.c
trunk/libgfortran/generated/minval_r8.c
trunk/libgfortran/generated/product_c10.c
trunk/libgfortran/generated/product_c16.c
trunk/libgfortran/generated/product_c4.c
trunk/libgfortran/generated/product_c8.c
trunk/libgfortran/generated/product_i1.c
trunk/libgfortran/generated/product_i16.c
trunk/libgfortran/generated/product_i2.c
trunk/libgfortran/generated/product_i4.c
trunk/libgfortran/generated/product_i8.c
trunk/libgfortran/generated/product_r10.c
trunk/libgfortran/generated/product_r16.c
trunk/libgfortran/generated/product_r4.c
trunk/libgfortran/generated/product_r8.c
trunk/libgfortran/generated/sum_c10.c
trunk/libgfortran/generated/sum_c16.c
trunk/libgfortran/generated/sum_c4.c
trunk/libgfortran/generated/sum_c8.c
trunk/libgfortran/generated/sum_i1.c
trunk/libgfortran/generated/sum_i16.c
trunk/libgfortran/generated/sum_i2.c
trunk/libgfortran/generated/sum_i4.c
trunk/libgfortran/generated/sum_i8.c
trunk/libgfortran/generated/sum_r10.c
trunk/libgfortran/generated/sum_r16.c
trunk/libgfortran/generated/sum_r4.c
trunk/libgfortran/generated/sum_r8.c
trunk/libgfortran/gfortran.map
trunk/libgfortran/m4/all.m4
trunk/libgfortran/m4/any.m4
trunk/libgfortran/m4/count.m4
trunk/libgfortran/m4/ifunction.m4
trunk/libgfortran/m4/maxloc1.m4
trunk/libgfortran/m4/maxval.m4
trunk/libgfortran/m4/minloc1.m4
trunk/libgfortran/m4/minval.m4
trunk/libgfortran/m4/product.m4
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33197
^ permalink raw reply [flat|nested] 31+ messages in thread
* [Bug fortran/33197] Fortran 2008: math functions
2007-08-26 18:25 [Bug fortran/33197] New: Fortran 2008: gamma() and other small changes burnus at gcc dot gnu dot org
` (28 preceding siblings ...)
2010-08-27 19:18 ` burnus at gcc dot gnu dot org
@ 2010-08-27 19:21 ` burnus at gcc dot gnu dot org
29 siblings, 0 replies; 31+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-08-27 19:21 UTC (permalink / raw)
To: gcc-bugs
------- Comment #41 from burnus at gcc dot gnu dot org 2010-08-27 19:20 -------
FIXED on the 4.6 trunk.
Thanks to all involved in implementing the math intrinsics.
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33197
^ permalink raw reply [flat|nested] 31+ messages in thread