arm: big-endian issue in gen_cpymem_ldrd_strd [PR105981]
authorRichard Earnshaw <rearnsha@arm.com>
Wed, 15 Jun 2022 15:07:20 +0000 (16:07 +0100)
committerRichard Earnshaw <rearnsha@arm.com>
Wed, 15 Jun 2022 15:09:01 +0000 (16:09 +0100)
commit8aaa948059a8b5f0a62ad010d0aa6346b7ac9cd3
treeef1385bb8f226204f411e4f2c159e53171a41764
parent052d89537a4c09e1e1437042e2d1ea215656325f
arm: big-endian issue in gen_cpymem_ldrd_strd [PR105981]

The code in gen_cpymem_ldrd_strd has been incorrect for big-endian
since r230663.  The problem is that we use gen_lowpart, etc. to split
the 64-bit quantity, but fail to account for the fact that these
routines are really dealing with 64-bit /values/ and in big-endian the
ordering of the sub-registers changes.

To fix this, I've renamed the conceptually misnamed low_reg and hi_reg
as first_reg and second_reg, and then used different logic for
big-endian targets to initialize these values.  This makes the logic
clearer than trying to think about high bits and low bits.

gcc/ChangeLog:

PR target/105981
* config/arm/arm.cc (gen_cpymem_ldrd_strd): Rename low_reg and hi_reg
to first_reg and second_reg respectively.  Initialize them correctly
when generating big-endian code.
gcc/config/arm/arm.cc