[Spice-devel] [PATCH spice-common v2 1/3] Make the compiler work out better way to write unaligned memory
Christophe Fergeau
cfergeau at redhat.com
Mon Sep 25 14:37:43 UTC 2017
On Mon, Sep 25, 2017 at 10:22:57AM -0400, Frediano Ziglio wrote:
> >
> > On Mon, Sep 25, 2017 at 09:04:16AM -0400, Frediano Ziglio wrote:
> > > Yes, intentional and consistent with previous code.
> > > The usage of unsigned for BYTESWAP avoid sign extension during arithmetic.
> >
> > If BYTESWAP has such issues (and I don't think it does), then this should be
> > fixed.
> > ack on being consistent with what was done before.
> >
> > Christophe
> >
>
> Looking at macro sources do not seem to have such issue.
>
> OT: Looking at macro sources why don't we use asm/swab.h or byteswap.h on Linux?
> They provide support for more architectures. Or something like
Even el6 has gcc 4.4, I'd just drop the whole #elif defined (__GNUC__) && (__GNUC__ >= 2) && defined (__OPTIMIZE__)
block and only keep __builtin_bswap*() and the generic fallback.
Christophe
More information about the Spice-devel
mailing list