qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] target/ppc: Set float_tininess_before_rounding at cpu reset
@ 2019-08-27  2:00 Richard Henderson
  2019-08-27  3:41 ` David Gibson
  2019-08-27  4:13 ` Paul Clarke
  0 siblings, 2 replies; 3+ messages in thread
From: Richard Henderson @ 2019-08-27  2:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-ppc, pc, david

As defined in Power 3.0 section 4.4.4 "Underflow Exception",
a tiny result is detected before rounding.

Fixes: https://bugs.launchpad.net/qemu/+bug/1841491
Reported-by: Paul Clarke <pc@us.ibm.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/ppc/translate_init.inc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.inc.c
index 4a21ed7289..023138c2f9 100644
--- a/target/ppc/translate_init.inc.c
+++ b/target/ppc/translate_init.inc.c
@@ -10461,6 +10461,10 @@ static void ppc_cpu_reset(CPUState *s)
     s->exception_index = POWERPC_EXCP_NONE;
     env->error_code = 0;
 
+    /* tininess for underflow is detected before rounding */
+    set_float_detect_tininess(float_tininess_before_rounding,
+                              &env->fp_status);
+
     for (i = 0; i < ARRAY_SIZE(env->spr_cb); i++) {
         ppc_spr_t *spr = &env->spr_cb[i];
 
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] target/ppc: Set float_tininess_before_rounding at cpu reset
  2019-08-27  2:00 [Qemu-devel] [PATCH] target/ppc: Set float_tininess_before_rounding at cpu reset Richard Henderson
@ 2019-08-27  3:41 ` David Gibson
  2019-08-27  4:13 ` Paul Clarke
  1 sibling, 0 replies; 3+ messages in thread
From: David Gibson @ 2019-08-27  3:41 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-ppc, qemu-devel, pc

[-- Attachment #1: Type: text/plain, Size: 1320 bytes --]

On Mon, Aug 26, 2019 at 07:00:13PM -0700, Richard Henderson wrote:
> As defined in Power 3.0 section 4.4.4 "Underflow Exception",
> a tiny result is detected before rounding.
> 
> Fixes: https://bugs.launchpad.net/qemu/+bug/1841491
> Reported-by: Paul Clarke <pc@us.ibm.com>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

Applied to ppc-for-4.2, thanks.

> ---
>  target/ppc/translate_init.inc.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.inc.c
> index 4a21ed7289..023138c2f9 100644
> --- a/target/ppc/translate_init.inc.c
> +++ b/target/ppc/translate_init.inc.c
> @@ -10461,6 +10461,10 @@ static void ppc_cpu_reset(CPUState *s)
>      s->exception_index = POWERPC_EXCP_NONE;
>      env->error_code = 0;
>  
> +    /* tininess for underflow is detected before rounding */
> +    set_float_detect_tininess(float_tininess_before_rounding,
> +                              &env->fp_status);
> +
>      for (i = 0; i < ARRAY_SIZE(env->spr_cb); i++) {
>          ppc_spr_t *spr = &env->spr_cb[i];
>  

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] target/ppc: Set float_tininess_before_rounding at cpu reset
  2019-08-27  2:00 [Qemu-devel] [PATCH] target/ppc: Set float_tininess_before_rounding at cpu reset Richard Henderson
  2019-08-27  3:41 ` David Gibson
@ 2019-08-27  4:13 ` Paul Clarke
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Clarke @ 2019-08-27  4:13 UTC (permalink / raw)
  To: Richard Henderson, qemu-devel; +Cc: qemu-ppc, david

On 8/26/19 9:00 PM, Richard Henderson wrote:
> As defined in Power 3.0 section 4.4.4 "Underflow Exception",
> a tiny result is detected before rounding.

Responded in the bug:
https://bugs.launchpad.net/qemu/+bug/1841491/comments/3

In my testing, this works for "double", but not "float".

> Fixes: https://bugs.launchpad.net/qemu/+bug/1841491 
> Reported-by: Paul Clarke <pc@us.ibm.com>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/ppc/translate_init.inc.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.inc.c
> index 4a21ed7289..023138c2f9 100644
> --- a/target/ppc/translate_init.inc.c
> +++ b/target/ppc/translate_init.inc.c
> @@ -10461,6 +10461,10 @@ static void ppc_cpu_reset(CPUState *s)
>      s->exception_index = POWERPC_EXCP_NONE;
>      env->error_code = 0;
>  
> +    /* tininess for underflow is detected before rounding */
> +    set_float_detect_tininess(float_tininess_before_rounding,
> +                              &env->fp_status);
> +
>      for (i = 0; i < ARRAY_SIZE(env->spr_cb); i++) {
>          ppc_spr_t *spr = &env->spr_cb[i];

PC


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-08-27  4:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-27  2:00 [Qemu-devel] [PATCH] target/ppc: Set float_tininess_before_rounding at cpu reset Richard Henderson
2019-08-27  3:41 ` David Gibson
2019-08-27  4:13 ` Paul Clarke

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).