Jump to content

Comment on r7339


Recommended Posts

I noticed r7339 removed ia32_memcpy, so now it's calling the standard memcpy via cpu_memcpy. Since compilers do various optimisations and specialisations of memcpy given the context where it's used, it'd probably be better for performance to avoid the indirection, and just do a "#define cpu_memcpy memcpy" instead. (Should do the same for the amd64 version too). Any objections to doing so? :)

Link to comment
Share on other sites

how about a global search+destroy of cpu_memcpy, replacing it with memcpy?
Is there any chance an optimised memcpy will ever be necessary on any platform? Sounds like that's probably unlikely, in which case we'll never need to revert the change, so it seems like a simplification and therefore a good idea.
I've not noticed any performance problems or lack of inlining in that case
I suppose WPO might inline it, but otherwise simple cases like
int main() {
int a = 1, b;
cpu_memcpy(&b, &a, sizeof(a));
return a+b;
}

are a function call with cpu_memcpy but get optimised into "return 2" with memcpy (in g++ -O1), which probably isn't going to make a huge difference overall but seems handy nonetheless.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...