Messages in this thread | | | Date | Thu, 12 Nov 2009 23:30:04 -0800 | From | "H. Peter Anvin" <> | Subject | Re: [PATCH RFC] [X86] performance improvement for memcpy_64.S by fast string. |
| |
On 11/12/2009 11:23 PM, Ma, Ling wrote: > Hi H. Peter Anvin >> What it sounds to me is that for Nehalem, we want to use memcpy_c for >= >> 1024 bytes and the old code for < 1024 bytes; > > Yes, so we modify memcpy_c as memcpy_new for Nehalem, and keep old > code for Core2 is acceptable?
No, what I think we should do is to rename the old memcpy to something like memcpy_o, and then have the actual memcpy routine look like:
cmpq $1024, %rcx ja memcpy_c jmp memcpy_o
... where the constant as well as the ja opcode can be patched by the alternatives mechanism (to a jb if needed).
memcpy is *definitely* frequent enough that static patching is justified.
-hpa
-- H. Peter Anvin, Intel Open Source Technology Center I work for Intel. I don't speak on their behalf.
| |