Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I can only make a guess here:</p> <p>It seems, the clang optimizer <em>prefers</em> to use "immediate offsets" for accessing the input and output arrays. e.g.</p> <pre><code>str.w r3, [r1, lr, lsl #3] </code></pre> <p>If the offset <em>exceeds</em> 1024, the clang optimizer chooses <em>double</em> register load and stores with a <em>register offset</em>: </p> <p>Here is a disassembly for when the range of accessed integers exceeds 1024 (1025 in this case):</p> <pre><code>0x79188: push {r4, r5, r7, lr} 0x7918a: add r7, sp, #8 0x7918c: str r8, [sp, #-4]! 0x79190: movw r3, #1025 0x79194: ldrd r8, r9, [r0] 0x79198: add.w r5, r9, r2 0x7919c: adds r0, #8 0x7919e: subs r3, #1 0x791a0: add.w r4, r8, r2 0x791a4: strd r4, r5, [r1] 0x791a8: add.w r1, r1, #8 0x791ac: bne 0x79194 ; Add_8K_3 + 12 at AppDelegate.m:24 0x791ae: movs r0, #0 0x791b0: ldr r8, [sp], #4 0x791b4: pop {r4, r5, r7, pc} </code></pre> <p>When the range of accessed integers exceeds 1800 (<code>for (int i = 0; i &lt; 1800; ++i)</code>) clang will again choose to use "immediate offsets" with single register load and stores:</p> <pre><code>0x94180: push {r7, lr} 0x94182: mov.w lr, #0 0x94186: mov r7, sp 0x94188: ldr.w r12, [r0, lr, lsl #3] 0x9418c: add.w r3, r0, lr, lsl #3 0x94190: ldr.w r9, [r3, #4] 0x94194: add.w r3, r12, r2 0x94198: str.w r3, [r1, lr, lsl #3] 0x9419c: add.w r12, r1, lr, lsl #3 0x941a0: add.w lr, lr, #1 0x941a4: add.w r3, r9, r2 0x941a8: str.w r3, [r12, #4] 0x941ac: cmp.w lr, #1800 0x941b0: bne 0x94188 ; Add_8K_3 + 8 at AppDelegate.m:24 0x941b2: movs r0, #0 0x941b4: pop {r7, pc} </code></pre> <p>Not sure, why - maybe heuristics which suggest the best performance.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload