Skip to content
Snippets Groups Projects
Commit 267c17e8 authored by Richard Henderson's avatar Richard Henderson
Browse files

tcg/optimize: Use fold_xx_to_i for rem


Recognize the constant function for remainder.

Suggested-by: default avatarLuis Pires <luis.pires@eldorado.org.br>
Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
parent 2f9d9a34
No related branches found
No related tags found
No related merge requests found
......@@ -1624,7 +1624,11 @@ static bool fold_qemu_st(OptContext *ctx, TCGOp *op)
static bool fold_remainder(OptContext *ctx, TCGOp *op)
{
return fold_const2(ctx, op);
if (fold_const2(ctx, op) ||
fold_xx_to_i(ctx, op, 0)) {
return true;
}
return false;
}
static bool fold_setcond(OptContext *ctx, TCGOp *op)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment