George Koehler <kern...@gmail.com> wrote: > On Sat, 27 Jun 2020 01:27:14 +0200 > Christian Weisgerber <na...@mips.inka.de> wrote: > > > I'm also intrigued by this aside in the PowerPC ISA documentation: > > | Moreover, Load with Update instructions may take longer to execute > > | in some implementations than the corresponding pair of a non-update > > | Load instruction and an Add instruction. > > What does clang generate? > > clang likes load/store with update instructions. For example, the > powerpc64 kernel has /sys/lib/libkern/memcpy.c, which copies bytes: > > while (n-- > 0) > *t++ = *f++;
Keep in mind in userland we use memcpy.c, which does backwards detection. It's probably slower. The original idea was to use the C version with backwards detection until it stopped finding bugs, but... it keeps finding bugs........