From: Richard Henderson <rth@redhat.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA/alpha] Add handling of FP control insn in software-single step
Date: Tue, 17 May 2005 08:02:00 -0000 [thread overview]
Message-ID: <20050517062228.GA31869@redhat.com> (raw)
In-Reply-To: <20050517023400.GW1462@adacore.com>
On Tue, May 17, 2005 at 12:34:00PM +1000, Joel Brobecker wrote:
> +fp_register_zero_p (char *buf)
> +{
> + return ((buf[1] & 0x0f) == 0 && buf[2] == 0 && buf[3] == 0
> + && buf[4] == 0 && buf[5] == 0 && buf[6] == 0 && buf[7] == 0);
> +}
...
> + case 0x31: /* FBEQ */
> + if (fp_register_zero_p (reg))
> + goto branch_taken;
> + break;
> + case 0x36: /* FBGE */
> + if (fp_register_sign_bit (reg) == 0 || fp_register_zero_p (reg))
> + goto branch_taken;
> + break;
> + case 0x37: /* FBGT */
> + if (fp_register_sign_bit (reg) == 0 && ! fp_register_zero_p (reg))
> + goto branch_taken;
> + break;
> + case 0x33: /* FBLE */
> + if (fp_register_sign_bit (reg) == 1 || fp_register_zero_p (reg))
> + goto branch_taken;
> + break;
> + case 0x32: /* FBLT */
> + if (fp_register_sign_bit (reg) == 1 && ! fp_register_zero_p (reg))
> + goto branch_taken;
> + break;
> + case 0x35: /* FBNE */
> + if (! fp_register_zero_p (reg))
> + goto branch_taken;
> + break;
NACK. Why are you ignoring the entire exponent? These are not the
operations that fp branches perform. The tests are:
zero (reg & 0x7fff_ffff_ffff_ffff) == 0
sign (reg & 0x8000_0000_0000_0000) != 0
fbeq zero
fbne !zero
fbge !sign || zero
fbgt !sign && !zero
fble sign || zero
fblt sign && !zero
This is a nearly normal integer test, except for the special case
of 0x8000_0000_0000_0000, i.e. -0.0, which is treated as zero.
r~
next prev parent reply other threads:[~2005-05-17 6:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-17 2:50 Joel Brobecker
2005-05-17 3:44 ` Daniel Jacobowitz
2005-05-17 4:49 ` Joel Brobecker
2005-05-17 5:46 ` Daniel Jacobowitz
2005-05-17 6:22 ` Joel Brobecker
2005-05-17 6:30 ` Mark Kettenis
2005-05-17 8:02 ` Richard Henderson [this message]
2005-05-17 10:21 ` Richard Henderson
2005-05-17 13:24 ` Joel Brobecker
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=20050517062228.GA31869@redhat.com \
--to=rth@redhat.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sources.redhat.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