This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Wide characters and GCC


On Mon, 11 Jun 2001, Michael Hayes wrote:

> OK, I chose the wrong word here.  Yes, all the bits of an unsigned
> char are significant on the C4x; you can perform 32-bit arithmetic
> using chars if you wish.  But if you wanted to write portable code you
> wouldn't be doing this.

Se we still need to work out how GCC should store 32-bit target chars
internally as part of target string constants (and then make GCC use this
representation consistently).  As no-one has said what this representation
should be, I'll suggest: each target byte (hardware byte of BITS_PER_UNIT
bits, if CHAR_TYPE_SIZE is bigger - though no-one has said whether
CHAR_TYPE_SIZE > BITS_PER_UNIT really works) is stored big-endian in the
minimal number of host bytes ((BITS_PER_UNIT + CHAR_BIT - 1) / CHAR_BIT),
with the first host byte padded with 0s if necessary to fill an integer
number of host bytes.

Next question: should TREE_STRING_LENGTH store the number of host bytes,
or the number of target bytes?  It is used in the compiler with both
meanings at present.  I think target bytes are probably more appropriate.

What should the length parameter to ASM_OUTPUT_ASCII be?  I'd guess target
bytes as well.

-- 
Joseph S. Myers
jsm28@cam.ac.uk


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]