[xiph-commits] r17988 - trunk/chirptest

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Mon May 16 22:08:04 PDT 2011


Author: xiphmont
Date: 2011-05-16 22:08:04 -0700 (Mon, 16 May 2011)
New Revision: 17988

Modified:
   trunk/chirptest/chirptest.c
Log:
Move FPU exception setup out of threads into main process.



Modified: trunk/chirptest/chirptest.c
===================================================================
--- trunk/chirptest/chirptest.c	2011-05-17 05:01:42 UTC (rev 17987)
+++ trunk/chirptest/chirptest.c	2011-05-17 05:08:04 UTC (rev 17988)
@@ -405,8 +405,7 @@
   colarg *arg = (colarg *)in;
   int blocksize=arg->blocksize;
   int y,i,ret;
-  int except;
-            float *cv = malloc(sizeof(*cv)*blocksize);
+  float *cv = malloc(sizeof(*cv)*blocksize);
   int cimult=(arg->alt_chirp_p?2:1);
   int ym;
 
@@ -448,11 +447,6 @@
       }
     }
 
-    except=fegetexcept();
-    fedisableexcept(FE_INEXACT);
-    fedisableexcept(FE_UNDERFLOW);
-    feenableexcept(FE_ALL_EXCEPT & ~(FE_INEXACT|FE_UNDERFLOW));
-
     ret=estimate_chirps(cv,arg->window,blocksize,
                         arg->estimate+ym,cimult,
                         arg->fit_tolerance,
@@ -489,8 +483,6 @@
     arg->ssq_energy[y] = energy_acc;
     arg->ssq_error[y] = error_acc;
     arg->iterations[y] = arg->max_iterations-ret;
-    feclearexcept(FE_ALL_EXCEPT);
-    feenableexcept(except);
   }
 
   free(cv);
@@ -1409,8 +1401,14 @@
   int ydB=0;
 
   char *filebase;
+  int except;
+  struct timeval last;
 
-  struct timeval last;
+  except=fegetexcept();
+  fedisableexcept(FE_INEXACT);
+  fedisableexcept(FE_UNDERFLOW);
+  feenableexcept(FE_ALL_EXCEPT & ~(FE_INEXACT|FE_UNDERFLOW));
+
   gettimeofday(&last,NULL);
   setup_titles_1chirp(arg);
 
@@ -2486,6 +2484,9 @@
   destroy_page(cddA_d);
   destroy_page(cRMS_d);
 
+  feclearexcept(FE_ALL_EXCEPT);
+  feenableexcept(except);
+
   fprintf(stderr," done\n");
 }
 



More information about the commits mailing list