Changed SSE typecasts back to #defines for portability; also a couple redirect fixes.
authorPeter Kasson <kasson@DN0a20fb20.SUNet>
Mon, 14 Dec 2009 16:22:46 +0000 (08:22 -0800)
committerPeter Kasson <kasson@DN0a20fb20.SUNet>
Mon, 14 Dec 2009 16:22:46 +0000 (08:22 -0800)
include/gmx_sse2_single.h
src/gmxlib/futil.c
src/kernel/md.c

index 597a0b8643abe34e8ae9097b5217cb6170eaab74..0f1d1b10147d6eee5806fbd3177d32095defcf14 100644 (file)
@@ -243,26 +243,26 @@ gmx_mm_exp_ps(__m128 x)
        __m128 xmm0,xmm1;
        __m128i xmm2;
        
-       xmm0 = _mm_mul_ps(x,(__m128) CC);
-       xmm1 = _mm_sub_ps(xmm0, (__m128) half);
+       xmm0 = _mm_mul_ps(x,gmx_mm_castsi128_ps(CC));
+       xmm1 = _mm_sub_ps(xmm0, gmx_mm_castsi128_ps(half));
        xmm2 = _mm_cvtps_epi32(xmm1); 
        xmm1 = _mm_cvtepi32_ps(xmm2); 
        
-       xmm2 = _mm_add_epi32(xmm2,(__m128i) base);
+       xmm2 = _mm_add_epi32(xmm2,gmx_mm_castps_si128(base));
        xmm2 = _mm_slli_epi32(xmm2,23);
        
        xmm0 = _mm_sub_ps(xmm0,xmm1);
-       xmm1 = _mm_mul_ps(xmm0,(__m128) D5);
-       xmm1 = _mm_add_ps(xmm1,(__m128) D4);
+       xmm1 = _mm_mul_ps(xmm0,gmx_mm_castsi128_ps( D5));
+       xmm1 = _mm_add_ps(xmm1,gmx_mm_castsi128_ps(D4));
        xmm1 = _mm_mul_ps(xmm1,xmm0);
-       xmm1 = _mm_add_ps(xmm1,(__m128) D3);
+       xmm1 = _mm_add_ps(xmm1,gmx_mm_castsi128_ps(D3));
        xmm1 = _mm_mul_ps(xmm1,xmm0);
-       xmm1 = _mm_add_ps(xmm1,(__m128) D2);
+       xmm1 = _mm_add_ps(xmm1,gmx_mm_castsi128_ps(D2));
        xmm1 = _mm_mul_ps(xmm1,xmm0);
-       xmm1 = _mm_add_ps(xmm1,(__m128) D1);
+       xmm1 = _mm_add_ps(xmm1,gmx_mm_castsi128_ps(D1));
        xmm1 = _mm_mul_ps(xmm1,xmm0);
-       xmm1 = _mm_add_ps(xmm1,(__m128) D0);
-       xmm1 = _mm_mul_ps(xmm1,(__m128) xmm2);
+       xmm1 = _mm_add_ps(xmm1,gmx_mm_castsi128_ps(D0));
+       xmm1 = _mm_mul_ps(xmm1,gmx_mm_castsi128_ps(xmm2));
        
        /* 18 instructions currently */
        return xmm1;
index 24950f8775f7961c7e5a5d75445c0694550f8ace..7f67f0fefd2fee2613ded2b82ff30f16aeb2e246 100644 (file)
@@ -107,15 +107,15 @@ void push_ps(FILE *fp)
 
 #ifdef GMX_FAHCORE
 /* don't use pipes!*/
-#define popen(x,y) fah_fopen(x,y)
-#define pclose(x) fah_fclose(x)
+#define popen fah_fopen
+#define pclose fah_fclose
 #else
 #ifdef ffclose
 #undef ffclose
 #endif
 #endif
 
-
+#ifndef GMX_FAHCORE
 #ifndef HAVE_PIPES
 static FILE *popen(const char *nm,const char *mode)
 {
@@ -131,7 +131,7 @@ static int pclose(FILE *fp)
     return 0;
 }
 #endif
-
+#endif
 
 #ifndef SKIP_FFOPS
 int ffclose(FILE *fp)
@@ -486,6 +486,9 @@ bool get_libdir(char *libdir)
     bool found=FALSE;
     int i;
 
+    if (Program() != NULL)
+    {
+
     /* First - detect binary name */
     strncpy(bin_name,Program(),512);
 
@@ -564,6 +567,7 @@ bool get_libdir(char *libdir)
             found=search_subdirs(full_path,libdir);
         }
     }
+    }
     /* End of smart searching. If we didn't find it in our parent tree,
      * or if the program name wasn't set, at least try some standard 
      * locations before giving up, in case we are running from e.g. 
index 1dc89608db706f240741c97f2caaf45431046fc8..df765e45f1ae3a02339474d4a2dc303d1ef69a60 100644 (file)
@@ -1833,7 +1833,6 @@ double do_md(FILE *fplog,t_commrec *cr,int nfile,const t_filenm fnm[],
         bX = bX || bLastStep; /*enforce writing positions and velocities 
                                 at end of run */
         bV = bV || bLastStep;
-        bXTC = bXTC || bLastStep;
         {
             int nthreads=(cr->nthreads==0 ? 1 : cr->nthreads);
             int nnodes=(cr->nnodes==0 ? 1 : cr->nnodes);