mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-09-09 08:17:53 -06:00
tcg/optimize: Handle known-zeros masks for ANDC
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Richard Henderson <rth@twiddle.net>
This commit is contained in:
parent
c8d7027253
commit
23ec69ed37
1 changed files with 11 additions and 0 deletions
|
@ -727,6 +727,17 @@ static TCGArg *tcg_constant_folding(TCGContext *s, uint16_t *tcg_opc_ptr,
|
||||||
mask = temps[args[1]].mask & mask;
|
mask = temps[args[1]].mask & mask;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
CASE_OP_32_64(andc):
|
||||||
|
/* Known-zeros does not imply known-ones. Therefore unless
|
||||||
|
args[2] is constant, we can't infer anything from it. */
|
||||||
|
if (temps[args[2]].state == TCG_TEMP_CONST) {
|
||||||
|
mask = ~temps[args[2]].mask;
|
||||||
|
goto and_const;
|
||||||
|
}
|
||||||
|
/* But we certainly know nothing outside args[1] may be set. */
|
||||||
|
mask = temps[args[1]].mask;
|
||||||
|
break;
|
||||||
|
|
||||||
case INDEX_op_sar_i32:
|
case INDEX_op_sar_i32:
|
||||||
if (temps[args[2]].state == TCG_TEMP_CONST) {
|
if (temps[args[2]].state == TCG_TEMP_CONST) {
|
||||||
mask = (int32_t)temps[args[1]].mask >> temps[args[2]].val;
|
mask = (int32_t)temps[args[1]].mask >> temps[args[2]].val;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue