lkml.org 
[lkml]   [2010]   [Mar]   [26]   [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()


On Fri, 26 Mar 2010, Ralf Baechle wrote:
>
> My trusty old 486 book [1] in the remarks about the BSF instruction:
>
> "The documentation on the 80386 and 80486 states that op1 is undefined if
> op2 is 0. In reality the 80386 will leave the value in op1 unchanged.
> The first versions of the 80486 will change op1 to an undefined value.
> Later version again will leave it unchanged."
>
> [1] Die Intel Familie in German language, by Robert Hummel, 1992

Ok, that explains my memory of us having tried this, at least.

But I do wonder if any of the people working for Intel could ask the CPU
architects whether we could depend on the "don't write" for 64-bit mode.
If AMD already documents the don't-touch semantics, and if Intel were to
be ok with documenting it for their 64-bit capable CPU's, we wouldn't then
need to rely on undefined behavior.

Linus


\
 
 \ /
  Last update: 2010-03-26 19:11    [W:1.894 / U:1.672 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site