tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Request for "fix float to u64 intrinsics"


From: Kyryl Melekhin
Subject: Re: [Tinycc-devel] Request for "fix float to u64 intrinsics"
Date: Fri, 11 Sep 2020 10:32:06 +0000

Hi Christian,

I completely understand what you mean about potential regressions. If
that is the case
it would be trivial to wrap the code into #ifdef. By the way you
mentioned Aarch64
long double precision, well that will not be a problem because if you
look at existing
source code, function __fixunsxfdi is already wrapped in #ifndef __arm__ so
it's not even used on arm I suppose.

I guess I'll explain the bug here as well.
consider this code:

float a = -123.987;
printf("%lu", (unsigned long int)a);

Before the patch output would be 123.
After the patch output would be 18446744073709551493.

Compare that to what gcc will output for example,
and the correct answer is 18446744073709551493.

Which is exactly what I've fixed here.
I hope that explains.

Kind regards,
Kyryl.

пт, 11 сент. 2020 г. в 03:50, Christian Jullien <eligis@orange.fr>:
>
> Hi Kyryl,
>
>
>
> First I personally appreciate you want to make tcc even better.
>
> Unfortunately your fixes are unclear about what they fix.
>
> It’s hard to see if they don’t introduce a regression on another platform. 
> For example, long double has not the same precision on x64 or on Aarch64. It 
> easy to make a fix on a plateform that introduces a regression on another.
>
> I understand that you can’t test on all supported platforms but a new test in 
> test suite can help us to understand what was the bug and if your patches fix 
> it on all supported plateforms.
>
> Can you please add an almost complete set of tests that prove that tcc was 
> previously wrong and that now, it fixes them all.
>
> For example, I suggest you add those tests (with a little comment) on 
> 22_floating_point.c
>
>
>
> $ make && make test
>
>
>
> Then I’ll be glad to test it works on all supported platforms.
>
>
>
> Also, as a matter of style, we prefer a space between if and ( in expression 
> like if(SIGN(fl1.l)).
>
> Style with space occurs 4015 times while style w.o. space occurs only 154 
> times.
>
>
>
> Tia
>
>
>
> Christian
>
> _______________________________________________
> Tinycc-devel mailing list
> Tinycc-devel@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]