This is the mail archive of the gcc-cvs@gcc.gnu.org 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]

r239923 - in /trunk/gcc: ChangeLog config/aarch...


Author: wilco
Date: Thu Sep  1 11:34:49 2016
New Revision: 239923

URL: https://gcc.gnu.org/viewcvs?rev=239923&root=gcc&view=rev
Log:
This patch adds legitimize_address_displacement hook so that stack accesses
with large offsets are split into a more efficient sequence.  Unaligned and
TI/TFmode use a 256-byte range, byte and halfword accesses use a 4KB range,
wider accesses use a 16KB range to maximise the available addressing range
and increase opportunities to share the base address.

int f(int x)
{
  int arr[8192];
  arr[4096] = 0;
  arr[6000] = 0;
  arr[7000] = 0;
  arr[8191] = 0;
  return arr[x];
}

Now generates:

  sub   sp, sp, #32768
  add   x1, sp, 16384
  str   wzr, [x1]
  str   wzr, [x1, 7616]
  str   wzr, [x1, 11616]
  str   wzr, [x1, 16380]
  ldr   w0, [sp, w0, sxtw 2]
  add   sp, sp, 32768
  ret

    gcc/
	* config/aarch64/aarch64.c (aarch64_legitimize_address_displacement):
	New function.
	(TARGET_LEGITIMIZE_ADDRESS_DISPLACEMENT): Define.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/aarch64/aarch64.c


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