[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] First batch of numerics changes

From: Mark H Weaver
Subject: Re: [PATCH] First batch of numerics changes
Date: Sun, 30 Jan 2011 11:33:35 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Andy Wingo <address@hidden> writes:
> On Sat 29 Jan 2011 09:20, Mark H Weaver <address@hidden> 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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]