[lkml]   [2009]   [Aug]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] Make shr to divide by power of 2
On 08/07/2009 12:50 AM, Andi Kleen wrote:
> Sergey Senozhatsky<> 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..

 \ /
  Last update: 2009-08-08 05:11    [W:0.052 / U:3.724 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site