• Philippe Bergheaud's avatar
    powerpc: memcpy optimization for 64bit LE · 00f554fa
    Philippe Bergheaud authored
    Unaligned stores take alignment exceptions on POWER7 running in little-endian.
    This is a dumb little-endian base memcpy that prevents unaligned stores.
    Once booted the feature fixup code switches over to the VMX copy loops
    (which are already endian safe).
    
    The question is what we do before that switch over. The base 64bit
    memcpy takes alignment exceptions on POWER7 so we can't use it as is.
    Fixing the causes of alignment exception would slow it down, because
    we'd need to ensure all loads and stores are aligned either through
    rotate tricks or bytewise loads and stores. Either would be bad for
    all other 64bit platforms.
    
    [ I simplified the loop a bit - Anton ]
    Signed-off-by: default avatarPhilippe Bergheaud <felix@linux.vnet.ibm.com>
    Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
    Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
    00f554fa
string.h 1.01 KB