lkml.org 
[lkml]   [2010]   [Apr]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/3] X86: Optimise fls(), ffs() and fls64()
Linus Torvalds wrote:
> On Fri, 26 Mar 2010, Scott Lurndal wrote:
> >
> > I wonder if Intel's EM64 stuff makes this more deterministic, perhaps
> > David's implementation would work for x86_64 only?
>
> Limiting it to x86-64 would certainly remove all the worries about all the
> historical x86 clones.
>
> I'd still worry about it for future Intel chips, though. I absolutely
> _detest_ relying on undocumented features - it pretty much always ends up
> biting you eventually. And conditional writeback is actually pretty nasty
> from a microarchitectural standpoint.

On the same subject of relying on undocumented features:

/* If SMP and !X86_PPRO_FENCE. */
#define smp_rmb() barrier()

I've seen documentation, links posted to lkml ages ago, which implies
this is fine on 64-bit for both Intel and AMD.

But it appears to be relying on undocumented behaviour on 32-bit...

Are you sure it is ok? Has anyone from Intel/AMD ever confirmed it is
ok? Has it been tested? Clones?

-- Jamie


\
 
 \ /
  Last update: 2010-04-06 16:01    [W:0.098 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site