libgcc: arm: convert thumb1 code to unified syntax
commit6b9ce2b4eb49e3c930730c3721323349e2136b1a
authorRichard Earnshaw <rearnsha@arm.com>
Tue, 3 Mar 2020 16:02:24 +0000 (3 16:02 +0000)
committerRichard Earnshaw <rearnsha@arm.com>
Tue, 3 Mar 2020 16:02:24 +0000 (3 16:02 +0000)
treeafa66b0142ad3c4d5fc63256eb466d5a0a51a58c
parent8e6d0dba166324f4b257329bd4b4ddc2b4522359
libgcc: arm: convert thumb1 code to unified syntax

Unified syntax has been the official syntax for thumb1 assembly for
over 10 years now.  It's time we made preparations for that becoming
the default in the assembler.  But before we can start doing that we
really need to clean up some laggards from the olden days.  Libgcc
support for thumb1 is one such example.

This patch converts all of the legacy (disjoint) syntax that I could
find over to unified code.  The identification was done by using a
trick version of gas that defaulted to unified mode which then faults
if legacy syntax is encountered.  The code produced was then compared
against the old code to check for differences.  One such difference
does exist, but that is because in unified syntax 'movs rd, rn' is
encoded as 'lsls rd, rn, #0', rather than 'adds rd, rn, #0'; but that
is a deliberate change that was introduced because the lsls encoding
more closely reflects the behaviour of 'movs' in arm state (where only
some of the condition flags are modified).

* config/arm/bpabi-v6m.S (aeabi_lcmp): Convert thumb1 code to unified
syntax.
(aeabi_ulcmp, aeabi_ldivmod, aeabi_uldivmod): Likewise.
(aeabi_frsub, aeabi_cfcmpeq, aeabi_fcmpeq): Likewise.
(aeabi_fcmp, aeabi_drsub, aeabi_cdrcmple): Likewise.
(aeabi_cdcmpeq, aeabi_dcmpeq, aeabi_dcmp): Likewise.
* config/arm/lib1funcs.S (Lend_fde): Convert thumb1 code to unified
syntax.
(divsi3, modsi3): Likewise.
(clzdi2, ctzsi2): Likewise.
* config/arm/libunwind.S (restore_core_regs): Convert thumb1 code to
unified syntax.
(UNWIND_WRAPPER): Likewise.
libgcc/ChangeLog
libgcc/config/arm/bpabi-v6m.S
libgcc/config/arm/lib1funcs.S
libgcc/config/arm/libunwind.S