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