]> Git Repo - qemu.git/commitdiff
tcg/optimize: Handle or r,a,a with constant a
authorRichard Henderson <[email protected]>
Fri, 13 Mar 2015 19:26:21 +0000 (12:26 -0700)
committerRichard Henderson <[email protected]>
Mon, 16 Mar 2015 15:46:13 +0000 (08:46 -0700)
As seen with ubuntu-5.10-live-powerpc.iso.

Reported-by: Mark Cave-Ayland <[email protected]>
Tested-by: Mark Cave-Ayland <[email protected]>
Reviewed-by: Bastian Koppelmann <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
tcg/optimize.c

index 067917c396f4457e14d5db714842f79b3587fbfa..37c11103a62b44bd6a83b32d68b043a2b13857cd 100644 (file)
@@ -980,8 +980,11 @@ static void tcg_constant_folding(TCGContext *s)
             if (temps_are_copies(args[1], args[2])) {
                 if (temps_are_copies(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;
             }
This page took 0.028609 seconds and 4 git commands to generate.