All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Hancock <hancockrwd@gmail.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Make shr to divide by power of 2
Date: Fri, 07 Aug 2009 21:09:36 -0600	[thread overview]
Message-ID: <4A7CEC70.4050806@gmail.com> (raw)
In-Reply-To: <87d478i0d7.fsf@basil.nowhere.org>

On 08/07/2009 12:50 AM, Andi Kleen wrote:
> Sergey Senozhatsky<sergey.senozhatsky@gmail.com>  writes:
>> Of course, compiler supposed to do something like
>> 	add    $0x7,%eax
>> 	shr    $0x3,%eax
>> instead of div. Should we rely on this?
>
> Yes. We should rely on this.

It may depend on the selected CPU type that gcc is optimizing for - I 
believe that on some P4s the shift may actually be slower than the divide..

  parent reply	other threads:[~2009-08-08  3:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-06 18:09 [PATCH] Make shr to divide by power of 2 Sergey Senozhatsky
2009-08-07  6:50 ` Andi Kleen
2009-08-07  7:42   ` Sergey Senozhatsky
2009-08-08  3:09   ` Robert Hancock [this message]
2009-08-08  7:35     ` Andi Kleen
2009-08-09  9:40       ` Sergey Senozhatsky

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=4A7CEC70.4050806@gmail.com \
    --to=hancockrwd@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sergey.senozhatsky@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.