This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [arm] Use load/store double instructions

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  <>
> 	* 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.
> 	* config/gcc/arm/ (arm_movdi): Allow all valid memory operands.
> 	New splitter for invalid doubleword loads.
> 	* config/arm/ (iwmmxt_arm_movdi): Use Uy constraint.
> 	* config/arm/ (arm_movdi_vfp): Allow all valid memory operands.
> 	* doc/md.texi: Document Uy constraint.


You might want to take a look at arm_legitimize_address and tweak the
code there for DImode.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]