aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2015-03-16 17:22:32 +0000
committerPeter Maydell <peter.maydell@linaro.org>2015-03-16 17:22:33 +0000
commit9575234db19df260a3c00f5f947a9c1c823b0f5b (patch)
tree667fd3cc7a5249240988e24983cb7b0c6dca7dbe
parentbc68d2e5128284c8beb98b1c5b0331a0ed9f3197 (diff)
parent2374c4b8375072da1f401c6daccc68ae76c73e63 (diff)
Merge remote-tracking branch 'remotes/rth/tags/tcg-pull-20150316' into staging
tcg opt fix for or x,a,a # gpg: Signature made Mon Mar 16 15:47:19 2015 GMT using RSA key ID 4DD0279B # gpg: Good signature from "Richard Henderson <rth7680@gmail.com>" # gpg: aka "Richard Henderson <rth@redhat.com>" # gpg: aka "Richard Henderson <rth@twiddle.net>" * remotes/rth/tags/tcg-pull-20150316: tcg/optimize: Handle or r,a,a with constant a Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--tcg/optimize.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tcg/optimize.c b/tcg/optimize.c
index 067917c396..37c11103a6 100644
--- a/tcg/optimize.c
+++ b/tcg/optimize.c
@@ -980,8 +980,11 @@ static void tcg_constant_folding(TCGContext *s)
if (temps_are_copies(args[1], args[2])) {
if (temps_are_copies(args[0], args[1])) {
tcg_op_remove(s, op);
- } else {
+ } else if (temps[args[1]].state != TCG_TEMP_CONST) {
tcg_opt_gen_mov(s, op, args, opc, args[0], args[1]);
+ } else {
+ tcg_opt_gen_movi(s, op, args, opc,
+ args[0], temps[args[1]].val);
}
continue;
}