From: Stafford Horne <shorne@gmail.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: GCC patches <gcc-patches@gcc.gnu.org>,
Openrisc <openrisc@lists.librecores.org>,
Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>,
Jeff Law <law@redhat.com>
Subject: Re: [PATCH v2 3/5] or1k: Add mrori option, fix option docs
Date: Wed, 03 Jul 2019 22:56:00 -0000 [thread overview]
Message-ID: <20190703223957.GF2601@lianli.shorne-pla.net> (raw)
In-Reply-To: <20190703222658.GD18316@gate.crashing.org>
On Wed, Jul 03, 2019 at 05:26:58PM -0500, Segher Boessenkool wrote:
> On Thu, Jul 04, 2019 at 06:49:17AM +0900, Stafford Horne wrote:
> > On Wed, Jul 03, 2019 at 09:49:02AM -0500, Segher Boessenkool wrote:
> > > On Wed, Jul 03, 2019 at 12:33:49PM +0900, Stafford Horne wrote:
> > > > @@ -179,11 +183,11 @@
> > > > [(set (match_operand:SI 0 "register_operand" "=r,r")
> > > > (rotatert:SI (match_operand:SI 1 "register_operand" "r,r")
> > > > (match_operand:SI 2 "reg_or_u6_operand" "r,n")))]
> > > > - "TARGET_ROR"
> > > > + "TARGET_ROR || TARGET_RORI"
> > > > "@
> > > > l.ror\t%0, %1, %2
> > > > l.rori\t%0, %1, %2"
> > > > - [(set_attr "insn_support" "*,shftimm")])
> > > > + [(set_attr "insn_support" "ror,rori")])
> > >
> > > Does this work? If you use -mno-ror -mrori? It will then allow generating
> > > a reg for the second operand, and ICE later on, as far as I can see?
> >
> > It does seem to work. Why would it produce an internal compiler error?
> >
> > One thing I have is RegectNegative on mror and mrori, so -mno-ror will not be
> > allowed and cause an error.
>
> But both options are off by default, and neither is enabled or disabled
> based on the setting of the other.
>
> > Example:
> >
> > $ cat ./gcc/testsuite/gcc.target/or1k/ror-4.c
> >
> > unsigned int rotate6 (unsigned int a) {
> > return ( a >> 6 ) | ( a << ( 32 - 6 ) );
> > }
>
> That's a fixed distance rotate. My question is will it work if the
> distance is a variable. The other direction should work fine, agreed.
>
> So, does ror-[12].c work with -mrori and no -mror? The predicates say
> this insn pattern is just fine in that case, but the constraints will
> disagree.
OK, yes I see it now. Sorry I mis-understood what you meant by second argument.
I will fix. It's probably going to be easiest to split this to 2 instructions.
-Stafford
next prev parent reply other threads:[~2019-07-03 22:40 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-03 3:34 [PATCH v2 0/5] OpenRISC updates for 10 (fpu, fixes) Stafford Horne
2019-07-03 3:34 ` [PATCH v2 1/5] or1k: Fix code quality for volatile memory loads Stafford Horne
2019-07-03 3:34 ` [PATCH v2 4/5] or1k: Initial support for FPU Stafford Horne
2019-07-03 15:51 ` Segher Boessenkool
2019-07-03 19:43 ` [OpenRISC] " Richard Henderson
2019-07-03 22:21 ` Stafford Horne
2019-07-03 22:35 ` Segher Boessenkool
2019-07-03 22:10 ` Stafford Horne
2019-07-03 3:34 ` [PATCH v2 2/5] or1k: Fix issues with msoft-div Stafford Horne
2019-07-03 3:34 ` [PATCH v2 3/5] or1k: Add mrori option, fix option docs Stafford Horne
2019-07-03 14:53 ` Segher Boessenkool
2019-07-03 21:59 ` Stafford Horne
2019-07-03 22:27 ` Segher Boessenkool
2019-07-03 22:56 ` Stafford Horne [this message]
2019-07-03 3:34 ` [PATCH v2 5/5] or1k: only force reg for immediates Stafford Horne
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=20190703223957.GF2601@lianli.shorne-pla.net \
--to=shorne@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=law@redhat.com \
--cc=openrisc@lists.librecores.org \
--cc=rep.dot.nop@gmail.com \
--cc=segher@kernel.crashing.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).