Switch aarch64 to __builtin_bswap16.
authorElliott Hughes <enh@google.com>
Wed, 3 Dec 2014 03:55:38 +0000 (19:55 -0800)
committerElliott Hughes <enh@google.com>
Wed, 3 Dec 2014 03:55:38 +0000 (19:55 -0800)
It generates the same code.

Bug: 18597513
Change-Id: I164296da8c676668983dd93697c6dfa05f10ec56

libc/arch-arm64/include/machine/endian.h

index 4743733633b4eb4aa362feca995da83d14e95b7f..b9544afe5c007f3d275df4a5e110188626c2a6dc 100644 (file)
 
 #ifdef __GNUC__
 
-#define __swap16md(x) ({                                        \
-    register u_int16_t _x = (x);                                \
-    __asm volatile ("rev16 %0, %0" : "+r" (_x));                \
-    _x;                                                         \
-})
-
 /* Use GCC builtins */
+#define __swap16md(x) __builtin_bswap16(x)
 #define __swap32md(x) __builtin_bswap32(x)
 #define __swap64md(x) __builtin_bswap64(x)