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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...