All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aleksandar Markovic <Aleksandar.Markovic@imgtec.com>
To: Richard Henderson <rth@twiddle.net>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: "peter.maydell@linaro.org" <peter.maydell@linaro.org>,
	"ehabkost@redhat.com" <ehabkost@redhat.com>,
	"kbastian@mail.uni-paderborn.de" <kbastian@mail.uni-paderborn.de>,
	"mark.cave-ayland@ilande.co.uk" <mark.cave-ayland@ilande.co.uk>,
	"agraf@suse.de" <agraf@suse.de>,
	Petar Jovanovic <Petar.Jovanovic@imgtec.com>,
	"blauwirbel@gmail.com" <blauwirbel@gmail.com>,
	"jcmvbkbc@gmail.com" <jcmvbkbc@gmail.com>,
	Miodrag Dinic <Miodrag.Dinic@imgtec.com>,
	"qemu-arm@nongnu.org" <qemu-arm@nongnu.org>,
	"qemu-ppc@nongnu.org" <qemu-ppc@nongnu.org>,
	"pbonzini@redhat.com" <pbonzini@redhat.com>,
	"edgar.iglesias@gmail.com" <edgar.iglesias@gmail.com>,
	"gxt@mprc.pku.edu.cn" <gxt@mprc.pku.edu.cn>,
	Leon Alrae <Leon.Alrae@imgtec.com>,
	"afaerber@suse.de" <afaerber@suse.de>,
	"aurelien@aurel32.net" <aurelien@aurel32.net>,
	"proljc@gmail.com" <proljc@gmail.com>
Subject: Re: [Qemu-devel] [PATCH 1/2] softfloat: Enable run-time-configurable meaning of signaling NaN bit
Date: Mon, 4 Apr 2016 13:21:10 +0000	[thread overview]
Message-ID: <EF5FA6C3467F85449672C3E735957B859168FB0A@BADAG02.ba.imgtec.org> (raw)
In-Reply-To: <56F9A3D1.2050402@twiddle.net>

Hello, Richard.

I truly appreciate your guidance, it is of tremendous help to me.

I plan to address all issues you brought up in this mail in the V2 of my patch series.

All is clear to me, except some subtleties regarding initialization of platforms.
More specifically, for setting snan bit, I adopted this principle.

1. If target platform doesn't use SoftFloatLibrary, nothing is added.
      (cris, lm32, moxie)
2. Else, if target platform's signalling bit meaning is "1 is signalling",
   explicit invocation of set_snan_bit_is_one(1) is added.
      (mips, sh4, unicore32)
         (for mips this will change in the second patch of this series,
         but this very patch leaves mips features as they currently are.)
3. Else, if target platform explicitely sets other fields of its
   float_status structure(s), explicit invocation of
   set_snan_bit_is_one(0) is added.
      (arm, ppc, s390x, tricore)
4. Else, if target platform doesn't exlpcitely sets its structure CPUXXXState,
   explicit invocation of set_snan_bit_is_one(0) is added.
      (alpha, xtensa)
5. For remaining cases, nothing is added. (Those cases explicitely set
   their CPUXXXState to 0, and implicitly perform set_snan_bit_is_one(0).)
      (i386, m68k, microblaze, openrisc, sparc)

By platforms, this looks like following:

A. alpha - structure CPUAlphaState not explicitely set to 0s,
      explicit invocation of set_snan_bit_is_one(0) added
B. arm - explicitely sets other fields of float_status,
      explicit invocation of set_snan_bit_is_one(0) added
C. cris - does not use SoftFloat library, nothing added
D. i386 - structure CPUX86State explicitely set to 0s,
      nothing added (implicit set_snan_bit_is_one(0))
E. lm32 - does not use SoftFloat library, nothing added
F. m68k - structure CPUM68KState explicitely set to 0s,
      nothing added (implicit set_snan_bit_is_one(0))
G. microblaze - structure CPUMBState explicitely set to 0s,
      nothing added (implicit set_snan_bit_is_one(0))
H. mips - must explicitely invoke set_snan_bit_is_one(1)
I. moxie - does not use SoftFloat library, nothing added
J. openrisc - structure CPUOpenRISCState explicitely set to 0s,
      nothing added (implicit set_snan_bit_is_one(0))
K. ppc - explicitely sets other fields of float_status,
      explicit invocation of set_snan_bit_is_one(0) added
L. s390x - explicitely sets other fields of float_status,
      explicit invocation of set_snan_bit_is_one(0) added
M. sh4 - must explicitely invoke set_snan_bit_is_one(1)
N. sparc - structure CPUSPARCState explicitely set to 0s,
      nothing added (implicit set_snan_bit_is_one(0))
O. tricore - explicitely sets other fields of float_status,
      explicit invocation of set_snan_bit_is_one(0) added
P. unicore32 - must explicitely invoke set_snan_bit_is_one(1)
Q. xtensa - structure CPUXtensaState not explicitely set to 0s,
      explicit invocation of set_snan_bit_is_one(0) added

Does such approach look OK to you?

Feightfully yours,
Aleksandar



