This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to optimize this assembly code segment..

Hi, I am trying to rewrite the arm assembly code generated by gcc in release mode (for optimization purpose). The below code is in a loop and so it will get executed many times. Can some one please let me know how can I optimize it for cycles. Are there any bottle necks in this code? Thanks in advance..

Assembly code:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
ldr r4, [r1, #8]
ldr r6, [r1]
ldr r7, [r7, #-12]
and r11, r4, #7
ldr r6, [r6, r4, lsr #3]
rev r6, r6
lsl r6, r6, r11
lsr r6, r6, #23
lsl r6, r6, #2
add r11, r7, r6
ldrsh r6, [r7, r6]
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

0