Open Quuxplusone opened 14 years ago
Attached const-addr.ll
(522 bytes, application/octet-stream): test case
This still reproduces just fine with ToT (r212922):
movw r0, #49160
movw r1, #49156
movt r0, #1039
movt r1, #1039
ldr r0, [r0]
ldr r1, [r1]
add r0, r1
movw r1, #49164
movt r1, #1039
ldr r1, [r1]
add r0, r1
bx lr
I noticed this a long time ago. When Thumb2 is active (at least) the movw/movt appears to take precedence over the displacement. That is probably fine for O2 and such since I think the pair is pipelined into a single load on proc, but the extra code caused would hurt other cases.
Assuming a constant needs the pair, the ARM assembly spec defines the MOV32 pseudo to allow nice display of the operand, and I've always wondered why we didn't use it.
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0489f/Cjagdjbf.html
const-addr.ll
(522 bytes, application/octet-stream)