public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Kyrill Tkachov <kyrylo.tkachov@arm.com>
To: James Greenhalgh <James.Greenhalgh@arm.com>,
	 "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Cc: Marcus Shawcroft <Marcus.Shawcroft@arm.com>,
	 Richard Earnshaw <Richard.Earnshaw@arm.com>,
	Ramana Radhakrishnan <Ramana.Radhakrishnan@arm.com>
Subject: Re: [Patch 1/2 AArch64/ARM] Give AArch64 ROR (Immediate) a new type attribute
Date: Fri, 25 Sep 2015 13:19:00 -0000	[thread overview]
Message-ID: <560543CF.2000909@arm.com> (raw)
In-Reply-To: <1443167973-37806-2-git-send-email-james.greenhalgh@arm.com>

Hi James,

On 25/09/15 08:59, James Greenhalgh wrote:
> Hi,
>
> This patch splits the "shift_imm" type attribute used by AArch64 in
> two - giving rotate_imm and shift_imm.
>
> We then apply this transform across the AArch64 pipeline descriptions
> which have modelling for shift_imm (cortex-a53, cortex-a57, thunderx).
> This should give no functional change to these models.
>
> Bootstrapped and tested on aarch64-none-linux-gnu, and
> arm-none-linux-gnueabihf with no issues.
>
> OK?
>
> Thanks,
> James
>
> ---
> 2015-09-25  James Greenhalgh  <james.greenhalgh@arm.com>
>
> 	* config/arm/types.md (type): Add rotate_imm.
> 	* config/aarch64/aarch64.md (*ror<mode>3_insn): Split out the
> 	ROR immediate case.
> 	(*rorsi3_insn_uxtw): Likewise.
> 	* config/aarch64/thunderx.md (thunderx_shift): Add rotate_imm.
> 	* config/arm/cortex-a53.md (cortex_a53_alu_shift): Add rotate_imm.
> 	* config/arm/cortex-a57.md (cortex_a53_alu): Add rotate_imm.
>

--- a/gcc/config/aarch64/aarch64.md
+++ b/gcc/config/aarch64/aarch64.md
@@ -3807,13 +3807,15 @@
  
  ;; Rotate right
  (define_insn "*ror<mode>3_insn"
-  [(set (match_operand:GPI 0 "register_operand" "=r")
-        (rotatert:GPI
-          (match_operand:GPI 1 "register_operand" "r")
-          (match_operand:QI 2 "aarch64_reg_or_shift_imm_<mode>" "rUs<cmode>")))]
+  [(set (match_operand:GPI 0 "register_operand" "=r,r")
+     (rotatert:GPI
+       (match_operand:GPI 1 "register_operand" "r,r")
+       (match_operand:QI 2 "aarch64_reg_or_shift_imm_<mode>" "r,Us<cmode>")))]
    ""
-  "ror\\t%<w>0, %<w>1, %<w>2"
-  [(set_attr "type" "shift_reg")]
+  "@
+   ror\\t%<w>0, %<w>1, %<w>2
+   ror\\t%<w>0, %<w>1, %<w>2"
+  [(set_attr "type" "shift_reg, rotate_imm")]
  )
  
AFAIK since the output template for the two alternatives is identical you don't need to specify multiple
identical output templates using '@'. You can just specify the alternative values for the "type" attribute.
See the *sub_shiftsi pattern in the arm backend for an example of that.

arm-wise this patch is ok since you don't actually introduce usage of the new type to any arm patterns.

Thanks,
Kyrill


  reply	other threads:[~2015-09-25 12:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-25  8:20 [Patch 0/2 ARM/AArch64] Add a new Cortex-A53 scheduling model James Greenhalgh
2015-09-25  8:30 ` [Patch 1/2 AArch64/ARM] Give AArch64 ROR (Immediate) a new type attribute James Greenhalgh
2015-09-25 13:19   ` Kyrill Tkachov [this message]
2015-09-25 13:49     ` James Greenhalgh
2015-09-25 15:05       ` Marcus Shawcroft
2015-09-25  8:37 ` [Patch 2/2 ARM/AArch64] Add a new Cortex-A53 scheduling model James Greenhalgh
2015-10-01  8:31   ` Kyrill Tkachov
2015-10-01  8:32   ` Marcus Shawcroft
2015-10-01  9:41     ` James Greenhalgh
2015-10-05 10:07       ` Christophe Lyon
2015-10-05 10:36         ` James Greenhalgh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=560543CF.2000909@arm.com \
    --to=kyrylo.tkachov@arm.com \
    --cc=James.Greenhalgh@arm.com \
    --cc=Marcus.Shawcroft@arm.com \
    --cc=Ramana.Radhakrishnan@arm.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).