unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: Andy Wingo <wingo@pobox.com>
Cc: guile-devel@gnu.org
Subject: Re: [PATCH] First batch of numerics changes
Date: Sun, 30 Jan 2011 11:33:35 -0500	[thread overview]
Message-ID: <87fwsa1hcw.fsf@yeeloong.netris.org> (raw)
In-Reply-To: <m31v3u3815.fsf@unquote.localdomain> (Andy Wingo's message of "Sun, 30 Jan 2011 13:12:06 +0100")

Andy Wingo <wingo@pobox.com> writes:
> On Sat 29 Jan 2011 09:20, Mark H Weaver <mhw@netris.org> writes:
>
>> @@ -728,7 +728,7 @@ SCM_PRIMITIVE_GENERIC (scm_abs, "abs", 1, 0, 0,
>>  		       "Return the absolute value of @var{x}.")
>>  #define FUNC_NAME
>>  {
>> -  if (SCM_I_INUMP (x))
>> +  if (SCM_LIKELY (SCM_I_INUMP (x)))
>>      {
>>        scm_t_inum xx = SCM_I_INUM (x);
>>        if (xx >= 0)
>
> Is this really likely the case?  Probably not.  I'm going to hold off on
> this patch, unless you really want it in.

Well, my thinking there was that floating-point operations in Guile are
probably very slow anyway, since they require heap allocations (right?),
so a few mispredicted branches are probably not going to make much
difference there.  I felt that the fixnum case should get the fast path.
However, you may be right that abs(x) is rarely used on exact integers.
I just submitted a new version of this patch with that hunk skipped.

    Thanks!
      Mark



  reply	other threads:[~2011-01-30 16:33 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-26 16:32 [PATCH] First batch of numerics changes Mark H Weaver
2011-01-26 18:07 ` Mark H Weaver
2011-01-26 22:46 ` Mark H Weaver
2011-01-27 22:06   ` Mark H Weaver
2011-01-28 12:19     ` Andy Wingo
2011-01-29  0:05       ` Mark H Weaver
2011-01-29 11:29         ` Andy Wingo
2011-01-27 22:32   ` Mark H Weaver
2011-01-28 13:46   ` Andy Wingo
2011-01-28 14:44     ` Noah Lavine
2011-01-28 15:55       ` Andy Wingo
2011-01-29  8:20     ` Mark H Weaver
2011-01-29 17:42       ` Andy Wingo
2011-01-29 20:20         ` Mark H Weaver
2011-01-30 11:48           ` Andy Wingo
2011-01-29 17:50       ` Andy Wingo
2011-01-29 20:36         ` Mark H Weaver
2011-01-29 22:24         ` Mark H Weaver
2011-01-30  6:02           ` Commentary: R6RS div0-and-mod0 vs Taylor's `round/' Mark H Weaver
2011-01-30 11:50           ` [PATCH] First batch of numerics changes Andy Wingo
2011-01-30 12:12       ` Andy Wingo
2011-01-30 16:33         ` Mark H Weaver [this message]
2011-01-28 11:41 ` Andy Wingo
2011-01-28 23:36   ` Mark H Weaver

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

  List information: https://www.gnu.org/software/guile/

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

  git send-email \
    --in-reply-to=87fwsa1hcw.fsf@yeeloong.netris.org \
    --to=mhw@netris.org \
    --cc=guile-devel@gnu.org \
    --cc=wingo@pobox.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).