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

            Bug ID: 90768
           Summary: better range analysis for converting lt/gt into bit
                    tests
           Product: gcc
           Version: 8.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: slandden at gmail dot com
  Target Milestone: ---

Converting the >= 8 to a & 8 results in one less instruction on power 9

https://godbolt.org/z/0QPN3z

#include <stdint.h>
#include <stdlib.h>
int bcmp_2(char *a, char *b, size_t s) {
    if (s < 16) {
        if (s >= 8)
            if (*(uint64_t *)a != *(uint64_t *)b)
                return 1;

    }
}

Reply via email to