Bug Summary

File:gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRFCut_VdwCSTab_GeomW3W3_sse4_1_single.c
Location:line 121, column 22
Description:Value stored to 'two' during its initialization is never read

Annotated Source Code

1/*
2 * This file is part of the GROMACS molecular simulation package.
3 *
4 * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
5 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6 * and including many others, as listed in the AUTHORS file in the
7 * top-level source directory and at http://www.gromacs.org.
8 *
9 * GROMACS is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 2.1
12 * of the License, or (at your option) any later version.
13 *
14 * GROMACS is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with GROMACS; if not, see
21 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 *
24 * If you want to redistribute modifications to GROMACS, please
25 * consider that scientific software is very special. Version
26 * control is crucial - bugs must be traceable. We will be happy to
27 * consider code for inclusion in the official distribution, but
28 * derived work must not be called official GROMACS. Details are found
29 * in the README & COPYING files - if they are missing, get the
30 * official version at http://www.gromacs.org.
31 *
32 * To help us fund GROMACS development, we humbly ask that you cite
33 * the research papers on the package. Check out http://www.gromacs.org.
34 */
35/*
36 * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
37 */
38#ifdef HAVE_CONFIG_H1
39#include <config.h>
40#endif
41
42#include <math.h>
43
44#include "../nb_kernel.h"
45#include "types/simple.h"
46#include "gromacs/math/vec.h"
47#include "nrnb.h"
48
49#include "gromacs/simd/math_x86_sse4_1_single.h"
50#include "kernelutil_x86_sse4_1_single.h"
51
52/*
53 * Gromacs nonbonded kernel: nb_kernel_ElecRFCut_VdwCSTab_GeomW3W3_VF_sse4_1_single
54 * Electrostatics interaction: ReactionField
55 * VdW interaction: CubicSplineTable
56 * Geometry: Water3-Water3
57 * Calculate force/pot: PotentialAndForce
58 */
59void
60nb_kernel_ElecRFCut_VdwCSTab_GeomW3W3_VF_sse4_1_single
61 (t_nblist * gmx_restrict nlist,
62 rvec * gmx_restrict xx,
63 rvec * gmx_restrict ff,
64 t_forcerec * gmx_restrict fr,
65 t_mdatoms * gmx_restrict mdatoms,
66 nb_kernel_data_t gmx_unused__attribute__ ((unused)) * gmx_restrict kernel_data,
67 t_nrnb * gmx_restrict nrnb)
68{
69 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
70 * just 0 for non-waters.
71 * Suffixes A,B,C,D refer to j loop unrolling done with SSE, e.g. for the four different
72 * jnr indices corresponding to data put in the four positions in the SIMD register.
73 */
74 int i_shift_offset,i_coord_offset,outeriter,inneriter;
75 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
76 int jnrA,jnrB,jnrC,jnrD;
77 int jnrlistA,jnrlistB,jnrlistC,jnrlistD;
78 int j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
79 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
80 real rcutoff_scalar;
81 real *shiftvec,*fshift,*x,*f;
82 real *fjptrA,*fjptrB,*fjptrC,*fjptrD;
83 real scratch[4*DIM3];
84 __m128 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
85 int vdwioffset0;
86 __m128 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
87 int vdwioffset1;
88 __m128 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
89 int vdwioffset2;
90 __m128 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
91 int vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
92 __m128 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
93 int vdwjidx1A,vdwjidx1B,vdwjidx1C,vdwjidx1D;
94 __m128 jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
95 int vdwjidx2A,vdwjidx2B,vdwjidx2C,vdwjidx2D;
96 __m128 jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
97 __m128 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
98 __m128 dx01,dy01,dz01,rsq01,rinv01,rinvsq01,r01,qq01,c6_01,c12_01;
99 __m128 dx02,dy02,dz02,rsq02,rinv02,rinvsq02,r02,qq02,c6_02,c12_02;
100 __m128 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
101 __m128 dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11;
102 __m128 dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12;
103 __m128 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
104 __m128 dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21;
105 __m128 dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22;
106 __m128 velec,felec,velecsum,facel,crf,krf,krf2;
107 real *charge;
108 int nvdwtype;
109 __m128 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
110 int *vdwtype;
111 real *vdwparam;
112 __m128 one_sixth = _mm_set1_ps(1.0/6.0);
113 __m128 one_twelfth = _mm_set1_ps(1.0/12.0);
114 __m128i vfitab;
115 __m128i ifour = _mm_set1_epi32(4);
116 __m128 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
117 real *vftab;
118 __m128 dummy_mask,cutoff_mask;
119 __m128 signbit = _mm_castsi128_ps( _mm_set1_epi32(0x80000000) );
120 __m128 one = _mm_set1_ps(1.0);
121 __m128 two = _mm_set1_ps(2.0);
Value stored to 'two' during its initialization is never read
122 x = xx[0];
123 f = ff[0];
124
125 nri = nlist->nri;
126 iinr = nlist->iinr;
127 jindex = nlist->jindex;
128 jjnr = nlist->jjnr;
129 shiftidx = nlist->shift;
130 gid = nlist->gid;
131 shiftvec = fr->shift_vec[0];
132 fshift = fr->fshift[0];
133 facel = _mm_set1_ps(fr->epsfac);
134 charge = mdatoms->chargeA;
135 krf = _mm_set1_ps(fr->ic->k_rf);
136 krf2 = _mm_set1_ps(fr->ic->k_rf*2.0);
137 crf = _mm_set1_ps(fr->ic->c_rf);
138 nvdwtype = fr->ntype;
139 vdwparam = fr->nbfp;
140 vdwtype = mdatoms->typeA;
141
142 vftab = kernel_data->table_vdw->data;
143 vftabscale = _mm_set1_ps(kernel_data->table_vdw->scale);
144
145 /* Setup water-specific parameters */
146 inr = nlist->iinr[0];
147 iq0 = _mm_mul_ps(facel,_mm_set1_ps(charge[inr+0]));
148 iq1 = _mm_mul_ps(facel,_mm_set1_ps(charge[inr+1]));
149 iq2 = _mm_mul_ps(facel,_mm_set1_ps(charge[inr+2]));
150 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
151
152 jq0 = _mm_set1_ps(charge[inr+0]);
153 jq1 = _mm_set1_ps(charge[inr+1]);
154 jq2 = _mm_set1_ps(charge[inr+2]);
155 vdwjidx0A = 2*vdwtype[inr+0];
156 qq00 = _mm_mul_ps(iq0,jq0);
157 c6_00 = _mm_set1_ps(vdwparam[vdwioffset0+vdwjidx0A]);
158 c12_00 = _mm_set1_ps(vdwparam[vdwioffset0+vdwjidx0A+1]);
159 qq01 = _mm_mul_ps(iq0,jq1);
160 qq02 = _mm_mul_ps(iq0,jq2);
161 qq10 = _mm_mul_ps(iq1,jq0);
162 qq11 = _mm_mul_ps(iq1,jq1);
163 qq12 = _mm_mul_ps(iq1,jq2);
164 qq20 = _mm_mul_ps(iq2,jq0);
165 qq21 = _mm_mul_ps(iq2,jq1);
166 qq22 = _mm_mul_ps(iq2,jq2);
167
168 /* When we use explicit cutoffs the value must be identical for elec and VdW, so use elec as an arbitrary choice */
169 rcutoff_scalar = fr->rcoulomb;
170 rcutoff = _mm_set1_ps(rcutoff_scalar);
171 rcutoff2 = _mm_mul_ps(rcutoff,rcutoff);
172
173 /* Avoid stupid compiler warnings */
174 jnrA = jnrB = jnrC = jnrD = 0;
175 j_coord_offsetA = 0;
176 j_coord_offsetB = 0;
177 j_coord_offsetC = 0;
178 j_coord_offsetD = 0;
179
180 outeriter = 0;
181 inneriter = 0;
182
183 for(iidx=0;iidx<4*DIM3;iidx++)
184 {
185 scratch[iidx] = 0.0;
186 }
187
188 /* Start outer loop over neighborlists */
189 for(iidx=0; iidx<nri; iidx++)
190 {
191 /* Load shift vector for this list */
192 i_shift_offset = DIM3*shiftidx[iidx];
193
194 /* Load limits for loop over neighbors */
195 j_index_start = jindex[iidx];
196 j_index_end = jindex[iidx+1];
197
198 /* Get outer coordinate index */
199 inr = iinr[iidx];
200 i_coord_offset = DIM3*inr;
201
202 /* Load i particle coords and add shift vector */
203 gmx_mm_load_shift_and_3rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,
204 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2);
205
206 fix0 = _mm_setzero_ps();
207 fiy0 = _mm_setzero_ps();
208 fiz0 = _mm_setzero_ps();
209 fix1 = _mm_setzero_ps();
210 fiy1 = _mm_setzero_ps();
211 fiz1 = _mm_setzero_ps();
212 fix2 = _mm_setzero_ps();
213 fiy2 = _mm_setzero_ps();
214 fiz2 = _mm_setzero_ps();
215
216 /* Reset potential sums */
217 velecsum = _mm_setzero_ps();
218 vvdwsum = _mm_setzero_ps();
219
220 /* Start inner kernel loop */
221 for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
222 {
223
224 /* Get j neighbor index, and coordinate index */
225 jnrA = jjnr[jidx];
226 jnrB = jjnr[jidx+1];
227 jnrC = jjnr[jidx+2];
228 jnrD = jjnr[jidx+3];
229 j_coord_offsetA = DIM3*jnrA;
230 j_coord_offsetB = DIM3*jnrB;
231 j_coord_offsetC = DIM3*jnrC;
232 j_coord_offsetD = DIM3*jnrD;
233
234 /* load j atom coordinates */
235 gmx_mm_load_3rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
236 x+j_coord_offsetC,x+j_coord_offsetD,
237 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,&jy2,&jz2);
238
239 /* Calculate displacement vector */
240 dx00 = _mm_sub_ps(ix0,jx0);
241 dy00 = _mm_sub_ps(iy0,jy0);
242 dz00 = _mm_sub_ps(iz0,jz0);
243 dx01 = _mm_sub_ps(ix0,jx1);
244 dy01 = _mm_sub_ps(iy0,jy1);
245 dz01 = _mm_sub_ps(iz0,jz1);
246 dx02 = _mm_sub_ps(ix0,jx2);
247 dy02 = _mm_sub_ps(iy0,jy2);
248 dz02 = _mm_sub_ps(iz0,jz2);
249 dx10 = _mm_sub_ps(ix1,jx0);
250 dy10 = _mm_sub_ps(iy1,jy0);
251 dz10 = _mm_sub_ps(iz1,jz0);
252 dx11 = _mm_sub_ps(ix1,jx1);
253 dy11 = _mm_sub_ps(iy1,jy1);
254 dz11 = _mm_sub_ps(iz1,jz1);
255 dx12 = _mm_sub_ps(ix1,jx2);
256 dy12 = _mm_sub_ps(iy1,jy2);
257 dz12 = _mm_sub_ps(iz1,jz2);
258 dx20 = _mm_sub_ps(ix2,jx0);
259 dy20 = _mm_sub_ps(iy2,jy0);
260 dz20 = _mm_sub_ps(iz2,jz0);
261 dx21 = _mm_sub_ps(ix2,jx1);
262 dy21 = _mm_sub_ps(iy2,jy1);
263 dz21 = _mm_sub_ps(iz2,jz1);
264 dx22 = _mm_sub_ps(ix2,jx2);
265 dy22 = _mm_sub_ps(iy2,jy2);
266 dz22 = _mm_sub_ps(iz2,jz2);
267
268 /* Calculate squared distance and things based on it */
269 rsq00 = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
270 rsq01 = gmx_mm_calc_rsq_ps(dx01,dy01,dz01);
271 rsq02 = gmx_mm_calc_rsq_ps(dx02,dy02,dz02);
272 rsq10 = gmx_mm_calc_rsq_ps(dx10,dy10,dz10);
273 rsq11 = gmx_mm_calc_rsq_ps(dx11,dy11,dz11);
274 rsq12 = gmx_mm_calc_rsq_ps(dx12,dy12,dz12);
275 rsq20 = gmx_mm_calc_rsq_ps(dx20,dy20,dz20);
276 rsq21 = gmx_mm_calc_rsq_ps(dx21,dy21,dz21);
277 rsq22 = gmx_mm_calc_rsq_ps(dx22,dy22,dz22);
278
279 rinv00 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq00);
280 rinv01 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq01);
281 rinv02 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq02);
282 rinv10 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq10);
283 rinv11 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq11);
284 rinv12 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq12);
285 rinv20 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq20);
286 rinv21 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq21);
287 rinv22 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq22);
288
289 rinvsq00 = _mm_mul_ps(rinv00,rinv00);
290 rinvsq01 = _mm_mul_ps(rinv01,rinv01);
291 rinvsq02 = _mm_mul_ps(rinv02,rinv02);
292 rinvsq10 = _mm_mul_ps(rinv10,rinv10);
293 rinvsq11 = _mm_mul_ps(rinv11,rinv11);
294 rinvsq12 = _mm_mul_ps(rinv12,rinv12);
295 rinvsq20 = _mm_mul_ps(rinv20,rinv20);
296 rinvsq21 = _mm_mul_ps(rinv21,rinv21);
297 rinvsq22 = _mm_mul_ps(rinv22,rinv22);
298
299 fjx0 = _mm_setzero_ps();
300 fjy0 = _mm_setzero_ps();
301 fjz0 = _mm_setzero_ps();
302 fjx1 = _mm_setzero_ps();
303 fjy1 = _mm_setzero_ps();
304 fjz1 = _mm_setzero_ps();
305 fjx2 = _mm_setzero_ps();
306 fjy2 = _mm_setzero_ps();
307 fjz2 = _mm_setzero_ps();
308
309 /**************************
310 * CALCULATE INTERACTIONS *
311 **************************/
312
313 if (gmx_mm_any_lt(rsq00,rcutoff2))
314 {
315
316 r00 = _mm_mul_ps(rsq00,rinv00);
317
318 /* Calculate table index by multiplying r with table scale and truncate to integer */
319 rt = _mm_mul_ps(r00,vftabscale);
320 vfitab = _mm_cvttps_epi32(rt);
321 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
322 vfitab = _mm_slli_epi32(vfitab,3);
323
324 /* REACTION-FIELD ELECTROSTATICS */
325 velec = _mm_mul_ps(qq00,_mm_sub_ps(_mm_add_ps(rinv00,_mm_mul_ps(krf,rsq00)),crf));
326 felec = _mm_mul_ps(qq00,_mm_sub_ps(_mm_mul_ps(rinv00,rinvsq00),krf2));
327
328 /* CUBIC SPLINE TABLE DISPERSION */
329 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
330 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
331 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
332 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
333 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
334 Heps = _mm_mul_ps(vfeps,H);
335 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
336 VV = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
337 vvdw6 = _mm_mul_ps(c6_00,VV);
338 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
339 fvdw6 = _mm_mul_ps(c6_00,FF);
340
341 /* CUBIC SPLINE TABLE REPULSION */
342 vfitab = _mm_add_epi32(vfitab,ifour);
343 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
344 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
345 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
346 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
347 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
348 Heps = _mm_mul_ps(vfeps,H);
349 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
350 VV = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
351 vvdw12 = _mm_mul_ps(c12_00,VV);
352 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
353 fvdw12 = _mm_mul_ps(c12_00,FF);
354 vvdw = _mm_add_ps(vvdw12,vvdw6);
355 fvdw = _mm_xor_ps(signbit,_mm_mul_ps(_mm_add_ps(fvdw6,fvdw12),_mm_mul_ps(vftabscale,rinv00)));
356
357 cutoff_mask = _mm_cmplt_ps(rsq00,rcutoff2);
358
359 /* Update potential sum for this i atom from the interaction with this j atom. */
360 velec = _mm_and_ps(velec,cutoff_mask);
361 velecsum = _mm_add_ps(velecsum,velec);
362 vvdw = _mm_and_ps(vvdw,cutoff_mask);
363 vvdwsum = _mm_add_ps(vvdwsum,vvdw);
364
365 fscal = _mm_add_ps(felec,fvdw);
366
367 fscal = _mm_and_ps(fscal,cutoff_mask);
368
369 /* Calculate temporary vectorial force */
370 tx = _mm_mul_ps(fscal,dx00);
371 ty = _mm_mul_ps(fscal,dy00);
372 tz = _mm_mul_ps(fscal,dz00);
373
374 /* Update vectorial force */
375 fix0 = _mm_add_ps(fix0,tx);
376 fiy0 = _mm_add_ps(fiy0,ty);
377 fiz0 = _mm_add_ps(fiz0,tz);
378
379 fjx0 = _mm_add_ps(fjx0,tx);
380 fjy0 = _mm_add_ps(fjy0,ty);
381 fjz0 = _mm_add_ps(fjz0,tz);
382
383 }
384
385 /**************************
386 * CALCULATE INTERACTIONS *
387 **************************/
388
389 if (gmx_mm_any_lt(rsq01,rcutoff2))
390 {
391
392 /* REACTION-FIELD ELECTROSTATICS */
393 velec = _mm_mul_ps(qq01,_mm_sub_ps(_mm_add_ps(rinv01,_mm_mul_ps(krf,rsq01)),crf));
394 felec = _mm_mul_ps(qq01,_mm_sub_ps(_mm_mul_ps(rinv01,rinvsq01),krf2));
395
396 cutoff_mask = _mm_cmplt_ps(rsq01,rcutoff2);
397
398 /* Update potential sum for this i atom from the interaction with this j atom. */
399 velec = _mm_and_ps(velec,cutoff_mask);
400 velecsum = _mm_add_ps(velecsum,velec);
401
402 fscal = felec;
403
404 fscal = _mm_and_ps(fscal,cutoff_mask);
405
406 /* Calculate temporary vectorial force */
407 tx = _mm_mul_ps(fscal,dx01);
408 ty = _mm_mul_ps(fscal,dy01);
409 tz = _mm_mul_ps(fscal,dz01);
410
411 /* Update vectorial force */
412 fix0 = _mm_add_ps(fix0,tx);
413 fiy0 = _mm_add_ps(fiy0,ty);
414 fiz0 = _mm_add_ps(fiz0,tz);
415
416 fjx1 = _mm_add_ps(fjx1,tx);
417 fjy1 = _mm_add_ps(fjy1,ty);
418 fjz1 = _mm_add_ps(fjz1,tz);
419
420 }
421
422 /**************************
423 * CALCULATE INTERACTIONS *
424 **************************/
425
426 if (gmx_mm_any_lt(rsq02,rcutoff2))
427 {
428
429 /* REACTION-FIELD ELECTROSTATICS */
430 velec = _mm_mul_ps(qq02,_mm_sub_ps(_mm_add_ps(rinv02,_mm_mul_ps(krf,rsq02)),crf));
431 felec = _mm_mul_ps(qq02,_mm_sub_ps(_mm_mul_ps(rinv02,rinvsq02),krf2));
432
433 cutoff_mask = _mm_cmplt_ps(rsq02,rcutoff2);
434
435 /* Update potential sum for this i atom from the interaction with this j atom. */
436 velec = _mm_and_ps(velec,cutoff_mask);
437 velecsum = _mm_add_ps(velecsum,velec);
438
439 fscal = felec;
440
441 fscal = _mm_and_ps(fscal,cutoff_mask);
442
443 /* Calculate temporary vectorial force */
444 tx = _mm_mul_ps(fscal,dx02);
445 ty = _mm_mul_ps(fscal,dy02);
446 tz = _mm_mul_ps(fscal,dz02);
447
448 /* Update vectorial force */
449 fix0 = _mm_add_ps(fix0,tx);
450 fiy0 = _mm_add_ps(fiy0,ty);
451 fiz0 = _mm_add_ps(fiz0,tz);
452
453 fjx2 = _mm_add_ps(fjx2,tx);
454 fjy2 = _mm_add_ps(fjy2,ty);
455 fjz2 = _mm_add_ps(fjz2,tz);
456
457 }
458
459 /**************************
460 * CALCULATE INTERACTIONS *
461 **************************/
462
463 if (gmx_mm_any_lt(rsq10,rcutoff2))
464 {
465
466 /* REACTION-FIELD ELECTROSTATICS */
467 velec = _mm_mul_ps(qq10,_mm_sub_ps(_mm_add_ps(rinv10,_mm_mul_ps(krf,rsq10)),crf));
468 felec = _mm_mul_ps(qq10,_mm_sub_ps(_mm_mul_ps(rinv10,rinvsq10),krf2));
469
470 cutoff_mask = _mm_cmplt_ps(rsq10,rcutoff2);
471
472 /* Update potential sum for this i atom from the interaction with this j atom. */
473 velec = _mm_and_ps(velec,cutoff_mask);
474 velecsum = _mm_add_ps(velecsum,velec);
475
476 fscal = felec;
477
478 fscal = _mm_and_ps(fscal,cutoff_mask);
479
480 /* Calculate temporary vectorial force */
481 tx = _mm_mul_ps(fscal,dx10);
482 ty = _mm_mul_ps(fscal,dy10);
483 tz = _mm_mul_ps(fscal,dz10);
484
485 /* Update vectorial force */
486 fix1 = _mm_add_ps(fix1,tx);
487 fiy1 = _mm_add_ps(fiy1,ty);
488 fiz1 = _mm_add_ps(fiz1,tz);
489
490 fjx0 = _mm_add_ps(fjx0,tx);
491 fjy0 = _mm_add_ps(fjy0,ty);
492 fjz0 = _mm_add_ps(fjz0,tz);
493
494 }
495
496 /**************************
497 * CALCULATE INTERACTIONS *
498 **************************/
499
500 if (gmx_mm_any_lt(rsq11,rcutoff2))
501 {
502
503 /* REACTION-FIELD ELECTROSTATICS */
504 velec = _mm_mul_ps(qq11,_mm_sub_ps(_mm_add_ps(rinv11,_mm_mul_ps(krf,rsq11)),crf));
505 felec = _mm_mul_ps(qq11,_mm_sub_ps(_mm_mul_ps(rinv11,rinvsq11),krf2));
506
507 cutoff_mask = _mm_cmplt_ps(rsq11,rcutoff2);
508
509 /* Update potential sum for this i atom from the interaction with this j atom. */
510 velec = _mm_and_ps(velec,cutoff_mask);
511 velecsum = _mm_add_ps(velecsum,velec);
512
513 fscal = felec;
514
515 fscal = _mm_and_ps(fscal,cutoff_mask);
516
517 /* Calculate temporary vectorial force */
518 tx = _mm_mul_ps(fscal,dx11);
519 ty = _mm_mul_ps(fscal,dy11);
520 tz = _mm_mul_ps(fscal,dz11);
521
522 /* Update vectorial force */
523 fix1 = _mm_add_ps(fix1,tx);
524 fiy1 = _mm_add_ps(fiy1,ty);
525 fiz1 = _mm_add_ps(fiz1,tz);
526
527 fjx1 = _mm_add_ps(fjx1,tx);
528 fjy1 = _mm_add_ps(fjy1,ty);
529 fjz1 = _mm_add_ps(fjz1,tz);
530
531 }
532
533 /**************************
534 * CALCULATE INTERACTIONS *
535 **************************/
536
537 if (gmx_mm_any_lt(rsq12,rcutoff2))
538 {
539
540 /* REACTION-FIELD ELECTROSTATICS */
541 velec = _mm_mul_ps(qq12,_mm_sub_ps(_mm_add_ps(rinv12,_mm_mul_ps(krf,rsq12)),crf));
542 felec = _mm_mul_ps(qq12,_mm_sub_ps(_mm_mul_ps(rinv12,rinvsq12),krf2));
543
544 cutoff_mask = _mm_cmplt_ps(rsq12,rcutoff2);
545
546 /* Update potential sum for this i atom from the interaction with this j atom. */
547 velec = _mm_and_ps(velec,cutoff_mask);
548 velecsum = _mm_add_ps(velecsum,velec);
549
550 fscal = felec;
551
552 fscal = _mm_and_ps(fscal,cutoff_mask);
553
554 /* Calculate temporary vectorial force */
555 tx = _mm_mul_ps(fscal,dx12);
556 ty = _mm_mul_ps(fscal,dy12);
557 tz = _mm_mul_ps(fscal,dz12);
558
559 /* Update vectorial force */
560 fix1 = _mm_add_ps(fix1,tx);
561 fiy1 = _mm_add_ps(fiy1,ty);
562 fiz1 = _mm_add_ps(fiz1,tz);
563
564 fjx2 = _mm_add_ps(fjx2,tx);
565 fjy2 = _mm_add_ps(fjy2,ty);
566 fjz2 = _mm_add_ps(fjz2,tz);
567
568 }
569
570 /**************************
571 * CALCULATE INTERACTIONS *
572 **************************/
573
574 if (gmx_mm_any_lt(rsq20,rcutoff2))
575 {
576
577 /* REACTION-FIELD ELECTROSTATICS */
578 velec = _mm_mul_ps(qq20,_mm_sub_ps(_mm_add_ps(rinv20,_mm_mul_ps(krf,rsq20)),crf));
579 felec = _mm_mul_ps(qq20,_mm_sub_ps(_mm_mul_ps(rinv20,rinvsq20),krf2));
580
581 cutoff_mask = _mm_cmplt_ps(rsq20,rcutoff2);
582
583 /* Update potential sum for this i atom from the interaction with this j atom. */
584 velec = _mm_and_ps(velec,cutoff_mask);
585 velecsum = _mm_add_ps(velecsum,velec);
586
587 fscal = felec;
588
589 fscal = _mm_and_ps(fscal,cutoff_mask);
590
591 /* Calculate temporary vectorial force */
592 tx = _mm_mul_ps(fscal,dx20);
593 ty = _mm_mul_ps(fscal,dy20);
594 tz = _mm_mul_ps(fscal,dz20);
595
596 /* Update vectorial force */
597 fix2 = _mm_add_ps(fix2,tx);
598 fiy2 = _mm_add_ps(fiy2,ty);
599 fiz2 = _mm_add_ps(fiz2,tz);
600
601 fjx0 = _mm_add_ps(fjx0,tx);
602 fjy0 = _mm_add_ps(fjy0,ty);
603 fjz0 = _mm_add_ps(fjz0,tz);
604
605 }
606
607 /**************************
608 * CALCULATE INTERACTIONS *
609 **************************/
610
611 if (gmx_mm_any_lt(rsq21,rcutoff2))
612 {
613
614 /* REACTION-FIELD ELECTROSTATICS */
615 velec = _mm_mul_ps(qq21,_mm_sub_ps(_mm_add_ps(rinv21,_mm_mul_ps(krf,rsq21)),crf));
616 felec = _mm_mul_ps(qq21,_mm_sub_ps(_mm_mul_ps(rinv21,rinvsq21),krf2));
617
618 cutoff_mask = _mm_cmplt_ps(rsq21,rcutoff2);
619
620 /* Update potential sum for this i atom from the interaction with this j atom. */
621 velec = _mm_and_ps(velec,cutoff_mask);
622 velecsum = _mm_add_ps(velecsum,velec);
623
624 fscal = felec;
625
626 fscal = _mm_and_ps(fscal,cutoff_mask);
627
628 /* Calculate temporary vectorial force */
629 tx = _mm_mul_ps(fscal,dx21);
630 ty = _mm_mul_ps(fscal,dy21);
631 tz = _mm_mul_ps(fscal,dz21);
632
633 /* Update vectorial force */
634 fix2 = _mm_add_ps(fix2,tx);
635 fiy2 = _mm_add_ps(fiy2,ty);
636 fiz2 = _mm_add_ps(fiz2,tz);
637
638 fjx1 = _mm_add_ps(fjx1,tx);
639 fjy1 = _mm_add_ps(fjy1,ty);
640 fjz1 = _mm_add_ps(fjz1,tz);
641
642 }
643
644 /**************************
645 * CALCULATE INTERACTIONS *
646 **************************/
647
648 if (gmx_mm_any_lt(rsq22,rcutoff2))
649 {
650
651 /* REACTION-FIELD ELECTROSTATICS */
652 velec = _mm_mul_ps(qq22,_mm_sub_ps(_mm_add_ps(rinv22,_mm_mul_ps(krf,rsq22)),crf));
653 felec = _mm_mul_ps(qq22,_mm_sub_ps(_mm_mul_ps(rinv22,rinvsq22),krf2));
654
655 cutoff_mask = _mm_cmplt_ps(rsq22,rcutoff2);
656
657 /* Update potential sum for this i atom from the interaction with this j atom. */
658 velec = _mm_and_ps(velec,cutoff_mask);
659 velecsum = _mm_add_ps(velecsum,velec);
660
661 fscal = felec;
662
663 fscal = _mm_and_ps(fscal,cutoff_mask);
664
665 /* Calculate temporary vectorial force */
666 tx = _mm_mul_ps(fscal,dx22);
667 ty = _mm_mul_ps(fscal,dy22);
668 tz = _mm_mul_ps(fscal,dz22);
669
670 /* Update vectorial force */
671 fix2 = _mm_add_ps(fix2,tx);
672 fiy2 = _mm_add_ps(fiy2,ty);
673 fiz2 = _mm_add_ps(fiz2,tz);
674
675 fjx2 = _mm_add_ps(fjx2,tx);
676 fjy2 = _mm_add_ps(fjy2,ty);
677 fjz2 = _mm_add_ps(fjz2,tz);
678
679 }
680
681 fjptrA = f+j_coord_offsetA;
682 fjptrB = f+j_coord_offsetB;
683 fjptrC = f+j_coord_offsetC;
684 fjptrD = f+j_coord_offsetD;
685
686 gmx_mm_decrement_3rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,
687 fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2);
688
689 /* Inner loop uses 360 flops */
690 }
691
692 if(jidx<j_index_end)
693 {
694
695 /* Get j neighbor index, and coordinate index */
696 jnrlistA = jjnr[jidx];
697 jnrlistB = jjnr[jidx+1];
698 jnrlistC = jjnr[jidx+2];
699 jnrlistD = jjnr[jidx+3];
700 /* Sign of each element will be negative for non-real atoms.
701 * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
702 * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
703 */
704 dummy_mask = gmx_mm_castsi128_ps_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
705 jnrA = (jnrlistA>=0) ? jnrlistA : 0;
706 jnrB = (jnrlistB>=0) ? jnrlistB : 0;
707 jnrC = (jnrlistC>=0) ? jnrlistC : 0;
708 jnrD = (jnrlistD>=0) ? jnrlistD : 0;
709 j_coord_offsetA = DIM3*jnrA;
710 j_coord_offsetB = DIM3*jnrB;
711 j_coord_offsetC = DIM3*jnrC;
712 j_coord_offsetD = DIM3*jnrD;
713
714 /* load j atom coordinates */
715 gmx_mm_load_3rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
716 x+j_coord_offsetC,x+j_coord_offsetD,
717 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,&jy2,&jz2);
718
719 /* Calculate displacement vector */
720 dx00 = _mm_sub_ps(ix0,jx0);
721 dy00 = _mm_sub_ps(iy0,jy0);
722 dz00 = _mm_sub_ps(iz0,jz0);
723 dx01 = _mm_sub_ps(ix0,jx1);
724 dy01 = _mm_sub_ps(iy0,jy1);
725 dz01 = _mm_sub_ps(iz0,jz1);
726 dx02 = _mm_sub_ps(ix0,jx2);
727 dy02 = _mm_sub_ps(iy0,jy2);
728 dz02 = _mm_sub_ps(iz0,jz2);
729 dx10 = _mm_sub_ps(ix1,jx0);
730 dy10 = _mm_sub_ps(iy1,jy0);
731 dz10 = _mm_sub_ps(iz1,jz0);
732 dx11 = _mm_sub_ps(ix1,jx1);
733 dy11 = _mm_sub_ps(iy1,jy1);
734 dz11 = _mm_sub_ps(iz1,jz1);
735 dx12 = _mm_sub_ps(ix1,jx2);
736 dy12 = _mm_sub_ps(iy1,jy2);
737 dz12 = _mm_sub_ps(iz1,jz2);
738 dx20 = _mm_sub_ps(ix2,jx0);
739 dy20 = _mm_sub_ps(iy2,jy0);
740 dz20 = _mm_sub_ps(iz2,jz0);
741 dx21 = _mm_sub_ps(ix2,jx1);
742 dy21 = _mm_sub_ps(iy2,jy1);
743 dz21 = _mm_sub_ps(iz2,jz1);
744 dx22 = _mm_sub_ps(ix2,jx2);
745 dy22 = _mm_sub_ps(iy2,jy2);
746 dz22 = _mm_sub_ps(iz2,jz2);
747
748 /* Calculate squared distance and things based on it */
749 rsq00 = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
750 rsq01 = gmx_mm_calc_rsq_ps(dx01,dy01,dz01);
751 rsq02 = gmx_mm_calc_rsq_ps(dx02,dy02,dz02);
752 rsq10 = gmx_mm_calc_rsq_ps(dx10,dy10,dz10);
753 rsq11 = gmx_mm_calc_rsq_ps(dx11,dy11,dz11);
754 rsq12 = gmx_mm_calc_rsq_ps(dx12,dy12,dz12);
755 rsq20 = gmx_mm_calc_rsq_ps(dx20,dy20,dz20);
756 rsq21 = gmx_mm_calc_rsq_ps(dx21,dy21,dz21);
757 rsq22 = gmx_mm_calc_rsq_ps(dx22,dy22,dz22);
758
759 rinv00 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq00);
760 rinv01 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq01);
761 rinv02 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq02);
762 rinv10 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq10);
763 rinv11 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq11);
764 rinv12 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq12);
765 rinv20 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq20);
766 rinv21 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq21);
767 rinv22 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq22);
768
769 rinvsq00 = _mm_mul_ps(rinv00,rinv00);
770 rinvsq01 = _mm_mul_ps(rinv01,rinv01);
771 rinvsq02 = _mm_mul_ps(rinv02,rinv02);
772 rinvsq10 = _mm_mul_ps(rinv10,rinv10);
773 rinvsq11 = _mm_mul_ps(rinv11,rinv11);
774 rinvsq12 = _mm_mul_ps(rinv12,rinv12);
775 rinvsq20 = _mm_mul_ps(rinv20,rinv20);
776 rinvsq21 = _mm_mul_ps(rinv21,rinv21);
777 rinvsq22 = _mm_mul_ps(rinv22,rinv22);
778
779 fjx0 = _mm_setzero_ps();
780 fjy0 = _mm_setzero_ps();
781 fjz0 = _mm_setzero_ps();
782 fjx1 = _mm_setzero_ps();
783 fjy1 = _mm_setzero_ps();
784 fjz1 = _mm_setzero_ps();
785 fjx2 = _mm_setzero_ps();
786 fjy2 = _mm_setzero_ps();
787 fjz2 = _mm_setzero_ps();
788
789 /**************************
790 * CALCULATE INTERACTIONS *
791 **************************/
792
793 if (gmx_mm_any_lt(rsq00,rcutoff2))
794 {
795
796 r00 = _mm_mul_ps(rsq00,rinv00);
797 r00 = _mm_andnot_ps(dummy_mask,r00);
798
799 /* Calculate table index by multiplying r with table scale and truncate to integer */
800 rt = _mm_mul_ps(r00,vftabscale);
801 vfitab = _mm_cvttps_epi32(rt);
802 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
803 vfitab = _mm_slli_epi32(vfitab,3);
804
805 /* REACTION-FIELD ELECTROSTATICS */
806 velec = _mm_mul_ps(qq00,_mm_sub_ps(_mm_add_ps(rinv00,_mm_mul_ps(krf,rsq00)),crf));
807 felec = _mm_mul_ps(qq00,_mm_sub_ps(_mm_mul_ps(rinv00,rinvsq00),krf2));
808
809 /* CUBIC SPLINE TABLE DISPERSION */
810 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
811 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
812 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
813 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
814 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
815 Heps = _mm_mul_ps(vfeps,H);
816 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
817 VV = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
818 vvdw6 = _mm_mul_ps(c6_00,VV);
819 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
820 fvdw6 = _mm_mul_ps(c6_00,FF);
821
822 /* CUBIC SPLINE TABLE REPULSION */
823 vfitab = _mm_add_epi32(vfitab,ifour);
824 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
825 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
826 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
827 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
828 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
829 Heps = _mm_mul_ps(vfeps,H);
830 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
831 VV = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
832 vvdw12 = _mm_mul_ps(c12_00,VV);
833 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
834 fvdw12 = _mm_mul_ps(c12_00,FF);
835 vvdw = _mm_add_ps(vvdw12,vvdw6);
836 fvdw = _mm_xor_ps(signbit,_mm_mul_ps(_mm_add_ps(fvdw6,fvdw12),_mm_mul_ps(vftabscale,rinv00)));
837
838 cutoff_mask = _mm_cmplt_ps(rsq00,rcutoff2);
839
840 /* Update potential sum for this i atom from the interaction with this j atom. */
841 velec = _mm_and_ps(velec,cutoff_mask);
842 velec = _mm_andnot_ps(dummy_mask,velec);
843 velecsum = _mm_add_ps(velecsum,velec);
844 vvdw = _mm_and_ps(vvdw,cutoff_mask);
845 vvdw = _mm_andnot_ps(dummy_mask,vvdw);
846 vvdwsum = _mm_add_ps(vvdwsum,vvdw);
847
848 fscal = _mm_add_ps(felec,fvdw);
849
850 fscal = _mm_and_ps(fscal,cutoff_mask);
851
852 fscal = _mm_andnot_ps(dummy_mask,fscal);
853
854 /* Calculate temporary vectorial force */
855 tx = _mm_mul_ps(fscal,dx00);
856 ty = _mm_mul_ps(fscal,dy00);
857 tz = _mm_mul_ps(fscal,dz00);
858
859 /* Update vectorial force */
860 fix0 = _mm_add_ps(fix0,tx);
861 fiy0 = _mm_add_ps(fiy0,ty);
862 fiz0 = _mm_add_ps(fiz0,tz);
863
864 fjx0 = _mm_add_ps(fjx0,tx);
865 fjy0 = _mm_add_ps(fjy0,ty);
866 fjz0 = _mm_add_ps(fjz0,tz);
867
868 }
869
870 /**************************
871 * CALCULATE INTERACTIONS *
872 **************************/
873
874 if (gmx_mm_any_lt(rsq01,rcutoff2))
875 {
876
877 /* REACTION-FIELD ELECTROSTATICS */
878 velec = _mm_mul_ps(qq01,_mm_sub_ps(_mm_add_ps(rinv01,_mm_mul_ps(krf,rsq01)),crf));
879 felec = _mm_mul_ps(qq01,_mm_sub_ps(_mm_mul_ps(rinv01,rinvsq01),krf2));
880
881 cutoff_mask = _mm_cmplt_ps(rsq01,rcutoff2);
882
883 /* Update potential sum for this i atom from the interaction with this j atom. */
884 velec = _mm_and_ps(velec,cutoff_mask);
885 velec = _mm_andnot_ps(dummy_mask,velec);
886 velecsum = _mm_add_ps(velecsum,velec);
887
888 fscal = felec;
889
890 fscal = _mm_and_ps(fscal,cutoff_mask);
891
892 fscal = _mm_andnot_ps(dummy_mask,fscal);
893
894 /* Calculate temporary vectorial force */
895 tx = _mm_mul_ps(fscal,dx01);
896 ty = _mm_mul_ps(fscal,dy01);
897 tz = _mm_mul_ps(fscal,dz01);
898
899 /* Update vectorial force */
900 fix0 = _mm_add_ps(fix0,tx);
901 fiy0 = _mm_add_ps(fiy0,ty);
902 fiz0 = _mm_add_ps(fiz0,tz);
903
904 fjx1 = _mm_add_ps(fjx1,tx);
905 fjy1 = _mm_add_ps(fjy1,ty);
906 fjz1 = _mm_add_ps(fjz1,tz);
907
908 }
909
910 /**************************
911 * CALCULATE INTERACTIONS *
912 **************************/
913
914 if (gmx_mm_any_lt(rsq02,rcutoff2))
915 {
916
917 /* REACTION-FIELD ELECTROSTATICS */
918 velec = _mm_mul_ps(qq02,_mm_sub_ps(_mm_add_ps(rinv02,_mm_mul_ps(krf,rsq02)),crf));
919 felec = _mm_mul_ps(qq02,_mm_sub_ps(_mm_mul_ps(rinv02,rinvsq02),krf2));
920
921 cutoff_mask = _mm_cmplt_ps(rsq02,rcutoff2);
922
923 /* Update potential sum for this i atom from the interaction with this j atom. */
924 velec = _mm_and_ps(velec,cutoff_mask);
925 velec = _mm_andnot_ps(dummy_mask,velec);
926 velecsum = _mm_add_ps(velecsum,velec);
927
928 fscal = felec;
929
930 fscal = _mm_and_ps(fscal,cutoff_mask);
931
932 fscal = _mm_andnot_ps(dummy_mask,fscal);
933
934 /* Calculate temporary vectorial force */
935 tx = _mm_mul_ps(fscal,dx02);
936 ty = _mm_mul_ps(fscal,dy02);
937 tz = _mm_mul_ps(fscal,dz02);
938
939 /* Update vectorial force */
940 fix0 = _mm_add_ps(fix0,tx);
941 fiy0 = _mm_add_ps(fiy0,ty);
942 fiz0 = _mm_add_ps(fiz0,tz);
943
944 fjx2 = _mm_add_ps(fjx2,tx);
945 fjy2 = _mm_add_ps(fjy2,ty);
946 fjz2 = _mm_add_ps(fjz2,tz);
947
948 }
949
950 /**************************
951 * CALCULATE INTERACTIONS *
952 **************************/
953
954 if (gmx_mm_any_lt(rsq10,rcutoff2))
955 {
956
957 /* REACTION-FIELD ELECTROSTATICS */
958 velec = _mm_mul_ps(qq10,_mm_sub_ps(_mm_add_ps(rinv10,_mm_mul_ps(krf,rsq10)),crf));
959 felec = _mm_mul_ps(qq10,_mm_sub_ps(_mm_mul_ps(rinv10,rinvsq10),krf2));
960
961 cutoff_mask = _mm_cmplt_ps(rsq10,rcutoff2);
962
963 /* Update potential sum for this i atom from the interaction with this j atom. */
964 velec = _mm_and_ps(velec,cutoff_mask);
965 velec = _mm_andnot_ps(dummy_mask,velec);
966 velecsum = _mm_add_ps(velecsum,velec);
967
968 fscal = felec;
969
970 fscal = _mm_and_ps(fscal,cutoff_mask);
971
972 fscal = _mm_andnot_ps(dummy_mask,fscal);
973
974 /* Calculate temporary vectorial force */
975 tx = _mm_mul_ps(fscal,dx10);
976 ty = _mm_mul_ps(fscal,dy10);
977 tz = _mm_mul_ps(fscal,dz10);
978
979 /* Update vectorial force */
980 fix1 = _mm_add_ps(fix1,tx);
981 fiy1 = _mm_add_ps(fiy1,ty);
982 fiz1 = _mm_add_ps(fiz1,tz);
983
984 fjx0 = _mm_add_ps(fjx0,tx);
985 fjy0 = _mm_add_ps(fjy0,ty);
986 fjz0 = _mm_add_ps(fjz0,tz);
987
988 }
989
990 /**************************
991 * CALCULATE INTERACTIONS *
992 **************************/
993
994 if (gmx_mm_any_lt(rsq11,rcutoff2))
995 {
996
997 /* REACTION-FIELD ELECTROSTATICS */
998 velec = _mm_mul_ps(qq11,_mm_sub_ps(_mm_add_ps(rinv11,_mm_mul_ps(krf,rsq11)),crf));
999 felec = _mm_mul_ps(qq11,_mm_sub_ps(_mm_mul_ps(rinv11,rinvsq11),krf2));
1000
1001 cutoff_mask = _mm_cmplt_ps(rsq11,rcutoff2);
1002
1003 /* Update potential sum for this i atom from the interaction with this j atom. */
1004 velec = _mm_and_ps(velec,cutoff_mask);
1005 velec = _mm_andnot_ps(dummy_mask,velec);
1006 velecsum = _mm_add_ps(velecsum,velec);
1007
1008 fscal = felec;
1009
1010 fscal = _mm_and_ps(fscal,cutoff_mask);
1011
1012 fscal = _mm_andnot_ps(dummy_mask,fscal);
1013
1014 /* Calculate temporary vectorial force */
1015 tx = _mm_mul_ps(fscal,dx11);
1016 ty = _mm_mul_ps(fscal,dy11);
1017 tz = _mm_mul_ps(fscal,dz11);
1018
1019 /* Update vectorial force */
1020 fix1 = _mm_add_ps(fix1,tx);
1021 fiy1 = _mm_add_ps(fiy1,ty);
1022 fiz1 = _mm_add_ps(fiz1,tz);
1023
1024 fjx1 = _mm_add_ps(fjx1,tx);
1025 fjy1 = _mm_add_ps(fjy1,ty);
1026 fjz1 = _mm_add_ps(fjz1,tz);
1027
1028 }
1029
1030 /**************************
1031 * CALCULATE INTERACTIONS *
1032 **************************/
1033
1034 if (gmx_mm_any_lt(rsq12,rcutoff2))
1035 {
1036
1037 /* REACTION-FIELD ELECTROSTATICS */
1038 velec = _mm_mul_ps(qq12,_mm_sub_ps(_mm_add_ps(rinv12,_mm_mul_ps(krf,rsq12)),crf));
1039 felec = _mm_mul_ps(qq12,_mm_sub_ps(_mm_mul_ps(rinv12,rinvsq12),krf2));
1040
1041 cutoff_mask = _mm_cmplt_ps(rsq12,rcutoff2);
1042
1043 /* Update potential sum for this i atom from the interaction with this j atom. */
1044 velec = _mm_and_ps(velec,cutoff_mask);
1045 velec = _mm_andnot_ps(dummy_mask,velec);
1046 velecsum = _mm_add_ps(velecsum,velec);
1047
1048 fscal = felec;
1049
1050 fscal = _mm_and_ps(fscal,cutoff_mask);
1051
1052 fscal = _mm_andnot_ps(dummy_mask,fscal);
1053
1054 /* Calculate temporary vectorial force */
1055 tx = _mm_mul_ps(fscal,dx12);
1056 ty = _mm_mul_ps(fscal,dy12);
1057 tz = _mm_mul_ps(fscal,dz12);
1058
1059 /* Update vectorial force */
1060 fix1 = _mm_add_ps(fix1,tx);
1061 fiy1 = _mm_add_ps(fiy1,ty);
1062 fiz1 = _mm_add_ps(fiz1,tz);
1063
1064 fjx2 = _mm_add_ps(fjx2,tx);
1065 fjy2 = _mm_add_ps(fjy2,ty);
1066 fjz2 = _mm_add_ps(fjz2,tz);
1067
1068 }
1069
1070 /**************************
1071 * CALCULATE INTERACTIONS *
1072 **************************/
1073
1074 if (gmx_mm_any_lt(rsq20,rcutoff2))
1075 {
1076
1077 /* REACTION-FIELD ELECTROSTATICS */
1078 velec = _mm_mul_ps(qq20,_mm_sub_ps(_mm_add_ps(rinv20,_mm_mul_ps(krf,rsq20)),crf));
1079 felec = _mm_mul_ps(qq20,_mm_sub_ps(_mm_mul_ps(rinv20,rinvsq20),krf2));
1080
1081 cutoff_mask = _mm_cmplt_ps(rsq20,rcutoff2);
1082
1083 /* Update potential sum for this i atom from the interaction with this j atom. */
1084 velec = _mm_and_ps(velec,cutoff_mask);
1085 velec = _mm_andnot_ps(dummy_mask,velec);
1086 velecsum = _mm_add_ps(velecsum,velec);
1087
1088 fscal = felec;
1089
1090 fscal = _mm_and_ps(fscal,cutoff_mask);
1091
1092 fscal = _mm_andnot_ps(dummy_mask,fscal);
1093
1094 /* Calculate temporary vectorial force */
1095 tx = _mm_mul_ps(fscal,dx20);
1096 ty = _mm_mul_ps(fscal,dy20);
1097 tz = _mm_mul_ps(fscal,dz20);
1098
1099 /* Update vectorial force */
1100 fix2 = _mm_add_ps(fix2,tx);
1101 fiy2 = _mm_add_ps(fiy2,ty);
1102 fiz2 = _mm_add_ps(fiz2,tz);
1103
1104 fjx0 = _mm_add_ps(fjx0,tx);
1105 fjy0 = _mm_add_ps(fjy0,ty);
1106 fjz0 = _mm_add_ps(fjz0,tz);
1107
1108 }
1109
1110 /**************************
1111 * CALCULATE INTERACTIONS *
1112 **************************/
1113
1114 if (gmx_mm_any_lt(rsq21,rcutoff2))
1115 {
1116
1117 /* REACTION-FIELD ELECTROSTATICS */
1118 velec = _mm_mul_ps(qq21,_mm_sub_ps(_mm_add_ps(rinv21,_mm_mul_ps(krf,rsq21)),crf));
1119 felec = _mm_mul_ps(qq21,_mm_sub_ps(_mm_mul_ps(rinv21,rinvsq21),krf2));
1120
1121 cutoff_mask = _mm_cmplt_ps(rsq21,rcutoff2);
1122
1123 /* Update potential sum for this i atom from the interaction with this j atom. */
1124 velec = _mm_and_ps(velec,cutoff_mask);
1125 velec = _mm_andnot_ps(dummy_mask,velec);
1126 velecsum = _mm_add_ps(velecsum,velec);
1127
1128 fscal = felec;
1129
1130 fscal = _mm_and_ps(fscal,cutoff_mask);
1131
1132 fscal = _mm_andnot_ps(dummy_mask,fscal);
1133
1134 /* Calculate temporary vectorial force */
1135 tx = _mm_mul_ps(fscal,dx21);
1136 ty = _mm_mul_ps(fscal,dy21);
1137 tz = _mm_mul_ps(fscal,dz21);
1138
1139 /* Update vectorial force */
1140 fix2 = _mm_add_ps(fix2,tx);
1141 fiy2 = _mm_add_ps(fiy2,ty);
1142 fiz2 = _mm_add_ps(fiz2,tz);
1143
1144 fjx1 = _mm_add_ps(fjx1,tx);
1145 fjy1 = _mm_add_ps(fjy1,ty);
1146 fjz1 = _mm_add_ps(fjz1,tz);
1147
1148 }
1149
1150 /**************************
1151 * CALCULATE INTERACTIONS *
1152 **************************/
1153
1154 if (gmx_mm_any_lt(rsq22,rcutoff2))
1155 {
1156
1157 /* REACTION-FIELD ELECTROSTATICS */
1158 velec = _mm_mul_ps(qq22,_mm_sub_ps(_mm_add_ps(rinv22,_mm_mul_ps(krf,rsq22)),crf));
1159 felec = _mm_mul_ps(qq22,_mm_sub_ps(_mm_mul_ps(rinv22,rinvsq22),krf2));
1160
1161 cutoff_mask = _mm_cmplt_ps(rsq22,rcutoff2);
1162
1163 /* Update potential sum for this i atom from the interaction with this j atom. */
1164 velec = _mm_and_ps(velec,cutoff_mask);
1165 velec = _mm_andnot_ps(dummy_mask,velec);
1166 velecsum = _mm_add_ps(velecsum,velec);
1167
1168 fscal = felec;
1169
1170 fscal = _mm_and_ps(fscal,cutoff_mask);
1171
1172 fscal = _mm_andnot_ps(dummy_mask,fscal);
1173
1174 /* Calculate temporary vectorial force */
1175 tx = _mm_mul_ps(fscal,dx22);
1176 ty = _mm_mul_ps(fscal,dy22);
1177 tz = _mm_mul_ps(fscal,dz22);
1178
1179 /* Update vectorial force */
1180 fix2 = _mm_add_ps(fix2,tx);
1181 fiy2 = _mm_add_ps(fiy2,ty);
1182 fiz2 = _mm_add_ps(fiz2,tz);
1183
1184 fjx2 = _mm_add_ps(fjx2,tx);
1185 fjy2 = _mm_add_ps(fjy2,ty);
1186 fjz2 = _mm_add_ps(fjz2,tz);
1187
1188 }
1189
1190 fjptrA = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
1191 fjptrB = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
1192 fjptrC = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
1193 fjptrD = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
1194
1195 gmx_mm_decrement_3rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,
1196 fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2);
1197
1198 /* Inner loop uses 361 flops */
1199 }
1200
1201 /* End of innermost loop */
1202
1203 gmx_mm_update_iforce_3atom_swizzle_ps(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,
1204 f+i_coord_offset,fshift+i_shift_offset);
1205
1206 ggid = gid[iidx];
1207 /* Update potential energies */
1208 gmx_mm_update_1pot_ps(velecsum,kernel_data->energygrp_elec+ggid);
1209 gmx_mm_update_1pot_ps(vvdwsum,kernel_data->energygrp_vdw+ggid);
1210
1211 /* Increment number of inner iterations */
1212 inneriter += j_index_end - j_index_start;
1213
1214 /* Outer loop uses 20 flops */
1215 }
1216
1217 /* Increment number of outer iterations */
1218 outeriter += nri;
1219
1220 /* Update outer/inner flops */
1221
1222 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3W3_VF,outeriter*20 + inneriter*361)(nrnb)->n[eNR_NBKERNEL_ELEC_VDW_W3W3_VF] += outeriter*20 +
inneriter*361
;
1223}
1224/*
1225 * Gromacs nonbonded kernel: nb_kernel_ElecRFCut_VdwCSTab_GeomW3W3_F_sse4_1_single
1226 * Electrostatics interaction: ReactionField
1227 * VdW interaction: CubicSplineTable
1228 * Geometry: Water3-Water3
1229 * Calculate force/pot: Force
1230 */
1231void
1232nb_kernel_ElecRFCut_VdwCSTab_GeomW3W3_F_sse4_1_single
1233 (t_nblist * gmx_restrict nlist,
1234 rvec * gmx_restrict xx,
1235 rvec * gmx_restrict ff,
1236 t_forcerec * gmx_restrict fr,
1237 t_mdatoms * gmx_restrict mdatoms,
1238 nb_kernel_data_t gmx_unused__attribute__ ((unused)) * gmx_restrict kernel_data,
1239 t_nrnb * gmx_restrict nrnb)
1240{
1241 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
1242 * just 0 for non-waters.
1243 * Suffixes A,B,C,D refer to j loop unrolling done with SSE, e.g. for the four different
1244 * jnr indices corresponding to data put in the four positions in the SIMD register.
1245 */
1246 int i_shift_offset,i_coord_offset,outeriter,inneriter;
1247 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
1248 int jnrA,jnrB,jnrC,jnrD;
1249 int jnrlistA,jnrlistB,jnrlistC,jnrlistD;
1250 int j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
1251 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
1252 real rcutoff_scalar;
1253 real *shiftvec,*fshift,*x,*f;
1254 real *fjptrA,*fjptrB,*fjptrC,*fjptrD;
1255 real scratch[4*DIM3];
1256 __m128 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
1257 int vdwioffset0;
1258 __m128 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
1259 int vdwioffset1;
1260 __m128 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
1261 int vdwioffset2;
1262 __m128 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
1263 int vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
1264 __m128 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
1265 int vdwjidx1A,vdwjidx1B,vdwjidx1C,vdwjidx1D;
1266 __m128 jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
1267 int vdwjidx2A,vdwjidx2B,vdwjidx2C,vdwjidx2D;
1268 __m128 jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
1269 __m128 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
1270 __m128 dx01,dy01,dz01,rsq01,rinv01,rinvsq01,r01,qq01,c6_01,c12_01;
1271 __m128 dx02,dy02,dz02,rsq02,rinv02,rinvsq02,r02,qq02,c6_02,c12_02;
1272 __m128 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
1273 __m128 dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11;
1274 __m128 dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12;
1275 __m128 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
1276 __m128 dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21;
1277 __m128 dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22;
1278 __m128 velec,felec,velecsum,facel,crf,krf,krf2;
1279 real *charge;
1280 int nvdwtype;
1281 __m128 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
1282 int *vdwtype;
1283 real *vdwparam;
1284 __m128 one_sixth = _mm_set1_ps(1.0/6.0);
1285 __m128 one_twelfth = _mm_set1_ps(1.0/12.0);
1286 __m128i vfitab;
1287 __m128i ifour = _mm_set1_epi32(4);
1288 __m128 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
1289 real *vftab;
1290 __m128 dummy_mask,cutoff_mask;
1291 __m128 signbit = _mm_castsi128_ps( _mm_set1_epi32(0x80000000) );
1292 __m128 one = _mm_set1_ps(1.0);
1293 __m128 two = _mm_set1_ps(2.0);
1294 x = xx[0];
1295 f = ff[0];
1296
1297 nri = nlist->nri;
1298 iinr = nlist->iinr;
1299 jindex = nlist->jindex;
1300 jjnr = nlist->jjnr;
1301 shiftidx = nlist->shift;
1302 gid = nlist->gid;
1303 shiftvec = fr->shift_vec[0];
1304 fshift = fr->fshift[0];
1305 facel = _mm_set1_ps(fr->epsfac);
1306 charge = mdatoms->chargeA;
1307 krf = _mm_set1_ps(fr->ic->k_rf);
1308 krf2 = _mm_set1_ps(fr->ic->k_rf*2.0);
1309 crf = _mm_set1_ps(fr->ic->c_rf);
1310 nvdwtype = fr->ntype;
1311 vdwparam = fr->nbfp;
1312 vdwtype = mdatoms->typeA;
1313
1314 vftab = kernel_data->table_vdw->data;
1315 vftabscale = _mm_set1_ps(kernel_data->table_vdw->scale);
1316
1317 /* Setup water-specific parameters */
1318 inr = nlist->iinr[0];
1319 iq0 = _mm_mul_ps(facel,_mm_set1_ps(charge[inr+0]));
1320 iq1 = _mm_mul_ps(facel,_mm_set1_ps(charge[inr+1]));
1321 iq2 = _mm_mul_ps(facel,_mm_set1_ps(charge[inr+2]));
1322 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
1323
1324 jq0 = _mm_set1_ps(charge[inr+0]);
1325 jq1 = _mm_set1_ps(charge[inr+1]);
1326 jq2 = _mm_set1_ps(charge[inr+2]);
1327 vdwjidx0A = 2*vdwtype[inr+0];
1328 qq00 = _mm_mul_ps(iq0,jq0);
1329 c6_00 = _mm_set1_ps(vdwparam[vdwioffset0+vdwjidx0A]);
1330 c12_00 = _mm_set1_ps(vdwparam[vdwioffset0+vdwjidx0A+1]);
1331 qq01 = _mm_mul_ps(iq0,jq1);
1332 qq02 = _mm_mul_ps(iq0,jq2);
1333 qq10 = _mm_mul_ps(iq1,jq0);
1334 qq11 = _mm_mul_ps(iq1,jq1);
1335 qq12 = _mm_mul_ps(iq1,jq2);
1336 qq20 = _mm_mul_ps(iq2,jq0);
1337 qq21 = _mm_mul_ps(iq2,jq1);
1338 qq22 = _mm_mul_ps(iq2,jq2);
1339
1340 /* When we use explicit cutoffs the value must be identical for elec and VdW, so use elec as an arbitrary choice */
1341 rcutoff_scalar = fr->rcoulomb;
1342 rcutoff = _mm_set1_ps(rcutoff_scalar);
1343 rcutoff2 = _mm_mul_ps(rcutoff,rcutoff);
1344
1345 /* Avoid stupid compiler warnings */
1346 jnrA = jnrB = jnrC = jnrD = 0;
1347 j_coord_offsetA = 0;
1348 j_coord_offsetB = 0;
1349 j_coord_offsetC = 0;
1350 j_coord_offsetD = 0;
1351
1352 outeriter = 0;
1353 inneriter = 0;
1354
1355 for(iidx=0;iidx<4*DIM3;iidx++)
1356 {
1357 scratch[iidx] = 0.0;
1358 }
1359
1360 /* Start outer loop over neighborlists */
1361 for(iidx=0; iidx<nri; iidx++)
1362 {
1363 /* Load shift vector for this list */
1364 i_shift_offset = DIM3*shiftidx[iidx];
1365
1366 /* Load limits for loop over neighbors */
1367 j_index_start = jindex[iidx];
1368 j_index_end = jindex[iidx+1];
1369
1370 /* Get outer coordinate index */
1371 inr = iinr[iidx];
1372 i_coord_offset = DIM3*inr;
1373
1374 /* Load i particle coords and add shift vector */
1375 gmx_mm_load_shift_and_3rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,
1376 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2);
1377
1378 fix0 = _mm_setzero_ps();
1379 fiy0 = _mm_setzero_ps();
1380 fiz0 = _mm_setzero_ps();
1381 fix1 = _mm_setzero_ps();
1382 fiy1 = _mm_setzero_ps();
1383 fiz1 = _mm_setzero_ps();
1384 fix2 = _mm_setzero_ps();
1385 fiy2 = _mm_setzero_ps();
1386 fiz2 = _mm_setzero_ps();
1387
1388 /* Start inner kernel loop */
1389 for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
1390 {
1391
1392 /* Get j neighbor index, and coordinate index */
1393 jnrA = jjnr[jidx];
1394 jnrB = jjnr[jidx+1];
1395 jnrC = jjnr[jidx+2];
1396 jnrD = jjnr[jidx+3];
1397 j_coord_offsetA = DIM3*jnrA;
1398 j_coord_offsetB = DIM3*jnrB;
1399 j_coord_offsetC = DIM3*jnrC;
1400 j_coord_offsetD = DIM3*jnrD;
1401
1402 /* load j atom coordinates */
1403 gmx_mm_load_3rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
1404 x+j_coord_offsetC,x+j_coord_offsetD,
1405 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,&jy2,&jz2);
1406
1407 /* Calculate displacement vector */
1408 dx00 = _mm_sub_ps(ix0,jx0);
1409 dy00 = _mm_sub_ps(iy0,jy0);
1410 dz00 = _mm_sub_ps(iz0,jz0);
1411 dx01 = _mm_sub_ps(ix0,jx1);
1412 dy01 = _mm_sub_ps(iy0,jy1);
1413 dz01 = _mm_sub_ps(iz0,jz1);
1414 dx02 = _mm_sub_ps(ix0,jx2);
1415 dy02 = _mm_sub_ps(iy0,jy2);
1416 dz02 = _mm_sub_ps(iz0,jz2);
1417 dx10 = _mm_sub_ps(ix1,jx0);
1418 dy10 = _mm_sub_ps(iy1,jy0);
1419 dz10 = _mm_sub_ps(iz1,jz0);
1420 dx11 = _mm_sub_ps(ix1,jx1);
1421 dy11 = _mm_sub_ps(iy1,jy1);
1422 dz11 = _mm_sub_ps(iz1,jz1);
1423 dx12 = _mm_sub_ps(ix1,jx2);
1424 dy12 = _mm_sub_ps(iy1,jy2);
1425 dz12 = _mm_sub_ps(iz1,jz2);
1426 dx20 = _mm_sub_ps(ix2,jx0);
1427 dy20 = _mm_sub_ps(iy2,jy0);
1428 dz20 = _mm_sub_ps(iz2,jz0);
1429 dx21 = _mm_sub_ps(ix2,jx1);
1430 dy21 = _mm_sub_ps(iy2,jy1);
1431 dz21 = _mm_sub_ps(iz2,jz1);
1432 dx22 = _mm_sub_ps(ix2,jx2);
1433 dy22 = _mm_sub_ps(iy2,jy2);
1434 dz22 = _mm_sub_ps(iz2,jz2);
1435
1436 /* Calculate squared distance and things based on it */
1437 rsq00 = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
1438 rsq01 = gmx_mm_calc_rsq_ps(dx01,dy01,dz01);
1439 rsq02 = gmx_mm_calc_rsq_ps(dx02,dy02,dz02);
1440 rsq10 = gmx_mm_calc_rsq_ps(dx10,dy10,dz10);
1441 rsq11 = gmx_mm_calc_rsq_ps(dx11,dy11,dz11);
1442 rsq12 = gmx_mm_calc_rsq_ps(dx12,dy12,dz12);
1443 rsq20 = gmx_mm_calc_rsq_ps(dx20,dy20,dz20);
1444 rsq21 = gmx_mm_calc_rsq_ps(dx21,dy21,dz21);
1445 rsq22 = gmx_mm_calc_rsq_ps(dx22,dy22,dz22);
1446
1447 rinv00 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq00);
1448 rinv01 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq01);
1449 rinv02 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq02);
1450 rinv10 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq10);
1451 rinv11 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq11);
1452 rinv12 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq12);
1453 rinv20 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq20);
1454 rinv21 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq21);
1455 rinv22 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq22);
1456
1457 rinvsq00 = _mm_mul_ps(rinv00,rinv00);
1458 rinvsq01 = _mm_mul_ps(rinv01,rinv01);
1459 rinvsq02 = _mm_mul_ps(rinv02,rinv02);
1460 rinvsq10 = _mm_mul_ps(rinv10,rinv10);
1461 rinvsq11 = _mm_mul_ps(rinv11,rinv11);
1462 rinvsq12 = _mm_mul_ps(rinv12,rinv12);
1463 rinvsq20 = _mm_mul_ps(rinv20,rinv20);
1464 rinvsq21 = _mm_mul_ps(rinv21,rinv21);
1465 rinvsq22 = _mm_mul_ps(rinv22,rinv22);
1466
1467 fjx0 = _mm_setzero_ps();
1468 fjy0 = _mm_setzero_ps();
1469 fjz0 = _mm_setzero_ps();
1470 fjx1 = _mm_setzero_ps();
1471 fjy1 = _mm_setzero_ps();
1472 fjz1 = _mm_setzero_ps();
1473 fjx2 = _mm_setzero_ps();
1474 fjy2 = _mm_setzero_ps();
1475 fjz2 = _mm_setzero_ps();
1476
1477 /**************************
1478 * CALCULATE INTERACTIONS *
1479 **************************/
1480
1481 if (gmx_mm_any_lt(rsq00,rcutoff2))
1482 {
1483
1484 r00 = _mm_mul_ps(rsq00,rinv00);
1485
1486 /* Calculate table index by multiplying r with table scale and truncate to integer */
1487 rt = _mm_mul_ps(r00,vftabscale);
1488 vfitab = _mm_cvttps_epi32(rt);
1489 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
1490 vfitab = _mm_slli_epi32(vfitab,3);
1491
1492 /* REACTION-FIELD ELECTROSTATICS */
1493 felec = _mm_mul_ps(qq00,_mm_sub_ps(_mm_mul_ps(rinv00,rinvsq00),krf2));
1494
1495 /* CUBIC SPLINE TABLE DISPERSION */
1496 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
1497 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
1498 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
1499 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
1500 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
1501 Heps = _mm_mul_ps(vfeps,H);
1502 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
1503 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
1504 fvdw6 = _mm_mul_ps(c6_00,FF);
1505
1506 /* CUBIC SPLINE TABLE REPULSION */
1507 vfitab = _mm_add_epi32(vfitab,ifour);
1508 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
1509 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
1510 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
1511 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
1512 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
1513 Heps = _mm_mul_ps(vfeps,H);
1514 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
1515 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
1516 fvdw12 = _mm_mul_ps(c12_00,FF);
1517 fvdw = _mm_xor_ps(signbit,_mm_mul_ps(_mm_add_ps(fvdw6,fvdw12),_mm_mul_ps(vftabscale,rinv00)));
1518
1519 cutoff_mask = _mm_cmplt_ps(rsq00,rcutoff2);
1520
1521 fscal = _mm_add_ps(felec,fvdw);
1522
1523 fscal = _mm_and_ps(fscal,cutoff_mask);
1524
1525 /* Calculate temporary vectorial force */
1526 tx = _mm_mul_ps(fscal,dx00);
1527 ty = _mm_mul_ps(fscal,dy00);
1528 tz = _mm_mul_ps(fscal,dz00);
1529
1530 /* Update vectorial force */
1531 fix0 = _mm_add_ps(fix0,tx);
1532 fiy0 = _mm_add_ps(fiy0,ty);
1533 fiz0 = _mm_add_ps(fiz0,tz);
1534
1535 fjx0 = _mm_add_ps(fjx0,tx);
1536 fjy0 = _mm_add_ps(fjy0,ty);
1537 fjz0 = _mm_add_ps(fjz0,tz);
1538
1539 }
1540
1541 /**************************
1542 * CALCULATE INTERACTIONS *
1543 **************************/
1544
1545 if (gmx_mm_any_lt(rsq01,rcutoff2))
1546 {
1547
1548 /* REACTION-FIELD ELECTROSTATICS */
1549 felec = _mm_mul_ps(qq01,_mm_sub_ps(_mm_mul_ps(rinv01,rinvsq01),krf2));
1550
1551 cutoff_mask = _mm_cmplt_ps(rsq01,rcutoff2);
1552
1553 fscal = felec;
1554
1555 fscal = _mm_and_ps(fscal,cutoff_mask);
1556
1557 /* Calculate temporary vectorial force */
1558 tx = _mm_mul_ps(fscal,dx01);
1559 ty = _mm_mul_ps(fscal,dy01);
1560 tz = _mm_mul_ps(fscal,dz01);
1561
1562 /* Update vectorial force */
1563 fix0 = _mm_add_ps(fix0,tx);
1564 fiy0 = _mm_add_ps(fiy0,ty);
1565 fiz0 = _mm_add_ps(fiz0,tz);
1566
1567 fjx1 = _mm_add_ps(fjx1,tx);
1568 fjy1 = _mm_add_ps(fjy1,ty);
1569 fjz1 = _mm_add_ps(fjz1,tz);
1570
1571 }
1572
1573 /**************************
1574 * CALCULATE INTERACTIONS *
1575 **************************/
1576
1577 if (gmx_mm_any_lt(rsq02,rcutoff2))
1578 {
1579
1580 /* REACTION-FIELD ELECTROSTATICS */
1581 felec = _mm_mul_ps(qq02,_mm_sub_ps(_mm_mul_ps(rinv02,rinvsq02),krf2));
1582
1583 cutoff_mask = _mm_cmplt_ps(rsq02,rcutoff2);
1584
1585 fscal = felec;
1586
1587 fscal = _mm_and_ps(fscal,cutoff_mask);
1588
1589 /* Calculate temporary vectorial force */
1590 tx = _mm_mul_ps(fscal,dx02);
1591 ty = _mm_mul_ps(fscal,dy02);
1592 tz = _mm_mul_ps(fscal,dz02);
1593
1594 /* Update vectorial force */
1595 fix0 = _mm_add_ps(fix0,tx);
1596 fiy0 = _mm_add_ps(fiy0,ty);
1597 fiz0 = _mm_add_ps(fiz0,tz);
1598
1599 fjx2 = _mm_add_ps(fjx2,tx);
1600 fjy2 = _mm_add_ps(fjy2,ty);
1601 fjz2 = _mm_add_ps(fjz2,tz);
1602
1603 }
1604
1605 /**************************
1606 * CALCULATE INTERACTIONS *
1607 **************************/
1608
1609 if (gmx_mm_any_lt(rsq10,rcutoff2))
1610 {
1611
1612 /* REACTION-FIELD ELECTROSTATICS */
1613 felec = _mm_mul_ps(qq10,_mm_sub_ps(_mm_mul_ps(rinv10,rinvsq10),krf2));
1614
1615 cutoff_mask = _mm_cmplt_ps(rsq10,rcutoff2);
1616
1617 fscal = felec;
1618
1619 fscal = _mm_and_ps(fscal,cutoff_mask);
1620
1621 /* Calculate temporary vectorial force */
1622 tx = _mm_mul_ps(fscal,dx10);
1623 ty = _mm_mul_ps(fscal,dy10);
1624 tz = _mm_mul_ps(fscal,dz10);
1625
1626 /* Update vectorial force */
1627 fix1 = _mm_add_ps(fix1,tx);
1628 fiy1 = _mm_add_ps(fiy1,ty);
1629 fiz1 = _mm_add_ps(fiz1,tz);
1630
1631 fjx0 = _mm_add_ps(fjx0,tx);
1632 fjy0 = _mm_add_ps(fjy0,ty);
1633 fjz0 = _mm_add_ps(fjz0,tz);
1634
1635 }
1636
1637 /**************************
1638 * CALCULATE INTERACTIONS *
1639 **************************/
1640
1641 if (gmx_mm_any_lt(rsq11,rcutoff2))
1642 {
1643
1644 /* REACTION-FIELD ELECTROSTATICS */
1645 felec = _mm_mul_ps(qq11,_mm_sub_ps(_mm_mul_ps(rinv11,rinvsq11),krf2));
1646
1647 cutoff_mask = _mm_cmplt_ps(rsq11,rcutoff2);
1648
1649 fscal = felec;
1650
1651 fscal = _mm_and_ps(fscal,cutoff_mask);
1652
1653 /* Calculate temporary vectorial force */
1654 tx = _mm_mul_ps(fscal,dx11);
1655 ty = _mm_mul_ps(fscal,dy11);
1656 tz = _mm_mul_ps(fscal,dz11);
1657
1658 /* Update vectorial force */
1659 fix1 = _mm_add_ps(fix1,tx);
1660 fiy1 = _mm_add_ps(fiy1,ty);
1661 fiz1 = _mm_add_ps(fiz1,tz);
1662
1663 fjx1 = _mm_add_ps(fjx1,tx);
1664 fjy1 = _mm_add_ps(fjy1,ty);
1665 fjz1 = _mm_add_ps(fjz1,tz);
1666
1667 }
1668
1669 /**************************
1670 * CALCULATE INTERACTIONS *
1671 **************************/
1672
1673 if (gmx_mm_any_lt(rsq12,rcutoff2))
1674 {
1675
1676 /* REACTION-FIELD ELECTROSTATICS */
1677 felec = _mm_mul_ps(qq12,_mm_sub_ps(_mm_mul_ps(rinv12,rinvsq12),krf2));
1678
1679 cutoff_mask = _mm_cmplt_ps(rsq12,rcutoff2);
1680
1681 fscal = felec;
1682
1683 fscal = _mm_and_ps(fscal,cutoff_mask);
1684
1685 /* Calculate temporary vectorial force */
1686 tx = _mm_mul_ps(fscal,dx12);
1687 ty = _mm_mul_ps(fscal,dy12);
1688 tz = _mm_mul_ps(fscal,dz12);
1689
1690 /* Update vectorial force */
1691 fix1 = _mm_add_ps(fix1,tx);
1692 fiy1 = _mm_add_ps(fiy1,ty);
1693 fiz1 = _mm_add_ps(fiz1,tz);
1694
1695 fjx2 = _mm_add_ps(fjx2,tx);
1696 fjy2 = _mm_add_ps(fjy2,ty);
1697 fjz2 = _mm_add_ps(fjz2,tz);
1698
1699 }
1700
1701 /**************************
1702 * CALCULATE INTERACTIONS *
1703 **************************/
1704
1705 if (gmx_mm_any_lt(rsq20,rcutoff2))
1706 {
1707
1708 /* REACTION-FIELD ELECTROSTATICS */
1709 felec = _mm_mul_ps(qq20,_mm_sub_ps(_mm_mul_ps(rinv20,rinvsq20),krf2));
1710
1711 cutoff_mask = _mm_cmplt_ps(rsq20,rcutoff2);
1712
1713 fscal = felec;
1714
1715 fscal = _mm_and_ps(fscal,cutoff_mask);
1716
1717 /* Calculate temporary vectorial force */
1718 tx = _mm_mul_ps(fscal,dx20);
1719 ty = _mm_mul_ps(fscal,dy20);
1720 tz = _mm_mul_ps(fscal,dz20);
1721
1722 /* Update vectorial force */
1723 fix2 = _mm_add_ps(fix2,tx);
1724 fiy2 = _mm_add_ps(fiy2,ty);
1725 fiz2 = _mm_add_ps(fiz2,tz);
1726
1727 fjx0 = _mm_add_ps(fjx0,tx);
1728 fjy0 = _mm_add_ps(fjy0,ty);
1729 fjz0 = _mm_add_ps(fjz0,tz);
1730
1731 }
1732
1733 /**************************
1734 * CALCULATE INTERACTIONS *
1735 **************************/
1736
1737 if (gmx_mm_any_lt(rsq21,rcutoff2))
1738 {
1739
1740 /* REACTION-FIELD ELECTROSTATICS */
1741 felec = _mm_mul_ps(qq21,_mm_sub_ps(_mm_mul_ps(rinv21,rinvsq21),krf2));
1742
1743 cutoff_mask = _mm_cmplt_ps(rsq21,rcutoff2);
1744
1745 fscal = felec;
1746
1747 fscal = _mm_and_ps(fscal,cutoff_mask);
1748
1749 /* Calculate temporary vectorial force */
1750 tx = _mm_mul_ps(fscal,dx21);
1751 ty = _mm_mul_ps(fscal,dy21);
1752 tz = _mm_mul_ps(fscal,dz21);
1753
1754 /* Update vectorial force */
1755 fix2 = _mm_add_ps(fix2,tx);
1756 fiy2 = _mm_add_ps(fiy2,ty);
1757 fiz2 = _mm_add_ps(fiz2,tz);
1758
1759 fjx1 = _mm_add_ps(fjx1,tx);
1760 fjy1 = _mm_add_ps(fjy1,ty);
1761 fjz1 = _mm_add_ps(fjz1,tz);
1762
1763 }
1764
1765 /**************************
1766 * CALCULATE INTERACTIONS *
1767 **************************/
1768
1769 if (gmx_mm_any_lt(rsq22,rcutoff2))
1770 {
1771
1772 /* REACTION-FIELD ELECTROSTATICS */
1773 felec = _mm_mul_ps(qq22,_mm_sub_ps(_mm_mul_ps(rinv22,rinvsq22),krf2));
1774
1775 cutoff_mask = _mm_cmplt_ps(rsq22,rcutoff2);
1776
1777 fscal = felec;
1778
1779 fscal = _mm_and_ps(fscal,cutoff_mask);
1780
1781 /* Calculate temporary vectorial force */
1782 tx = _mm_mul_ps(fscal,dx22);
1783 ty = _mm_mul_ps(fscal,dy22);
1784 tz = _mm_mul_ps(fscal,dz22);
1785
1786 /* Update vectorial force */
1787 fix2 = _mm_add_ps(fix2,tx);
1788 fiy2 = _mm_add_ps(fiy2,ty);
1789 fiz2 = _mm_add_ps(fiz2,tz);
1790
1791 fjx2 = _mm_add_ps(fjx2,tx);
1792 fjy2 = _mm_add_ps(fjy2,ty);
1793 fjz2 = _mm_add_ps(fjz2,tz);
1794
1795 }
1796
1797 fjptrA = f+j_coord_offsetA;
1798 fjptrB = f+j_coord_offsetB;
1799 fjptrC = f+j_coord_offsetC;
1800 fjptrD = f+j_coord_offsetD;
1801
1802 gmx_mm_decrement_3rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,
1803 fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2);
1804
1805 /* Inner loop uses 297 flops */
1806 }
1807
1808 if(jidx<j_index_end)
1809 {
1810
1811 /* Get j neighbor index, and coordinate index */
1812 jnrlistA = jjnr[jidx];
1813 jnrlistB = jjnr[jidx+1];
1814 jnrlistC = jjnr[jidx+2];
1815 jnrlistD = jjnr[jidx+3];
1816 /* Sign of each element will be negative for non-real atoms.
1817 * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
1818 * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
1819 */
1820 dummy_mask = gmx_mm_castsi128_ps_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
1821 jnrA = (jnrlistA>=0) ? jnrlistA : 0;
1822 jnrB = (jnrlistB>=0) ? jnrlistB : 0;
1823 jnrC = (jnrlistC>=0) ? jnrlistC : 0;
1824 jnrD = (jnrlistD>=0) ? jnrlistD : 0;
1825 j_coord_offsetA = DIM3*jnrA;
1826 j_coord_offsetB = DIM3*jnrB;
1827 j_coord_offsetC = DIM3*jnrC;
1828 j_coord_offsetD = DIM3*jnrD;
1829
1830 /* load j atom coordinates */
1831 gmx_mm_load_3rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
1832 x+j_coord_offsetC,x+j_coord_offsetD,
1833 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,&jy2,&jz2);
1834
1835 /* Calculate displacement vector */
1836 dx00 = _mm_sub_ps(ix0,jx0);
1837 dy00 = _mm_sub_ps(iy0,jy0);
1838 dz00 = _mm_sub_ps(iz0,jz0);
1839 dx01 = _mm_sub_ps(ix0,jx1);
1840 dy01 = _mm_sub_ps(iy0,jy1);
1841 dz01 = _mm_sub_ps(iz0,jz1);
1842 dx02 = _mm_sub_ps(ix0,jx2);
1843 dy02 = _mm_sub_ps(iy0,jy2);
1844 dz02 = _mm_sub_ps(iz0,jz2);
1845 dx10 = _mm_sub_ps(ix1,jx0);
1846 dy10 = _mm_sub_ps(iy1,jy0);
1847 dz10 = _mm_sub_ps(iz1,jz0);
1848 dx11 = _mm_sub_ps(ix1,jx1);
1849 dy11 = _mm_sub_ps(iy1,jy1);
1850 dz11 = _mm_sub_ps(iz1,jz1);
1851 dx12 = _mm_sub_ps(ix1,jx2);
1852 dy12 = _mm_sub_ps(iy1,jy2);
1853 dz12 = _mm_sub_ps(iz1,jz2);
1854 dx20 = _mm_sub_ps(ix2,jx0);
1855 dy20 = _mm_sub_ps(iy2,jy0);
1856 dz20 = _mm_sub_ps(iz2,jz0);
1857 dx21 = _mm_sub_ps(ix2,jx1);
1858 dy21 = _mm_sub_ps(iy2,jy1);
1859 dz21 = _mm_sub_ps(iz2,jz1);
1860 dx22 = _mm_sub_ps(ix2,jx2);
1861 dy22 = _mm_sub_ps(iy2,jy2);
1862 dz22 = _mm_sub_ps(iz2,jz2);
1863
1864 /* Calculate squared distance and things based on it */
1865 rsq00 = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
1866 rsq01 = gmx_mm_calc_rsq_ps(dx01,dy01,dz01);
1867 rsq02 = gmx_mm_calc_rsq_ps(dx02,dy02,dz02);
1868 rsq10 = gmx_mm_calc_rsq_ps(dx10,dy10,dz10);
1869 rsq11 = gmx_mm_calc_rsq_ps(dx11,dy11,dz11);
1870 rsq12 = gmx_mm_calc_rsq_ps(dx12,dy12,dz12);
1871 rsq20 = gmx_mm_calc_rsq_ps(dx20,dy20,dz20);
1872 rsq21 = gmx_mm_calc_rsq_ps(dx21,dy21,dz21);
1873 rsq22 = gmx_mm_calc_rsq_ps(dx22,dy22,dz22);
1874
1875 rinv00 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq00);
1876 rinv01 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq01);
1877 rinv02 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq02);
1878 rinv10 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq10);
1879 rinv11 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq11);
1880 rinv12 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq12);
1881 rinv20 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq20);
1882 rinv21 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq21);
1883 rinv22 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq22);
1884
1885 rinvsq00 = _mm_mul_ps(rinv00,rinv00);
1886 rinvsq01 = _mm_mul_ps(rinv01,rinv01);
1887 rinvsq02 = _mm_mul_ps(rinv02,rinv02);
1888 rinvsq10 = _mm_mul_ps(rinv10,rinv10);
1889 rinvsq11 = _mm_mul_ps(rinv11,rinv11);
1890 rinvsq12 = _mm_mul_ps(rinv12,rinv12);
1891 rinvsq20 = _mm_mul_ps(rinv20,rinv20);
1892 rinvsq21 = _mm_mul_ps(rinv21,rinv21);
1893 rinvsq22 = _mm_mul_ps(rinv22,rinv22);
1894
1895 fjx0 = _mm_setzero_ps();
1896 fjy0 = _mm_setzero_ps();
1897 fjz0 = _mm_setzero_ps();
1898 fjx1 = _mm_setzero_ps();
1899 fjy1 = _mm_setzero_ps();
1900 fjz1 = _mm_setzero_ps();
1901 fjx2 = _mm_setzero_ps();
1902 fjy2 = _mm_setzero_ps();
1903 fjz2 = _mm_setzero_ps();
1904
1905 /**************************
1906 * CALCULATE INTERACTIONS *
1907 **************************/
1908
1909 if (gmx_mm_any_lt(rsq00,rcutoff2))
1910 {
1911
1912 r00 = _mm_mul_ps(rsq00,rinv00);
1913 r00 = _mm_andnot_ps(dummy_mask,r00);
1914
1915 /* Calculate table index by multiplying r with table scale and truncate to integer */
1916 rt = _mm_mul_ps(r00,vftabscale);
1917 vfitab = _mm_cvttps_epi32(rt);
1918 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
1919 vfitab = _mm_slli_epi32(vfitab,3);
1920
1921 /* REACTION-FIELD ELECTROSTATICS */
1922 felec = _mm_mul_ps(qq00,_mm_sub_ps(_mm_mul_ps(rinv00,rinvsq00),krf2));
1923
1924 /* CUBIC SPLINE TABLE DISPERSION */
1925 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
1926 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
1927 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
1928 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
1929 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
1930 Heps = _mm_mul_ps(vfeps,H);
1931 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
1932 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
1933 fvdw6 = _mm_mul_ps(c6_00,FF);
1934
1935 /* CUBIC SPLINE TABLE REPULSION */
1936 vfitab = _mm_add_epi32(vfitab,ifour);
1937 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
1938 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
1939 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
1940 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
1941 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
1942 Heps = _mm_mul_ps(vfeps,H);
1943 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
1944 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
1945 fvdw12 = _mm_mul_ps(c12_00,FF);
1946 fvdw = _mm_xor_ps(signbit,_mm_mul_ps(_mm_add_ps(fvdw6,fvdw12),_mm_mul_ps(vftabscale,rinv00)));
1947
1948 cutoff_mask = _mm_cmplt_ps(rsq00,rcutoff2);
1949
1950 fscal = _mm_add_ps(felec,fvdw);
1951
1952 fscal = _mm_and_ps(fscal,cutoff_mask);
1953
1954 fscal = _mm_andnot_ps(dummy_mask,fscal);
1955
1956 /* Calculate temporary vectorial force */
1957 tx = _mm_mul_ps(fscal,dx00);
1958 ty = _mm_mul_ps(fscal,dy00);
1959 tz = _mm_mul_ps(fscal,dz00);
1960
1961 /* Update vectorial force */
1962 fix0 = _mm_add_ps(fix0,tx);
1963 fiy0 = _mm_add_ps(fiy0,ty);
1964 fiz0 = _mm_add_ps(fiz0,tz);
1965
1966 fjx0 = _mm_add_ps(fjx0,tx);
1967 fjy0 = _mm_add_ps(fjy0,ty);
1968 fjz0 = _mm_add_ps(fjz0,tz);
1969
1970 }
1971
1972 /**************************
1973 * CALCULATE INTERACTIONS *
1974 **************************/
1975
1976 if (gmx_mm_any_lt(rsq01,rcutoff2))
1977 {
1978
1979 /* REACTION-FIELD ELECTROSTATICS */
1980 felec = _mm_mul_ps(qq01,_mm_sub_ps(_mm_mul_ps(rinv01,rinvsq01),krf2));
1981
1982 cutoff_mask = _mm_cmplt_ps(rsq01,rcutoff2);
1983
1984 fscal = felec;
1985
1986 fscal = _mm_and_ps(fscal,cutoff_mask);
1987
1988 fscal = _mm_andnot_ps(dummy_mask,fscal);
1989
1990 /* Calculate temporary vectorial force */
1991 tx = _mm_mul_ps(fscal,dx01);
1992 ty = _mm_mul_ps(fscal,dy01);
1993 tz = _mm_mul_ps(fscal,dz01);
1994
1995 /* Update vectorial force */
1996 fix0 = _mm_add_ps(fix0,tx);
1997 fiy0 = _mm_add_ps(fiy0,ty);
1998 fiz0 = _mm_add_ps(fiz0,tz);
1999
2000 fjx1 = _mm_add_ps(fjx1,tx);
2001 fjy1 = _mm_add_ps(fjy1,ty);
2002 fjz1 = _mm_add_ps(fjz1,tz);
2003
2004 }
2005
2006 /**************************
2007 * CALCULATE INTERACTIONS *
2008 **************************/
2009
2010 if (gmx_mm_any_lt(rsq02,rcutoff2))
2011 {
2012
2013 /* REACTION-FIELD ELECTROSTATICS */
2014 felec = _mm_mul_ps(qq02,_mm_sub_ps(_mm_mul_ps(rinv02,rinvsq02),krf2));
2015
2016 cutoff_mask = _mm_cmplt_ps(rsq02,rcutoff2);
2017
2018 fscal = felec;
2019
2020 fscal = _mm_and_ps(fscal,cutoff_mask);
2021
2022 fscal = _mm_andnot_ps(dummy_mask,fscal);
2023
2024 /* Calculate temporary vectorial force */
2025 tx = _mm_mul_ps(fscal,dx02);
2026 ty = _mm_mul_ps(fscal,dy02);
2027 tz = _mm_mul_ps(fscal,dz02);
2028
2029 /* Update vectorial force */
2030 fix0 = _mm_add_ps(fix0,tx);
2031 fiy0 = _mm_add_ps(fiy0,ty);
2032 fiz0 = _mm_add_ps(fiz0,tz);
2033
2034 fjx2 = _mm_add_ps(fjx2,tx);
2035 fjy2 = _mm_add_ps(fjy2,ty);
2036 fjz2 = _mm_add_ps(fjz2,tz);
2037
2038 }
2039
2040 /**************************
2041 * CALCULATE INTERACTIONS *
2042 **************************/
2043
2044 if (gmx_mm_any_lt(rsq10,rcutoff2))
2045 {
2046
2047 /* REACTION-FIELD ELECTROSTATICS */
2048 felec = _mm_mul_ps(qq10,_mm_sub_ps(_mm_mul_ps(rinv10,rinvsq10),krf2));
2049
2050 cutoff_mask = _mm_cmplt_ps(rsq10,rcutoff2);
2051
2052 fscal = felec;
2053
2054 fscal = _mm_and_ps(fscal,cutoff_mask);
2055
2056 fscal = _mm_andnot_ps(dummy_mask,fscal);
2057
2058 /* Calculate temporary vectorial force */
2059 tx = _mm_mul_ps(fscal,dx10);
2060 ty = _mm_mul_ps(fscal,dy10);
2061 tz = _mm_mul_ps(fscal,dz10);
2062
2063 /* Update vectorial force */
2064 fix1 = _mm_add_ps(fix1,tx);
2065 fiy1 = _mm_add_ps(fiy1,ty);
2066 fiz1 = _mm_add_ps(fiz1,tz);
2067
2068 fjx0 = _mm_add_ps(fjx0,tx);
2069 fjy0 = _mm_add_ps(fjy0,ty);
2070 fjz0 = _mm_add_ps(fjz0,tz);
2071
2072 }
2073
2074 /**************************
2075 * CALCULATE INTERACTIONS *
2076 **************************/
2077
2078 if (gmx_mm_any_lt(rsq11,rcutoff2))
2079 {
2080
2081 /* REACTION-FIELD ELECTROSTATICS */
2082 felec = _mm_mul_ps(qq11,_mm_sub_ps(_mm_mul_ps(rinv11,rinvsq11),krf2));
2083
2084 cutoff_mask = _mm_cmplt_ps(rsq11,rcutoff2);
2085
2086 fscal = felec;
2087
2088 fscal = _mm_and_ps(fscal,cutoff_mask);
2089
2090 fscal = _mm_andnot_ps(dummy_mask,fscal);
2091
2092 /* Calculate temporary vectorial force */
2093 tx = _mm_mul_ps(fscal,dx11);
2094 ty = _mm_mul_ps(fscal,dy11);
2095 tz = _mm_mul_ps(fscal,dz11);
2096
2097 /* Update vectorial force */
2098 fix1 = _mm_add_ps(fix1,tx);
2099 fiy1 = _mm_add_ps(fiy1,ty);
2100 fiz1 = _mm_add_ps(fiz1,tz);
2101
2102 fjx1 = _mm_add_ps(fjx1,tx);
2103 fjy1 = _mm_add_ps(fjy1,ty);
2104 fjz1 = _mm_add_ps(fjz1,tz);
2105
2106 }
2107
2108 /**************************
2109 * CALCULATE INTERACTIONS *
2110 **************************/
2111
2112 if (gmx_mm_any_lt(rsq12,rcutoff2))
2113 {
2114
2115 /* REACTION-FIELD ELECTROSTATICS */
2116 felec = _mm_mul_ps(qq12,_mm_sub_ps(_mm_mul_ps(rinv12,rinvsq12),krf2));
2117
2118 cutoff_mask = _mm_cmplt_ps(rsq12,rcutoff2);
2119
2120 fscal = felec;
2121
2122 fscal = _mm_and_ps(fscal,cutoff_mask);
2123
2124 fscal = _mm_andnot_ps(dummy_mask,fscal);
2125
2126 /* Calculate temporary vectorial force */
2127 tx = _mm_mul_ps(fscal,dx12);
2128 ty = _mm_mul_ps(fscal,dy12);
2129 tz = _mm_mul_ps(fscal,dz12);
2130
2131 /* Update vectorial force */
2132 fix1 = _mm_add_ps(fix1,tx);
2133 fiy1 = _mm_add_ps(fiy1,ty);
2134 fiz1 = _mm_add_ps(fiz1,tz);
2135
2136 fjx2 = _mm_add_ps(fjx2,tx);
2137 fjy2 = _mm_add_ps(fjy2,ty);
2138 fjz2 = _mm_add_ps(fjz2,tz);
2139
2140 }
2141
2142 /**************************
2143 * CALCULATE INTERACTIONS *
2144 **************************/
2145
2146 if (gmx_mm_any_lt(rsq20,rcutoff2))
2147 {
2148
2149 /* REACTION-FIELD ELECTROSTATICS */
2150 felec = _mm_mul_ps(qq20,_mm_sub_ps(_mm_mul_ps(rinv20,rinvsq20),krf2));
2151
2152 cutoff_mask = _mm_cmplt_ps(rsq20,rcutoff2);
2153
2154 fscal = felec;
2155
2156 fscal = _mm_and_ps(fscal,cutoff_mask);
2157
2158 fscal = _mm_andnot_ps(dummy_mask,fscal);
2159
2160 /* Calculate temporary vectorial force */
2161 tx = _mm_mul_ps(fscal,dx20);
2162 ty = _mm_mul_ps(fscal,dy20);
2163 tz = _mm_mul_ps(fscal,dz20);
2164
2165 /* Update vectorial force */
2166 fix2 = _mm_add_ps(fix2,tx);
2167 fiy2 = _mm_add_ps(fiy2,ty);
2168 fiz2 = _mm_add_ps(fiz2,tz);
2169
2170 fjx0 = _mm_add_ps(fjx0,tx);
2171 fjy0 = _mm_add_ps(fjy0,ty);
2172 fjz0 = _mm_add_ps(fjz0,tz);
2173
2174 }
2175
2176 /**************************
2177 * CALCULATE INTERACTIONS *
2178 **************************/
2179
2180 if (gmx_mm_any_lt(rsq21,rcutoff2))
2181 {
2182
2183 /* REACTION-FIELD ELECTROSTATICS */
2184 felec = _mm_mul_ps(qq21,_mm_sub_ps(_mm_mul_ps(rinv21,rinvsq21),krf2));
2185
2186 cutoff_mask = _mm_cmplt_ps(rsq21,rcutoff2);
2187
2188 fscal = felec;
2189
2190 fscal = _mm_and_ps(fscal,cutoff_mask);
2191
2192 fscal = _mm_andnot_ps(dummy_mask,fscal);
2193
2194 /* Calculate temporary vectorial force */
2195 tx = _mm_mul_ps(fscal,dx21);
2196 ty = _mm_mul_ps(fscal,dy21);
2197 tz = _mm_mul_ps(fscal,dz21);
2198
2199 /* Update vectorial force */
2200 fix2 = _mm_add_ps(fix2,tx);
2201 fiy2 = _mm_add_ps(fiy2,ty);
2202 fiz2 = _mm_add_ps(fiz2,tz);
2203
2204 fjx1 = _mm_add_ps(fjx1,tx);
2205 fjy1 = _mm_add_ps(fjy1,ty);
2206 fjz1 = _mm_add_ps(fjz1,tz);
2207
2208 }
2209
2210 /**************************
2211 * CALCULATE INTERACTIONS *
2212 **************************/
2213
2214 if (gmx_mm_any_lt(rsq22,rcutoff2))
2215 {
2216
2217 /* REACTION-FIELD ELECTROSTATICS */
2218 felec = _mm_mul_ps(qq22,_mm_sub_ps(_mm_mul_ps(rinv22,rinvsq22),krf2));
2219
2220 cutoff_mask = _mm_cmplt_ps(rsq22,rcutoff2);
2221
2222 fscal = felec;
2223
2224 fscal = _mm_and_ps(fscal,cutoff_mask);
2225
2226 fscal = _mm_andnot_ps(dummy_mask,fscal);
2227
2228 /* Calculate temporary vectorial force */
2229 tx = _mm_mul_ps(fscal,dx22);
2230 ty = _mm_mul_ps(fscal,dy22);
2231 tz = _mm_mul_ps(fscal,dz22);
2232
2233 /* Update vectorial force */
2234 fix2 = _mm_add_ps(fix2,tx);
2235 fiy2 = _mm_add_ps(fiy2,ty);
2236 fiz2 = _mm_add_ps(fiz2,tz);
2237
2238 fjx2 = _mm_add_ps(fjx2,tx);
2239 fjy2 = _mm_add_ps(fjy2,ty);
2240 fjz2 = _mm_add_ps(fjz2,tz);
2241
2242 }
2243
2244 fjptrA = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
2245 fjptrB = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
2246 fjptrC = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
2247 fjptrD = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
2248
2249 gmx_mm_decrement_3rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,
2250 fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2);
2251
2252 /* Inner loop uses 298 flops */
2253 }
2254
2255 /* End of innermost loop */
2256
2257 gmx_mm_update_iforce_3atom_swizzle_ps(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,
2258 f+i_coord_offset,fshift+i_shift_offset);
2259
2260 /* Increment number of inner iterations */
2261 inneriter += j_index_end - j_index_start;
2262
2263 /* Outer loop uses 18 flops */
2264 }
2265
2266 /* Increment number of outer iterations */
2267 outeriter += nri;
2268
2269 /* Update outer/inner flops */
2270
2271 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3W3_F,outeriter*18 + inneriter*298)(nrnb)->n[eNR_NBKERNEL_ELEC_VDW_W3W3_F] += outeriter*18 + inneriter
*298
;
2272}