OSDN Git Service
(root)
/
qmiga
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2f9d9a3
)
tcg/optimize: Use fold_xx_to_i for rem
author
Richard Henderson
<richard.henderson@linaro.org>
Mon, 25 Oct 2021 18:30:33 +0000
(11:30 -0700)
committer
Richard Henderson
<richard.henderson@linaro.org>
Fri, 29 Oct 2021 03:55:07 +0000
(20:55 -0700)
Recognize the constant function for remainder.
Suggested-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>
tcg/optimize.c
patch
|
blob
|
history
diff --git
a/tcg/optimize.c
b/tcg/optimize.c
index
f8b0709
..
7ac63c9
100644
(file)
--- a/
tcg/optimize.c
+++ b/
tcg/optimize.c
@@
-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)