Andrew Stubbs wrote:
On 06/09/10 07:16, Yao Qi wrote:
I've put some ideas in this wiki page, https://wiki.linaro.org/Internal/People/YaoQi/Thumb2Optimize
We probably shouldn't post Internal links to this public list. Is there any reason this can't be done in the open?
I've moved this page to a public place https://wiki.linaro.org/YaoQi/Sandbox/Thumb2SizeOptimize
Now for the page content ....
I think you should make clear that we're after _size_ optimizations in this case, if just for readability's sake.
- This example (regardless of correctness) gains no size improvement.
OK, I should remove this one.
- This code is clearly an inlined memset. It might be that a branch
instruction with constants and such is not (much) smaller. We should investigate what GCC does for different size writes.
Yeah, I agree that we should investigate how gcc does for different size.
- This sounds like a nightmare for register allocation, but if you
could make it happen then great :)
....
- Is that an EEMBC function? We can't change those in the source. Are
you proposing a -fwhole-program optimization? (Of course, enabling inlining at -Os for trivial functions like this might work without -fwhole-program or LTO, if it's in the same TU.)
Yes, that is an EEMBC function. Of course, we can't change source code. It is not related to thumb2 code size optimization. I've moved it to another section.
Other ideas:
Add it in this wiki page.
- Investigate reduced alignment constraints?
Any details on this?