target-i386: implement lzcnt emulation
authorAndre Przywara <andre.przywara@amd.com>
Fri, 23 Oct 2009 11:44:31 +0000 (13:44 +0200)
committerAurelien Jarno <aurelien@aurel32.net>
Fri, 23 Oct 2009 15:10:36 +0000 (17:10 +0200)
commit686b6c7980c4fae47c94b7addf9562baaefdf088
treeff6ad928f74dd654a02770cd90a799ae8d17a83e
parent790b22c3e89a8a1e9133680603a1f8110c15ada7
target-i386: implement lzcnt emulation

lzcnt is a AMD Phenom/Barcelona added instruction returning the
number of leading zero bits in a word.
As this is similar to the "bsr" instruction, reuse the existing
code. There need to be some more changes, though, as lzcnt always
returns a valid value (in opposite to bsr, which has a special
case when the operand is 0).
lzcnt is guarded by the ABM CPUID bit (Fn8000_0001:ECX_5).

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
target-i386/helper.h
target-i386/op_helper.c
target-i386/translate.c