4 ms·
> libpng, for example, doesn't use it on x86… Do you mean doesn't use it explicitly? If so, GCC is still happy to find quite a few spots to automatically injec
by viraptor 10y ago
> libpng, for example, doesn't use it on x86…
Do you mean doesn't use it explicitly? If so, GCC is still happy to find quite a few spots to automatically inject it. On my arch system:
$ objdump -d /usr/lib/libpng.so | grep -c xmm
316
Then again, gif doesn't seem to get even that, so maybe there is something in libpng?
$ objdump -d /usr/lib/libgif.so | grep -c xmm
0
- pcwalton 10y agoExplicitly, for filtering.
- mayoff 10y agogcc and clang generate SSE2 instructions for scalar (non-SIMD) arithmetic, depending on the target architecture and compiler flags. For x86_64 targets, the calling convention puts floating point arguments in xmm registers, so the compilers must use SSE2 (and it's faster than x87 anyway). That's what you're seeing. If you look at the instructions in libpng.so that mention xmm registers, you'll see that they aren't SIMD instructions.