This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Bignums and .sleb128
- From: Daniel Jacobowitz <drow at false dot org>
- To: Paul Schlie <schlie at comcast dot net>
- Cc: Richard Sandiford <rsandifo at redhat dot com>, binutils at sources dot redhat dot com
- Date: Mon, 31 Jan 2005 22:28:46 -0500
- Subject: Re: Bignums and .sleb128
- References: <BE243D1B.8DB0%schlie@comcast.net>
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