- Which architecture?
Nintendo Wii (Broadway CPU)
- Which compiler, which version?
Freescale C/C++ Compiler for Embedded PowerPC
Version 4.2 build 142
Runtime Built: Aug 26 2008 02:32:39
- Which calling convention(if there are multiple)?The default I think.
- Why do you think it matters?
Just the obvious performance boost by eliminating the reference load.
They are register sized or less, so it would be nice to at least have the option.
We checked the assembly and as expected pass-by-value currently causes a copy to be made on the stack, and a behind the scenes a pointer is passed.
In practice will probably turn out not to be too much of an issue, especially on Wii which has a higher cache : cpu speed ratio, so L1 vs. register isn't as bad as on PS3 etc., but we would at least like to be able to do some profiling and find out.
- Is inlining an option (no arguments at all)?
This would help in some cases. The struct would almost always be in L1 but it would be better to chuck it in a register if possible and leave L1 alone for other stuff. Plus even L1 is slow compared to a register
and we know it is going to be a guaranteed lookup.
I suppose we could just cast to unsigned int, pass that, and then cast back, but this is pretty nasty from a readability perspective obviously, and I'm not sure if it would result in an extra local on the stack - hopefully that would get optimised away.