This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch][sh] FP exception control.


On 12/05/10 10:17, Andrew Stubbs wrote:
Ok, fixed and attached.

Apparently I was only half right. Now attached.


Andrew
2010-05-12  Andrew Stubbs  <ams@codesourcery.com>

	* sysdeps/sh/sh4/fpu/feholdexcpt.c (feholdexcept): Really disable all
	exceptions.  Return 0.

---
 .../sysdeps/sh/sh4/fpu/feholdexcpt.c               |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/glibc-mainline/sysdeps/sh/sh4/fpu/feholdexcpt.c b/src/glibc-mainline/sysdeps/sh/sh4/fpu/feholdexcpt.c
index 7aac5a0..87d6420 100644
--- a/src/glibc-mainline/sysdeps/sh/sh4/fpu/feholdexcpt.c
+++ b/src/glibc-mainline/sysdeps/sh/sh4/fpu/feholdexcpt.c
@@ -1,5 +1,6 @@
 /* Store current floating-point environment and clear exceptions.
-   Copyright (C) 1997, 1998, 1999, 2000, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 1999, 2000, 2005, 2010
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -29,10 +30,15 @@ feholdexcept (fenv_t *envp)
   _FPU_GETCW (temp);
   envp->__fpscr = temp;
 
-  /* Now set all exceptions to non-stop.  */
+  /* Clear the status flags.  */
   temp &= ~FE_ALL_EXCEPT;
+
+  /* Now set all exceptions to non-stop.  */
+  temp &= ~(FE_ALL_EXCEPT << 5);
+
   _FPU_SETCW (temp);
 
-  return 1;
+  /* Success.  */
+  return 0;
 }
 libm_hidden_def (feholdexcept)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]