]> git.proxmox.com Git - mirror_qemu.git/commit
target/i386: optimize computation of JL and JLE from flags
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 27 Oct 2023 02:12:59 +0000 (04:12 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 29 Dec 2023 21:02:48 +0000 (22:02 +0100)
commit6032627f07a1632114f09612c80cf806ba03de4a
treef98465b4837ad70a2b112d792cfd8e70e2a6ebe7
parent007531586aa8ef6dccdadd927b89a50af62288d1
target/i386: optimize computation of JL and JLE from flags

Take advantage of the fact that there can be no 1 bits between SF and OF.
If they were adjacent, you could sum SF and get a carry only if SF was
already set.  Then the value of OF in the sum is the XOR of OF itself,
the carry (which is SF) and 0 (the value of the OF bit in the addend):
this is OF^SF exactly.

Because OF and SF are not adjacent, just place more 1 bits to the
left so that the carry propagates, which means summing CC_O - CC_S.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/tcg/translate.c