From 563b6ee873b898c0f3e3671cf6adaf91def5d92a Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 27 Mar 2017 14:59:06 -0700 Subject: Rewrite the byte swapping macros. The clever pointer tricks were actually not working, and we were doing the byte-by-byte moves in general. By just doing the memcpy and obvious byte swap code, we end up generating actual byte swap instructions, thanks to optimizing compilers. text data bss dec hex filename before: 2240807 51552 132016 2424375 24fe37 hw/xfree86/Xorg after: 2215167 51552 132016 2398735 249a0f hw/xfree86/Xorg Signed-off-by: Eric Anholt Reviewed-by: Keith Packard --- glx/glxbyteorder.h | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'glx') diff --git a/glx/glxbyteorder.h b/glx/glxbyteorder.h index 5e94e8626..8f0cd8a4b 100644 --- a/glx/glxbyteorder.h +++ b/glx/glxbyteorder.h @@ -37,25 +37,4 @@ #include "misc.h" -static inline uint16_t -bswap_16(uint16_t val) -{ - swap_uint16(&val); - return val; -} - -static inline uint32_t -bswap_32(uint32_t val) -{ - swap_uint32(&val); - return val; -} - -static inline uint64_t -bswap_64(uint64_t val) -{ - swap_uint64(&val); - return val; -} - #endif /* !defined(__GLXBYTEORDER_H__) */ -- cgit v1.2.3