Subject: Re: [PATCH] powerpc: memcpy optimization for 64bit LE

From: Anton Blanchard <[email-masked]>
Date: Thu, 7 Nov 2013 13:07:03 +1100

Hi,

> > Unaligned stores take alignment exceptions on POWER7 running in
> > little-endian. This is a dumb little-endian base memcpy that
> > prevents unaligned stores. It is replaced by the VMX memcpy at boot.
> 
> Is this any faster than the generic version?

Once booted the feature fixup code switches us 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.

Anton