[gmx-developers] MSVC 32bit + SSE

Roland Schulz roland at utk.edu
Tue Jul 27 00:06:54 CEST 2010


On Mon, Jul 26, 2010 at 4:06 PM, Sander Pronk <pronk at cbr.su.se> wrote:

> 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...
>
FFTW works without problems with MSVC. One can download a binary on the FFTW
website and this works. They claim one can also compile it with MSVC but I
haven't tried.
I don't mind cygwin but it is terrible slow. And don't really want to get
ICC just for occasional testing on Windows (of course mainly use Linux thus
MSVC Express is nice). But it is not such a big problem. I got the 64bit
version to compile under MSVC.

Thus I probably agree that the solution adds to much complexity if it is
just for MSVC on Win32. I understood the rant as a plan to modify every
functions with more than 3 parameters to macros. And I think my proposed
solution is better than using macros instead of inline functions. Thus I
suggest to leave it like it is but go with my solution and not macros if we
decide we want to support MSVC+Win32.

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.
>
That's true.

Roland


> 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.
>
>
>
> --
> 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.
>



-- 
ORNL/UT Center for Molecular Biophysics cmb.ornl.gov
865-241-1537, ORNL PO BOX 2008 MS6309
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20100726/38613220/attachment.html>


More information about the gromacs.org_gmx-developers mailing list