(original) (raw)



On Sun, Oct 19, 2014 at 6:11 AM, Joerg Sonnenberger <joerg@britannica.bec.de> wrote:
On Fri, Oct 17, 2014 at 06:51:38PM +0400, Anton Korobeynikov wrote:
\> > Chandler’s complex arithmetic changes are also in the range: r219557 in clang. We saw it change the code in mandel-2 significantly.
\> mandel-2 is broken on hard FP ABI systems, btw. The reason is simply:
\> we're emitting a call to \_\_muldc3 with AAPCS VFP calling convention,
\> however, the function expects softfp (AAPCS) calling conv and reads
\> garbage from GP registers.

One possible approach is the attached patch. It is not completely
correct as it doesn't handle the possible exceptions for WoA and iOS,
but it might be a starting point. The real question for me is whether
this logic belongs into clang at all. Who can speak up for the Fortran
related behavior of complex arithmetic? If it matters the desired C
rules, especially with regard to real and imaginary numbers, it would
strongly support putting it into IR properly.

I apologize that I haven't been able to follow this thread entirely, but if someone gives me a Fortran testcase I can check what Fortran+llvm would do currently and maybe give more feedback.