This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [arm] Use load/store double instructions
- From: Richard Earnshaw <Richard dot Earnshaw at arm dot com>
- To: Paul Brook <paul at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 05 May 2004 15:15:58 +0100
- Subject: Re: [arm] Use load/store double instructions
- References: <200405041745.41249.paul@codesourcery.com>
On Tue, 2004-05-04 at 17:45, Paul Brook wrote:
> The attached patch lets gcc generate arm doubleword load/store instructions.
> These allow a wider variety of addressing modes, but have a few restrictions:
>
> - Only even register pairs are allowed. It turns out that forcing this in all
> cases is actually a win overall. I guess this is because it matches the ABI
> requirements, so function arguments are more likely to already be in the
> correct registers.
>
> - Memory addresses must be doubleword aligned. This is already guaranteed by
> the aapcs ABI.
>
> - The address index register cannot overlap the destination registers of a
> load. Allowing this and then fixing up the invalid cases during assembly
> output seems to give better code than disallowing [reg+reg] addressing.
>
> I used code size as an indication of code quality. Measuring gcc, the csibe
> benchmark, and a "longlong" targeted gmp. Improvements ranged from almost
> nothing to ~4%.
>
> Tested with cross to arm-none-elf.
> Ok?
>
> Paul
>
> 2004-05-04 Paul Brook <paul@codesourcery.com>
>
> * config/arm/arm-protots.h (vfp_mem_operand): Rename ...
> (arm_coproc_mem_operand): ... To this.
> * config/arm/arm.c (arm_legitimate_address_p): Allow ldrd modes.
> (arm_legitimate_index_p): Ditto.
> (vfp_mem_operand): Rename ...
> (arm_coproc_mem_operand): ... To this. Handle writeback modes.
> (vfp_secondary_reload_class): Use it.
> (output_move_double): Use doubleword load/store instructions.
> (arm_hard_regno_mode_ok): Only allow even reg pairs for ldrd.
> * config/arm/arm.h (TARGET_LDRD): Define.
> (EXTRA_CONSTRAINT_STR_ARM): Add 'Uy'.
> * config/gcc/arm/arm.md (arm_movdi): Allow all valid memory operands.
> New splitter for invalid doubleword loads.
> * config/arm/iwmmxt.md (iwmmxt_arm_movdi): Use Uy constraint.
> * config/arm/vfp.md (arm_movdi_vfp): Allow all valid memory operands.
> * doc/md.texi: Document Uy constraint.
OK.
You might want to take a look at arm_legitimize_address and tweak the
code there for DImode.
R.