qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] tests/tcg: add test-i386-fprem and make target


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH] tests/tcg: add test-i386-fprem and make target for comparing QEMU to h/w
Date: Tue, 17 Jul 2012 13:23:54 +0100

On 17 July 2012 03:24, Catalin Patulea <address@hidden> wrote:
> I'm just sending this in as a draft for now. There are two outstanding issues:
>
> 1) What is the recommended type for bitfields? A quick grep shows inconsistent
> usage of unsigned int/signed int/uintNN_t across the codebase. Note that
> mantissa must be 63 bits so int won't do on either 32 or 64-bit builds.

I think our current position is "don't use bitfields for anything that
has to match an externally defined layout". This is because on Windows
we have to compile with -mms-bitfields [for compatibility with Windows
APIs], which can lead to different layouts for structs with bitfields.
For instance in your struct:

> +    struct {
> +        unsigned long long mantissa:63;
> +        unsigned int one:1;
> +        unsigned int exponent:15;
> +        unsigned int negative:1;
> +        unsigned int empty:16;
> +    } ieee;

the Windows build would not put the fields 'mantissa' and
'one' in the same 64 bit word, it would insert a padding bit.

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]