[llvm-dev] Help to understand a store instruction

Alberto Barbaro via llvm-dev
2019-11-15T13:07:21Z

Hi all,
Yesterday I managed to obtain the IR of libpng and while I was going
through the code I found out that within the function png_write_sig[1] the
signature is created using a store instruction like the following: store
i64 727905341920923785, i64 %2, align 8, !dbg, !40041. %2 is the array...

That massive number is the hexadecimal representation of the png signature
but with the bytes in reverse order.

Can someone explain me why? If seen other similar instructions and the
integer value on the left was not reversed...

I can only think about little and big endian...

Thanks in advance
Alberto

[1]
https://code.woboq.org/qt5/qtbase/src/3rdparty/libpng/pngwutil.c.html#png_write_sig
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20191115/0438344a/attachment.html>