This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RE: [PATCH][gensupport] Add optional attributes field to define_cond_exec
- From: "Kyrylo Tkachov" <kyrylo dot tkachov at arm dot com>
- To: "'Richard Henderson'" <rth at redhat dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>, <sellcey at mips dot com>, <rguenther at suse dot de>
- Date: Thu, 23 May 2013 09:56:54 +0100
- Subject: RE: [PATCH][gensupport] Add optional attributes field to define_cond_exec
- References: <00c001ce557a$d58cab20$80a60160$ at tkachov@arm.com> <519A7F4B dot 2090506 at redhat dot com> <00ce01ce563c$70d55a20$52800e60$ at tkachov@arm.com> <00db01ce56d2$5fb5bd70$1f213850$ at tkachov@arm.com> <519CFA77 dot 7040309 at redhat dot com>
Hi Richard,
> No, define_subst works across patterns, keyed by attributes. Exactly
> like
> cond_exec, really.
>
> But what you ought to be able to do right now is
>
> (define_subst "ds_predicable"
> [(match_operand 0)]
> ""
> [(cond_exec (blah) (match_dup 0))])
>
> (define_subst_attr "ds_predicable_enabled" "ds_predicable" "no" "yes"0
>
> (define_insn "blah"
> [(blah)]
> ""
> "@
> blah
> blah"
> [(set_attr "ds_predicable" "yes")
> (set_attr "ds_predicated" "<ds_predicable_enabled>")])
What would be the function of (set_attr "ds_predicable" "yes") ?
Doesn't the use of <ds_predicable_enabled> already trigger the substitution?
>
> At which point you can define "enabled" in terms of ds_predicated plus
> whatever.
>
> With a small bit of work we ought to be able to move that ds_predicated
> attribute to the define_subst itself, so that you don't have to
> replicate that
> set_attr line N times.
That would be nice. So we would have to use define_subst instead of
define_cond_exec
to generate the cond_exec patterns. But I'd like to keep using the
"predicable" attribute
the way it's used now to mark patterns for cond_exec'ednes.
So you'd recommend changing the define_subst machinery to handle that
ds_predicated attribute?
I think that's more or less what you were
> suggesting
> with your cond_exec extension, yes?
Pretty much, yes. Thanks for the explanation.
>
>
>
> r~