qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] ARM: Detect FP tininess before rounding
@ 2011-04-12 12:56 Peter Maydell
  2011-04-12 12:56 ` [Qemu-devel] [PATCH 1/2] softfloat: Add setter function for tininess detection mode Peter Maydell
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Peter Maydell @ 2011-04-12 12:56 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

Softfloat supports two kinds of FP tininess detection: before and
after rounding (corresponding to the two behaviours permitted by
IEEE754). The ARM architecture mandates detection before rounding,
so set the flag appropriately. I had to add a setter function
for this, since there wasn't one already.

Peter Maydell (2):
  softfloat: Add setter function for tininess detection mode
  target-arm: Detect tininess before rounding for FP operations

 fpu/softfloat.h     |    4 ++++
 target-arm/helper.c |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)

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

* [Qemu-devel] [PATCH 1/2] softfloat: Add setter function for tininess detection mode
  2011-04-12 12:56 [Qemu-devel] [PATCH 0/2] ARM: Detect FP tininess before rounding Peter Maydell
@ 2011-04-12 12:56 ` Peter Maydell
  2011-04-12 12:56 ` [Qemu-devel] [PATCH 2/2] target-arm: Detect tininess before rounding for FP operations Peter Maydell
  2011-04-12 21:35 ` [Qemu-devel] [PATCH 0/2] ARM: Detect FP tininess before rounding Aurelien Jarno
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2011-04-12 12:56 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

Add a setter function for the underflow tininess detection mode,
in line with the similar functions for other parts of the float status
structure.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 fpu/softfloat.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/fpu/softfloat.h b/fpu/softfloat.h
index 90f4250..618537e 100644
--- a/fpu/softfloat.h
+++ b/fpu/softfloat.h
@@ -211,6 +211,10 @@ typedef struct float_status {
 
 void set_float_rounding_mode(int val STATUS_PARAM);
 void set_float_exception_flags(int val STATUS_PARAM);
+INLINE void set_float_detect_tininess(int val STATUS_PARAM)
+{
+    STATUS(float_detect_tininess) = val;
+}
 INLINE void set_flush_to_zero(flag val STATUS_PARAM)
 {
     STATUS(flush_to_zero) = val;
-- 
1.7.1

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

* [Qemu-devel] [PATCH 2/2] target-arm: Detect tininess before rounding for FP operations
  2011-04-12 12:56 [Qemu-devel] [PATCH 0/2] ARM: Detect FP tininess before rounding Peter Maydell
  2011-04-12 12:56 ` [Qemu-devel] [PATCH 1/2] softfloat: Add setter function for tininess detection mode Peter Maydell
@ 2011-04-12 12:56 ` Peter Maydell
  2011-04-12 21:35 ` [Qemu-devel] [PATCH 0/2] ARM: Detect FP tininess before rounding Aurelien Jarno
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2011-04-12 12:56 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

The ARM architecture mandates that we detect tininess before rounding,
so set the softfloat fp_status up appropriately.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target-arm/helper.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/target-arm/helper.c b/target-arm/helper.c
index ce9a9d8..9172fc7 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -269,6 +269,10 @@ void cpu_reset(CPUARMState *env)
     set_flush_to_zero(1, &env->vfp.standard_fp_status);
     set_flush_inputs_to_zero(1, &env->vfp.standard_fp_status);
     set_default_nan_mode(1, &env->vfp.standard_fp_status);
+    set_float_detect_tininess(float_tininess_before_rounding,
+                              &env->vfp.fp_status);
+    set_float_detect_tininess(float_tininess_before_rounding,
+                              &env->vfp.standard_fp_status);
     tlb_flush(env, 1);
 }
 
-- 
1.7.1

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

* Re: [Qemu-devel] [PATCH 0/2] ARM: Detect FP tininess before rounding
  2011-04-12 12:56 [Qemu-devel] [PATCH 0/2] ARM: Detect FP tininess before rounding Peter Maydell
  2011-04-12 12:56 ` [Qemu-devel] [PATCH 1/2] softfloat: Add setter function for tininess detection mode Peter Maydell
  2011-04-12 12:56 ` [Qemu-devel] [PATCH 2/2] target-arm: Detect tininess before rounding for FP operations Peter Maydell
@ 2011-04-12 21:35 ` Aurelien Jarno
  2 siblings, 0 replies; 4+ messages in thread
From: Aurelien Jarno @ 2011-04-12 21:35 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel, patches

On Tue, Apr 12, 2011 at 01:56:39PM +0100, Peter Maydell wrote:
> Softfloat supports two kinds of FP tininess detection: before and
> after rounding (corresponding to the two behaviours permitted by
> IEEE754). The ARM architecture mandates detection before rounding,
> so set the flag appropriately. I had to add a setter function
> for this, since there wasn't one already.
> 
> Peter Maydell (2):
>   softfloat: Add setter function for tininess detection mode
>   target-arm: Detect tininess before rounding for FP operations
> 
>  fpu/softfloat.h     |    4 ++++
>  target-arm/helper.c |    4 ++++
>  2 files changed, 8 insertions(+), 0 deletions(-)
> 
> 

Thanks, both applied.

-- 
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

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

end of thread, other threads:[~2011-04-13  1:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-12 12:56 [Qemu-devel] [PATCH 0/2] ARM: Detect FP tininess before rounding Peter Maydell
2011-04-12 12:56 ` [Qemu-devel] [PATCH 1/2] softfloat: Add setter function for tininess detection mode Peter Maydell
2011-04-12 12:56 ` [Qemu-devel] [PATCH 2/2] target-arm: Detect tininess before rounding for FP operations Peter Maydell
2011-04-12 21:35 ` [Qemu-devel] [PATCH 0/2] ARM: Detect FP tininess before rounding Aurelien Jarno

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