From: Leon Alrae <leon.alrae@imgtec.com>
To: Yongbok Kim <Yongbok.Kim@imgtec.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: Cristian Cuna <Cristian.Cuna@imgtec.com>,
"aurelien@aurel32.net" <aurelien@aurel32.net>
Subject: Re: [Qemu-devel] [PATCH v2] target-mips: fix broken MIPS16 and microMIPS
Date: Mon, 22 Sep 2014 14:55:01 +0100 [thread overview]
Message-ID: <54202A35.9040405@imgtec.com> (raw)
In-Reply-To: <22483EC52335AD41841BD2BC97D39CFC36FB7687@hhmail02.hh.imgtec.org>
Hi Yongbok,
For me this patch looks fine, just minor nitpicks:
> if (blink > 0) {
> int post_delay = insn_bytes;
> int lowbit = !!(ctx->hflags & MIPS_HFLAG_M16);
>
> - if (opc != OPC_JALRC)
> - post_delay += ((ctx->hflags & MIPS_HFLAG_BDS16) ? 2 : 4);
> -
> + post_delay += delayslot_size;
Wouldn't it be better to remove this line add delayslot_size during
post_delay initialization?
> + if (ctx->hflags & MIPS_HFLAG_BDS_STRICT) {
> + switch (op & 0x7) { /* MSB-3..MSB-5 */
> + case 0:
> + /* POOL31A, POOL32B, POOL32I, POOL32C */
POOL32A :)
> case OPC_J ... OPC_JAL: /* Jump */
> offset = (int32_t)(ctx->opcode & 0x3FFFFFF) << 2;
> - gen_compute_branch(ctx, op, 4, rs, rt, offset);
> + gen_compute_branch(ctx, op, 4, rs, rt, offset, 4);
> break;
> case OPC_BEQ ... OPC_BGTZ: /* Branch */
> case OPC_BEQL ... OPC_BGTZL:
> - gen_compute_branch(ctx, op, 4, rs, rt, imm << 2);
> + gen_compute_branch(ctx, op, 4, rs, rt, imm << 2, 4);
Indentation issue?
> @@ -15719,6 +15648,13 @@ gen_intermediate_code_internal(MIPSCPU *cpu, TranslationBlock *tb,
> ctx.bstate = BS_STOP;
> break;
> }
> + if (ctx.hflags & MIPS_HFLAG_BMASK) {
> + if (!(ctx.hflags & MIPS_HFLAG_BDS16) &&
> + !(ctx.hflags & MIPS_HFLAG_BDS32)) {
IMHO it would look nicer if you made this condition shorter by ORing BDS
hflags.
Feel free to add:
Reviewed-by: Leon Alrae <leon.alrae@imgtec.com>
Regards,
Leon
next prev parent reply other threads:[~2014-09-22 14:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-01 16:43 [Qemu-devel] [PATCH v2] target-mips: fix broken MIPS16 and microMIPS Yongbok Kim
2014-08-01 11:03 ` Yongbok Kim
2014-09-22 13:55 ` Leon Alrae [this message]
2014-09-29 13:03 ` Maciej W. Rozycki
2014-09-03 13:33 ` James Hogan
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=54202A35.9040405@imgtec.com \
--to=leon.alrae@imgtec.com \
--cc=Cristian.Cuna@imgtec.com \
--cc=Yongbok.Kim@imgtec.com \
--cc=aurelien@aurel32.net \
--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 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.