________________________________________
From: qemu-devel-bounces+aleksandar.markovic=imgtec.com@nongnu.org [qemu-devel-bounces+aleksandar.markovic=imgtec.com@nongnu.org] on behalf of Richard Henderson [rth@twiddle.net]
Sent: Monday, March 28, 2016 2:36 PM
To: Aleksandar Markovic; qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org; ehabkost@redhat.com; kbastian@mail.uni-paderborn.de; mark.cave-ayland@ilande.co.uk; agraf@suse.de; Petar Jovanovic; blauwirbel@gmail.com; jcmvbkbc@gmail.com; Miodrag Dinic; qemu-arm@nongnu.org; qemu-ppc@nongnu.org; edgar.iglesias@gmail.com; pbonzini@redhat.com; gxt@mprc.pku.edu.cn; Leon Alrae; afaerber@suse.de; aurelien@aurel32.net; proljc@gmail.com
Subject: Re: [Qemu-devel] [PATCH 1/2] softfloat: Enable run-time-configurable meaning of signaling NaN bit

On 03/25/2016 05:50 AM, Aleksandar Markovic wrote:
> +float16 float16_default_nan(float_status *status) {

{ on the next line.

> +        return const_float64(LIT64( 0xFFF8000000000000 ));

Let's please fix the horrible formatting in this file as we touch the lines,
please.

> -#define floatx80_default_nan_high 0x7FFF
> -#define floatx80_default_nan_low  LIT64(0xBFFFFFFFFFFFFFFF)
> -#else
> -#define floatx80_default_nan_high 0xFFFF
> -#define floatx80_default_nan_low  LIT64( 0xC000000000000000 )
> -#endif
> +uint16_t floatx80_default_nan_high(float_status *status) {
> +uint64_t floatx80_default_nan_low(float_status *status) {

Why do you need two separate functions for this?

> +floatx80 floatx80_default_nan(float_status *status) {

Seems to me this one is good enough, and indeed preferable.

> -#define float128_default_nan_high LIT64(0x7FFF7FFFFFFFFFFF)
> -#define float128_default_nan_low  LIT64(0xFFFFFFFFFFFFFFFF)
...
> +float128 float128_default_nan(float_status *status) {

Likewise.


> diff --git a/target-alpha/cpu.c b/target-alpha/cpu.c
> index 2eab060..1714387 100644
> --- a/target-alpha/cpu.c
> +++ b/target-alpha/cpu.c
> @@ -277,6 +277,8 @@ static void alpha_cpu_initfn(Object *obj)
>   #endif
>       env->lock_addr = -1;
>       env->fen = 1;
> +
> +    set_snan_bit_is_one(0, &env->fp_status);

We've just done a memset of (most of) the entire cpu struct.  We don't need to
re-initialize this field to zero here.  Same with most of the other cpus.


r~

  reply	other threads:[~2016-04-04 13:21 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-25 12:50 [Qemu-devel] [PATCH 0/2] target-mips: Fix IEEE 754-2008-related issues Aleksandar Markovic
2016-03-25 12:50 ` [Qemu-devel] [PATCH 1/2] softfloat: Enable run-time-configurable meaning of signaling NaN bit Aleksandar Markovic
2016-03-28 21:36   ` Richard Henderson
2016-04-04 13:21     ` Aleksandar Markovic [this message]
2016-04-04 13:31       ` Peter Maydell
2016-04-04 19:37         ` Eduardo Habkost
2016-04-04 19:38           ` Peter Maydell
2016-04-04 19:42             ` Eduardo Habkost
2016-04-04 19:46               ` Peter Maydell
2016-04-04 19:56                 ` Eduardo Habkost
2016-03-29 12:50   ` Bastian Koppelmann
2016-03-30 16:58     ` Aleksandar Markovic
2016-04-01 19:02   ` Leon Alrae
2016-04-03 14:25     ` Aleksandar Markovic
2016-04-04 16:10       ` Leon Alrae
2016-03-25 12:50 ` [Qemu-devel] [PATCH 2/2] target-mips: Implement IEEE 754-2008 functionality for R6 and MSA instructions Aleksandar Markovic
2016-03-28 21:49   ` Richard Henderson
2016-03-30 19:28     ` Aleksandar Markovic
2016-03-31 11:55     ` Aleksandar Markovic
2016-03-31 16:30       ` Richard Henderson
2016-04-01 19:07   ` Leon Alrae
2016-04-03 15:05     ` Aleksandar Markovic

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=EF5FA6C3467F85449672C3E735957B859168FB0A@BADAG02.ba.imgtec.org \
    --to=aleksandar.markovic@imgtec.com \
    --cc=Leon.Alrae@imgtec.com \
    --cc=Miodrag.Dinic@imgtec.com \
    --cc=Petar.Jovanovic@imgtec.com \
    --cc=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=aurelien@aurel32.net \
    --cc=blauwirbel@gmail.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=ehabkost@redhat.com \
    --cc=gxt@mprc.pku.edu.cn \
    --cc=jcmvbkbc@gmail.com \
    --cc=kbastian@mail.uni-paderborn.de \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=proljc@gmail.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=rth@twiddle.net \
    /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.