tcg/optimize: Handle or r, a, a with constant a
PATCH 1/1 tcg/optimize: Handle or r, a, a with constant a
As seen with ubuntu-5.10-live-powerpc.iso.
Reported-by Mark Cave-Ayland <[email protected]>
Signed-off-by Richard Henderson <[email protected]>
--- tcg/optimize.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
tcg/optimize.c +4 -1
@@ -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 ; }
Signature · 1 line
2.1.0
Quoted 15 lines · Richard Henderson
As seen with ubuntu-5.10-live-powerpc.iso.
Reported-by Mark Cave-Ayland <[email protected]>Signed-off-by Richard Henderson <[email protected]>--- tcg/optimize.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)tcg/optimize.c +0
-0@@ -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/optimize.c static void tcg_constant_folding(TCGContext *s) · line 990
Quoted 10 lines
tcg/optimize.c +4
-1tcg_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 ; }
Reviewed-by Bastian Koppelmann <[email protected]>
Cheers,
Bastian
Quoted 16 lines · Richard Henderson
As seen with ubuntu-5.10-live-powerpc.iso.
Reported-by Mark Cave-Ayland <[email protected]>Signed-off-by Richard Henderson <[email protected]>--- tcg/optimize.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)tcg/optimize.c +0
-0@@ -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/optimize.c static void tcg_constant_folding(TCGContext *s) · line 990
Quoted 10 lines
tcg/optimize.c +4
-1tcg_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 ; }
Great work! Fixes the issue here for me so:
Tested-by Mark Cave-Ayland <[email protected]>
ATB,
Mark.