[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...

Richard Smith richard at metafoo.co.uk
Fri Oct 10 17:45:45 PDT 2014


On Fri, Oct 10, 2014 at 5:27 PM, Chandler Carruth <chandlerc at gmail.com>
wrote:

>
> 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?
>

No, the rest LGTM.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141010/acf26e97/attachment.html>


More information about the cfe-commits mailing list