aboutsummaryrefslogtreecommitdiff
path: root/tcg/optimize.c
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2021-10-25 11:19:14 -0700
committerRichard Henderson <richard.henderson@linaro.org>2021-10-28 20:55:07 -0700
commit5b5cf47983c37d4c49eb2b8449bc62a7d3d76dbc (patch)
tree056f864319589165c29129903191be12f211289f /tcg/optimize.c
parent4e858d96aa3997113014a31afabcf95fb36d2860 (diff)
tcg/optimize: Use fold_xi_to_x for mul
Recognize the identity function for low-part multiply. Suggested-by: Luis Pires <luis.pires@eldorado.org.br> Reviewed-by: Luis Pires <luis.pires@eldorado.org.br> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'tcg/optimize.c')
-rw-r--r--tcg/optimize.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tcg/optimize.c b/tcg/optimize.c
index 6d795954f2..907049fb06 100644
--- a/tcg/optimize.c
+++ b/tcg/optimize.c
@@ -1461,7 +1461,8 @@ static bool fold_movcond(OptContext *ctx, TCGOp *op)
static bool fold_mul(OptContext *ctx, TCGOp *op)
{
if (fold_const2(ctx, op) ||
- fold_xi_to_i(ctx, op, 0)) {
+ fold_xi_to_i(ctx, op, 0) ||
+ fold_xi_to_x(ctx, op, 1)) {
return true;
}
return false;