Hi,

is the toolchain somehow excessively naive only on arm, or is the output like
this to be expected, and what other archs are also running with?
I'm pointing at the bhi looping back to "mov r3, #0" instead of straight to
"str r3, [r1]" as ridiculous by the compiler even if no additional flags given,
any chance to improve here?

example:

/*
 * Called from armv7_boot.S during boot,
 * this was the first C code that's run,
 * now we have _bootstrap_early() before us,
 * and this is where we jump to main() from.
 */
__dead void
armv7_bootstrap(struct armv7_bootinfo *bi)
{
        /* zero .bss */
        while (bi->_bss < bi->__ebss)
                *bi->_bss++ = 0;
        cpu_drain_writebuf();


c023c8c0 <armv7_bootstrap>:
c023c8c0:       e1a0c00d        mov     ip, sp
c023c8c4:       e1a09000        mov     r9, r0
c023c8c8:       e92dd800        stmdb   sp!, {fp, ip, lr, pc}
c023c8cc:       e24cb004        sub     fp, ip, #4      ; 0x4
c023c8d0:       e24dd030        sub     sp, sp, #48     ; 0x30
c023c8d4:       e590104c        ldr     r1, [r0, #76]
c023c8d8:       e5903050        ldr     r3, [r0, #80]
c023c8dc:       e1530001        cmp     r3, r1
c023c8e0:       9a000005        bls     c023c8fc <armv7_bootstrap+0x3c>
c023c8e4:       e3a03000        mov     r3, #0  ; 0x0
c023c8e8:       e4813004        str     r3, [r1], #4
c023c8ec:       e5992050        ldr     r2, [r9, #80]
c023c8f0:       e589104c        str     r1, [r9, #76]
c023c8f4:       e1520001        cmp     r2, r1
c023c8f8:       8afffff9        bhi     c023c8e4 <armv7_bootstrap+0x24>
c023c8fc:       f57ff04f        dsb     sy
c023c900:       f57ff06f        isb     sy


-Artturi

Reply via email to