#18669 - johsta - Wed Mar 31, 2004 12:54 pm
hi
This is two ways of doing the exact same thing...
the thing is that the asm code with 7 instructions i much slower then the one with 13 instructions... why??? something to do with the pipeline? I don't got a clue.. btw this is done in a tight loop...
the C/C++ expression is: relX=(tileX<<3)+x-objHalfWidth;
ASM - Fast:
ldr r3, [r11, -#128]
str r3, [r11, -#112]
ldr r3, [r11, -#112]
mov r3, r3, lsl #3
str r3, [r11, -#112]
ldr r2, [r11, -#112]
ldr r3, [r11, -#68]
add r3, r2, r3
str r3, [r11, -#112]
ldr r2, [r11, -#112]
ldr r3, [r11, -#88]
rsb r3, r3, r2
str r3, [r11, -#112]
ASM - slow
ldr r3, [r11, -#128]
mov r2, r3, lsl #3
ldr r3, [r11, -#68]
add r2, r2, r3
ldr r3, [r11, -#88]
rsb r3, r3, r2
str r3, [r11, -#112]
thanks,
This is two ways of doing the exact same thing...
the thing is that the asm code with 7 instructions i much slower then the one with 13 instructions... why??? something to do with the pipeline? I don't got a clue.. btw this is done in a tight loop...
the C/C++ expression is: relX=(tileX<<3)+x-objHalfWidth;
ASM - Fast:
ldr r3, [r11, -#128]
str r3, [r11, -#112]
ldr r3, [r11, -#112]
mov r3, r3, lsl #3
str r3, [r11, -#112]
ldr r2, [r11, -#112]
ldr r3, [r11, -#68]
add r3, r2, r3
str r3, [r11, -#112]
ldr r2, [r11, -#112]
ldr r3, [r11, -#88]
rsb r3, r3, r2
str r3, [r11, -#112]
ASM - slow
ldr r3, [r11, -#128]
mov r2, r3, lsl #3
ldr r3, [r11, -#68]
add r2, r2, r3
ldr r3, [r11, -#88]
rsb r3, r3, r2
str r3, [r11, -#112]
thanks,