Patchwork [02/10] tcg: Canonicalize add2 operand ordering

login
register
mail settings
Submitter Richard Henderson
Date Oct. 2, 2012, 6:32 p.m.
Message ID <1349202750-16815-3-git-send-email-rth@twiddle.net>
Download mbox | patch
Permalink /patch/188607/
State New
Headers show

Comments

Richard Henderson - Oct. 2, 2012, 6:32 p.m.
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 tcg/optimize.c | 5 +++++
 1 file changed, 5 insertions(+)
Aurelien Jarno - Oct. 9, 2012, 3:14 p.m.
On Tue, Oct 02, 2012 at 11:32:22AM -0700, Richard Henderson wrote:
> Signed-off-by: Richard Henderson <rth@twiddle.net>
> ---
>  tcg/optimize.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/tcg/optimize.c b/tcg/optimize.c
> index 5e0504a..3539826 100644
> --- a/tcg/optimize.c
> +++ b/tcg/optimize.c
> @@ -472,6 +472,11 @@ static TCGArg *tcg_constant_folding(TCGContext *s, uint16_t *tcg_opc_ptr,
>              if (swap_commutative(args[0], &args[4], &args[3])) {
>                  args[5] = tcg_invert_cond(args[5]);
>              }
> +            break;
> +        case INDEX_op_add2_i32:
> +            swap_commutative(args[0], &args[2], &args[4]);
> +            swap_commutative(args[1], &args[3], &args[5]);
> +            break;
>          default:
>              break;
>          }

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>

Patch

diff --git a/tcg/optimize.c b/tcg/optimize.c
index 5e0504a..3539826 100644
--- a/tcg/optimize.c
+++ b/tcg/optimize.c
@@ -472,6 +472,11 @@  static TCGArg *tcg_constant_folding(TCGContext *s, uint16_t *tcg_opc_ptr,
             if (swap_commutative(args[0], &args[4], &args[3])) {
                 args[5] = tcg_invert_cond(args[5]);
             }
+            break;
+        case INDEX_op_add2_i32:
+            swap_commutative(args[0], &args[2], &args[4]);
+            swap_commutative(args[1], &args[3], &args[5]);
+            break;
         default:
             break;
         }