complex division alogrithm?

Steve Kargl sgk@troutmask.apl.washington.edu
Fri May 7 19:38:00 GMT 2004


On Fri, May 07, 2004 at 09:15:24PM +0200, Toon Moene wrote:
> Steve Kargl wrote:
> 
> [ Implement complex division like it is currently implemented in the
>   RTL expanders ]
> 
> >I haven't had time to implement a f2c-like algorithm, but I
> >should be able to get it this weekend.
> 
> Are you sure we have to do this in the Fortran frontend ?  Can't we just 
> hand complex division as a GENERIC expression to be expanded by GIMPLE ?
> 

program a
  complex z
  z = (1,9)/(7,6)
end program

The frontend will reduce the above division.  Tobi finally answered my
question.  GMP is initialized to use 130 bits during compilition.  If
I understand David Goldberg's paper correctly, then this is sufficient
for the naive complex division algorithm in gfc_arith_divide() to yield
the correct result.

I started to look at how we are handling complex types because LAPACK
test programs are failing for these types.

-- 
Steve



More information about the Fortran mailing list