public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Adjust variable shift costs for IA MCU
@ 2015-07-09 18:05 H.J. Lu
  2015-07-09 20:30 ` Uros Bizjak
  2015-08-24 15:36 ` H.J. Lu
  0 siblings, 2 replies; 4+ messages in thread
From: H.J. Lu @ 2015-07-09 18:05 UTC (permalink / raw)
  To: gcc-patches; +Cc: Uros Bizjak

We reduce code size for IA MCU by adjusting variable shift costs for IA
MCU.  OK for trunk?

Thanks.


H.J.
---
	PR target/66821
	* config/i386/i386.c (iamcu_cost): Adjust variable shift costs.
---
 gcc/config/i386/i386.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 85e59a8..e4e505c 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -420,7 +420,7 @@ static const
 struct processor_costs iamcu_cost = {
   COSTS_N_INSNS (1),			/* cost of an add instruction */
   COSTS_N_INSNS (1) + 1,		/* cost of a lea instruction */
-  COSTS_N_INSNS (4),			/* variable shift costs */
+  COSTS_N_INSNS (1),			/* variable shift costs */
   COSTS_N_INSNS (1),			/* constant shift costs */
   {COSTS_N_INSNS (11),			/* cost of starting multiply for QI */
    COSTS_N_INSNS (11),			/*				 HI */
-- 
2.4.3

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

* Re: [PATCH] Adjust variable shift costs for IA MCU
  2015-07-09 18:05 [PATCH] Adjust variable shift costs for IA MCU H.J. Lu
@ 2015-07-09 20:30 ` Uros Bizjak
  2015-07-09 20:36   ` H.J. Lu
  2015-08-24 15:36 ` H.J. Lu
  1 sibling, 1 reply; 4+ messages in thread
From: Uros Bizjak @ 2015-07-09 20:30 UTC (permalink / raw)
  To: H.J. Lu; +Cc: gcc-patches

On Thu, Jul 9, 2015 at 8:05 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:
> We reduce code size for IA MCU by adjusting variable shift costs for IA
> MCU.  OK for trunk?

IMO, tuning patches should fall into "obvious" category. I don't have
any data to to do any meaningful review of a cost metric for a new
target.

So, instead of rubberstamping them again and again, these kind of
patches are pre-approved for all non-algorithmic tuning changes for
IAMCU target.

Uros.

> Thanks.
>
>
> H.J.
> ---
>         PR target/66821
>         * config/i386/i386.c (iamcu_cost): Adjust variable shift costs.
> ---
>  gcc/config/i386/i386.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
> index 85e59a8..e4e505c 100644
> --- a/gcc/config/i386/i386.c
> +++ b/gcc/config/i386/i386.c
> @@ -420,7 +420,7 @@ static const
>  struct processor_costs iamcu_cost = {
>    COSTS_N_INSNS (1),                   /* cost of an add instruction */
>    COSTS_N_INSNS (1) + 1,               /* cost of a lea instruction */
> -  COSTS_N_INSNS (4),                   /* variable shift costs */
> +  COSTS_N_INSNS (1),                   /* variable shift costs */
>    COSTS_N_INSNS (1),                   /* constant shift costs */
>    {COSTS_N_INSNS (11),                 /* cost of starting multiply for QI */
>     COSTS_N_INSNS (11),                 /*                               HI */
> --
> 2.4.3
>

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

* Re: [PATCH] Adjust variable shift costs for IA MCU
  2015-07-09 20:30 ` Uros Bizjak
@ 2015-07-09 20:36   ` H.J. Lu
  0 siblings, 0 replies; 4+ messages in thread
From: H.J. Lu @ 2015-07-09 20:36 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: gcc-patches

On Thu, Jul 9, 2015 at 1:30 PM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Thu, Jul 9, 2015 at 8:05 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:
>> We reduce code size for IA MCU by adjusting variable shift costs for IA
>> MCU.  OK for trunk?
>
> IMO, tuning patches should fall into "obvious" category. I don't have
> any data to to do any meaningful review of a cost metric for a new
> target.
>
> So, instead of rubberstamping them again and again, these kind of
> patches are pre-approved for all non-algorithmic tuning changes for
> IAMCU target.
>

I will keep it in mind.

Thanks.

-- 
H.J.

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

* Re: [PATCH] Adjust variable shift costs for IA MCU
  2015-07-09 18:05 [PATCH] Adjust variable shift costs for IA MCU H.J. Lu
  2015-07-09 20:30 ` Uros Bizjak
@ 2015-08-24 15:36 ` H.J. Lu
  1 sibling, 0 replies; 4+ messages in thread
From: H.J. Lu @ 2015-08-24 15:36 UTC (permalink / raw)
  To: gcc-patches, Uros Bizjak

On Thu, Jul 09, 2015 at 11:05:27AM -0700, H.J. Lu wrote:
> We reduce code size for IA MCU by adjusting variable shift costs for IA
> MCU.  OK for trunk?
> 
> Thanks.
> 
> 
> H.J.
> ---
> 	PR target/66821
> 	* config/i386/i386.c (iamcu_cost): Adjust variable shift costs.

I checked in this patch to add a testcase for PR target/66821.


H.J.
---
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 227132)
+++ ChangeLog	(working copy)
@@ -1,5 +1,10 @@
 2015-08-24  H.J. Lu  <hongjiu.lu@intel.com>
 
+	PR target/66821
+	* gcc.target/i386/pr66821.c: New test.
+
+2015-08-24  H.J. Lu  <hongjiu.lu@intel.com>
+
 	PR target/67329
 	* gcc.target/i386/pr67329.c: New test.
 
Index: gcc.target/i386/pr66821.c
===================================================================
--- gcc.target/i386/pr66821.c	(revision 0)
+++ gcc.target/i386/pr66821.c	(working copy)
@@ -0,0 +1,15 @@
+/* { dg-do compile { target ia32 } } */
+/* { dg-options "-O2 -fdump-tree-optimized -mtune=iamcu" } */
+
+void bar (void);
+
+void
+foo (int x)
+{
+  if (x != 2 && x != 3 && x != 10 && x != 11 && x != 17 && x != 18 && x != 23)
+    bar ();
+}
+
+/* Check if the tests have been folded into a bit test.  */
+/* { dg-final { scan-tree-dump "(8784908|0x0*860c0c)" "optimized" } } */
+/* { dg-final { scan-tree-dump "(<<|>>)" "optimized" } } */

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

end of thread, other threads:[~2015-08-24 15:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-09 18:05 [PATCH] Adjust variable shift costs for IA MCU H.J. Lu
2015-07-09 20:30 ` Uros Bizjak
2015-07-09 20:36   ` H.J. Lu
2015-08-24 15:36 ` H.J. Lu

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).