[gmx-developers] MSVC 32bit + SSE

Sander Pronk pronk at cbr.su.se
Mon Jul 26 22:06:59 CEST 2010

I just checked, and MSVC does appear to support more than 3 __m128 parameters if parameters 4 and up are pointers. Your solution would probably work, but we'd be working around - and introducing additional complexity for - a braindead compiler, on a platform where icc does the right thing.

The other issue with MSVC is that it doesn't support fftw: we might as well require icc+mkl or cygwin for Windows. People who use Windows and insist on the MSVC development environment are probably used to paying for their compiler and OS anyway... 

Once C++ is allowed, the easy solution would be to make those parameters const references, so there's no need to change the calling code.


On Jul 26, 2010, at 07:00 , Roland Schulz wrote:

> Hi,
> gmx_sse2_single.h doesn't compile with MSVC 2010 on 32bit. As the COMPILER RANT in the file states MSVC doesn't support more than 3 __m128 parameters. 
> In the rant it also says that  some compilers don't support pointers to __m128. For what compiler is this still true? If none, I suggest to change the arguments to const pointers.
> If there are still, some: Are there also compilers which don't support either pointers nor unlimited __m128 parameters?
> If not, I suggest a mixed approach. Where we detect which version is supported and use macros to have to write each function only once. See the below example. I think this is much less error prone than converting all functions to macros as the rant suggests. Mainly because of the double evaluation pitfall of macros. 
> Roland
> sample:
> #include <xmmintrin.h>
> #ifdef SSE_POINTER
> #define SSE_M128(a) const __m128 *a
> #define SSE_REF(a) (&a)
> #define SSE_IND(a) (*a)
> #else
> #define SSE_M128(a) __m128 a
> #define SSE_REF(a) (a)
> #define SSE_IND(a) (a)
> #endif
> static inline void f(SSE_M128(b)) {
>   __m128 x = SSE_IND(b);
> }
> int main() {
>   __m128 x;
>   f(SSE_REF(x));
>   return 0;
> }
> -- 
> ORNL/UT Center for Molecular Biophysics cmb.ornl.gov
> 865-241-1537, ORNL PO BOX 2008 MS6309
> -- 
> gmx-developers mailing list
> gmx-developers at gromacs.org
> http://lists.gromacs.org/mailman/listinfo/gmx-developers
> Please don't post (un)subscribe requests to the list. Use the 
> www interface or send it to gmx-developers-request at gromacs.org.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20100726/f1dbfcb5/attachment.html>

More information about the gromacs.org_gmx-developers mailing list