Re: [PATCH xserver 3/2] Rewrite the byte swapping macros.

2017-03-30 Thread Eric Anholt
Keith Packard writes: > [ Unknown signature status ] > Eric Anholt writes: > >> Unaligned accesses trap on some platforms, and I don't think we're >> guaranteed that the caller has the pointer aligned (at least, the >> previous code seemed pretty clearly to

Re: [PATCH xserver 3/2] Rewrite the byte swapping macros.

2017-03-28 Thread Keith Packard
Eric Anholt writes: > Unaligned accesses trap on some platforms, and I don't think we're > guaranteed that the caller has the pointer aligned (at least, the > previous code seemed pretty clearly to be trying to work around that, as > well). If it's protocol, then everything is

Re: [PATCH xserver 3/2] Rewrite the byte swapping macros.

2017-03-28 Thread Eric Anholt
Peter Hutterer writes: > On Mon, Mar 27, 2017 at 03:11:03PM -0700, Eric Anholt wrote: >> 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

Re: [PATCH xserver 3/2] Rewrite the byte swapping macros.

2017-03-27 Thread Peter Hutterer
On Mon, Mar 27, 2017 at 03:11:03PM -0700, Eric Anholt wrote: > 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

[PATCH xserver 3/2] Rewrite the byte swapping macros.

2017-03-27 Thread Eric Anholt
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