Skip to content

Commit

Permalink
Use portable SIMD vectors as a backup (openmm#4328)
Browse files Browse the repository at this point in the history
* Use portable SIMD vectors as a backup

* Remove old file

* Try to fix compilation error on Windows
  • Loading branch information
peastman authored Dec 12, 2023
1 parent 5739788 commit 4717c84
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions openmmapi/include/openmm/internal/vectorize.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2014-2018 Stanford University and the Authors. *
* Portions copyright (c) 2014-2023 Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
Expand All @@ -36,8 +36,10 @@
#include "vectorize_neon.h"
#elif defined(__PPC__)
#include "vectorize_ppc.h"
#else
#elif defined(__SSE__) || defined(_M_IX86) || defined(_M_AMD64)
#include "vectorize_sse.h"
#else
#include "vectorize_portable.h"
#endif

#endif /*OPENMM_VECTORIZE_H_*/
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef OPENMM_VECTORIZE_PNACL_H_
#define OPENMM_VECTORIZE_PNACL_H_
#ifndef OPENMM_VECTORIZE_PORTABLE_H_
#define OPENMM_VECTORIZE_PORTABLE_H_

/* -------------------------------------------------------------------------- *
* OpenMM *
Expand All @@ -9,7 +9,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2013-2015 Stanford University and the Authors. *
* Portions copyright (c) 2013-2023 Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
Expand Down Expand Up @@ -362,7 +362,7 @@ static inline fvec4 operator/(float v1, fvec4 v2) {
// Operations for blending fvec4s based on an ivec4.

static inline fvec4 blend(fvec4 v1, fvec4 v2, __m128i mask) {
return (__m128) ((mask&(__m128i)v2) + ((ivec4(0xFFFFFFFF)-ivec4(mask))&(__m128i)v1));
return mask ? v2.val : v1.val;
}

static inline fvec4 blendZero(fvec4 v, ivec4 mask) {
Expand Down Expand Up @@ -454,5 +454,5 @@ static inline fvec4 reduceToVec3(fvec4 x, fvec4 y, fvec4 z) {
return fvec4(nx, ny, nz, 0.0);
}

#endif /*OPENMM_VECTORIZE_PNACL_H_*/
#endif /*OPENMM_VECTORIZE_PORTABLE_H_*/

0 comments on commit 4717c84

Please sign in to comment.