From c1a702737a6ddb5bc4882e9bb185de0040155dd0 Mon Sep 17 00:00:00 2001 From: zrj Date: Tue, 11 Oct 2016 12:49:46 +0300 Subject: [PATCH] machine/endian.h: Mark bswap functions always inlineable. This solves many cases where compiler decides to make them as a local static functions to prevent code size growth and causing -Winline. Also then it leads to less optimal code generation. To prevent all of this just mark them as always inlineable. These functions are intended to be inlined and should be thought as macros. --- sys/cpu/x86_64/include/endian.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/cpu/x86_64/include/endian.h b/sys/cpu/x86_64/include/endian.h index 5ea1842d76..86d6adf5c4 100644 --- a/sys/cpu/x86_64/include/endian.h +++ b/sys/cpu/x86_64/include/endian.h @@ -158,21 +158,21 @@ __extension__ ({ register __uint16_t __X = (x); \ #endif /* __OPTIMIZE__ */ -static __inline __uint64_t +static __inline __always_inline __uint64_t __bswap64(__uint64_t _x) { return (__byte_swap_long(_x)); } -static __inline __uint32_t +static __inline __always_inline __uint32_t __bswap32(__uint32_t _x) { return (__byte_swap_int(_x)); } -static __inline __uint16_t +static __inline __always_inline __uint16_t __bswap16(__uint16_t _x) { -- 2.41.0