> 在 2016年12月22日,13:11,Paul Hua <paul.hua...@gmail.com> 写道:
> 
> Hi,
> 
>> +On MIPS targets, set the @option{-mno-unfused-madd4} option by default.
>> +On some platform, like Loongson 3A/3B 1000/2000/3000, madd.fmt/msub.fmt is
>> +broken, which may which may generate wrong calculator result.
> 
> The Loongson 3A/3B 1000/2000/3000 madd.fmt/msub.fmt are fused madd 
> instructions.
> Can you try this patch:
> https://gcc.gnu.org/ml/gcc-patches/2016-11/msg00255.html .
> 
> Is this patch testing on trunk? I build the trunk failure for a long time.

I don’t think your patch is correct.
No matter Loongson’s madd.fmt are fused or unfused, they give wrong result.
So for Loongson, madd.fmt should be disabled at all.
you can test it with:

#include <stdio.h>

double a = 0.6;
double b = 0.4;
double c = 0.6;
double d = 0.4;

int main(void)
{
        double x = a * b - c * d;
        printf("%le\n", x);
        return 0;
}

Reply via email to