Arm Unit 3
Arm Unit 3
I is declare as integer
•In this example the input and output values are both short.
•Yet the values will be passed in (and out) in 32-bit-wide registers.
•Should the compiler assume values are already in the range of
a short?
•Or should the compiler force the values to this range by sign-
extending the low 16 bits to fill the 32-bit register?
•The compiler must make a compatible decision for both the caller
and the callee.
The SUBS and BNE instructions implement the loop and it takes four instructions per loop. But
using increment operation it takes 5 instructions per iteration.
Compare this with the output for checksum_v7 using for loop, while loop save
two-cycles in comparing with for loop.
The three executed instructions take a total of five cycles. The MOV instruction executes on
the first cycle. On the second cycle, the branch instruction calculates the destination address.
This causes the core to flush the pipeline and refill it using this new pc value. The refill takes
two cycles.
ARM UNIT-3 Radha R C