qemu/tcg/i386
Richard Henderson 4ac7691073 tcg/i386: Rely on undefined/undocumented behaviour of BSF/BSR
The ISA manual documents the output is undefined if the input was zero.

However, we document in target-i386 that the behavior of real silicon
is to preserve the contents of the output register.  We also mention
that there are real applications that depend on this.  That this is
baked into silicon is mentioned as a potential cause for some false
sharing behaviour wrt lzcnt/tzcnt.

Taking advantage of this allows us to save 2 insns in the normal case,
and 4 insns for i686 emulating a 64-bit clz.

Signed-off-by: Richard Henderson <rth@twiddle.net>
2017-01-10 08:47:48 -08:00
..
tcg-target.h tcg/i386: Handle ctz and clz opcodes 2017-01-10 08:47:48 -08:00
tcg-target.inc.c tcg/i386: Rely on undefined/undocumented behaviour of BSF/BSR 2017-01-10 08:47:48 -08:00