2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2012,2013,2014,2015,2017, 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.
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.
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.
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.
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.
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.
36 * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
44 #include "../nb_kernel.h"
45 #include "gromacs/gmxlib/nrnb.h"
47 #include "kernelutil_x86_avx_128_fma_single.h"
50 * Gromacs nonbonded kernel: nb_kernel_ElecRF_VdwLJ_GeomW4P1_VF_avx_128_fma_single
51 * Electrostatics interaction: ReactionField
52 * VdW interaction: LennardJones
53 * Geometry: Water4-Particle
54 * Calculate force/pot: PotentialAndForce
57 nb_kernel_ElecRF_VdwLJ_GeomW4P1_VF_avx_128_fma_single
58 (t_nblist * gmx_restrict nlist,
59 rvec * gmx_restrict xx,
60 rvec * gmx_restrict ff,
61 struct t_forcerec * gmx_restrict fr,
62 t_mdatoms * gmx_restrict mdatoms,
63 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
64 t_nrnb * gmx_restrict nrnb)
66 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
67 * just 0 for non-waters.
68 * Suffixes A,B,C,D refer to j loop unrolling done with AVX_128, e.g. for the four different
69 * jnr indices corresponding to data put in the four positions in the SIMD register.
71 int i_shift_offset,i_coord_offset,outeriter,inneriter;
72 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
73 int jnrA,jnrB,jnrC,jnrD;
74 int jnrlistA,jnrlistB,jnrlistC,jnrlistD;
75 int j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
76 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
78 real *shiftvec,*fshift,*x,*f;
79 real *fjptrA,*fjptrB,*fjptrC,*fjptrD;
81 __m128 fscal,rcutoff,rcutoff2,jidxall;
83 __m128 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
85 __m128 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
87 __m128 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
89 __m128 ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
90 int vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
91 __m128 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
92 __m128 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
93 __m128 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
94 __m128 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
95 __m128 dx30,dy30,dz30,rsq30,rinv30,rinvsq30,r30,qq30,c6_30,c12_30;
96 __m128 velec,felec,velecsum,facel,crf,krf,krf2;
99 __m128 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
102 __m128 one_sixth = _mm_set1_ps(1.0/6.0);
103 __m128 one_twelfth = _mm_set1_ps(1.0/12.0);
104 __m128 dummy_mask,cutoff_mask;
105 __m128 signbit = _mm_castsi128_ps( _mm_set1_epi32(0x80000000) );
106 __m128 one = _mm_set1_ps(1.0);
107 __m128 two = _mm_set1_ps(2.0);
113 jindex = nlist->jindex;
115 shiftidx = nlist->shift;
117 shiftvec = fr->shift_vec[0];
118 fshift = fr->fshift[0];
119 facel = _mm_set1_ps(fr->ic->epsfac);
120 charge = mdatoms->chargeA;
121 krf = _mm_set1_ps(fr->ic->k_rf);
122 krf2 = _mm_set1_ps(fr->ic->k_rf*2.0);
123 crf = _mm_set1_ps(fr->ic->c_rf);
124 nvdwtype = fr->ntype;
126 vdwtype = mdatoms->typeA;
128 /* Setup water-specific parameters */
129 inr = nlist->iinr[0];
130 iq1 = _mm_mul_ps(facel,_mm_set1_ps(charge[inr+1]));
131 iq2 = _mm_mul_ps(facel,_mm_set1_ps(charge[inr+2]));
132 iq3 = _mm_mul_ps(facel,_mm_set1_ps(charge[inr+3]));
133 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
135 /* Avoid stupid compiler warnings */
136 jnrA = jnrB = jnrC = jnrD = 0;
145 for(iidx=0;iidx<4*DIM;iidx++)
150 /* Start outer loop over neighborlists */
151 for(iidx=0; iidx<nri; iidx++)
153 /* Load shift vector for this list */
154 i_shift_offset = DIM*shiftidx[iidx];
156 /* Load limits for loop over neighbors */
157 j_index_start = jindex[iidx];
158 j_index_end = jindex[iidx+1];
160 /* Get outer coordinate index */
162 i_coord_offset = DIM*inr;
164 /* Load i particle coords and add shift vector */
165 gmx_mm_load_shift_and_4rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,
166 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
168 fix0 = _mm_setzero_ps();
169 fiy0 = _mm_setzero_ps();
170 fiz0 = _mm_setzero_ps();
171 fix1 = _mm_setzero_ps();
172 fiy1 = _mm_setzero_ps();
173 fiz1 = _mm_setzero_ps();
174 fix2 = _mm_setzero_ps();
175 fiy2 = _mm_setzero_ps();
176 fiz2 = _mm_setzero_ps();
177 fix3 = _mm_setzero_ps();
178 fiy3 = _mm_setzero_ps();
179 fiz3 = _mm_setzero_ps();
181 /* Reset potential sums */
182 velecsum = _mm_setzero_ps();
183 vvdwsum = _mm_setzero_ps();
185 /* Start inner kernel loop */
186 for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
189 /* Get j neighbor index, and coordinate index */
194 j_coord_offsetA = DIM*jnrA;
195 j_coord_offsetB = DIM*jnrB;
196 j_coord_offsetC = DIM*jnrC;
197 j_coord_offsetD = DIM*jnrD;
199 /* load j atom coordinates */
200 gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
201 x+j_coord_offsetC,x+j_coord_offsetD,
204 /* Calculate displacement vector */
205 dx00 = _mm_sub_ps(ix0,jx0);
206 dy00 = _mm_sub_ps(iy0,jy0);
207 dz00 = _mm_sub_ps(iz0,jz0);
208 dx10 = _mm_sub_ps(ix1,jx0);
209 dy10 = _mm_sub_ps(iy1,jy0);
210 dz10 = _mm_sub_ps(iz1,jz0);
211 dx20 = _mm_sub_ps(ix2,jx0);
212 dy20 = _mm_sub_ps(iy2,jy0);
213 dz20 = _mm_sub_ps(iz2,jz0);
214 dx30 = _mm_sub_ps(ix3,jx0);
215 dy30 = _mm_sub_ps(iy3,jy0);
216 dz30 = _mm_sub_ps(iz3,jz0);
218 /* Calculate squared distance and things based on it */
219 rsq00 = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
220 rsq10 = gmx_mm_calc_rsq_ps(dx10,dy10,dz10);
221 rsq20 = gmx_mm_calc_rsq_ps(dx20,dy20,dz20);
222 rsq30 = gmx_mm_calc_rsq_ps(dx30,dy30,dz30);
224 rinv10 = avx128fma_invsqrt_f(rsq10);
225 rinv20 = avx128fma_invsqrt_f(rsq20);
226 rinv30 = avx128fma_invsqrt_f(rsq30);
228 rinvsq00 = avx128fma_inv_f(rsq00);
229 rinvsq10 = _mm_mul_ps(rinv10,rinv10);
230 rinvsq20 = _mm_mul_ps(rinv20,rinv20);
231 rinvsq30 = _mm_mul_ps(rinv30,rinv30);
233 /* Load parameters for j particles */
234 jq0 = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
235 charge+jnrC+0,charge+jnrD+0);
236 vdwjidx0A = 2*vdwtype[jnrA+0];
237 vdwjidx0B = 2*vdwtype[jnrB+0];
238 vdwjidx0C = 2*vdwtype[jnrC+0];
239 vdwjidx0D = 2*vdwtype[jnrD+0];
241 fjx0 = _mm_setzero_ps();
242 fjy0 = _mm_setzero_ps();
243 fjz0 = _mm_setzero_ps();
245 /**************************
246 * CALCULATE INTERACTIONS *
247 **************************/
249 /* Compute parameters for interactions between i and j atoms */
250 gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
251 vdwparam+vdwioffset0+vdwjidx0B,
252 vdwparam+vdwioffset0+vdwjidx0C,
253 vdwparam+vdwioffset0+vdwjidx0D,
256 /* LENNARD-JONES DISPERSION/REPULSION */
258 rinvsix = _mm_mul_ps(_mm_mul_ps(rinvsq00,rinvsq00),rinvsq00);
259 vvdw6 = _mm_mul_ps(c6_00,rinvsix);
260 vvdw12 = _mm_mul_ps(c12_00,_mm_mul_ps(rinvsix,rinvsix));
261 vvdw = _mm_msub_ps(vvdw12,one_twelfth,_mm_mul_ps(vvdw6,one_sixth));
262 fvdw = _mm_mul_ps(_mm_sub_ps(vvdw12,vvdw6),rinvsq00);
264 /* Update potential sum for this i atom from the interaction with this j atom. */
265 vvdwsum = _mm_add_ps(vvdwsum,vvdw);
269 /* Update vectorial force */
270 fix0 = _mm_macc_ps(dx00,fscal,fix0);
271 fiy0 = _mm_macc_ps(dy00,fscal,fiy0);
272 fiz0 = _mm_macc_ps(dz00,fscal,fiz0);
274 fjx0 = _mm_macc_ps(dx00,fscal,fjx0);
275 fjy0 = _mm_macc_ps(dy00,fscal,fjy0);
276 fjz0 = _mm_macc_ps(dz00,fscal,fjz0);
278 /**************************
279 * CALCULATE INTERACTIONS *
280 **************************/
282 /* Compute parameters for interactions between i and j atoms */
283 qq10 = _mm_mul_ps(iq1,jq0);
285 /* REACTION-FIELD ELECTROSTATICS */
286 velec = _mm_mul_ps(qq10,_mm_sub_ps(_mm_macc_ps(krf,rsq10,rinv10),crf));
287 felec = _mm_mul_ps(qq10,_mm_msub_ps(rinv10,rinvsq10,krf2));
289 /* Update potential sum for this i atom from the interaction with this j atom. */
290 velecsum = _mm_add_ps(velecsum,velec);
294 /* Update vectorial force */
295 fix1 = _mm_macc_ps(dx10,fscal,fix1);
296 fiy1 = _mm_macc_ps(dy10,fscal,fiy1);
297 fiz1 = _mm_macc_ps(dz10,fscal,fiz1);
299 fjx0 = _mm_macc_ps(dx10,fscal,fjx0);
300 fjy0 = _mm_macc_ps(dy10,fscal,fjy0);
301 fjz0 = _mm_macc_ps(dz10,fscal,fjz0);
303 /**************************
304 * CALCULATE INTERACTIONS *
305 **************************/
307 /* Compute parameters for interactions between i and j atoms */
308 qq20 = _mm_mul_ps(iq2,jq0);
310 /* REACTION-FIELD ELECTROSTATICS */
311 velec = _mm_mul_ps(qq20,_mm_sub_ps(_mm_macc_ps(krf,rsq20,rinv20),crf));
312 felec = _mm_mul_ps(qq20,_mm_msub_ps(rinv20,rinvsq20,krf2));
314 /* Update potential sum for this i atom from the interaction with this j atom. */
315 velecsum = _mm_add_ps(velecsum,velec);
319 /* Update vectorial force */
320 fix2 = _mm_macc_ps(dx20,fscal,fix2);
321 fiy2 = _mm_macc_ps(dy20,fscal,fiy2);
322 fiz2 = _mm_macc_ps(dz20,fscal,fiz2);
324 fjx0 = _mm_macc_ps(dx20,fscal,fjx0);
325 fjy0 = _mm_macc_ps(dy20,fscal,fjy0);
326 fjz0 = _mm_macc_ps(dz20,fscal,fjz0);
328 /**************************
329 * CALCULATE INTERACTIONS *
330 **************************/
332 /* Compute parameters for interactions between i and j atoms */
333 qq30 = _mm_mul_ps(iq3,jq0);
335 /* REACTION-FIELD ELECTROSTATICS */
336 velec = _mm_mul_ps(qq30,_mm_sub_ps(_mm_macc_ps(krf,rsq30,rinv30),crf));
337 felec = _mm_mul_ps(qq30,_mm_msub_ps(rinv30,rinvsq30,krf2));
339 /* Update potential sum for this i atom from the interaction with this j atom. */
340 velecsum = _mm_add_ps(velecsum,velec);
344 /* Update vectorial force */
345 fix3 = _mm_macc_ps(dx30,fscal,fix3);
346 fiy3 = _mm_macc_ps(dy30,fscal,fiy3);
347 fiz3 = _mm_macc_ps(dz30,fscal,fiz3);
349 fjx0 = _mm_macc_ps(dx30,fscal,fjx0);
350 fjy0 = _mm_macc_ps(dy30,fscal,fjy0);
351 fjz0 = _mm_macc_ps(dz30,fscal,fjz0);
353 fjptrA = f+j_coord_offsetA;
354 fjptrB = f+j_coord_offsetB;
355 fjptrC = f+j_coord_offsetC;
356 fjptrD = f+j_coord_offsetD;
358 gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjx0,fjy0,fjz0);
360 /* Inner loop uses 140 flops */
366 /* Get j neighbor index, and coordinate index */
367 jnrlistA = jjnr[jidx];
368 jnrlistB = jjnr[jidx+1];
369 jnrlistC = jjnr[jidx+2];
370 jnrlistD = jjnr[jidx+3];
371 /* Sign of each element will be negative for non-real atoms.
372 * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
373 * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
375 dummy_mask = gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
376 jnrA = (jnrlistA>=0) ? jnrlistA : 0;
377 jnrB = (jnrlistB>=0) ? jnrlistB : 0;
378 jnrC = (jnrlistC>=0) ? jnrlistC : 0;
379 jnrD = (jnrlistD>=0) ? jnrlistD : 0;
380 j_coord_offsetA = DIM*jnrA;
381 j_coord_offsetB = DIM*jnrB;
382 j_coord_offsetC = DIM*jnrC;
383 j_coord_offsetD = DIM*jnrD;
385 /* load j atom coordinates */
386 gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
387 x+j_coord_offsetC,x+j_coord_offsetD,
390 /* Calculate displacement vector */
391 dx00 = _mm_sub_ps(ix0,jx0);
392 dy00 = _mm_sub_ps(iy0,jy0);
393 dz00 = _mm_sub_ps(iz0,jz0);
394 dx10 = _mm_sub_ps(ix1,jx0);
395 dy10 = _mm_sub_ps(iy1,jy0);
396 dz10 = _mm_sub_ps(iz1,jz0);
397 dx20 = _mm_sub_ps(ix2,jx0);
398 dy20 = _mm_sub_ps(iy2,jy0);
399 dz20 = _mm_sub_ps(iz2,jz0);
400 dx30 = _mm_sub_ps(ix3,jx0);
401 dy30 = _mm_sub_ps(iy3,jy0);
402 dz30 = _mm_sub_ps(iz3,jz0);
404 /* Calculate squared distance and things based on it */
405 rsq00 = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
406 rsq10 = gmx_mm_calc_rsq_ps(dx10,dy10,dz10);
407 rsq20 = gmx_mm_calc_rsq_ps(dx20,dy20,dz20);
408 rsq30 = gmx_mm_calc_rsq_ps(dx30,dy30,dz30);
410 rinv10 = avx128fma_invsqrt_f(rsq10);
411 rinv20 = avx128fma_invsqrt_f(rsq20);
412 rinv30 = avx128fma_invsqrt_f(rsq30);
414 rinvsq00 = avx128fma_inv_f(rsq00);
415 rinvsq10 = _mm_mul_ps(rinv10,rinv10);
416 rinvsq20 = _mm_mul_ps(rinv20,rinv20);
417 rinvsq30 = _mm_mul_ps(rinv30,rinv30);
419 /* Load parameters for j particles */
420 jq0 = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
421 charge+jnrC+0,charge+jnrD+0);
422 vdwjidx0A = 2*vdwtype[jnrA+0];
423 vdwjidx0B = 2*vdwtype[jnrB+0];
424 vdwjidx0C = 2*vdwtype[jnrC+0];
425 vdwjidx0D = 2*vdwtype[jnrD+0];
427 fjx0 = _mm_setzero_ps();
428 fjy0 = _mm_setzero_ps();
429 fjz0 = _mm_setzero_ps();
431 /**************************
432 * CALCULATE INTERACTIONS *
433 **************************/
435 /* Compute parameters for interactions between i and j atoms */
436 gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
437 vdwparam+vdwioffset0+vdwjidx0B,
438 vdwparam+vdwioffset0+vdwjidx0C,
439 vdwparam+vdwioffset0+vdwjidx0D,
442 /* LENNARD-JONES DISPERSION/REPULSION */
444 rinvsix = _mm_mul_ps(_mm_mul_ps(rinvsq00,rinvsq00),rinvsq00);
445 vvdw6 = _mm_mul_ps(c6_00,rinvsix);
446 vvdw12 = _mm_mul_ps(c12_00,_mm_mul_ps(rinvsix,rinvsix));
447 vvdw = _mm_msub_ps(vvdw12,one_twelfth,_mm_mul_ps(vvdw6,one_sixth));
448 fvdw = _mm_mul_ps(_mm_sub_ps(vvdw12,vvdw6),rinvsq00);
450 /* Update potential sum for this i atom from the interaction with this j atom. */
451 vvdw = _mm_andnot_ps(dummy_mask,vvdw);
452 vvdwsum = _mm_add_ps(vvdwsum,vvdw);
456 fscal = _mm_andnot_ps(dummy_mask,fscal);
458 /* Update vectorial force */
459 fix0 = _mm_macc_ps(dx00,fscal,fix0);
460 fiy0 = _mm_macc_ps(dy00,fscal,fiy0);
461 fiz0 = _mm_macc_ps(dz00,fscal,fiz0);
463 fjx0 = _mm_macc_ps(dx00,fscal,fjx0);
464 fjy0 = _mm_macc_ps(dy00,fscal,fjy0);
465 fjz0 = _mm_macc_ps(dz00,fscal,fjz0);
467 /**************************
468 * CALCULATE INTERACTIONS *
469 **************************/
471 /* Compute parameters for interactions between i and j atoms */
472 qq10 = _mm_mul_ps(iq1,jq0);
474 /* REACTION-FIELD ELECTROSTATICS */
475 velec = _mm_mul_ps(qq10,_mm_sub_ps(_mm_macc_ps(krf,rsq10,rinv10),crf));
476 felec = _mm_mul_ps(qq10,_mm_msub_ps(rinv10,rinvsq10,krf2));
478 /* Update potential sum for this i atom from the interaction with this j atom. */
479 velec = _mm_andnot_ps(dummy_mask,velec);
480 velecsum = _mm_add_ps(velecsum,velec);
484 fscal = _mm_andnot_ps(dummy_mask,fscal);
486 /* Update vectorial force */
487 fix1 = _mm_macc_ps(dx10,fscal,fix1);
488 fiy1 = _mm_macc_ps(dy10,fscal,fiy1);
489 fiz1 = _mm_macc_ps(dz10,fscal,fiz1);
491 fjx0 = _mm_macc_ps(dx10,fscal,fjx0);
492 fjy0 = _mm_macc_ps(dy10,fscal,fjy0);
493 fjz0 = _mm_macc_ps(dz10,fscal,fjz0);
495 /**************************
496 * CALCULATE INTERACTIONS *
497 **************************/
499 /* Compute parameters for interactions between i and j atoms */
500 qq20 = _mm_mul_ps(iq2,jq0);
502 /* REACTION-FIELD ELECTROSTATICS */
503 velec = _mm_mul_ps(qq20,_mm_sub_ps(_mm_macc_ps(krf,rsq20,rinv20),crf));
504 felec = _mm_mul_ps(qq20,_mm_msub_ps(rinv20,rinvsq20,krf2));
506 /* Update potential sum for this i atom from the interaction with this j atom. */
507 velec = _mm_andnot_ps(dummy_mask,velec);
508 velecsum = _mm_add_ps(velecsum,velec);
512 fscal = _mm_andnot_ps(dummy_mask,fscal);
514 /* Update vectorial force */
515 fix2 = _mm_macc_ps(dx20,fscal,fix2);
516 fiy2 = _mm_macc_ps(dy20,fscal,fiy2);
517 fiz2 = _mm_macc_ps(dz20,fscal,fiz2);
519 fjx0 = _mm_macc_ps(dx20,fscal,fjx0);
520 fjy0 = _mm_macc_ps(dy20,fscal,fjy0);
521 fjz0 = _mm_macc_ps(dz20,fscal,fjz0);
523 /**************************
524 * CALCULATE INTERACTIONS *
525 **************************/
527 /* Compute parameters for interactions between i and j atoms */
528 qq30 = _mm_mul_ps(iq3,jq0);
530 /* REACTION-FIELD ELECTROSTATICS */
531 velec = _mm_mul_ps(qq30,_mm_sub_ps(_mm_macc_ps(krf,rsq30,rinv30),crf));
532 felec = _mm_mul_ps(qq30,_mm_msub_ps(rinv30,rinvsq30,krf2));
534 /* Update potential sum for this i atom from the interaction with this j atom. */
535 velec = _mm_andnot_ps(dummy_mask,velec);
536 velecsum = _mm_add_ps(velecsum,velec);
540 fscal = _mm_andnot_ps(dummy_mask,fscal);
542 /* Update vectorial force */
543 fix3 = _mm_macc_ps(dx30,fscal,fix3);
544 fiy3 = _mm_macc_ps(dy30,fscal,fiy3);
545 fiz3 = _mm_macc_ps(dz30,fscal,fiz3);
547 fjx0 = _mm_macc_ps(dx30,fscal,fjx0);
548 fjy0 = _mm_macc_ps(dy30,fscal,fjy0);
549 fjz0 = _mm_macc_ps(dz30,fscal,fjz0);
551 fjptrA = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
552 fjptrB = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
553 fjptrC = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
554 fjptrD = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
556 gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjx0,fjy0,fjz0);
558 /* Inner loop uses 140 flops */
561 /* End of innermost loop */
563 gmx_mm_update_iforce_4atom_swizzle_ps(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
564 f+i_coord_offset,fshift+i_shift_offset);
567 /* Update potential energies */
568 gmx_mm_update_1pot_ps(velecsum,kernel_data->energygrp_elec+ggid);
569 gmx_mm_update_1pot_ps(vvdwsum,kernel_data->energygrp_vdw+ggid);
571 /* Increment number of inner iterations */
572 inneriter += j_index_end - j_index_start;
574 /* Outer loop uses 26 flops */
577 /* Increment number of outer iterations */
580 /* Update outer/inner flops */
582 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4_VF,outeriter*26 + inneriter*140);
585 * Gromacs nonbonded kernel: nb_kernel_ElecRF_VdwLJ_GeomW4P1_F_avx_128_fma_single
586 * Electrostatics interaction: ReactionField
587 * VdW interaction: LennardJones
588 * Geometry: Water4-Particle
589 * Calculate force/pot: Force
592 nb_kernel_ElecRF_VdwLJ_GeomW4P1_F_avx_128_fma_single
593 (t_nblist * gmx_restrict nlist,
594 rvec * gmx_restrict xx,
595 rvec * gmx_restrict ff,
596 struct t_forcerec * gmx_restrict fr,
597 t_mdatoms * gmx_restrict mdatoms,
598 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
599 t_nrnb * gmx_restrict nrnb)
601 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
602 * just 0 for non-waters.
603 * Suffixes A,B,C,D refer to j loop unrolling done with AVX_128, e.g. for the four different
604 * jnr indices corresponding to data put in the four positions in the SIMD register.
606 int i_shift_offset,i_coord_offset,outeriter,inneriter;
607 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
608 int jnrA,jnrB,jnrC,jnrD;
609 int jnrlistA,jnrlistB,jnrlistC,jnrlistD;
610 int j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
611 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
613 real *shiftvec,*fshift,*x,*f;
614 real *fjptrA,*fjptrB,*fjptrC,*fjptrD;
616 __m128 fscal,rcutoff,rcutoff2,jidxall;
618 __m128 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
620 __m128 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
622 __m128 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
624 __m128 ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
625 int vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
626 __m128 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
627 __m128 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
628 __m128 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
629 __m128 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
630 __m128 dx30,dy30,dz30,rsq30,rinv30,rinvsq30,r30,qq30,c6_30,c12_30;
631 __m128 velec,felec,velecsum,facel,crf,krf,krf2;
634 __m128 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
637 __m128 one_sixth = _mm_set1_ps(1.0/6.0);
638 __m128 one_twelfth = _mm_set1_ps(1.0/12.0);
639 __m128 dummy_mask,cutoff_mask;
640 __m128 signbit = _mm_castsi128_ps( _mm_set1_epi32(0x80000000) );
641 __m128 one = _mm_set1_ps(1.0);
642 __m128 two = _mm_set1_ps(2.0);
648 jindex = nlist->jindex;
650 shiftidx = nlist->shift;
652 shiftvec = fr->shift_vec[0];
653 fshift = fr->fshift[0];
654 facel = _mm_set1_ps(fr->ic->epsfac);
655 charge = mdatoms->chargeA;
656 krf = _mm_set1_ps(fr->ic->k_rf);
657 krf2 = _mm_set1_ps(fr->ic->k_rf*2.0);
658 crf = _mm_set1_ps(fr->ic->c_rf);
659 nvdwtype = fr->ntype;
661 vdwtype = mdatoms->typeA;
663 /* Setup water-specific parameters */
664 inr = nlist->iinr[0];
665 iq1 = _mm_mul_ps(facel,_mm_set1_ps(charge[inr+1]));
666 iq2 = _mm_mul_ps(facel,_mm_set1_ps(charge[inr+2]));
667 iq3 = _mm_mul_ps(facel,_mm_set1_ps(charge[inr+3]));
668 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
670 /* Avoid stupid compiler warnings */
671 jnrA = jnrB = jnrC = jnrD = 0;
680 for(iidx=0;iidx<4*DIM;iidx++)
685 /* Start outer loop over neighborlists */
686 for(iidx=0; iidx<nri; iidx++)
688 /* Load shift vector for this list */
689 i_shift_offset = DIM*shiftidx[iidx];
691 /* Load limits for loop over neighbors */
692 j_index_start = jindex[iidx];
693 j_index_end = jindex[iidx+1];
695 /* Get outer coordinate index */
697 i_coord_offset = DIM*inr;
699 /* Load i particle coords and add shift vector */
700 gmx_mm_load_shift_and_4rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,
701 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
703 fix0 = _mm_setzero_ps();
704 fiy0 = _mm_setzero_ps();
705 fiz0 = _mm_setzero_ps();
706 fix1 = _mm_setzero_ps();
707 fiy1 = _mm_setzero_ps();
708 fiz1 = _mm_setzero_ps();
709 fix2 = _mm_setzero_ps();
710 fiy2 = _mm_setzero_ps();
711 fiz2 = _mm_setzero_ps();
712 fix3 = _mm_setzero_ps();
713 fiy3 = _mm_setzero_ps();
714 fiz3 = _mm_setzero_ps();
716 /* Start inner kernel loop */
717 for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
720 /* Get j neighbor index, and coordinate index */
725 j_coord_offsetA = DIM*jnrA;
726 j_coord_offsetB = DIM*jnrB;
727 j_coord_offsetC = DIM*jnrC;
728 j_coord_offsetD = DIM*jnrD;
730 /* load j atom coordinates */
731 gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
732 x+j_coord_offsetC,x+j_coord_offsetD,
735 /* Calculate displacement vector */
736 dx00 = _mm_sub_ps(ix0,jx0);
737 dy00 = _mm_sub_ps(iy0,jy0);
738 dz00 = _mm_sub_ps(iz0,jz0);
739 dx10 = _mm_sub_ps(ix1,jx0);
740 dy10 = _mm_sub_ps(iy1,jy0);
741 dz10 = _mm_sub_ps(iz1,jz0);
742 dx20 = _mm_sub_ps(ix2,jx0);
743 dy20 = _mm_sub_ps(iy2,jy0);
744 dz20 = _mm_sub_ps(iz2,jz0);
745 dx30 = _mm_sub_ps(ix3,jx0);
746 dy30 = _mm_sub_ps(iy3,jy0);
747 dz30 = _mm_sub_ps(iz3,jz0);
749 /* Calculate squared distance and things based on it */
750 rsq00 = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
751 rsq10 = gmx_mm_calc_rsq_ps(dx10,dy10,dz10);
752 rsq20 = gmx_mm_calc_rsq_ps(dx20,dy20,dz20);
753 rsq30 = gmx_mm_calc_rsq_ps(dx30,dy30,dz30);
755 rinv10 = avx128fma_invsqrt_f(rsq10);
756 rinv20 = avx128fma_invsqrt_f(rsq20);
757 rinv30 = avx128fma_invsqrt_f(rsq30);
759 rinvsq00 = avx128fma_inv_f(rsq00);
760 rinvsq10 = _mm_mul_ps(rinv10,rinv10);
761 rinvsq20 = _mm_mul_ps(rinv20,rinv20);
762 rinvsq30 = _mm_mul_ps(rinv30,rinv30);
764 /* Load parameters for j particles */
765 jq0 = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
766 charge+jnrC+0,charge+jnrD+0);
767 vdwjidx0A = 2*vdwtype[jnrA+0];
768 vdwjidx0B = 2*vdwtype[jnrB+0];
769 vdwjidx0C = 2*vdwtype[jnrC+0];
770 vdwjidx0D = 2*vdwtype[jnrD+0];
772 fjx0 = _mm_setzero_ps();
773 fjy0 = _mm_setzero_ps();
774 fjz0 = _mm_setzero_ps();
776 /**************************
777 * CALCULATE INTERACTIONS *
778 **************************/
780 /* Compute parameters for interactions between i and j atoms */
781 gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
782 vdwparam+vdwioffset0+vdwjidx0B,
783 vdwparam+vdwioffset0+vdwjidx0C,
784 vdwparam+vdwioffset0+vdwjidx0D,
787 /* LENNARD-JONES DISPERSION/REPULSION */
789 rinvsix = _mm_mul_ps(_mm_mul_ps(rinvsq00,rinvsq00),rinvsq00);
790 fvdw = _mm_mul_ps(_mm_msub_ps(c12_00,rinvsix,c6_00),_mm_mul_ps(rinvsix,rinvsq00));
794 /* Update vectorial force */
795 fix0 = _mm_macc_ps(dx00,fscal,fix0);
796 fiy0 = _mm_macc_ps(dy00,fscal,fiy0);
797 fiz0 = _mm_macc_ps(dz00,fscal,fiz0);
799 fjx0 = _mm_macc_ps(dx00,fscal,fjx0);
800 fjy0 = _mm_macc_ps(dy00,fscal,fjy0);
801 fjz0 = _mm_macc_ps(dz00,fscal,fjz0);
803 /**************************
804 * CALCULATE INTERACTIONS *
805 **************************/
807 /* Compute parameters for interactions between i and j atoms */
808 qq10 = _mm_mul_ps(iq1,jq0);
810 /* REACTION-FIELD ELECTROSTATICS */
811 felec = _mm_mul_ps(qq10,_mm_msub_ps(rinv10,rinvsq10,krf2));
815 /* Update vectorial force */
816 fix1 = _mm_macc_ps(dx10,fscal,fix1);
817 fiy1 = _mm_macc_ps(dy10,fscal,fiy1);
818 fiz1 = _mm_macc_ps(dz10,fscal,fiz1);
820 fjx0 = _mm_macc_ps(dx10,fscal,fjx0);
821 fjy0 = _mm_macc_ps(dy10,fscal,fjy0);
822 fjz0 = _mm_macc_ps(dz10,fscal,fjz0);
824 /**************************
825 * CALCULATE INTERACTIONS *
826 **************************/
828 /* Compute parameters for interactions between i and j atoms */
829 qq20 = _mm_mul_ps(iq2,jq0);
831 /* REACTION-FIELD ELECTROSTATICS */
832 felec = _mm_mul_ps(qq20,_mm_msub_ps(rinv20,rinvsq20,krf2));
836 /* Update vectorial force */
837 fix2 = _mm_macc_ps(dx20,fscal,fix2);
838 fiy2 = _mm_macc_ps(dy20,fscal,fiy2);
839 fiz2 = _mm_macc_ps(dz20,fscal,fiz2);
841 fjx0 = _mm_macc_ps(dx20,fscal,fjx0);
842 fjy0 = _mm_macc_ps(dy20,fscal,fjy0);
843 fjz0 = _mm_macc_ps(dz20,fscal,fjz0);
845 /**************************
846 * CALCULATE INTERACTIONS *
847 **************************/
849 /* Compute parameters for interactions between i and j atoms */
850 qq30 = _mm_mul_ps(iq3,jq0);
852 /* REACTION-FIELD ELECTROSTATICS */
853 felec = _mm_mul_ps(qq30,_mm_msub_ps(rinv30,rinvsq30,krf2));
857 /* Update vectorial force */
858 fix3 = _mm_macc_ps(dx30,fscal,fix3);
859 fiy3 = _mm_macc_ps(dy30,fscal,fiy3);
860 fiz3 = _mm_macc_ps(dz30,fscal,fiz3);
862 fjx0 = _mm_macc_ps(dx30,fscal,fjx0);
863 fjy0 = _mm_macc_ps(dy30,fscal,fjy0);
864 fjz0 = _mm_macc_ps(dz30,fscal,fjz0);
866 fjptrA = f+j_coord_offsetA;
867 fjptrB = f+j_coord_offsetB;
868 fjptrC = f+j_coord_offsetC;
869 fjptrD = f+j_coord_offsetD;
871 gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjx0,fjy0,fjz0);
873 /* Inner loop uses 120 flops */
879 /* Get j neighbor index, and coordinate index */
880 jnrlistA = jjnr[jidx];
881 jnrlistB = jjnr[jidx+1];
882 jnrlistC = jjnr[jidx+2];
883 jnrlistD = jjnr[jidx+3];
884 /* Sign of each element will be negative for non-real atoms.
885 * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
886 * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
888 dummy_mask = gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
889 jnrA = (jnrlistA>=0) ? jnrlistA : 0;
890 jnrB = (jnrlistB>=0) ? jnrlistB : 0;
891 jnrC = (jnrlistC>=0) ? jnrlistC : 0;
892 jnrD = (jnrlistD>=0) ? jnrlistD : 0;
893 j_coord_offsetA = DIM*jnrA;
894 j_coord_offsetB = DIM*jnrB;
895 j_coord_offsetC = DIM*jnrC;
896 j_coord_offsetD = DIM*jnrD;
898 /* load j atom coordinates */
899 gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
900 x+j_coord_offsetC,x+j_coord_offsetD,
903 /* Calculate displacement vector */
904 dx00 = _mm_sub_ps(ix0,jx0);
905 dy00 = _mm_sub_ps(iy0,jy0);
906 dz00 = _mm_sub_ps(iz0,jz0);
907 dx10 = _mm_sub_ps(ix1,jx0);
908 dy10 = _mm_sub_ps(iy1,jy0);
909 dz10 = _mm_sub_ps(iz1,jz0);
910 dx20 = _mm_sub_ps(ix2,jx0);
911 dy20 = _mm_sub_ps(iy2,jy0);
912 dz20 = _mm_sub_ps(iz2,jz0);
913 dx30 = _mm_sub_ps(ix3,jx0);
914 dy30 = _mm_sub_ps(iy3,jy0);
915 dz30 = _mm_sub_ps(iz3,jz0);
917 /* Calculate squared distance and things based on it */
918 rsq00 = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
919 rsq10 = gmx_mm_calc_rsq_ps(dx10,dy10,dz10);
920 rsq20 = gmx_mm_calc_rsq_ps(dx20,dy20,dz20);
921 rsq30 = gmx_mm_calc_rsq_ps(dx30,dy30,dz30);
923 rinv10 = avx128fma_invsqrt_f(rsq10);
924 rinv20 = avx128fma_invsqrt_f(rsq20);
925 rinv30 = avx128fma_invsqrt_f(rsq30);
927 rinvsq00 = avx128fma_inv_f(rsq00);
928 rinvsq10 = _mm_mul_ps(rinv10,rinv10);
929 rinvsq20 = _mm_mul_ps(rinv20,rinv20);
930 rinvsq30 = _mm_mul_ps(rinv30,rinv30);
932 /* Load parameters for j particles */
933 jq0 = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
934 charge+jnrC+0,charge+jnrD+0);
935 vdwjidx0A = 2*vdwtype[jnrA+0];
936 vdwjidx0B = 2*vdwtype[jnrB+0];
937 vdwjidx0C = 2*vdwtype[jnrC+0];
938 vdwjidx0D = 2*vdwtype[jnrD+0];
940 fjx0 = _mm_setzero_ps();
941 fjy0 = _mm_setzero_ps();
942 fjz0 = _mm_setzero_ps();
944 /**************************
945 * CALCULATE INTERACTIONS *
946 **************************/
948 /* Compute parameters for interactions between i and j atoms */
949 gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
950 vdwparam+vdwioffset0+vdwjidx0B,
951 vdwparam+vdwioffset0+vdwjidx0C,
952 vdwparam+vdwioffset0+vdwjidx0D,
955 /* LENNARD-JONES DISPERSION/REPULSION */
957 rinvsix = _mm_mul_ps(_mm_mul_ps(rinvsq00,rinvsq00),rinvsq00);
958 fvdw = _mm_mul_ps(_mm_msub_ps(c12_00,rinvsix,c6_00),_mm_mul_ps(rinvsix,rinvsq00));
962 fscal = _mm_andnot_ps(dummy_mask,fscal);
964 /* Update vectorial force */
965 fix0 = _mm_macc_ps(dx00,fscal,fix0);
966 fiy0 = _mm_macc_ps(dy00,fscal,fiy0);
967 fiz0 = _mm_macc_ps(dz00,fscal,fiz0);
969 fjx0 = _mm_macc_ps(dx00,fscal,fjx0);
970 fjy0 = _mm_macc_ps(dy00,fscal,fjy0);
971 fjz0 = _mm_macc_ps(dz00,fscal,fjz0);
973 /**************************
974 * CALCULATE INTERACTIONS *
975 **************************/
977 /* Compute parameters for interactions between i and j atoms */
978 qq10 = _mm_mul_ps(iq1,jq0);
980 /* REACTION-FIELD ELECTROSTATICS */
981 felec = _mm_mul_ps(qq10,_mm_msub_ps(rinv10,rinvsq10,krf2));
985 fscal = _mm_andnot_ps(dummy_mask,fscal);
987 /* Update vectorial force */
988 fix1 = _mm_macc_ps(dx10,fscal,fix1);
989 fiy1 = _mm_macc_ps(dy10,fscal,fiy1);
990 fiz1 = _mm_macc_ps(dz10,fscal,fiz1);
992 fjx0 = _mm_macc_ps(dx10,fscal,fjx0);
993 fjy0 = _mm_macc_ps(dy10,fscal,fjy0);
994 fjz0 = _mm_macc_ps(dz10,fscal,fjz0);
996 /**************************
997 * CALCULATE INTERACTIONS *
998 **************************/
1000 /* Compute parameters for interactions between i and j atoms */
1001 qq20 = _mm_mul_ps(iq2,jq0);
1003 /* REACTION-FIELD ELECTROSTATICS */
1004 felec = _mm_mul_ps(qq20,_mm_msub_ps(rinv20,rinvsq20,krf2));
1008 fscal = _mm_andnot_ps(dummy_mask,fscal);
1010 /* Update vectorial force */
1011 fix2 = _mm_macc_ps(dx20,fscal,fix2);
1012 fiy2 = _mm_macc_ps(dy20,fscal,fiy2);
1013 fiz2 = _mm_macc_ps(dz20,fscal,fiz2);
1015 fjx0 = _mm_macc_ps(dx20,fscal,fjx0);
1016 fjy0 = _mm_macc_ps(dy20,fscal,fjy0);
1017 fjz0 = _mm_macc_ps(dz20,fscal,fjz0);
1019 /**************************
1020 * CALCULATE INTERACTIONS *
1021 **************************/
1023 /* Compute parameters for interactions between i and j atoms */
1024 qq30 = _mm_mul_ps(iq3,jq0);
1026 /* REACTION-FIELD ELECTROSTATICS */
1027 felec = _mm_mul_ps(qq30,_mm_msub_ps(rinv30,rinvsq30,krf2));
1031 fscal = _mm_andnot_ps(dummy_mask,fscal);
1033 /* Update vectorial force */
1034 fix3 = _mm_macc_ps(dx30,fscal,fix3);
1035 fiy3 = _mm_macc_ps(dy30,fscal,fiy3);
1036 fiz3 = _mm_macc_ps(dz30,fscal,fiz3);
1038 fjx0 = _mm_macc_ps(dx30,fscal,fjx0);
1039 fjy0 = _mm_macc_ps(dy30,fscal,fjy0);
1040 fjz0 = _mm_macc_ps(dz30,fscal,fjz0);
1042 fjptrA = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
1043 fjptrB = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
1044 fjptrC = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
1045 fjptrD = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
1047 gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjx0,fjy0,fjz0);
1049 /* Inner loop uses 120 flops */
1052 /* End of innermost loop */
1054 gmx_mm_update_iforce_4atom_swizzle_ps(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
1055 f+i_coord_offset,fshift+i_shift_offset);
1057 /* Increment number of inner iterations */
1058 inneriter += j_index_end - j_index_start;
1060 /* Outer loop uses 24 flops */
1063 /* Increment number of outer iterations */
1066 /* Update outer/inner flops */
1068 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4_F,outeriter*24 + inneriter*120);