mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-07-06 14:10:45 +00:00
tcg/optimize: Handle or r,a,a with constant a
Backports commit 2374c4b8375072da1f401c6daccc68ae76c73e63 from qemu
This commit is contained in:
parent
e0d99a1a06
commit
7532c92358
|
@ -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[1], args[2])) {
|
||||||
if (temps_are_copies(s, args[0], args[1])) {
|
if (temps_are_copies(s, args[0], args[1])) {
|
||||||
tcg_op_remove(s, op);
|
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]);
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue