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

Code for integer division on Cortex-A8?

Hi all,

when I wrote a C code with division operation the compiler is generating some library calls.....when I tried to see the equivalent code for those function calls...I'm unable to reach there (may be because they arm library SW routines)...I cant use those SW routine calls...I can embed the equivalent code in my program( in assembly code). Form where I can get the Equivalent codes for division SW routines....I need codes for 32-bit/32-bit ,32-bit/16-bit & 16-bit/16-bit divisions....

Thanks in advance....

Parents
  • Hi Joseph,

    Yes, you're right that on most ARM cores, division will be carried out using library calls. If you're unable to link to the libraries for some reason, then there are several ways to get around that. You could disassemble the libraries and extract the assembly code for the division routines but this would be very hard work!

    Alternatively, you can write your own. There are quite a few examples available in the web if you care to look. Here are a couple which I have found.

    This one is from the Keil documentation and is provided by way of an example of how to write a macro function in the assembler:

    http://www.keil.com/support/man/docs/armasm/armasm_cegecdgd.htm

    This one is a much more complex full-freatures fixed-point division function:

    A Fast Hi Precision Fixed Point Divide

    Beware that implementing correct high-speed division functions is not an easy task so take care!

    Hope this helps

    Chris

Reply
  • Hi Joseph,

    Yes, you're right that on most ARM cores, division will be carried out using library calls. If you're unable to link to the libraries for some reason, then there are several ways to get around that. You could disassemble the libraries and extract the assembly code for the division routines but this would be very hard work!

    Alternatively, you can write your own. There are quite a few examples available in the web if you care to look. Here are a couple which I have found.

    This one is from the Keil documentation and is provided by way of an example of how to write a macro function in the assembler:

    http://www.keil.com/support/man/docs/armasm/armasm_cegecdgd.htm

    This one is a much more complex full-freatures fixed-point division function:

    A Fast Hi Precision Fixed Point Divide

    Beware that implementing correct high-speed division functions is not an easy task so take care!

    Hope this helps

    Chris

Children
No data