Optimize the unaligned buffer copy logic
authorJunyan He <junyan.he@linux.intel.com>
Wed, 26 Mar 2014 10:27:56 +0000 (18:27 +0800)
committerZhigang Gong <zhigang.gong@intel.com>
Wed, 2 Apr 2014 05:07:11 +0000 (13:07 +0800)
commit2fe1e7ac9125d0d755dadce723bcaad68dba3c98
tree5c3026e2a6e3d17dfd0425c185e6e1745e3be5fd
parentda6fdcd1e21d710c5253417634a9b23543ea0271
Optimize the unaligned buffer copy logic

Because the byte aligned read and write send instruction is
very slow, we optimize to avoid the using of it.
We seperate the unaligned case into three cases,
   1. The src and dst has same %4 unaligned offset.
      Then we just need to handle first and last dword.
   2. The src has bigger %4 unaligned offset than the dst.
      We need to do some shift and montage between src[i]
      and src[i+1]
   3. The last case, src has smaller 4% unaligned.
      Then we need to do the same for src[i-1] and src[i].

Signed-off-by: Junyan He <junyan.he@linux.intel.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
src/cl_context.h
src/cl_mem.c