From: Rajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com>
To: Richard Henderson <rth@twiddle.net>,
qemu-ppc@nongnu.org, david@gibson.dropbear.id.au
Cc: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>,
qemu-devel@nongnu.org, nikunj@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH 1/6] target-ppc: add vmul10[u, eu, cu, ecu]q instructions
Date: Wed, 5 Oct 2016 10:53:54 +0530 [thread overview]
Message-ID: <eea2f0f3-b358-d283-c1bb-cddbeed37ae6@linux.vnet.ibm.com> (raw)
In-Reply-To: <83513c4f-64d2-7c74-c017-504193f749f1@twiddle.net>
On 09/28/2016 10:12 PM, Richard Henderson wrote:
> On 09/27/2016 10:45 PM, Rajalakshmi Srinivasaraghavan wrote:
>> + val = tcg_const_i64(10); \
> Rename this "ten" for clarity?
>
>> + z = tcg_const_i64(0); \
>> + \
>> + if (add_cin) { \
>> + tcg_gen_andi_i64(cin, cpu_avrl[rB(ctx->opcode)], 0xF); \
>> + tcg_gen_movcond_i64(TCG_COND_LTU, cin, cin, val, cin, z); \
> What is the purpose of this movcond? The docs specifically say that values
> greater than 9 are undefined.
>
>> + } else { \
>> + tcg_gen_movi_i64(cin, 0); \
>> + } \
>> + \
>> + tcg_gen_mulu2_i64(t0, t1, cpu_avrl[rA(ctx->opcode)], val); \
>> + tcg_gen_add2_i64(cpu_avrl[rD(ctx->opcode)], t2, t0, z, cin, z); \
>> + tcg_gen_add2_i64(t2, t0, t1, z, t2, z); \
> This two additions are unused if !add_cin, and the second appears to be
> mergable with the first -- don't use so many z's. I think this simplifies to
>
> if (add_cin) {
> tcg_gen_mulu2_i64(t0, t1, cpu_avrl[rA(ctx->opcode)], ten);
> tcg_gen_andi_i64(t2, cpu_avrl[rB(ctx->opcode)], 0xF);
> tcg_gen_add2_i64(cpu_avrl[rD(ctx->opcode)], t2, t0, t1, t2, z);
> } else {
> tcg_gen_mulu2_i64(cpu_avrl[rD(ctx->opcode)], t2,
> cpu_avrl[rA(ctx->opcode)], ten);
> }
>
>> + tcg_gen_mulu2_i64(t0, t1, cpu_avrh[rA(ctx->opcode)], val); \
>> + tcg_gen_add2_i64(cpu_avrh[rD(ctx->opcode)], t2, t0, z, t2, z); \
>> + \
>> + if (ret_carry) { \
>> + tcg_gen_add2_i64(cpu_avrl[rD(ctx->opcode)], t0, t1, z, t2, z); \
>> + tcg_gen_movi_i64(cpu_avrh[rD(ctx->opcode)], 0); \
> Likewise simplifies to
>
> if (ret_carry) {
> tcg_gen_mulu2_i64(t0, t1, cpu_avrh[rA(ctx->opcode)], ten);
> tcg_gen_add2_i64(t0, cpu_avrl[rD(ctx->opcode)], t0, t1, t2, z);
> tcg_gen_movi_i64(cpu_avrh[rD(ctx->opcode)], 0);
> } else {
> tcg_gen_mul_i64(t0, cpu_avrh[rA(ctx->opcode)], ten);
> tcg_gen_add_i64(cpu_avrh[rD(ctx->opcode)], t0, t2);
> }
>
Will check and send updated patch.
> r~
>
>
--
Thanks
Rajalakshmi S
next prev parent reply other threads:[~2016-10-05 5:24 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-28 5:45 [Qemu-devel] [PATCH 0/6] POWER9 TCG enablement - part5 Rajalakshmi Srinivasaraghavan
2016-09-28 5:45 ` [Qemu-devel] [PATCH 1/6] target-ppc: add vmul10[u, eu, cu, ecu]q instructions Rajalakshmi Srinivasaraghavan
2016-09-28 16:42 ` Richard Henderson
2016-10-05 5:23 ` Rajalakshmi Srinivasaraghavan [this message]
2016-09-29 2:07 ` David Gibson
2016-09-29 4:00 ` Richard Henderson
2016-09-29 4:24 ` [Qemu-devel] [Qemu-ppc] " David Gibson
2016-09-28 5:45 ` [Qemu-devel] [PATCH 2/6] target-ppc: add vextu[bhw]lx instructions Rajalakshmi Srinivasaraghavan
2016-09-28 16:54 ` Richard Henderson
2016-10-05 5:21 ` Rajalakshmi Srinivasaraghavan
2016-10-25 4:31 ` Rajalakshmi Srinivasaraghavan
2016-09-28 5:45 ` [Qemu-devel] [PATCH 3/6] target-ppc: add vextu[bhw]rx instructions Rajalakshmi Srinivasaraghavan
2016-10-25 4:32 ` Rajalakshmi Srinivasaraghavan
2016-09-28 5:45 ` [Qemu-devel] [PATCH 4/6] target-ppc: fix invalid mask - cmpl, bctar Rajalakshmi Srinivasaraghavan
2016-09-29 2:22 ` David Gibson
2016-09-28 5:45 ` [Qemu-devel] [PATCH 5/6] target-ppc: add vector compare not equal instructions Rajalakshmi Srinivasaraghavan
2016-09-28 17:01 ` Richard Henderson
2016-09-29 2:22 ` David Gibson
2016-09-28 5:45 ` [Qemu-devel] [PATCH 6/6] target-ppc: add vclzlsbb/vctzlsbb instructions Rajalakshmi Srinivasaraghavan
2016-09-28 17:08 ` Richard Henderson
2016-09-29 2:23 ` David Gibson
2016-09-29 2:25 ` David Gibson
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=eea2f0f3-b358-d283-c1bb-cddbeed37ae6@linux.vnet.ibm.com \
--to=raji@linux.vnet.ibm.com \
--cc=david@gibson.dropbear.id.au \
--cc=hegdevasant@linux.vnet.ibm.com \
--cc=nikunj@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@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.