This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Is there a way to use define_subst when operands need to change modes?
- From: Ilya Tocar <tocarip dot intel at gmail dot com>
- To: Kyrill Tkachov <kyrylo dot tkachov at arm dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Mon, 2 Mar 2015 20:38:29 +0300
- Subject: Re: Is there a way to use define_subst when operands need to change modes?
- Authentication-results: sourceware.org; auth=none
- References: <54F48030 dot 5080601 at arm dot com>
On 02 Mar 15:22, Kyrill Tkachov wrote:
> Hi all,
>
> I'm looking at using the define_subst machinery to auto-generate
> zero-extended
> versions of some patterns, for example having:
> (set reg:SI
> (xor:SI a:SI b:SI))
>
> generate a pattern of the form:
> (set reg:DI
> (zero_extend:DI
> (xor:SI (a:SI b:SI))))
>
> How do I go about achieving this? From the documentation, I think I need
> something like:
> (define_subst "add_z_extend"
> [(set (match_operand:SI 0 "" "")
> (match_operand:SI 1 "" ""))]
> ""
> [(set (match_dup 0)
> (zero_extend:DI (match_dup 1)))]
>
> but in the resultant pattern I need operand 0 to be tranfsormed into DImode.
> Is there a way to write that?
>
Can't you just use [(set (match_operand:DI 0 "" "")... instead of
match_dup?