tcg/optimize: Handle or r,a,a with constant a

Backports commit 2374c4b8375072da1f401c6daccc68ae76c73e63 from qemu
This commit is contained in:
Richard Henderson 2018-02-09 14:56:06 -05:00 committed by Lioncash
parent e0d99a1a06
commit 7532c92358
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -982,8 +982,11 @@ static void tcg_constant_folding(TCGContext *s)
if (temps_are_copies(s, args[1], args[2])) {
if (temps_are_copies(s, args[0], args[1])) {
tcg_op_remove(s, op);
} else {
} else if (temps[args[1]].state != TCG_TEMP_CONST) {
tcg_opt_gen_mov(s, op, args, opc, args[0], args[1]);
} else {
tcg_opt_gen_movi(s, op, args, opc,
args[0], temps[args[1]].val);
}
continue;
}