From: Richard Henderson <rth@twiddle.net>
To: Chen Gang <xili_gchen_5257@hotmail.com>,
gang.chen.5i5j@gmail.com, peter.maydell@linaro.org
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] target-tilegx: Implement v*add and v*sub instructions
Date: Tue, 22 Sep 2015 07:45:27 -0700 [thread overview]
Message-ID: <56016987.1000406@twiddle.net> (raw)
In-Reply-To: <BLU436-SMTP2199314EFAE0B19C93F4E2AB9450@phx.gbl>
On 09/21/2015 10:54 PM, Chen Gang wrote:
> On 2015年09月19日 10:34, Richard Henderson wrote:
>>
>> There's a trick for this that's more efficient for 4 or more elements
>> per vector (i.e. good for v2 and v1, but not v4):
>>
>> a + b = (a & 0x7f7f7f7f) + (b & 0x7f7f7f7f)) ^ ((a ^ b) & 0x80808080)
>>
>> a - b = (a | 0x80808080) - (b & 0x7f7f7f7f)) ^ ((a ^ ~b) & 0x80808080)
>>
>
> For me, we need use "(a ^ b) & 0x80..." instead of "(a ^ ~b) & 0x80...".
No. What you did wrong was not use (a | 0x80808080).
r~
next prev parent reply other threads:[~2015-09-22 14:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-19 0:03 [Qemu-devel] [PATCH] target-tilegx: Implement v*add and v*sub instructions gang.chen.5i5j
2015-09-19 2:34 ` Richard Henderson
2015-09-20 22:37 ` Chen Gang
2015-09-22 5:54 ` Chen Gang
2015-09-22 14:45 ` Richard Henderson [this message]
2015-09-22 21:41 ` Chen Gang
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=56016987.1000406@twiddle.net \
--to=rth@twiddle.net \
--cc=gang.chen.5i5j@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=xili_gchen_5257@hotmail.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).