tcg/optimize: Sink commutative operand swapping into fold functions
commit7a2f70845255bd6a2ad6399d159c58a7e7b64b51
authorRichard Henderson <richard.henderson@linaro.org>
Thu, 26 Aug 2021 14:06:39 +0000 (26 07:06 -0700)
committerRichard Henderson <richard.henderson@linaro.org>
Thu, 28 Oct 2021 00:11:23 +0000 (27 17:11 -0700)
treefcd6f50f946763e5d87ea8206d270b9782641186
parent9531c078ff63783f2a21ba302827123e7b073304
tcg/optimize: Sink commutative operand swapping into fold functions

Most of these are handled by creating a fold_const2_commutative
to handle all of the binary operators.  The rest were already
handled on a case-by-case basis in the switch, and have their
own fold function in which to place the call.

We now have only one major switch on TCGOpcode.

Introduce NO_DEST and a block comment for swap_commutative in
order to make the handling of brcond and movcond opcodes cleaner.

Reviewed-by: Luis Pires <luis.pires@eldorado.org.br>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
tcg/optimize.c