public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: [PATCH][rtlanal.c][BE][1/2] Fix vector load/stores to not use ld1/st1
@ 2014-12-10  9:51 Alan Hayward
  2014-12-10 10:25 ` Marcus Shawcroft
  0 siblings, 1 reply; 18+ messages in thread
From: Alan Hayward @ 2014-12-10  9:51 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1137 bytes --]


On 02/12/2014 12:36, "Alan Hayward" <alan.hayward@arm.com> wrote:

>
>On 21/11/2014 14:08, "Alan Hayward" <alan.hayward@arm.com> wrote:
>
>>
>>On 14/11/2014 16:48, "Alan Hayward" <alan.hayward@arm.com> wrote:
>>
>>>This is a new version of my BE patch from a few weeks ago.
>>>This is part 1 and covers rtlanal.c. The second part will be aarch64
>>>specific.
>>>
>>>When combined with the second patch, It fixes up movoi/ci/xi for Big
>>>Endian, so that we end up with the lab of a big-endian integer to be in
>>>the low byte of the highest-numbered register.
>>>
>>>This will apply cleanly by itself and no regressions were seen when
>>>testing aarch64 and x86_64 on make check.
>>>
>>>
>>>Changelog:
>>>
>>>2014-11-14  Alan Hayward  <alan.hayward@arm.com>
>>>
>>>        * rtlanal.c
>>>        (subreg_get_info): Exit early for simple and common cases
>>>
>>>
>>>Alan.
>>
>>Hi,
>>
>>The second part to this patch (aarch64 specific) has been approved.
>>
>>
>>Could someone review this one please.
>>
>>
>>Thanks,
>>Alan.
>
>
>Ping.
>
>
>Thanks,
>Alan.


Ping ping.

Thanks,
Alan.

[-- Attachment #2: 0001-BE-fix-load-stores.-Common-code.patch --]
[-- Type: application/octet-stream, Size: 1055 bytes --]

From abd13f7ec5f847d07554016d1f56158e8d747a09 Mon Sep 17 00:00:00 2001
From: Alan Hayward <alan.hayward@arm.com>
Date: Thu, 13 Nov 2014 11:10:36 +0000
Subject: [PATCH] BE fix load stores. Common code.

---
 gcc/rtlanal.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index c9bf69c..a3f7b78 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -3561,6 +3561,19 @@ subreg_get_info (unsigned int xregno, machine_mode xmode,
 	  info->offset = offset / regsize_xmode;
 	  return;
 	}
+       /* Quick exit for the simple and common case of extracting whole
+          subregisters from a multiregister value.  */
+      if (!rknown
+	  && WORDS_BIG_ENDIAN == REG_WORDS_BIG_ENDIAN
+	  && regsize_xmode == regsize_ymode
+	  && (offset % regsize_ymode) == 0)
+	{
+	  info->representable_p = true;
+	  info->nregs = nregs_ymode;
+	  info->offset = offset / regsize_ymode;
+	  gcc_assert (info->offset + info->nregs <= nregs_xmode);
+	  return;
+	}
     }
 
   /* Lowpart subregs are otherwise valid.  */
-- 
1.9.1


^ permalink raw reply	[flat|nested] 18+ messages in thread
* [PATCH][rtlanal.c][BE][1/2] Fix vector load/stores to not use ld1/st1
@ 2014-12-12 11:08 Alan Hayward
  2014-12-12 16:21 ` Richard Sandiford
  2015-01-09  7:12 ` Jeff Law
  0 siblings, 2 replies; 18+ messages in thread
From: Alan Hayward @ 2014-12-12 11:08 UTC (permalink / raw)
  To: gcc-patches; +Cc: ebotcazou, steven

[-- Attachment #1: Type: text/plain, Size: 2132 bytes --]

[Cleaning this thread up to submit patch again, with better explanation]

This patch causes subreg_get_info() to exit early in the simple cases
where we are extracting a whole register from a multi register.

In aarch64 for Big Endian we were producing a subreg of a OImode (256bits)
from a CImode (384bits) This would hit the following assert in
subreg_get_info:

gcc_assert ((GET_MODE_SIZE (xmode) % GET_MODE_SIZE (ymode)) == 0);


This is a rule we should be able to relax a little - if the subreg we want
fits into a whole register then this is a valid result and can be easily
detected earlier in the function.

This has the bonus that we should be slightly reducing the execution time
for more common cases, for example a subreg of 64bits from 256bits.

This patch is required for the second part of the patch, which is aarch64
specific, and fixes up aarch64 Big Endian movoi/ci/xi. This second part
has already been approved.

This patch will apply cleanly by itself and no regressions were seen when
testing aarch64 and x86_64 on make check.

Cheers,
Alan


Changelog:

2014-11-14  Alan Hayward  <alan.hayward@arm.com>

        * rtlanal.c
        (subreg_get_info): Exit early for simple and common cases



---
gcc/rtlanal.c | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index c9bf69c..a3f7b78 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -3561,6 +3561,19 @@ subreg_get_info (unsigned int xregno, machine_mode
xmode,
	  info->offset = offset / regsize_xmode;
	  return;
	}
+       /* Quick exit for the simple and common case of extracting whole
+          subregisters from a multiregister value.  */
+      if (!rknown
+	  && WORDS_BIG_ENDIAN == REG_WORDS_BIG_ENDIAN
+	  && regsize_xmode == regsize_ymode
+	  && (offset % regsize_ymode) == 0)
+	{
+	  info->representable_p = true;
+	  info->nregs = nregs_ymode;
+	  info->offset = offset / regsize_ymode;
+	  gcc_assert (info->offset + info->nregs <= nregs_xmode);
+	  return;
+	}
     }
   /* Lowpart subregs are otherwise valid.  */
--
1.9.1


[-- Attachment #2: 0001-BE-fix-load-stores.-Common-code.patch --]
[-- Type: application/octet-stream, Size: 1055 bytes --]

From abd13f7ec5f847d07554016d1f56158e8d747a09 Mon Sep 17 00:00:00 2001
From: Alan Hayward <alan.hayward@arm.com>
Date: Thu, 13 Nov 2014 11:10:36 +0000
Subject: [PATCH] BE fix load stores. Common code.

---
 gcc/rtlanal.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index c9bf69c..a3f7b78 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -3561,6 +3561,19 @@ subreg_get_info (unsigned int xregno, machine_mode xmode,
 	  info->offset = offset / regsize_xmode;
 	  return;
 	}
+       /* Quick exit for the simple and common case of extracting whole
+          subregisters from a multiregister value.  */
+      if (!rknown
+	  && WORDS_BIG_ENDIAN == REG_WORDS_BIG_ENDIAN
+	  && regsize_xmode == regsize_ymode
+	  && (offset % regsize_ymode) == 0)
+	{
+	  info->representable_p = true;
+	  info->nregs = nregs_ymode;
+	  info->offset = offset / regsize_ymode;
+	  gcc_assert (info->offset + info->nregs <= nregs_xmode);
+	  return;
+	}
     }
 
   /* Lowpart subregs are otherwise valid.  */
-- 
1.9.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2015-01-21 17:53 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-10  9:51 [PATCH][rtlanal.c][BE][1/2] Fix vector load/stores to not use ld1/st1 Alan Hayward
2014-12-10 10:25 ` Marcus Shawcroft
2014-12-12 11:08 Alan Hayward
2014-12-12 16:21 ` Richard Sandiford
2014-12-13 11:34   ` Eric Botcazou
2014-12-15  9:21     ` Richard Sandiford
2014-12-15 20:52       ` Eric Botcazou
2014-12-15 21:56         ` Richard Sandiford
2014-12-19 22:53           ` Eric Botcazou
2015-01-10 14:59             ` Richard Sandiford
2015-01-13 19:04               ` Eric Botcazou
2015-01-14  8:37                 ` Jeff Law
2015-01-14  9:55                   ` Marcus Shawcroft
2015-01-20 21:45                     ` Richard Sandiford
2015-01-21  1:48                       ` Eric Botcazou
2015-01-21 18:03                         ` Richard Sandiford
2015-01-14  7:48               ` Jeff Law
2015-01-09  7:12 ` Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).