This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: Very long alternative lists for RTL patterns like move
- From: Michael Meissner <meissner at linux dot vnet dot ibm dot com>
- To: Segher Boessenkool <segher at kernel dot crashing dot org>
- Cc: Jeff Law <law at redhat dot com>, Michael Meissner <meissner at linux dot vnet dot ibm dot com>, gcc-help at gcc dot gnu dot org, dje dot gcc at gmail dot com, richard dot earnshaw at arm dot com, rguenther at suse dot de, rth at redhat dot com, jakub at redhat dot com, joseph at codesourcery dot com, bschmidt at redhat dot com, wilson at tuliptree dot org, marcus dot shawcroft at arm dot com, ubizjak at gmail dot com, hubicka at ucw dot cz, nickc at redhat dot com, uweigand at de dot ibm dot com, Andreas dot Krebbel at de dot ibm dot com, vmakarov at redhat dot com, wschmidt at linux dot vnet dot ibm dot com, rdsandiford at googlemail dot com
- Date: Mon, 14 Mar 2016 16:47:57 -0400
- Subject: Re: RFC: Very long alternative lists for RTL patterns like move
- Authentication-results: sourceware.org; auth=none
- References: <20160314192950 dot GA20247 at ibm-tiger dot the-meissners dot org> <56E71282 dot 1030005 at redhat dot com> <20160314195540 dot GA25774 at gate dot crashing dot org>
On Mon, Mar 14, 2016 at 02:55:40PM -0500, Segher Boessenkool wrote:
> On Mon, Mar 14, 2016 at 01:35:30PM -0600, Jeff Law wrote:
> > >(define_insn "mov<mode>_hardfloat"
> > > [(set (match_operand:FMOVE32 0 "nonimmediate_operand"
> > > "=!r,!r,m,f,<f32_vsx>,<f32_vsx>,!r,<f32_lr>,<f32_lr2>,<f32_sm>,<f32_sm2>,<f32_av>,Z,?<f32_dm>,?r,*c*l,!r,*h")
> > > (match_operand:FMOVE32 1 "input_operand"
> > > "r,m,r,f,<f32_vsx>,j,j,<f32_lm>,<f32_lm2>,<f32_sr>,<f32_sr2>,Z,<f32_av>,r,<f32_dm>,r,h,0"))]
> > > "(gpc_reg_operand (operands[0], <MODE>mode)
> > > || gpc_reg_operand (operands[1], <MODE>mode))
> > > && (TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_SINGLE_FLOAT)"
>
> We can get rid of the very many different mov patterns (or at least limit
> it somewhat) by not doing a condition like this, instead using the
> "enabled" attribute?
>
> > >The problem is you have count each alternative to get things to line up.
> > >
> > >One thing that I do when editing rs6000.md is make the columns line up
> > >between
> > >the different operands, and then edit it with a very wide emacs screen, for
> > >example:
>
> You can split a string over multiple lines just fine, as well. That again
> becomes unreadable if you need too many lines, of course :-(
Yes you can split it over several lines, but that doesn't help much.
Then you have
(define_insn "mov<mode>_hardfloat"
[(set (match_operand:FMOVE32 0 "nonimmediate_operand" "=!r,
!r,
m,
f,
<f32_vsx>,
<f32_vsx>,
!r,
<f32_lr>,
<f32_lr2>,
<f32_sm>,
<f32_sm2>,
<f32_av>,
Z,
?<f32_dm>,
?r,
*c*l,
!r,
*h")
(match_operand:FMOVE32 1 "input_operand" "r,
m,
r,
f,
<f32_vsx>,
j,
j,
<f32_lm>,
<f32_lm2>,
<f32_sr>,
<f32_sr2>,
Z,
<f32_av>,
r,
<f32_dm>,
r,
h,
0"))]
"(gpc_reg_operand (operands[0], <MODE>mode)
|| gpc_reg_operand (operands[1], <MODE>mode))
&& (TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_SINGLE_FLOAT)"
...
And of course if we do add new syntax (or allow multiple moves), it will make
it harder to backport things to older releases.
--
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: meissner@linux.vnet.ibm.com, phone: +1 (978) 899-4797