From: Daniel Jacobowitz <drow@false.org>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Fix overflow conditions for MIPS add / subtract
Date: Fri, 28 Apr 2006 11:47:01 -0400 [thread overview]
Message-ID: <20060428154701.GA30778@nevyn.them.org> (raw)
In-Reply-To: <44522BFB.8030109@gmail.com>
On Fri, Apr 28, 2006 at 04:51:39PM +0200, Dirk Behme wrote:
> Daniel Jacobowitz wrote:
> >I haven't tested the patched qemu, but I did test the expressions
> >themselves in standalone code, and they definitely do not detect
> >overflow.
>
> Maybe you can test Ralf's alternative proposal
>
> http://lists.gnu.org/archive/html/qemu-devel/2006-02/msg00154.html
>
> as well?
Using 64-bit math for this would be awful for performance. My original
checks were wrong; we just need to use a correct fix... Lightly
tested, but I think this is right for add:
- if ((T0 >> 31) ^ (T1 >> 31) ^ (tmp >> 31)) {
+ if (~(T0 ^ T1) & (T0 ^ tmp) & 0x80000000) {
And this for sub:
- if (!((T0 >> 31) ^ (T1 >> 31) ^ (tmp >> 31))) {
+ if ((T0 ^ T1) & (T0 ^ tmp) & 0x80000000) {
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2006-04-28 15:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-13 18:49 [Qemu-devel] [PATCH] Fix overflow conditions for MIPS add / subtract Stefan Weil
2006-04-28 13:28 ` Daniel Jacobowitz
2006-04-28 14:51 ` Dirk Behme
2006-04-28 15:47 ` Daniel Jacobowitz [this message]
2006-04-28 15:52 ` Julian Seward
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=20060428154701.GA30778@nevyn.them.org \
--to=drow@false.org \
--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 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).