Question
What is exact conditional assembly branch instruction duration for ARM Cortex-M4?
I'm trying to determine exact duration in clock cycles for simple delay loop below :
loop: subs r2, r2, 1
bne loop I'm using directives :
.thumb
.syntax unified
RefManual says : 1 + P
P The number of cycles required for a pipeline refill. This ranges from 1 to 3 depending on the alignment and width of the target instruction, and whether the processor manages to speculate the address early.
ARM9 (5stage pipeline) has 3 cycles in this case for bne and 1 cycle for subs, Cortex M4 has 3 stage pipeline, but it seems quite similar, since first two stages look similar...
Thanks.
