From: Richard Henderson <rth@twiddle.net>
To: Yeongkyoon Lee <yeongkyoon.lee@samsung.com>
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: Tue, 09 Oct 2012 11:49:42 -0700 [thread overview]
Message-ID: <507471C6.6010003@twiddle.net> (raw)
In-Reply-To: <1349786252-12343-4-git-send-email-yeongkyoon.lee@samsung.com>
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...
> +#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.
> +/* 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?
r~
next prev parent reply other threads:[~2012-10-09 18:49 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 [this message]
2012-10-10 4:41 ` Yeongkyoon Lee
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=507471C6.6010003@twiddle.net \
--to=rth@twiddle.net \
--cc=qemu-devel@nongnu.org \
--cc=yeongkyoon.lee@samsung.com \
/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).