S
Shao Miller
Ben said:It's a bit stronger than that. Promotion produces a value not a
representation. I would say that any promoted operand has no padding
bits at all.
Really? Surely the "the value is converted to an int" implies that the
representation for an 'int' applies, for example, including any
implementation-defined padding bits, doesn't it?
To suggest that we can have a value with a non-bit-field type but
without a consistent representation for the type (not the value) strikes
me as unusual with 3.14p1 and 3.17p1 in mind. In 6.5.16.1p4 we see
details of "...converted...to int width..." which, to me, suggests that
even intermediate, non-addressable values adhere to the type
representation (for non-bit-fields).
If you are suggesting that the padding bits of results are defined
inaccessibly except via object representation inspection, well that's
rather the nature of my line of questioning...
I'd say the same even if the type does not change.
The same meaning "theoretically, there are no padding bits associated
with the intermediate values during evaluation, because they are
inaccessible until inspected via object representation"?
... ... ...
My point is that promoted results don't have a representation.
They can have a type but need not have a consistent type representation?
At some level it doesn't matter either way. Imagine an implementation
that adds 107 padding bits to every promoted int. Since you can't
inspect these bits
That's really rather what I'm asking about. I apologize if it's not
clear. Please allow me to ask it differently: If we complement an 'int'
and store the result and inspect the object representation, are we
defined to discover that padding bits from the original have been
complemented in the stored result? I doubt it, but am uncertain.
and they have no effect on the value, how could you
tell? I think it is simper to say they don't form part of the value
that results from a promotion.
Well I agree, they are a separate group of bits that also possibly
compose the type representation necessary for the value. But as for
inspection, see the question just above.
But if it pleases you to think of them being there, why not? In fact,
lets just say that all padding bits stay with their values during
promotion and they all get toggled by ~. Now what? As far as I can
tell, such a language has the same semantics as the one I am describing.
I think I understand your perspective; it's about accessibility of the
information regarding any possible padding bits. Since we work with
values and sign primarily, padding bits are pretty far out-of-scope for
theory. So really object representation inspection is the only area
where padding bits are in-scope. Since they're in-scope for this area,
I'd like to understand them better, and how useful information about
them is, perhaps in identification of environmental characteristics such
as parity representation or positional grouping of bits.
Thank you.