[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] x86 emulation: fix bswap

On 15/2/07 11:46, "Petersson, Mats" <Mats.Petersson@xxxxxxx> wrote:

> I just wrote a little bit of code to test it:
> int x = 0x12345678;
> __asm__(".byte 0x66; bswap %0": "=r"(x): "0"(x))
> printf("x=%x", x);
> Prints 12340000, so the data is "zerod". (and it looks like the code
> generated by gcc is correct!).

Same behaviour as on an Intel CPU. I am quite inclined to do that directly
in the emulator, with a comment explaining why, rather than do an undefined
operation. That just seems unnecessarily scary. Direct 32- and 64-bit BSWAP
is okay though and does reduce the code size.

 -- Keir

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.