This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: extendqihi2 and GCC RTL type system

On Mon, Feb 22, 2016 at 7:55 AM, David Edelsohn <> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]