[Bug c/81664] New: __attribute__((target("movbe"))) does not work

bugzilla@poradnik-webmastera.com gcc-bugzilla@gcc.gnu.org
Wed Aug 2 09:05:00 GMT 2017


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

            Bug ID: 81664
           Summary: __attribute__((target("movbe"))) does not work
           Product: gcc
           Version: 5.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bugzilla@poradnik-webmastera.com
  Target Milestone: ---

I found this when I tried to benchmark performance of ntohl with and without
movbe. Looka that target attribute with values "movbe" and "no-movbe" are not
supported. Tested on gcc 4.8.5 (RedHat 7) and 5.4.0 (Cygwin).

#include <arpa/inet.h>

__attribute__((target("movbe")))
long ntohl_movbe(long val)
{
    return ntohl(val);
}

__attribute__((target("no-movbe")))
long ntohl_no_movbe(long val)
{
    return ntohl(val);
}

$ gcc -c -o ntoh-perf.o ntoh-perf.cc -O2 -mmovbe
ntoh-perf.cc:4:26: error: attribute(target("movbe")) is unknown
 long ntohl_movbe(long val)
                          ^
ntoh-perf.cc:10:29: error: attribute(target("no-movbe")) is unknown
 long ntohl_no_movbe(long val)
                             ^


More information about the Gcc-bugs mailing list