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 1/4 v3] [SH/SH4]: Add support fedisableexcept,feenableexcept, fegetexcept and feupdateenv


Hi,

Thomas Schwinge <thomas@codesourcery.com> wrote:
> With these patches applied, while there is also some improvement visible
> in the test results, I'm seeing a lot more failures in the math/*
> testsuites than without them.  I just re-confirmed this in the current
> source tree with the patches reverted.  As I have no knowledge about math
> exception handling but you evidently do -- would it be possible for you
> to review that situation?
> 
> For example, diff of current source tree vs. current source tree with
> these four patches reverted:

I haven't seen any differences in test results for those
patches.  Surely I did something wrong when testing them.
Sorry for not noticing these new failures.

It looks that almost new failures come from fraiseexcpt change:

http://sourceware.org/ml/libc-alpha/2012-04/msg00165.html

It seems that now instructions to raise execptions clear old
exception flag fields.  A quick fix maybe

--- ORIG/libc/sysdeps/sh/sh4/fpu/fraiseexcpt.c	2012-05-17 09:50:58.000000000 +0900
+++ libc/sysdeps/sh/sh4/fpu/fraiseexcpt.c	2012-05-17 09:50:34.000000000 +0900
@@ -60,6 +60,14 @@ feraiseexcept (int excepts)
     __asm__ __volatile__ ("fmul %1, %0" : "+d" (d) : "d" (x));
   }
 
+  /* Restore flag fields.  */
+  {
+    fexcept_t temp;
+    _FPU_GETCW (temp);
+    temp |= (excepts & FE_ALL_EXCEPT);
+    _FPU_SETCW (temp);
+  }
+
   return 0;
 }
 libm_hidden_def (feraiseexcept)

> Similar for math/test-double.out, math/test-ifloat.out, and
> math/test-idouble.out -- though a lot of these may be due to deficient
> ULP information, which is another topic that I (or someone else, of
> course) should have a look at (and that I have no experience with).

I'm a bit curious about what is going on these failures,
though I have almost zero experience with ULP issues.

Regards,
	kaz


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