https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119468

            Bug ID: 119468
           Summary: PPCLE: Inefficient implementation of
                    __builtin_parityll
           Product: gcc
           Version: 14.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jens.seifert at de dot ibm.com
  Target Milestone: ---

bool parity(unsigned long long l)
{
    return __builtin_parityll(l);
}

bool parity2(unsigned long long l)
{
    return __builtin_popcountll(l) & 1;
}

return both:

bool parity2(unsigned long long l)
{
    return __builtin_popcountll(l) & 1;
}

but "&1" is faster than prtyd instruction.

Reply via email to