diff options
author | Eric Anholt <eric@anholt.net> | 2017-03-27 14:59:06 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2017-04-25 15:01:23 -0700 |
commit | 563b6ee873b898c0f3e3671cf6adaf91def5d92a (patch) | |
tree | 1a073c44df804d33b99595999006a71546597eec /os | |
parent | 5ef4e785131bb30e774a8175099c0432537533fa (diff) |
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 <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'os')
-rw-r--r-- | os/io.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -108,12 +108,12 @@ static ConnectionOutputPtr FreeOutputs = (ConnectionOutputPtr) NULL; static OsCommPtr AvailableInput = (OsCommPtr) NULL; #define get_req_len(req,cli) ((cli)->swapped ? \ - lswaps((req)->length) : (req)->length) + bswap_16((req)->length) : (req)->length) #include <X11/extensions/bigreqsproto.h> #define get_big_req_len(req,cli) ((cli)->swapped ? \ - lswapl(((xBigReq *)(req))->length) : \ + bswap_32(((xBigReq *)(req))->length) : \ ((xBigReq *)(req))->length) #define BUFSIZE 16384 |