MOVW/MOVT versus LDRs from a literal pool
Hi,
I am porting my project from Sourcery CodeBench 2012-09-63 (GCC 4.7.2) to GNU Tools for ARM Embedded Processors 4.7-2013-q3-update 2013-09-26 (GCC 4.7.4).
My project runs on a Cortex-M3 r2p1 CPU core based MCU. I found that in the GCC ARM Embedded compiler base_address-
Example assembler listing (MOVW/MOVT):
4FF6D073 movw r3, #65488
CEF20F03 movt r3, 57359
1B69 ldr r3, [r3, #16]
Example assmebler listing (LDR with literal pool):
104B ldr r3, .L23
1B69 ldr r3, [r3, #16]
.L23:
D0FF0FE0 .word -535822384
The resulting executable / binary size difference from this is considerable. I know that LDR is slow compared to MOVW/MOVT but my project has sever ROM size constraints and I cannot allow my self to loose any more ROM space.
I have seen a bug report at the Linaro GCC project: https:/
Is there a way to tell the compiler to favor LDRs from liter pools instead of MOVW/MOVT pairs? Is there a configuration setting or something to control this behavior?
Thank you in advance for your kind response.
Best regards,
Tamas
_
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Terry Guo
- Solved:
- Last query:
- Last reply: