This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch,Fortran] PR33197 (F2008) Add complex tan/cosh/sinh/cosh
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org, "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Thu, 9 Jul 2009 14:46:13 -0700
- Subject: Re: [Patch,Fortran] PR33197 (F2008) Add complex tan/cosh/sinh/cosh
- References: <20090709190816.GA12639@net-b.de>
On Thu, Jul 09, 2009 at 09:08:16PM +0200, Tobias Burnus wrote:
> Hi all,
>
> as Kaveh pointed out: The complex trigonometric
> functions tan, sinh, cosh and tanh are supported by
> MPC and libgfortran has the C99 fallback functions
> implemented. Thus one can simply enable them,
> what this patch does.
>
> I have not added the compile-time simplification
> via MPC - leaving this to a later patch by Kaveh,
> me or someone else.
>
> Build and regtested on x86-64-linux.
> OK for the trunk?
>
FX said he had a small amount of time to look into
implementing these functions. Perhaps, he'll do the
simplification.
It appears that the c99_function.c fallback functions
need some scrutiny. Your complex_intrinsic_3.f90
fails on FreeBSD. A quick scan of c99_functions.c
finds
ccoshf (float complex a)
{
float r, i;
float complex v;
r = REALPART (a);
i = IMAGPART (a);
COMPLEX_ASSIGN (v, coshf (r) * cosf (i), - (sinhf (r) * sinf (i)));
return v;
}
The sign of the imaginary part is wrong. It should be +.
Likewise, in ccosh and ccoshl.
--
Steve