On 12/02/2015 12:03 PM, Jakub Jelinek wrote:
Hi!

expand_unop already handles specially several bitop builtins (strangely
e.g. only clz and not ctz which can be handled pretty much the same,
except comparing the other subreg), but does not handle popcount/parity
this way.

popcount of double word value can be computed as popcount (hi) + popcount (lo),
parity of double word value can be computed as parity (hi ^ lo).

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2015-12-02  Jakub Jelinek  <ja...@redhat.com>

        PR target/68647
        * optabs.c (expand_doubleword_popcount, expand_doubleword_parity):
        New functions.
        (expand_unop): Use them.

        * gcc.target/i386/pr68647.c: New test.
OK.
jeff

Reply via email to