http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56315
Bug #: 56315 Summary: ARM: Improve use of 64-bit constants in logical operations Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: target AssignedTo: unassig...@gcc.gnu.org ReportedBy: josh.m.con...@gmail.com In the ARM backend, support was added for recognizing addition with 64-bit constants that could be split up into two 32-bit literals that could be handled with immediates in the adds/adc operations. However, this support is still not present for the logical operations. For example, compiling this code with -O2: unsigned long long or64 (unsigned long long input) { return input | 0x200000004ULL; } Gives us: mov r2, #4 mov r3, #2 orr r0, r0, r2 orr r1, r1, r3 When it could produce: orr r0, r0, #4 orr r1, r1, #2 The same improvement could be applied to & and ^ operations as well.