From: Yeongkyoon Lee <yeongkyoon.lee@samsung.com>
To: Richard Henderson <rth@twiddle.net>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v5 3/3] tcg: Optimize qemu_ld/st by generating slow paths at the end of a block
Date: Wed, 10 Oct 2012 13:41:27 +0900 [thread overview]
Message-ID: <5074FC77.8010407@samsung.com> (raw)
In-Reply-To: <507471C6.6010003@twiddle.net>
On 2012년 10월 10일 03:49, Richard Henderson wrote:
> On 10/09/2012 05:37 AM, Yeongkyoon Lee wrote:
>> +#if defined(CONFIG_QEMU_LDST_OPTIMIZATION) && defined(CONFIG_SOFTMMU)
>> + /* Initialize qemu_ld/st labels to assist code generation at the end of TB
>> + for TLB miss cases at the end of TB */
>> + s->qemu_ldst_labels = tcg_malloc(sizeof(TCGLabelQemuLdst) *
>> + TCG_MAX_QEMU_LDST);
>> + s->nb_qemu_ldst_labels = 0;
>> +#endif
> I said before that I wasn't fond of this sort of "constant" dynamic allocation.
> Regardless of what surrounding code does. You could clean those up too,
> as a separate patch...
I can change the dynamic allocation to static one as you said, however,
one concern is that we might use redundant memory on non-TCG
environment, such as, KVM mode.
What's you opinion about this?
>
>> +#if defined(CONFIG_QEMU_LDST_OPTIMIZATION) && defined(CONFIG_SOFTMMU)
>> + /* Generate slow paths of qemu_ld/st IRs which call MMU helpers at
>> + the end of block */
>> + tcg_out_qemu_ldst_slow_path(s);
>> +#endif
> This interface is so close to "tcg_out_ldst_and_constant_pools(s)" that
> I don't think the function should be specific to ldst. Just call it
> tcg_out_tb_finalize or something.
That looks good.
I'll do refactoring for the function names later.
>
>> +/* Macros/structures for qemu_ld/st IR code optimization:
>> + TCG_MAX_HELPER_LABELS is defined as same as OPC_BUF_SIZE in exec-all.h. */
>> +#define TCG_MAX_QEMU_LDST 640
>> +#define HL_LDST_SHIFT 4
>> +#define HL_LDST_MASK (1 << HL_LDST_SHIFT)
>> +#define HL_ST_MASK HL_LDST_MASK
>> +#define HL_OPC_MASK (HL_LDST_MASK - 1)
>> +#define IS_QEMU_LD_LABEL(L) (!((L)->opc_ext & HL_LDST_MASK))
>> +#define IS_QEMU_ST_LABEL(L) ((L)->opc_ext & HL_LDST_MASK)
>> +
>> +typedef struct TCGLabelQemuLdst {
>> + int opc_ext; /* | 27bit(reserved) | 1bit(ld/st) | 4bit(opc) | */
> Any good reason to use all these masks when the compiler can do it
> for you with bitfields?
No. It is just my coding style.
However, there might be no compiler problems and bitfields might look
somewhat pretty, so I'll use bitfields later.
>
>
> r~
>
next prev parent reply other threads:[~2012-10-10 4:41 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-09 12:37 [Qemu-devel] [PATCH v5 0/3] tcg: enhance code generation quality for qemu_ld/st IRs Yeongkyoon Lee
2012-10-09 12:37 ` [Qemu-devel] [PATCH v5 1/3] configure: Add CONFIG_QEMU_LDST_OPTIMIZATION for TCG qemu_ld/st optimization Yeongkyoon Lee
2012-10-09 12:37 ` [Qemu-devel] [PATCH v5 2/3] tcg: Add declarations and templates of extended MMU helpers Yeongkyoon Lee
2012-10-09 18:36 ` Richard Henderson
2012-10-10 11:04 ` Yeongkyoon Lee
2012-10-09 12:37 ` [Qemu-devel] [PATCH v5 3/3] tcg: Optimize qemu_ld/st by generating slow paths at the end of a block Yeongkyoon Lee
2012-10-09 18:49 ` Richard Henderson
2012-10-10 4:41 ` Yeongkyoon Lee [this message]
2012-10-09 14:26 ` [Qemu-devel] [PATCH v5 0/3] tcg: enhance code generation quality for qemu_ld/st IRs Aurelien Jarno
2012-10-09 16:19 ` Aurelien Jarno
2012-10-09 16:55 ` Paolo Bonzini
2012-10-09 17:09 ` Aurelien Jarno
2012-10-10 4:17 ` Yeongkyoon Lee
2012-10-10 6:45 ` Aurelien Jarno
2012-10-10 10:34 ` Yeongkyoon Lee
2012-10-10 14:09 ` Yeongkyoon Lee
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=5074FC77.8010407@samsung.com \
--to=yeongkyoon.lee@samsung.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.