ARM Overview: Difference between revisions
[unchecked revision] | [unchecked revision] |
Content deleted Content added
m finally got it right |
m changed statement meaning from "should" to "need" for usage of LIBGCC and make it more attraction for people to check out links about cross-compiling and libgcc than forum links (which might cause them to try to go around using libgcc) |
||
Line 249:
==Coding Gotchas==
===== Missing Division Functions (__aeabi_uidivmod, __aeabi_idiv) / No Division Support =====
This is caused by using GCC and not linking with ''libgcc''.
You must also make sure you use the ''libgcc'' that has been compiled for your target machine/architecture/platform. See [[Libgcc]] for more information. You can produce the correct library for GCC by reading [[GCC_Cross-Compiler]].
====== This section is just if you want a more in depth explanation and discussion. ======
This issue is actually complicated because different CPUs may not support hardware division, support it only through the floating point operations, in thumb mode, in native mode, or a combination. Also, in certain situations you may find it faster or more compact to use different methods because you may be interested in code size or performance.
<pre>
The following links talk about different methods in handling this problem:
http://forum.osdev.org/viewtopic.php?f=1&t=23857&p=212244▼
http://stackoverflow.com/questions/8348030/how-does-one-do-integer-signed-or-unsigned-division-on-arm▼
▲http://forum.osdev.org/viewtopic.php?f=1&t=23857&p=212244
▲http://stackoverflow.com/questions/8348030/how-does-one-do-integer-signed-or-unsigned-division-on-arm
Also, some extra information that maybe useful:
http://www.linkedin.com/groups/ARM-cores-hardware-division-85447.S.242517259▼
A discussion about this section, and also at the end an example of LIBGCC's version of the
▲http://www.linkedin.com/groups/ARM-cores-hardware-division-85447.S.242517259
http://forum.osdev.org/viewtopic.php?f=8&t=27767▼
▲A discussion about this section, and also at the end an example of LIBGCC's version of the functions:
▲http://forum.osdev.org/viewtopic.php?f=8&t=27767
The source for LIBGCC and source of the division emulation function:
https://github.com/mirrors/gcc/blob/master/libgcc/udivmodsi4.c▼
https://github.com/mirrors/gcc/blob/master/libgcc/
</pre>
▲https://github.com/mirrors/gcc/blob/master/libgcc/
===== Unaligned Memory Access And Byte Order =====
{| border="1px"
|