On 12/17/2015 04:36 PM, Kyrill Tkachov wrote:
The documentation on RTL canonical forms in md.texi says:

"Equality comparisons of a group of bits (usually a single bit) with zero
  will be written using @code{zero_extract} rather than the equivalent
  @code{and} or @code{sign_extract} operations. "

However, this is not always followed in combine. If it's trying to optimise
a comparison against zero of a bitmask that is the mode mask of some mode
(255 for QImode and 65535 for HImode in the testcases of this patch)
it will instead create a subreg to that shorter mode.

I suspect that this is an oversight in the documentation, and if given two choices the simpler form is intended to be the canonical one.

it ends up trying to make a QImode comparison against zero, for which
targets like
aarch64 have no pattern.

So, can you define a pattern for it...

To get the benefit on aarch64 this needs patch 1/2 that adds an aarch64
pattern
for comparing a zero_extract with zero.

... instead of this one?

What do people think of this approach?
I hope this just enforces the already documented canonicalisation rules
with minimal(none?) negative
fallout.

I'm not so sure about this. Other ports have QImode comparisons and I would want to see some evidence that there are no code quality regressions. This is not stage 3 material in any case.


Bernd

Reply via email to