From: Leon Alrae <leon.alrae@imgtec.com>
To: "Maciej W. Rozycki" <macro@linux-mips.org>, qemu-devel@nongnu.org
Cc: Thomas Schwinge <thomas@codesourcery.com>,
Aurelien Jarno <aurelien@aurel32.net>
Subject: Re: [Qemu-devel] [PATCH 7/7] target-mips: Add IEEE 754-2008 features support
Date: Mon, 9 Feb 2015 17:10:42 +0000 [thread overview]
Message-ID: <54D8EA12.3030004@imgtec.com> (raw)
In-Reply-To: <alpine.DEB.1.10.1412082308490.19155@tp.orcam.me.uk>
On 09/12/2014 01:56, Maciej W. Rozycki wrote:
> + if (info->elf_flags & EF_MIPS_NAN2008)
> + env->active_fpu.fcr31 |=
> + (1 << FCR31_NAN2008) & env->active_fpu.fcr31_rw_bitmask;
> + else
> + env->active_fpu.fcr31 &=
> + ~((1 << FCR31_NAN2008) & env->active_fpu.fcr31_rw_bitmask);
braces are needed here
> +uint64_t helper_float_chs_d(CPUMIPSState *env, uint64_t fdt0)
> +{
> + uint64_t fdt1;
> +
> + fdt1 = float64_sub(0, fdt0, &env->active_fpu.fp_status);
> + update_fcr31(env, GETPC());
> + return fdt1;
> +}
> +
> +uint32_t helper_float_chs_s(CPUMIPSState *env, uint32_t fst0)
> +{
> + uint32_t fst1;
> +
> + fst1 = float32_sub(0, fst0, &env->active_fpu.fp_status);
> + update_fcr31(env, GETPC());
> + return fst1;
> +}
I think there is one case where helper_float_chs_{d,s,ps} are not
correct -- when we have zero. In this case in subFloat32Sigs() we call:
return packFloat32(status->float_rounding_mode == float_round_down, 0, 0);
and the packFloat32() definition:
static inline float32 packFloat32(flag zSign, int_fast16_t zExp,
uint32_t zSig)
{
return make_float32(
( ( (uint32_t) zSign )<<31 ) + ( ( (uint32_t) zExp )<<23 ) +
zSig);
}
Which means that the sign may not get changed, whereas I believe NEG.fmt
is supposed to reverse the sign bit of positive/negative zero regardless
of rounding mode.
>
> enum {
> @@ -8718,7 +8719,10 @@ static void gen_farith (DisasContext *ct
> TCGv_i32 fp0 = tcg_temp_new_i32();
>
> gen_load_fpr32(fp0, fs);
> - gen_helper_float_abs_s(fp0, fp0);
> + if (ctx->abs2008)
> + gen_helper_float_abs2008_s(fp0, fp0);
> + else
> + gen_helper_float_abs_s(fp0, cpu_env, fp0);
braces are needed here too (and also in a few other places in this patch).
Thanks,
Leon
next prev parent reply other threads:[~2015-02-09 17:10 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-09 1:54 [Qemu-devel] [PATCH 0/7] MIPS: IEEE 754-2008 features support Maciej W. Rozycki
2014-12-09 1:54 ` [Qemu-devel] [PATCH 1/7] softfloat: Fix sNaN handling in FP conversion operations Maciej W. Rozycki
2015-01-29 14:51 ` Leon Alrae
2015-02-05 16:37 ` Peter Maydell
2015-02-05 16:38 ` Peter Maydell
2015-02-06 14:37 ` Maciej W. Rozycki
2015-02-06 14:45 ` Peter Maydell
2015-02-06 19:35 ` Maciej W. Rozycki
2015-02-08 12:12 ` Maciej W. Rozycki
2014-12-09 1:54 ` [Qemu-devel] [PATCH 2/7] softfloat: Simplify `floatx80ToCommonNaN' function Maciej W. Rozycki
2015-01-28 16:15 ` Leon Alrae
2014-12-09 1:55 ` [Qemu-devel] [PATCH 3/7] softfloat: Convert `*_default_nan' variables into inline functions Maciej W. Rozycki
2014-12-12 19:34 ` [Qemu-devel] [PATCH v2 " Maciej W. Rozycki
2015-01-30 14:09 ` Leon Alrae
2015-01-30 16:02 ` Maciej W. Rozycki
2015-01-30 16:55 ` Peter Maydell
2015-01-31 11:56 ` Maciej W. Rozycki
2015-01-31 12:52 ` Peter Maydell
2015-01-31 14:58 ` Maciej W. Rozycki
2015-02-03 15:43 ` Richard Henderson
2014-12-09 1:55 ` [Qemu-devel] [PATCH 4/7] softfloat: Add SoftFloat status parameter to `*_nan' functions Maciej W. Rozycki
2014-12-09 1:55 ` [Qemu-devel] [PATCH 5/7] softfloat: Rework `*_is_*_nan' functions Maciej W. Rozycki
2014-12-12 19:35 ` [Qemu-devel] [PATCH v2 " Maciej W. Rozycki
2015-02-05 16:42 ` Peter Maydell
2014-12-09 1:55 ` [Qemu-devel] [PATCH 6/7] softfloat: Add SoftFloat status `nan2008_mode' flag Maciej W. Rozycki
2014-12-12 19:35 ` [Qemu-devel] [PATCH v2 " Maciej W. Rozycki
2015-02-05 17:00 ` Peter Maydell
2015-02-05 19:07 ` Maciej W. Rozycki
2014-12-09 1:56 ` [Qemu-devel] [PATCH 7/7] target-mips: Add IEEE 754-2008 features support Maciej W. Rozycki
2015-02-09 17:10 ` Leon Alrae [this message]
2015-02-09 20:55 ` Maciej W. Rozycki
2015-02-10 10:44 ` Leon Alrae
2015-02-10 14:30 ` Maciej W. Rozycki
2015-02-10 17:21 ` Leon Alrae
2015-02-17 13:55 ` Maciej W. Rozycki
2014-12-09 9:20 ` [Qemu-devel] [PATCH 0/7] MIPS: " Peter Maydell
2014-12-09 12:28 ` Maciej W. Rozycki
2014-12-09 12:41 ` Peter Maydell
2014-12-09 18:16 ` Maciej W. Rozycki
2015-01-30 11:59 ` Peter Maydell
2015-01-30 13:47 ` Maciej W. Rozycki
2015-02-03 16:28 ` Thomas Schwinge
2015-02-03 22:30 ` Maciej W. Rozycki
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=54D8EA12.3030004@imgtec.com \
--to=leon.alrae@imgtec.com \
--cc=aurelien@aurel32.net \
--cc=macro@linux-mips.org \
--cc=qemu-devel@nongnu.org \
--cc=thomas@codesourcery.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 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.