This is the mail archive of the
mailing list for the GCC project.
Re: [AArch64] Make sure start callee-save offset for D registers aligned
- From: Maxim Kuvyrkov <maxim dot kuvyrkov at linaro dot org>
- To: Jiong Wang <jiong dot wang at arm dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 24 Jul 2014 14:16:15 +0100
- Subject: Re: [AArch64] Make sure start callee-save offset for D registers aligned
- Authentication-results: sourceware.org; auth=none
- References: <539078E9 dot 6040308 at arm dot com>
On Jun 5, 2014, at 3:04 PM, Jiong Wang <email@example.com> wrote:
> For AArch64, there may have been an odd num core registers need to be saved.
> This small patch ensure we remain 16 byte aligned for subsequent STP writes of D registers.
> OK for trunk?
How did you test the patch? You need to run GCC testsuites, and, ideally, bootstrap on aarch64-linux-gnu.
Is this patch to fix a correctness problem? Can you provide a testcase that breaks without this patch?
> diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
> index aada704..c4abf1e 100644
> --- a/gcc/config/aarch64/aarch64.c
> +++ b/gcc/config/aarch64/aarch64.c
> @@ -1793,6 +1793,10 @@ aarch64_layout_frame (void)
> offset += UNITS_PER_WORD;
> + /* Align offset to 16-bytes.
> + There may have been an odd num core registers. Ensure we remain
> + 16 byte aligned for subsequent STP writes of D registers. */
> + offset = AARCH64_ROUND_UP (offset, 2 * UNITS_PER_WORD);
> for (regno = V0_REGNUM; regno <= V31_REGNUM; regno++)
> if (cfun->machine->frame.reg_offset[regno] == SLOT_REQUIRED)
It seems that we need to align the offset to 16 bytes only when the V0_REGNUM loop stores a register pair, but not a single register. Since non-pair stores would occur only when a single register is stored in V0_REGNUM loop (i.e., comparatively rare occurrence), we should be OK to align the offset anyway.
The patch seems OK to me (provided no regressions on the testsuite), but you need to get an ACK from an official maintainer.