Beruflich Dokumente
Kultur Dokumente
Instruction Sets
32-bit ARM instruction set : 16-bit Thumb instruction set : 32-bit Thumb-2 instruction set :
(Trade off between two above), Most 32 bit instructions are unconditional when compared to ARM
e.g.
B label1 BL label1(Branch with link) BEQ {pc}+4
e.g.
ADD r2, r1, r3 SUBS r8, r6, #240 ; sets the flags on the result RSB r4, r4, #1280 ; subtracts contents of r4 from 1280 AND r9,r2,#0xFF00 ORREQ r2,r0,r5 MOVS r3, r2, LSR #3 ;
e.g.
STMFD r13!, {r0-r5} LDMFD r13!, {r0-r5} PUSH {r5-r7,lr} POP {r5-r7,pc} LDR r3, [r0], #4 ;r0 is incremented by 4 LDR r3, [r0],r4 ;r0 is incremented by r4 LDR r3,[r0,#0x2C] ;load with offset LDR r3,[r0,r4,lsl #2] ;
Alternate approach
SMLAL R0, R1, R2, R3
MOV r4,#0x6 ADD r5,r4,r5 MOV r6,#0x6 LDR r5,[r6,#0x2C]
ADD R7,R8,R0
Use fixed point arithmetic Use shifts instead of multiply and divisions See if complex calculations can be avoided using table lookup Minimize the number of arguments of a function Avoid branches in low level functions
Code Vectorization
Code Vectorization
Code Vectorization