Fix port of gapsys-LJ to simd.
[alexxy/gromacs.git] / src / gromacs / gmxlib / nonbonded / nb_softcore.h
index 2fc4754cc24652ef6eec085eb6d49656290914d6..8bd817cbfb2d8d1582ca4f127ce280a5671f7a15 100644 (file)
@@ -250,9 +250,9 @@ static inline void lennardJonesQuadraticPotential(const RealType c6,
                                 * ((6.5_real * rInv14C - rInv8C) - (13 * rInv13C - 2. * rInv7C)
                                    + (6.5_real * rInv12C - rInv6C));
 
-            *potential = *potential
-                         + gmx::selectByMask(((c12s * repulsionShift) - (c6s * dispersionShift)),
-                                             computeValues);
+            potentialQuad = potentialQuad
+                             + gmx::selectByMask(((c12s * repulsionShift) - (c6s * dispersionShift)),
+                                                 computeValues);
             *force     = gmx::blend(*force, forceQuad, computeValues);
             *potential = gmx::blend(*potential, potentialQuad, computeValues);
             *dvdl      = *dvdl + gmx::selectByMask(dvdlQuad, computeValues);