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

ARM mode Thumb mode switching

Note: This was originally posted on 13th January 2011 at http://forums.arm.com

Hi,

Let me explain my problem,
i come across one situation

cmp r1,#0
beq labels_of1

i would like to merge both the instructions in to one. for that i would like to use cbz (thumb instruction)

but my compiler shows an error message that this particular instruction not present in the Instruction.

Since the instruction is cbz the compilation should be in thum mode. how can i modify my make file and how can i switch the mode from ARM to thumb for execute the optimized instruction.

please let me know the mode change needs any extra cycle.


Rgds
Dave
Parents
  • Note: This was originally posted on 19th January 2011 at http://forums.arm.com

    Both should be quite fast, but personaly I prefer your solution.

    your code should be



    subs t0, a0, b0
    nop

    rsblt t0, t0, #0
    subs t1, b0, c0

    rsblt t1, t1, #0
    cmp t0, #25

    bge .exit
    cmp t1, #30

    bge .exit
    subs t2, c0, a0

    rsblt t2, t2, #0
    nop

    cmp    t2, # 45
    bge .bloc2


        // modify the values of a0,b0,c0
    b .exit


    .bloc2
    //modify the values of a0 and b0

    .exit


    I do not test this code, but it's seem's quite fast. no?
Reply
  • Note: This was originally posted on 19th January 2011 at http://forums.arm.com

    Both should be quite fast, but personaly I prefer your solution.

    your code should be



    subs t0, a0, b0
    nop

    rsblt t0, t0, #0
    subs t1, b0, c0

    rsblt t1, t1, #0
    cmp t0, #25

    bge .exit
    cmp t1, #30

    bge .exit
    subs t2, c0, a0

    rsblt t2, t2, #0
    nop

    cmp    t2, # 45
    bge .bloc2


        // modify the values of a0,b0,c0
    b .exit


    .bloc2
    //modify the values of a0 and b0

    .exit


    I do not test this code, but it's seem's quite fast. no?
Children
No data