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

Re: arm64, valgrind floating point instruction produces different result



On Wed, Jun 26, 2024 at 3:09 PM Bernhard Übelacker
<bernhardu@mailbox.org> wrote:
>
> Hello list,
> I was trying to do some debugging in bug [1071656].
>
> But for some reason I receive with arm64
> in a process running with valgrind
> and one without valgrind different results
> from the following floating point instruction:
>
>    => 0xaaaaaaaa4948 <ConvertToRational+104>:     fcvtas  w5, d8
>
> With plain GDB:
>    (gdb) print $w5
>    $2 = 323
>
>
> With valgrind+GDB:
>    (gdb) print $w5
>    $2 = 322
>
> And therefore the CI run fails and led to this bug [1071656] (at least with arm64).
> I was trying this first in a qemu arm64 VM on amd64,
> but could observe this on real arm64 hardware too.
>
> Is there some knowledge about such an issue, or how to avoid this?
>
> [1071656] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1071656

I'm not sure if it matters, but Valgrind added support for the fcvtas
using the following register types. See
<https://valgrind.org/docs/manual/dist.news.old.html> and
<https://bugs.kde.org/show_bug.cgi?id=340509>.

    fcvtas  w12, s1

I think the difference between dN (your example) and sN (valgrind)
register are bit widths. dN is 32-bit, and sN is 16-bit.

(This may be a rabbit hole).

Jeff


Reply to: