[PATCH] Favour FLDMD over FLDMX where possible on ARM

Mark Shinwell shinwell@codesourcery.com
Thu Aug 24 16:09:00 GMT 2006


[I posted this a couple of months ago but had to withdraw it; here
  is the revised version.]

The FLDMX and FSTMX load/store-multiple insns are deprecated in favour of
FLDMD and FSTMD respectively on ARMv6 and above.  This patch causes
gcc to use the latter instructions instead of FLDMX and FSTMX when
emitting code for such architectures.

FLDMD and FSTMD correspond to a different set of unwind opcodes from
FLDMX and FSTMX.  I have already had approved and committed a binutils
patch [1] that provides a new ".vsave" directive instructing the
assembler to emit unwind opcodes to correspond to an FSTMD instruction.
As a consequence, an ARM compiler with the patch below also requires
that binutils patch in the toolchain for successful emission of code
that involves the generation of unwind information for VFP registers.

The unwind opcodes for the `D' instructions also provide for VFPv3
registers, which this patch also supports.

Regression tested with an arm-none-linux-gnueabi target, with the
exception of course of the VFPv3 support in this patch.  The patch has
also been manually tested to check that stack unwinding is working
correctly.

OK for mainline, once open?

Mark

[1] See revision 1.2943 of src/gas/ChangeLog.

--

2006-08-24  Mark Shinwell  <shinwell@codesourcery.com>

	* config/arm/arm.c (arm_output_fldmx): Output FLDMD instead of
	FLDMX if target supports FLDMD.
	(vfp_output_fstmx): Output FSTMD instead of FSTMX if target supports
	FLDMD.
	(vfp_emit_fstmx): Don't leave space in the frame layout for the
	FSTMX format word if using FSTMD.
	(arm_get_vfp_saved_size): Don't add in space for the FSTMX format word
	if using FSTMD/FLDMD instead of FSTMX/FLDMX.
	(arm_output_epilogue): Adjust comment to reflect use of FSTMD.
	(arm_unwind_emit_sequence): Don't compensate for the FSTMX format
	word if emitting FSTMD.  Also emit "vsave" assembler directives in
	such cases rather than "save".
	* config/arm/libunwind.S (gnu_Unwind_Restore_VFP,
	gnu_Unwind_Save_VFP): Adjust comments.
	(gnu_Unwind_Restore_VFP_D, gnu_Unwind_Save_VFP_D): New functions
	for saving and restoring using FSTMD and FLDMD, rather than
	FSTMX and FLDMX.
	(gnu_Unwind_Restore_VFP_D_16_to_31, gnu_Unwind_Restore_VFP_D_16_to_31):
	New functions for saving and restoring the VFPv3 registers 16 .. 31.
	* config/arm/pr-support.c (gnu_unwind_execute): Add conditional
	compilation case to correctly handle unwind opcode 0xc8 when using
	VFP.
	* config/arm/unwind-arm.c (struct vfpv3_regs): New.
	(DEMAND_SAVE_VFP_D, DEMAND_SAVE_VFP_V3): New flags.
	(__gnu_Unwind_Save_VFP_D, __gnu_Unwind_Restore_VFP_D,
	__gnu_Unwind_Save_VFP_D_16_to_31, __gnu_Unwind_Restore_VFP_D_16_to_31):
	Declare.
	(restore_non_core_regs): Restore registers using FLDMD rather than
	FLDMX if required.  Also handle restoration of VFPv3 registers.
	(_Unwind_VRS_Pop): Handle saving and restoring of registers using
	FSTMD and FLDMD if required; also handle VFPv3 registers 16 .. 31,
	including cases where the caller specifies a range of registers
	that overlaps the d15/d16 boundary.
	* config/arm/arm.h (TARGET_FLDMX): New.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fldmd-mainline.patch
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20060824/33eaf699/attachment.ksh>


More information about the Gcc-patches mailing list