From: daniel tian <daniel.xntian@gmail.com>
To: Paolo Bonzini <bonzini@gnu.org>
Cc: Joern Rennecke <joern.rennecke@embecosm.com>,
gcc@gcc.gnu.org, peng.zheng@mavrixtech.com
Subject: Re: VOIDmode in ZERO_EXTEND crashed
Date: Mon, 12 Oct 2009 15:48:00 -0000 [thread overview]
Message-ID: <121fadb80910120837o787b6780j675ddbd54c347292@mail.gmail.com> (raw)
In-Reply-To: <4AD33B2B.9050700@gnu.org>
2009/10/12 Paolo Bonzini <bonzini@gnu.org>:
>
>>> That exactly is the problem. You can't have a CONST_INT inside a
>>> ZERO_EXTEND. That is not valid.
>>> You'll need a separate pattern to recognize the CONST_INT without a
>>> ZERO_EXTEND around it. Unfortunately, this will not give reload
>>> the freedom it should have.
>>>
>>
>>
>> You mean I should remove the const_int (by predicator) in umulhisi3
>> pattern?
>> I mean if I remove it, how to deal with the "reg = const_int * reg"
>> in umulhisi3 pattern.
>
> You follow these steps:
>
> 1) rename the existing pattern to something else than umulhisi3, and make it
> only accept register_operands
>
> 2) create another insn that matches (mult (zero_extend (match_operand
> "register_operand") (const_int))
>
> 3) create a define_expand that checks for a CONST_INT and does not wrap it
> (but wraps REGs and SUBREGs and if applicable MEMs).
>
> This is in general how you deal with too-forgiving predicates during
> expansion.
>
> Paolo
>
It sounds good point. I will try it first
I would like to accepted only register and force all const_int
operand into register first.
Obviously, this may generate low efficiency code compared with your solution.
I still can't get a clear mind with step3. I may need take a while to
think about it.
I am a newcomer. :)
Thanks for your guys advice.
Best wishes.
daniel.
prev parent reply other threads:[~2009-10-12 15:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-12 10:19 daniel tian
2009-10-12 10:31 ` Jon Beniston
2009-10-12 10:50 ` daniel tian
2009-10-12 11:02 ` Joern Rennecke
2009-10-12 14:20 ` daniel tian
2009-10-12 14:22 ` Paolo Bonzini
2009-10-12 15:48 ` daniel tian [this message]
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=121fadb80910120837o787b6780j675ddbd54c347292@mail.gmail.com \
--to=daniel.xntian@gmail.com \
--cc=bonzini@gnu.org \
--cc=gcc@gcc.gnu.org \
--cc=joern.rennecke@embecosm.com \
--cc=peng.zheng@mavrixtech.com \
/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).