Am 19.09.22 um 09:51 schrieb Richard Biener:
On Sun, Sep 18, 2022 at 7:40 PM Georg Johann Lay <a...@gjlay.de> wrote:

Hello,

this patch fixed PR target/99184 which incorrectly rounded during 64-bit
(long) double to 16-bit and 32-bit integers.

The patch just removes the respective roundings from
libf7-asm.sx::to_integer and ::to_unsigned.  Luckily, LibF7 does nowhere
use respective functions internally, the only user is in libf7.c::f7_exp

which reads

    f7_round (qq, qq);
    int16_t q = f7_get_s16 (qq);

so that f7_get_s16() operates on an already rounded value, and therefore
this code works unaltered with or without rounding in to_integer.

The patch applies to directory

./libgcc/config/avr/libf7/

and is the same for all GCC versions v10+.

Please someone with write permissions commit it to trunk and backport to
v12, v11, and v10 as it is a wrong-code issue.

The patch will fit without problems (except for ChangeLog) because there
is no traffic on that folder.

Thanks, I've pushed the change.  Please in future try to send patches
that can be applied with git am, thus use git format-patch

Richard.

Thanks you so much. The patch I generated with "git diff > file.diff", so that is not correct? The only change is that I defined extra hunks for asm so that one can see the function like in

 @@ -601,9 +601,6 @@ DEFUN to_integer

So git is not prepared to such hunks? Would you point me to some documentation on how to do it properly?

Thanks,

Johann

Reply via email to