tcg/i386: Use ANDN instruction

Note that the optimizer cannot simplify ANDC X,Y,C to AND X,Y,~C
so we must handle constants in the implementation of andc.

Signed-off-by: Richard Henderson <rth@twiddle.net>
tcg/i386: Use SHLX/SHRX/SARX instructions

These three-operand shift instructions do not require the shift count
to be placed into ECX.  This reduces the number of mov insns required,
with the mere addition of a new register constraint.

Don't attempt to get rid of the matching constraint, as that's impossible
to manipulate with just a new constraint.  In addition, constant shifts
still need the matching constraint.

Signed-off-by: Richard Henderson <rth@twiddle.net>
tcg/optimize: Handle known-zeros masks for ANDC

Signed-off-by: Richard Henderson <rth@twiddle.net>
tcg/optimize: Simply some logical ops to NOT

Given, of course, an appropriate constant.  These could be generated
from the "canonical" operation for inversion on the guest, or via
other optimizations.

Signed-off-by: Richard Henderson <rth@twiddle.net>
tcg/optimize: Optmize ANDC X,Y,Y to MOV X,0

Like we already do for SUB and XOR.

Signed-off-by: Richard Henderson <rth@twiddle.net>