Bignums and .sleb128
Daniel Jacobowitz
drow@false.org
Tue Feb 1 03:29:00 GMT 2005
On Mon, Jan 31, 2005 at 07:52:59PM -0500, Paul Schlie wrote:
> > Daniel Jacobowitz <drow@false.org> writes:
> > >> You said later that:
> > >>
> > >> > If we're going to use these semantics, at least the '-' case in
> > >> > operand() needs to be fixed.
> > >>
> > >> but I wasn't sure what you meant by "these semantics". Do you mean
> > >> treating bignums as signed, or treating them as unsigned? By my reading,
> > >> operand()'s current handling of '-' already assumes they are signed,
> > >> just like the sleb128 code does (and did ;).
> > > It doesn't work, because sometimes bignums are signed and sometimes
> > > they aren't. Consider -0xffffffffffff; the current code will return 1.
> > > If you want to treat the input as unsigned, then you need to add a new
> > > word with the sign bit. Note that with one less leading 'f', it
> > > suddenly works.
>
> Strongly suspect that the proper idiom to is to treat all non-explicitly
> negative constants as being unsigned values; where the point of confusion
This discussion is about the internal representation of bignums; the
user input is not ambiguous in any way. The meaning of
.sleb128 0xffffffffffffffff
is quite clear.
--
Daniel Jacobowitz
More information about the Binutils
mailing list