From: Richard Henderson <rth@twiddle.net>
To: qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>, aurelien@aurel32.net
Subject: [Qemu-devel] [PATCH 4/8] tcg/optimize: add known-zero bits compute for load ops
Date: Fri, 31 Jan 2014 08:46:59 -0600 [thread overview]
Message-ID: <1391179623-13626-5-git-send-email-rth@twiddle.net> (raw)
In-Reply-To: <1391179623-13626-1-git-send-email-rth@twiddle.net>
From: Aurelien Jarno <aurelien@aurel32.net>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
tcg/optimize.c | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/tcg/optimize.c b/tcg/optimize.c
index 1cf017a..d3b099a 100644
--- a/tcg/optimize.c
+++ b/tcg/optimize.c
@@ -779,13 +779,35 @@ static TCGArg *tcg_constant_folding(TCGContext *s, uint16_t *tcg_opc_ptr,
mask = temps[args[3]].mask | temps[args[4]].mask;
break;
+ CASE_OP_32_64(ld8u):
+ case INDEX_op_qemu_ld8u:
+ mask = 0xff;
+ break;
+ CASE_OP_32_64(ld16u):
+ case INDEX_op_qemu_ld16u:
+ mask = 0xffff;
+ break;
+ case INDEX_op_ld32u_i64:
+ case INDEX_op_qemu_ld32u:
+ mask = 0xffffffffu;
+ break;
+
+ CASE_OP_32_64(qemu_ld):
+ {
+ TCGMemOp mop = args[def->nb_oargs + def->nb_iargs];
+ if (!(mop & MO_SIGN)) {
+ mask = (2ULL << ((8 << (mop & MO_SIZE)) - 1)) - 1;
+ }
+ }
+ break;
+
default:
break;
}
/* 32-bit ops (non 64-bit ops and non load/store ops) generate 32-bit
results */
- if (!(tcg_op_defs[op].flags & (TCG_OPF_CALL_CLOBBER | TCG_OPF_64BIT))) {
+ if (!(def->flags & (TCG_OPF_CALL_CLOBBER | TCG_OPF_64BIT))) {
mask &= 0xffffffffu;
}
--
1.8.5.3
next prev parent reply other threads:[~2014-01-31 14:47 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-31 14:46 [Qemu-devel] [PATCH 0/8] tcg optimization improvements Richard Henderson
2014-01-31 14:46 ` [Qemu-devel] [PATCH 1/8] tcg/optimize: fix known-zero bits for right shift ops Richard Henderson
2014-01-31 14:46 ` [Qemu-devel] [PATCH 2/8] tcg/optimize: fix known-zero bits optimization Richard Henderson
2014-01-31 14:46 ` [Qemu-devel] [PATCH 3/8] tcg/optimize: improve known-zero bits for 32-bit ops Richard Henderson
2014-01-31 14:46 ` Richard Henderson [this message]
2014-01-31 14:47 ` [Qemu-devel] [PATCH 5/8] tcg/optimize: Handle known-zeros masks for ANDC Richard Henderson
2014-02-16 18:12 ` Aurelien Jarno
2014-01-31 14:47 ` [Qemu-devel] [PATCH 6/8] tcg/optimize: Simply some logical ops to NOT Richard Henderson
2014-02-16 18:27 ` Aurelien Jarno
2014-01-31 14:47 ` [Qemu-devel] [PATCH 7/8] tcg/optimize: Optmize ANDC X, Y, Y to MOV X, 0 Richard Henderson
2014-02-16 18:27 ` Aurelien Jarno
2014-01-31 14:47 ` [Qemu-devel] [PATCH 8/8] tcg/optimize: Add more identity simplifications Richard Henderson
2014-02-16 18:30 ` Aurelien Jarno
2014-02-14 21:44 ` [Qemu-devel] [PATCH 0/8] tcg optimization improvements Richard Henderson
2014-02-16 14:15 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1391179623-13626-5-git-send-email-rth@twiddle.net \
--to=rth@twiddle.net \
--cc=aurelien@aurel32.net \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).