public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Richard Sandiford <rsandifo@redhat.com>
To: binutils@sources.redhat.com
Subject: Re: Bignums and .sleb128
Date: Mon, 31 Jan 2005 21:33:00 -0000	[thread overview]
Message-ID: <87brb5p9mp.fsf@firetop.home> (raw)
In-Reply-To: <20050131195417.GA6254@nevyn.them.org> (Daniel Jacobowitz's message of "Mon, 31 Jan 2005 14:54:17 -0500")

Daniel Jacobowitz <drow@false.org> writes:
> I spent most of this morning chasing a bug in .sleb128 support.  After
> I finished running around in circles and discovered that Richard Sandiford
> had fixed it two weeks ago (thanks!) I compared the testcases I'd written
> with the ones that he committed.  There were a couple of differences,
> basically related to this comment from bignum.h:
>
>  *      Bignums are >= 0.                                               *

Ugh, didn't notice that, sorry.  But I think that comment fell by the
wayside the moment we tried to handle '-' for O_bigs.  After all, the
precision of bignums is completely arbitrary, so if the result of
-bignum is supposed to be unsigned, there's no obvious cut-off
point for the sign extension.

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 ;).

> So generating a sleb128 from one is pretty strange - the sign bit is
> ambiguously handled.

Perhaps, but the problem isn't limited to sleb128.  E.g.:

	.quad	-0xffffffffffff

acts in the same way as ".quad 1", not ".quad 0xffff000000000001".

The direction of recent changes suggests there really is a need
for negative bignums, so IMO we should try to support them.

Richard

  reply	other threads:[~2005-01-31 21:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-31 19:54 Daniel Jacobowitz
2005-01-31 21:33 ` Richard Sandiford [this message]
2005-01-31 21:57   ` Daniel Jacobowitz
2005-01-31 22:18     ` Richard Sandiford
2005-01-31 22:22       ` Daniel Jacobowitz
2005-02-01  0:53 Paul Schlie
2005-02-01  1:09 ` Paul Schlie
2005-02-01  5:04   ` Paul Schlie
2005-02-01  3:29 ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87brb5p9mp.fsf@firetop.home \
    --to=rsandifo@redhat.com \
    --cc=binutils@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).