[PATCH] [complex] Teach Clang to preserve different-type operands to arithmeticoperators where one type is a C complex type, and to emit both the efficientand correct implementation for complex arithmetic according to C11 AnnexG using this extra...

Chandler Carruth chandlerc at gmail.com
Fri Oct 10 17:27:33 PDT 2014


On Fri, Oct 10, 2014 at 4:39 PM, Richard Smith <richard at metafoo.co.uk>
wrote:

> ================
> Comment at: lib/AST/ExprConstant.cpp:8047-8048
> @@ +8046,4 @@
> +        APFloat Denom = C * C + D * D;
> +        ResR = scalbn((A * C + B * D) / Denom, -DenomLogB);
> +        ResI = scalbn((B * C - A * D) / Denom, -DenomLogB);
> +        if (ResR.isNaN() && ResI.isNaN()) {
> ----------------
> It looks like `B` is not initialized if `LHSReal` is `true` here.
>

Right you are. I just need to conjure a proper zero here.

Anything else you see that needs fixing?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141010/b5ddc20e/attachment.html>


More information about the cfe-commits mailing list