This is the mail archive of the
mailing list for the GCC project.
Re: extendqihi2 and GCC RTL type system
- From: Jim Wilson <jim dot wilson at linaro dot org>
- To: David Edelsohn <dje dot gcc at gmail dot com>
- Cc: GCC Development <gcc at gcc dot gnu dot org>, Richard Henderson <rth at redhat dot com>, Jeffrey Law <law at redhat dot com>
- Date: Mon, 22 Feb 2016 09:53:42 -0800
- Subject: Re: extendqihi2 and GCC RTL type system
- Authentication-results: sourceware.org; auth=none
- References: <CAGWvnyn4EfEdz8n35iCFHuy=Zba1fugHNkJJmzYk5=oADWCzCA at mail dot gmail dot com>
On Mon, Feb 22, 2016 at 7:55 AM, David Edelsohn <email@example.com> wrote:
> If I remove extendqihi2 (extend:HI pattern) from the PowerPC port,
> will that cause any problems for the GCC RTL type system or inhibit
> optimizations? I see that Alpha and SPARC define extendqihi2, but
> IA-64 and AArch64 do not, so there is precedent for both approaches.
aarch64 does have an extendqihi2 pattern. It uses so many iterator
macros that you can't use grep to look for stuff. The extendqihi2
pattern is called <ANY_OPTAB>qihi2.
If you have a target with registers larger than HImode, no HImode
register operations, qi/hi loads set the entire register, and you
define PROMOTE_MODE to convert all QImode and HImode operations to the
same larger mode with the same signedness, then I don't think that
there is any advantage to having an extendqihi2 pattern. You should
get the same code with or without it, as a qimode to himode conversion
is a no-op. The only difference should be that with an extendqihi2
pattern you will see some HImode operations in the RTL, without
extendqihi2 you will see equivalent operations in the promoted mode.
If you are concerned about this, then just try compiling some large
code base using two compilers, one with extendqihi2 and one without,
and check to see if there are any code generation differences.