This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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)
                             ^

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]