]> Git Repo - qemu.git/commit
tcg/i386: Rely on undefined/undocumented behaviour of BSF/BSR
authorRichard Henderson <[email protected]>
Fri, 18 Nov 2016 16:02:59 +0000 (17:02 +0100)
committerRichard Henderson <[email protected]>
Tue, 10 Jan 2017 16:47:48 +0000 (08:47 -0800)
commit4ac76910734209dab83ddd3795f08fc7889ef463
tree294ec14a5508d99b315cedff08f4717caf028060
parentbbf25f90ba802a286fd72be9175a860ae5fec726
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 <[email protected]>
tcg/i386/tcg-target.inc.c
This page took 0.025261 seconds and 4 git commands to generate.