~pali/llvm/compiler-rt-3.5

Viewing all changes in revision 4405.

  • Committer: compnerd
  • Date: 2014-07-20 04:44:21 UTC
  • Revision ID: svn-v4:91177308-0d34-0410-b5e6-96231b3b80d8:compiler-rt/trunk:213467
ARM: fix division in some cases

For ARM cores that are ARMv6T2+ but not ARMv7ve or ARMv7-r and not an updated
ARMv7-a that has the idiv extension (chips with clz but not idiv), an incorrect
jump would be calculated due to the preference to thumb instructions over ARM.

Rather than computing the target at runtime, use a jumptable instead.  This
trades a bit of storage for performance.  The overhead is 32-bytes for each of
the three routines, but avoid the calculation of the offset.

Because clz was introduced in ARMv6T2 and idiv in certain versions of ARMv7,
the non-clz, non-idiv case implies a target which does not support Thumb-2, and
thus we cannot use Thumb on those targets (as it is unlikely that the assembly
will assemble).

Take the opportunity to refactor the IT block macros into assembly.h rather than
redefining them in the TUs where they are used.

Existing tests cover the full change already, so no new tests are added.

This effectively reverts SVN r213309.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: