Ykkrosh Posted March 1, 2010 Report Share Posted March 1, 2010 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? Quote Link to comment Share on other sites More sharing options...
janwas Posted March 5, 2010 Report Share Posted March 5, 2010 I've not noticed any performance problems or lack of inlining in that case, but have no objection. Even better, how about a global search+destroy of cpu_memcpy, replacing it with memcpy?(the optimized memcpy is no longer necessary, see http://www.gamedev.net/community/forums/to...opic_id=560308) Quote Link to comment Share on other sites More sharing options...
Ykkrosh Posted March 5, 2010 Author Report Share Posted March 5, 2010 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 caseI 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.