This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Reducing JUMPs and using conditional exec based on if_then_else
- From: Hans-Peter Nilsson <hp at bitrange dot com>
- To: Sami Khawam <S dot Khawam at ee dot ed dot ac dot uk>
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 28 Nov 2004 08:41:20 -0500 (EST)
- Subject: Re: Reducing JUMPs and using conditional exec based on if_then_else
- References: <41A9CC59.3070409@ee.ed.ac.uk>
On Sun, 28 Nov 2004, Sami Khawam wrote:
> I have built a CPU architecture (based on the
> OpenRISC .md files)
Which isn't in the official GCC sources. There's a hint
there...
> where I would like to reduce the
> number of jump calls to a minimum and use other
> altervatives like conditional execution. I have set
> BRANCH_COST to 40 and REGISTER_MOVE_COST to 0 (so it
> can use as many MOVs at it wants) and added the 2
> insns (see below) to the .md file defining two
> conditional moves, one based on cond_exec and the
> other on if_then_else (is such thing possible?).
> The problem is that the compiler cannot do any of
> the required optimizations.
> Is this a limitation in ifcvt.c? Or is it me doing
> something wrong?
It seems what you want is the standard pattern movXcc (where X
is the mode of the data you want to move), so you need to name
your pattern movsicc. Did you miss this in the documentation?
I can see it. If the wording is bad, please help with patches.
When you look at existing targets (another hint) this is usually
implemented as a define_expand. See for example mmix.md.
brgds, H-P