[LLVMdev] FYI: IA-32 psABI draft version 0.1

Richard Smith
Thu, 22 Jan 2015 19:54:51 -0000

On Thu, Jan 22, 2015 at 4:35 AM, H.J. Lu <hjl.tools at gmail.com>
wrote:
> Here is the link:
>
> https://groups.google.com/forum/#!topic/ia32-abi/nq6cvH_VVV4

The document contains this claim (as do many other psABI documents):

"Bit-fields that are neither signed nor unsigned
always have non-negative values. Although they may have type char,
short, int, or long (which can have negative values), these bit-fields
have the same range as a bit-field of the same size with the
corresponding unsigned type."

This does not reflect the ABI as widely implemented, and is
incompatible with C++ (in which plain bit-fields are required to be
signed).

GCC documents why they ignore the psABI in this regard here:
https://gcc.gnu.org/onlinedocs/gcc/Non-bugs.html#Non-bugs

I would suggest either removing this specification from the psABI or
correcting it to reflect actual implementation practice: plain
bit-fields are signed.