David Chisnall writes:
> As to the | vs || issue - by all means change it to || if it fits
> better with the FreeBSD style. In the general case I prefer to use |
> to hint to the compiler and readers of the code that short-circuit
> evaluation is not required and to remove a sequence point and ma
On Thu, Nov 24, 2011 at 12:17 AM, Bruce Evans wrote:
> Maybe my mail client (unmentionable) is messing up something. This came
> back with the quotes even more mangled than usual, especially for my
> reply.
Is this better? I use Gmail as my mailer, and I have a feeling it gets
confused sometimes
On Tue, 22 Nov 2011, Eitan Adler wrote:
Meta comment:
I should have sent this patch to -hackers prior to seeking approval to
commit. I learned my lesson and will seek wider review before making
such changes in the future.
On Tue, Nov 22, 2011 at 6:21 AM, Bruce Evans wrote:
I saw your email abou
On 22 Nov 2011, at 20:27, David Schultz wrote:
> Benchmark or not, I think you'll have a very hard time finding a
> single real program that routinely calls strcasecmp() with
> identical pointers!
I've seen this pattern very often. Often the linker is able to combine
constant strings defined in
On Tue, Nov 22, 2011 at 6:56 PM, Peter Wemm wrote:
> On Tue, Nov 22, 2011 at 12:27 PM, David Schultz wrote:
>> On Tue, Nov 22, 2011, Eitan Adler wrote:
>>> The problem with profiling this type of change is that it is hard to
>>> find a good representative benchmark. I could easily write code that
On Tue, Nov 22, 2011 at 12:27 PM, David Schultz wrote:
> On Tue, Nov 22, 2011, Eitan Adler wrote:
>> The problem with profiling this type of change is that it is hard to
>> find a good representative benchmark. I could easily write code that
>> will show you that adding the equality check is a goo
On 11/22/2011 12:27 PM, David Schultz wrote:
> On Tue, Nov 22, 2011, Eitan Adler wrote:
>> The problem with profiling this type of change is that it is hard to
>> find a good representative benchmark. I could easily write code that
>> will show you that adding the equality check is a good idea or t
On Tue, Nov 22, 2011, Eitan Adler wrote:
> The problem with profiling this type of change is that it is hard to
> find a good representative benchmark. I could easily write code that
> will show you that adding the equality check is a good idea or that it
> is a horrible idea. IMHO it saves enough
On Tuesday, November 22, 2011 10:33:32 am David Schultz wrote:
> On Tue, Nov 22, 2011, Eitan Adler wrote:
> > + /* use a bitwise or to avoid an additional branch instruction */
> > + if ((s1 == s2) | (n == 0))
> > + return (0);
>
> I think there are three issues with this.
>
> First
Meta comment:
I should have sent this patch to -hackers prior to seeking approval to
commit. I learned my lesson and will seek wider review before making
such changes in the future.
On Tue, Nov 22, 2011 at 6:21 AM, Bruce Evans wrote:
I saw your email about the style changes. I'd like to flesh out
On Tue, Nov 22, 2011, David Schultz wrote:
> First, the comment suggesting that using '|' instead of '||' isn't
> correct; any reasonable compiler knows how to optimize
> side-effect-free expressions like these. (The reverse
> transformation, from the arithmetic expression to the boolean one,
> is
on 22/11/2011 16:20 David Chisnall said the following:
> the use of | tells a human reading the code that the order is unimportant
I think that it tells that we are dealing with bit flags, not with logical
operations. Which would be a lie^W^W an incorrect hint in this case (both to
humans and com
On Tue, Nov 22, 2011, Eitan Adler wrote:
> + /* use a bitwise or to avoid an additional branch instruction */
> + if ((s1 == s2) | (n == 0))
> + return (0);
I think there are three issues with this.
First, the comment suggesting that using '|' instead of '||' isn't
correct; an
On 22 Nov 2011, at 11:21, Bruce Evans wrote:
> If this optimization were any good, then the compiler would already do
> it. In fact, gcc-4.2.1 already does it -- the reverse of it -- it rewrites:
>
> "if ((i == 0) | (j == 0)) return; test();"
>
> into:
>
> "if (i == 0 || j == 0) re
On Mon, 21 Nov 2011 m...@freebsd.org wrote:
On Mon, Nov 21, 2011 at 6:50 PM, Eitan Adler wrote:
Author: eadler (ports committer)
Date: Tue Nov 22 02:50:24 2011
New Revision: 227812
URL: http://svn.freebsd.org/changeset/base/227812
Log:
?- fix some style(9) nits with my last commit
?- add a co
On Mon, Nov 21, 2011 at 6:50 PM, Eitan Adler wrote:
> Author: eadler (ports committer)
> Date: Tue Nov 22 02:50:24 2011
> New Revision: 227812
> URL: http://svn.freebsd.org/changeset/base/227812
>
> Log:
> - fix some style(9) nits with my last commit
> - add a comment explaining why I used '|' i
Author: eadler (ports committer)
Date: Tue Nov 22 02:50:24 2011
New Revision: 227812
URL: http://svn.freebsd.org/changeset/base/227812
Log:
- fix some style(9) nits with my last commit
- add a comment explaining why I used '|' instead of '||'
Submitted by: danfe@
Approved by: emaste@
17 matches
Mail list logo