From: Aurelien Jarno <aurelien@aurel32.net>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Use float_relation_* constants
Date: Sun, 14 Dec 2008 12:12:11 +0100 [thread overview]
Message-ID: <20081214111211.GI17729@volta.aurel32.net> (raw)
In-Reply-To: <20081214013126.GC23471@codesourcery.com>
On Sat, Dec 13, 2008 at 05:31:26PM -0800, Nathan Froyd wrote:
> (Apologies if this patch comes through multiple times; I've tried twice
> already and haven't seen it come through on my end or in the list
> archives.)
>
> Use float_relation_* constants rather than magic numbers in
> softfloat-native comparison routines.
>
> Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Thanks, applied.
> ---
> fpu/softfloat-native.c | 48 ++++++++++++++++++++++++------------------------
> 1 files changed, 24 insertions(+), 24 deletions(-)
>
> diff --git a/fpu/softfloat-native.c b/fpu/softfloat-native.c
> index 0b24bab..cd88113 100644
> --- a/fpu/softfloat-native.c
> +++ b/fpu/softfloat-native.c
> @@ -220,25 +220,25 @@ float32 float32_sqrt( float32 a STATUS_PARAM)
> int float32_compare( float32 a, float32 b STATUS_PARAM )
> {
> if (a < b) {
> - return -1;
> + return float_relation_less;
> } else if (a == b) {
> - return 0;
> + return float_relation_equal;
> } else if (a > b) {
> - return 1;
> + return float_relation_greater;
> } else {
> - return 2;
> + return float_relation_unordered;
> }
> }
> int float32_compare_quiet( float32 a, float32 b STATUS_PARAM )
> {
> if (isless(a, b)) {
> - return -1;
> + return float_relation_less;
> } else if (a == b) {
> - return 0;
> + return float_relation_equal;
> } else if (isgreater(a, b)) {
> - return 1;
> + return float_relation_greater;
> } else {
> - return 2;
> + return float_relation_unordered;
> }
> }
> int float32_is_signaling_nan( float32 a1)
> @@ -391,25 +391,25 @@ float64 float64_sqrt( float64 a STATUS_PARAM)
> int float64_compare( float64 a, float64 b STATUS_PARAM )
> {
> if (a < b) {
> - return -1;
> + return float_relation_less;
> } else if (a == b) {
> - return 0;
> + return float_relation_equal;
> } else if (a > b) {
> - return 1;
> + return float_relation_greater;
> } else {
> - return 2;
> + return float_relation_unordered;
> }
> }
> int float64_compare_quiet( float64 a, float64 b STATUS_PARAM )
> {
> if (isless(a, b)) {
> - return -1;
> + return float_relation_less;
> } else if (a == b) {
> - return 0;
> + return float_relation_equal;
> } else if (isgreater(a, b)) {
> - return 1;
> + return float_relation_greater;
> } else {
> - return 2;
> + return float_relation_unordered;
> }
> }
> int float64_is_signaling_nan( float64 a1)
> @@ -483,25 +483,25 @@ floatx80 floatx80_sqrt( floatx80 a STATUS_PARAM)
> int floatx80_compare( floatx80 a, floatx80 b STATUS_PARAM )
> {
> if (a < b) {
> - return -1;
> + return float_relation_less;
> } else if (a == b) {
> - return 0;
> + return float_relation_equal;
> } else if (a > b) {
> - return 1;
> + return float_relation_greater;
> } else {
> - return 2;
> + return float_relation_unordered;
> }
> }
> int floatx80_compare_quiet( floatx80 a, floatx80 b STATUS_PARAM )
> {
> if (isless(a, b)) {
> - return -1;
> + return float_relation_less;
> } else if (a == b) {
> - return 0;
> + return float_relation_equal;
> } else if (isgreater(a, b)) {
> - return 1;
> + return float_relation_greater;
> } else {
> - return 2;
> + return float_relation_unordered;
> }
> }
> int floatx80_is_signaling_nan( floatx80 a1)
> --
> 1.6.0.5
>
>
>
>
--
.''`. Aurelien Jarno | GPG: 1024D/F1BCDB73
: :' : Debian developer | Electrical Engineer
`. `' aurel32@debian.org | aurelien@aurel32.net
`- people.debian.org/~aurel32 | www.aurel32.net
prev parent reply other threads:[~2008-12-14 11:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-14 1:31 [Qemu-devel] [PATCH] Use float_relation_* constants Nathan Froyd
2008-12-14 11:12 ` Aurelien Jarno [this message]
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=20081214111211.GI17729@volta.aurel32.net \
--to=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 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).