2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2012, by the GROMACS development team, led by
5 * David van der Spoel, Berk Hess, Erik Lindahl, and including many
6 * others, as listed in the AUTHORS file in the top-level source
7 * 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 "types/simple.h"
49 #include "gmx_math_x86_avx_128_fma_single.h"
50 #include "kernelutil_x86_avx_128_fma_single.h"
53 * Gromacs nonbonded kernel: nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_avx_128_fma_single
54 * Electrostatics interaction: GeneralizedBorn
55 * VdW interaction: CubicSplineTable
56 * Geometry: Particle-Particle
57 * Calculate force/pot: PotentialAndForce
60 nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_avx_128_fma_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_restrict kernel_data,
67 t_nrnb * gmx_restrict nrnb)
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 AVX_128, e.g. for the four different
72 * jnr indices corresponding to data put in the four positions in the SIMD register.
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;
81 real *shiftvec,*fshift,*x,*f;
82 real *fjptrA,*fjptrB,*fjptrC,*fjptrD;
84 __m128 fscal,rcutoff,rcutoff2,jidxall;
86 __m128 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
87 int vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
88 __m128 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
89 __m128 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
90 __m128 velec,felec,velecsum,facel,crf,krf,krf2;
93 __m128 vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,twogbeps,dvdatmp;
94 __m128 minushalf = _mm_set1_ps(-0.5);
95 real *invsqrta,*dvda,*gbtab;
97 __m128 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
100 __m128 one_sixth = _mm_set1_ps(1.0/6.0);
101 __m128 one_twelfth = _mm_set1_ps(1.0/12.0);
103 __m128i ifour = _mm_set1_epi32(4);
104 __m128 rt,vfeps,twovfeps,vftabscale,Y,F,G,H,Fp,VV,FF;
106 __m128 dummy_mask,cutoff_mask;
107 __m128 signbit = _mm_castsi128_ps( _mm_set1_epi32(0x80000000) );
108 __m128 one = _mm_set1_ps(1.0);
109 __m128 two = _mm_set1_ps(2.0);
115 jindex = nlist->jindex;
117 shiftidx = nlist->shift;
119 shiftvec = fr->shift_vec[0];
120 fshift = fr->fshift[0];
121 facel = _mm_set1_ps(fr->epsfac);
122 charge = mdatoms->chargeA;
123 nvdwtype = fr->ntype;
125 vdwtype = mdatoms->typeA;
127 vftab = kernel_data->table_vdw->data;
128 vftabscale = _mm_set1_ps(kernel_data->table_vdw->scale);
130 invsqrta = fr->invsqrta;
132 gbtabscale = _mm_set1_ps(fr->gbtab.scale);
133 gbtab = fr->gbtab.data;
134 gbinvepsdiff = _mm_set1_ps((1.0/fr->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
136 /* Avoid stupid compiler warnings */
137 jnrA = jnrB = jnrC = jnrD = 0;
146 for(iidx=0;iidx<4*DIM;iidx++)
151 /* Start outer loop over neighborlists */
152 for(iidx=0; iidx<nri; iidx++)
154 /* Load shift vector for this list */
155 i_shift_offset = DIM*shiftidx[iidx];
157 /* Load limits for loop over neighbors */
158 j_index_start = jindex[iidx];
159 j_index_end = jindex[iidx+1];
161 /* Get outer coordinate index */
163 i_coord_offset = DIM*inr;
165 /* Load i particle coords and add shift vector */
166 gmx_mm_load_shift_and_1rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
168 fix0 = _mm_setzero_ps();
169 fiy0 = _mm_setzero_ps();
170 fiz0 = _mm_setzero_ps();
172 /* Load parameters for i particles */
173 iq0 = _mm_mul_ps(facel,_mm_load1_ps(charge+inr+0));
174 isai0 = _mm_load1_ps(invsqrta+inr+0);
175 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
177 /* Reset potential sums */
178 velecsum = _mm_setzero_ps();
179 vgbsum = _mm_setzero_ps();
180 vvdwsum = _mm_setzero_ps();
181 dvdasum = _mm_setzero_ps();
183 /* Start inner kernel loop */
184 for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
187 /* Get j neighbor index, and coordinate index */
192 j_coord_offsetA = DIM*jnrA;
193 j_coord_offsetB = DIM*jnrB;
194 j_coord_offsetC = DIM*jnrC;
195 j_coord_offsetD = DIM*jnrD;
197 /* load j atom coordinates */
198 gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
199 x+j_coord_offsetC,x+j_coord_offsetD,
202 /* Calculate displacement vector */
203 dx00 = _mm_sub_ps(ix0,jx0);
204 dy00 = _mm_sub_ps(iy0,jy0);
205 dz00 = _mm_sub_ps(iz0,jz0);
207 /* Calculate squared distance and things based on it */
208 rsq00 = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
210 rinv00 = gmx_mm_invsqrt_ps(rsq00);
212 /* Load parameters for j particles */
213 jq0 = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
214 charge+jnrC+0,charge+jnrD+0);
215 isaj0 = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
216 invsqrta+jnrC+0,invsqrta+jnrD+0);
217 vdwjidx0A = 2*vdwtype[jnrA+0];
218 vdwjidx0B = 2*vdwtype[jnrB+0];
219 vdwjidx0C = 2*vdwtype[jnrC+0];
220 vdwjidx0D = 2*vdwtype[jnrD+0];
222 /**************************
223 * CALCULATE INTERACTIONS *
224 **************************/
226 r00 = _mm_mul_ps(rsq00,rinv00);
228 /* Compute parameters for interactions between i and j atoms */
229 qq00 = _mm_mul_ps(iq0,jq0);
230 gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
231 vdwparam+vdwioffset0+vdwjidx0B,
232 vdwparam+vdwioffset0+vdwjidx0C,
233 vdwparam+vdwioffset0+vdwjidx0D,
236 /* Calculate table index by multiplying r with table scale and truncate to integer */
237 rt = _mm_mul_ps(r00,vftabscale);
238 vfitab = _mm_cvttps_epi32(rt);
240 vfeps = _mm_frcz_ps(rt);
242 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
244 twovfeps = _mm_add_ps(vfeps,vfeps);
245 vfitab = _mm_slli_epi32(vfitab,3);
247 /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
248 isaprod = _mm_mul_ps(isai0,isaj0);
249 gbqqfactor = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
250 gbscale = _mm_mul_ps(isaprod,gbtabscale);
252 /* Calculate generalized born table index - this is a separate table from the normal one,
253 * but we use the same procedure by multiplying r with scale and truncating to integer.
255 rt = _mm_mul_ps(r00,gbscale);
256 gbitab = _mm_cvttps_epi32(rt);
258 gbeps = _mm_frcz_ps(rt);
260 gbeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
262 gbitab = _mm_slli_epi32(gbitab,2);
264 Y = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,0) );
265 F = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,1) );
266 G = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,2) );
267 H = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,3) );
268 _MM_TRANSPOSE4_PS(Y,F,G,H);
269 Fp = _mm_macc_ps(gbeps,_mm_macc_ps(gbeps,H,G),F);
270 VV = _mm_macc_ps(gbeps,Fp,Y);
271 vgb = _mm_mul_ps(gbqqfactor,VV);
273 twogbeps = _mm_add_ps(gbeps,gbeps);
274 FF = _mm_macc_ps(_mm_macc_ps(twogbeps,H,G),gbeps,Fp);
275 fgb = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
276 dvdatmp = _mm_mul_ps(minushalf,_mm_macc_ps(fgb,r00,vgb));
277 dvdasum = _mm_add_ps(dvdasum,dvdatmp);
282 gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
283 velec = _mm_mul_ps(qq00,rinv00);
284 felec = _mm_mul_ps(_mm_msub_ps(velec,rinv00,fgb),rinv00);
286 /* CUBIC SPLINE TABLE DISPERSION */
287 Y = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,0) );
288 F = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,1) );
289 G = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,2) );
290 H = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,3) );
291 _MM_TRANSPOSE4_PS(Y,F,G,H);
292 Fp = _mm_macc_ps(vfeps,_mm_macc_ps(H,vfeps,G),F);
293 VV = _mm_macc_ps(vfeps,Fp,Y);
294 vvdw6 = _mm_mul_ps(c6_00,VV);
295 FF = _mm_macc_ps(vfeps,_mm_macc_ps(twovfeps,H,G),Fp);
296 fvdw6 = _mm_mul_ps(c6_00,FF);
298 /* CUBIC SPLINE TABLE REPULSION */
299 vfitab = _mm_add_epi32(vfitab,ifour);
300 Y = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,0) );
301 F = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,1) );
302 G = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,2) );
303 H = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,3) );
304 _MM_TRANSPOSE4_PS(Y,F,G,H);
305 Fp = _mm_macc_ps(vfeps,_mm_macc_ps(H,vfeps,G),F);
306 VV = _mm_macc_ps(vfeps,Fp,Y);
307 vvdw12 = _mm_mul_ps(c12_00,VV);
308 FF = _mm_macc_ps(vfeps,_mm_macc_ps(twovfeps,H,G),Fp);
309 fvdw12 = _mm_mul_ps(c12_00,FF);
310 vvdw = _mm_add_ps(vvdw12,vvdw6);
311 fvdw = _mm_xor_ps(signbit,_mm_mul_ps(_mm_add_ps(fvdw6,fvdw12),_mm_mul_ps(vftabscale,rinv00)));
313 /* Update potential sum for this i atom from the interaction with this j atom. */
314 velecsum = _mm_add_ps(velecsum,velec);
315 vgbsum = _mm_add_ps(vgbsum,vgb);
316 vvdwsum = _mm_add_ps(vvdwsum,vvdw);
318 fscal = _mm_add_ps(felec,fvdw);
320 /* Update vectorial force */
321 fix0 = _mm_macc_ps(dx00,fscal,fix0);
322 fiy0 = _mm_macc_ps(dy00,fscal,fiy0);
323 fiz0 = _mm_macc_ps(dz00,fscal,fiz0);
325 fjptrA = f+j_coord_offsetA;
326 fjptrB = f+j_coord_offsetB;
327 fjptrC = f+j_coord_offsetC;
328 fjptrD = f+j_coord_offsetD;
329 gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,
330 _mm_mul_ps(dx00,fscal),
331 _mm_mul_ps(dy00,fscal),
332 _mm_mul_ps(dz00,fscal));
334 /* Inner loop uses 95 flops */
340 /* Get j neighbor index, and coordinate index */
341 jnrlistA = jjnr[jidx];
342 jnrlistB = jjnr[jidx+1];
343 jnrlistC = jjnr[jidx+2];
344 jnrlistD = jjnr[jidx+3];
345 /* Sign of each element will be negative for non-real atoms.
346 * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
347 * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
349 dummy_mask = gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
350 jnrA = (jnrlistA>=0) ? jnrlistA : 0;
351 jnrB = (jnrlistB>=0) ? jnrlistB : 0;
352 jnrC = (jnrlistC>=0) ? jnrlistC : 0;
353 jnrD = (jnrlistD>=0) ? jnrlistD : 0;
354 j_coord_offsetA = DIM*jnrA;
355 j_coord_offsetB = DIM*jnrB;
356 j_coord_offsetC = DIM*jnrC;
357 j_coord_offsetD = DIM*jnrD;
359 /* load j atom coordinates */
360 gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
361 x+j_coord_offsetC,x+j_coord_offsetD,
364 /* Calculate displacement vector */
365 dx00 = _mm_sub_ps(ix0,jx0);
366 dy00 = _mm_sub_ps(iy0,jy0);
367 dz00 = _mm_sub_ps(iz0,jz0);
369 /* Calculate squared distance and things based on it */
370 rsq00 = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
372 rinv00 = gmx_mm_invsqrt_ps(rsq00);
374 /* Load parameters for j particles */
375 jq0 = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
376 charge+jnrC+0,charge+jnrD+0);
377 isaj0 = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
378 invsqrta+jnrC+0,invsqrta+jnrD+0);
379 vdwjidx0A = 2*vdwtype[jnrA+0];
380 vdwjidx0B = 2*vdwtype[jnrB+0];
381 vdwjidx0C = 2*vdwtype[jnrC+0];
382 vdwjidx0D = 2*vdwtype[jnrD+0];
384 /**************************
385 * CALCULATE INTERACTIONS *
386 **************************/
388 r00 = _mm_mul_ps(rsq00,rinv00);
389 r00 = _mm_andnot_ps(dummy_mask,r00);
391 /* Compute parameters for interactions between i and j atoms */
392 qq00 = _mm_mul_ps(iq0,jq0);
393 gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
394 vdwparam+vdwioffset0+vdwjidx0B,
395 vdwparam+vdwioffset0+vdwjidx0C,
396 vdwparam+vdwioffset0+vdwjidx0D,
399 /* Calculate table index by multiplying r with table scale and truncate to integer */
400 rt = _mm_mul_ps(r00,vftabscale);
401 vfitab = _mm_cvttps_epi32(rt);
403 vfeps = _mm_frcz_ps(rt);
405 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
407 twovfeps = _mm_add_ps(vfeps,vfeps);
408 vfitab = _mm_slli_epi32(vfitab,3);
410 /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
411 isaprod = _mm_mul_ps(isai0,isaj0);
412 gbqqfactor = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
413 gbscale = _mm_mul_ps(isaprod,gbtabscale);
415 /* Calculate generalized born table index - this is a separate table from the normal one,
416 * but we use the same procedure by multiplying r with scale and truncating to integer.
418 rt = _mm_mul_ps(r00,gbscale);
419 gbitab = _mm_cvttps_epi32(rt);
421 gbeps = _mm_frcz_ps(rt);
423 gbeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
425 gbitab = _mm_slli_epi32(gbitab,2);
427 Y = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,0) );
428 F = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,1) );
429 G = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,2) );
430 H = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,3) );
431 _MM_TRANSPOSE4_PS(Y,F,G,H);
432 Fp = _mm_macc_ps(gbeps,_mm_macc_ps(gbeps,H,G),F);
433 VV = _mm_macc_ps(gbeps,Fp,Y);
434 vgb = _mm_mul_ps(gbqqfactor,VV);
436 twogbeps = _mm_add_ps(gbeps,gbeps);
437 FF = _mm_macc_ps(_mm_macc_ps(twogbeps,H,G),gbeps,Fp);
438 fgb = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
439 dvdatmp = _mm_mul_ps(minushalf,_mm_macc_ps(fgb,r00,vgb));
440 dvdasum = _mm_add_ps(dvdasum,dvdatmp);
441 /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
442 fjptrA = (jnrlistA>=0) ? dvda+jnrA : scratch;
443 fjptrB = (jnrlistB>=0) ? dvda+jnrB : scratch;
444 fjptrC = (jnrlistC>=0) ? dvda+jnrC : scratch;
445 fjptrD = (jnrlistD>=0) ? dvda+jnrD : scratch;
446 gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
447 velec = _mm_mul_ps(qq00,rinv00);
448 felec = _mm_mul_ps(_mm_msub_ps(velec,rinv00,fgb),rinv00);
450 /* CUBIC SPLINE TABLE DISPERSION */
451 Y = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,0) );
452 F = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,1) );
453 G = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,2) );
454 H = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,3) );
455 _MM_TRANSPOSE4_PS(Y,F,G,H);
456 Fp = _mm_macc_ps(vfeps,_mm_macc_ps(H,vfeps,G),F);
457 VV = _mm_macc_ps(vfeps,Fp,Y);
458 vvdw6 = _mm_mul_ps(c6_00,VV);
459 FF = _mm_macc_ps(vfeps,_mm_macc_ps(twovfeps,H,G),Fp);
460 fvdw6 = _mm_mul_ps(c6_00,FF);
462 /* CUBIC SPLINE TABLE REPULSION */
463 vfitab = _mm_add_epi32(vfitab,ifour);
464 Y = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,0) );
465 F = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,1) );
466 G = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,2) );
467 H = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,3) );
468 _MM_TRANSPOSE4_PS(Y,F,G,H);
469 Fp = _mm_macc_ps(vfeps,_mm_macc_ps(H,vfeps,G),F);
470 VV = _mm_macc_ps(vfeps,Fp,Y);
471 vvdw12 = _mm_mul_ps(c12_00,VV);
472 FF = _mm_macc_ps(vfeps,_mm_macc_ps(twovfeps,H,G),Fp);
473 fvdw12 = _mm_mul_ps(c12_00,FF);
474 vvdw = _mm_add_ps(vvdw12,vvdw6);
475 fvdw = _mm_xor_ps(signbit,_mm_mul_ps(_mm_add_ps(fvdw6,fvdw12),_mm_mul_ps(vftabscale,rinv00)));
477 /* Update potential sum for this i atom from the interaction with this j atom. */
478 velec = _mm_andnot_ps(dummy_mask,velec);
479 velecsum = _mm_add_ps(velecsum,velec);
480 vgb = _mm_andnot_ps(dummy_mask,vgb);
481 vgbsum = _mm_add_ps(vgbsum,vgb);
482 vvdw = _mm_andnot_ps(dummy_mask,vvdw);
483 vvdwsum = _mm_add_ps(vvdwsum,vvdw);
485 fscal = _mm_add_ps(felec,fvdw);
487 fscal = _mm_andnot_ps(dummy_mask,fscal);
489 /* Update vectorial force */
490 fix0 = _mm_macc_ps(dx00,fscal,fix0);
491 fiy0 = _mm_macc_ps(dy00,fscal,fiy0);
492 fiz0 = _mm_macc_ps(dz00,fscal,fiz0);
494 fjptrA = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
495 fjptrB = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
496 fjptrC = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
497 fjptrD = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
498 gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,
499 _mm_mul_ps(dx00,fscal),
500 _mm_mul_ps(dy00,fscal),
501 _mm_mul_ps(dz00,fscal));
503 /* Inner loop uses 96 flops */
506 /* End of innermost loop */
508 gmx_mm_update_iforce_1atom_swizzle_ps(fix0,fiy0,fiz0,
509 f+i_coord_offset,fshift+i_shift_offset);
512 /* Update potential energies */
513 gmx_mm_update_1pot_ps(velecsum,kernel_data->energygrp_elec+ggid);
514 gmx_mm_update_1pot_ps(vgbsum,kernel_data->energygrp_polarization+ggid);
515 gmx_mm_update_1pot_ps(vvdwsum,kernel_data->energygrp_vdw+ggid);
516 dvdasum = _mm_mul_ps(dvdasum, _mm_mul_ps(isai0,isai0));
517 gmx_mm_update_1pot_ps(dvdasum,dvda+inr);
519 /* Increment number of inner iterations */
520 inneriter += j_index_end - j_index_start;
522 /* Outer loop uses 10 flops */
525 /* Increment number of outer iterations */
528 /* Update outer/inner flops */
530 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_VF,outeriter*10 + inneriter*96);
533 * Gromacs nonbonded kernel: nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_avx_128_fma_single
534 * Electrostatics interaction: GeneralizedBorn
535 * VdW interaction: CubicSplineTable
536 * Geometry: Particle-Particle
537 * Calculate force/pot: Force
540 nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_avx_128_fma_single
541 (t_nblist * gmx_restrict nlist,
542 rvec * gmx_restrict xx,
543 rvec * gmx_restrict ff,
544 t_forcerec * gmx_restrict fr,
545 t_mdatoms * gmx_restrict mdatoms,
546 nb_kernel_data_t * gmx_restrict kernel_data,
547 t_nrnb * gmx_restrict nrnb)
549 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
550 * just 0 for non-waters.
551 * Suffixes A,B,C,D refer to j loop unrolling done with AVX_128, e.g. for the four different
552 * jnr indices corresponding to data put in the four positions in the SIMD register.
554 int i_shift_offset,i_coord_offset,outeriter,inneriter;
555 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
556 int jnrA,jnrB,jnrC,jnrD;
557 int jnrlistA,jnrlistB,jnrlistC,jnrlistD;
558 int j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
559 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
561 real *shiftvec,*fshift,*x,*f;
562 real *fjptrA,*fjptrB,*fjptrC,*fjptrD;
564 __m128 fscal,rcutoff,rcutoff2,jidxall;
566 __m128 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
567 int vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
568 __m128 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
569 __m128 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
570 __m128 velec,felec,velecsum,facel,crf,krf,krf2;
573 __m128 vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,twogbeps,dvdatmp;
574 __m128 minushalf = _mm_set1_ps(-0.5);
575 real *invsqrta,*dvda,*gbtab;
577 __m128 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
580 __m128 one_sixth = _mm_set1_ps(1.0/6.0);
581 __m128 one_twelfth = _mm_set1_ps(1.0/12.0);
583 __m128i ifour = _mm_set1_epi32(4);
584 __m128 rt,vfeps,twovfeps,vftabscale,Y,F,G,H,Fp,VV,FF;
586 __m128 dummy_mask,cutoff_mask;
587 __m128 signbit = _mm_castsi128_ps( _mm_set1_epi32(0x80000000) );
588 __m128 one = _mm_set1_ps(1.0);
589 __m128 two = _mm_set1_ps(2.0);
595 jindex = nlist->jindex;
597 shiftidx = nlist->shift;
599 shiftvec = fr->shift_vec[0];
600 fshift = fr->fshift[0];
601 facel = _mm_set1_ps(fr->epsfac);
602 charge = mdatoms->chargeA;
603 nvdwtype = fr->ntype;
605 vdwtype = mdatoms->typeA;
607 vftab = kernel_data->table_vdw->data;
608 vftabscale = _mm_set1_ps(kernel_data->table_vdw->scale);
610 invsqrta = fr->invsqrta;
612 gbtabscale = _mm_set1_ps(fr->gbtab.scale);
613 gbtab = fr->gbtab.data;
614 gbinvepsdiff = _mm_set1_ps((1.0/fr->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
616 /* Avoid stupid compiler warnings */
617 jnrA = jnrB = jnrC = jnrD = 0;
626 for(iidx=0;iidx<4*DIM;iidx++)
631 /* Start outer loop over neighborlists */
632 for(iidx=0; iidx<nri; iidx++)
634 /* Load shift vector for this list */
635 i_shift_offset = DIM*shiftidx[iidx];
637 /* Load limits for loop over neighbors */
638 j_index_start = jindex[iidx];
639 j_index_end = jindex[iidx+1];
641 /* Get outer coordinate index */
643 i_coord_offset = DIM*inr;
645 /* Load i particle coords and add shift vector */
646 gmx_mm_load_shift_and_1rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
648 fix0 = _mm_setzero_ps();
649 fiy0 = _mm_setzero_ps();
650 fiz0 = _mm_setzero_ps();
652 /* Load parameters for i particles */
653 iq0 = _mm_mul_ps(facel,_mm_load1_ps(charge+inr+0));
654 isai0 = _mm_load1_ps(invsqrta+inr+0);
655 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
657 dvdasum = _mm_setzero_ps();
659 /* Start inner kernel loop */
660 for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
663 /* Get j neighbor index, and coordinate index */
668 j_coord_offsetA = DIM*jnrA;
669 j_coord_offsetB = DIM*jnrB;
670 j_coord_offsetC = DIM*jnrC;
671 j_coord_offsetD = DIM*jnrD;
673 /* load j atom coordinates */
674 gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
675 x+j_coord_offsetC,x+j_coord_offsetD,
678 /* Calculate displacement vector */
679 dx00 = _mm_sub_ps(ix0,jx0);
680 dy00 = _mm_sub_ps(iy0,jy0);
681 dz00 = _mm_sub_ps(iz0,jz0);
683 /* Calculate squared distance and things based on it */
684 rsq00 = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
686 rinv00 = gmx_mm_invsqrt_ps(rsq00);
688 /* Load parameters for j particles */
689 jq0 = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
690 charge+jnrC+0,charge+jnrD+0);
691 isaj0 = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
692 invsqrta+jnrC+0,invsqrta+jnrD+0);
693 vdwjidx0A = 2*vdwtype[jnrA+0];
694 vdwjidx0B = 2*vdwtype[jnrB+0];
695 vdwjidx0C = 2*vdwtype[jnrC+0];
696 vdwjidx0D = 2*vdwtype[jnrD+0];
698 /**************************
699 * CALCULATE INTERACTIONS *
700 **************************/
702 r00 = _mm_mul_ps(rsq00,rinv00);
704 /* Compute parameters for interactions between i and j atoms */
705 qq00 = _mm_mul_ps(iq0,jq0);
706 gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
707 vdwparam+vdwioffset0+vdwjidx0B,
708 vdwparam+vdwioffset0+vdwjidx0C,
709 vdwparam+vdwioffset0+vdwjidx0D,
712 /* Calculate table index by multiplying r with table scale and truncate to integer */
713 rt = _mm_mul_ps(r00,vftabscale);
714 vfitab = _mm_cvttps_epi32(rt);
716 vfeps = _mm_frcz_ps(rt);
718 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
720 twovfeps = _mm_add_ps(vfeps,vfeps);
721 vfitab = _mm_slli_epi32(vfitab,3);
723 /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
724 isaprod = _mm_mul_ps(isai0,isaj0);
725 gbqqfactor = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
726 gbscale = _mm_mul_ps(isaprod,gbtabscale);
728 /* Calculate generalized born table index - this is a separate table from the normal one,
729 * but we use the same procedure by multiplying r with scale and truncating to integer.
731 rt = _mm_mul_ps(r00,gbscale);
732 gbitab = _mm_cvttps_epi32(rt);
734 gbeps = _mm_frcz_ps(rt);
736 gbeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
738 gbitab = _mm_slli_epi32(gbitab,2);
740 Y = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,0) );
741 F = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,1) );
742 G = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,2) );
743 H = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,3) );
744 _MM_TRANSPOSE4_PS(Y,F,G,H);
745 Fp = _mm_macc_ps(gbeps,_mm_macc_ps(gbeps,H,G),F);
746 VV = _mm_macc_ps(gbeps,Fp,Y);
747 vgb = _mm_mul_ps(gbqqfactor,VV);
749 twogbeps = _mm_add_ps(gbeps,gbeps);
750 FF = _mm_macc_ps(_mm_macc_ps(twogbeps,H,G),gbeps,Fp);
751 fgb = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
752 dvdatmp = _mm_mul_ps(minushalf,_mm_macc_ps(fgb,r00,vgb));
753 dvdasum = _mm_add_ps(dvdasum,dvdatmp);
758 gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
759 velec = _mm_mul_ps(qq00,rinv00);
760 felec = _mm_mul_ps(_mm_msub_ps(velec,rinv00,fgb),rinv00);
762 /* CUBIC SPLINE TABLE DISPERSION */
763 Y = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,0) );
764 F = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,1) );
765 G = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,2) );
766 H = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,3) );
767 _MM_TRANSPOSE4_PS(Y,F,G,H);
768 Fp = _mm_macc_ps(vfeps,_mm_macc_ps(H,vfeps,G),F);
769 FF = _mm_macc_ps(vfeps,_mm_macc_ps(twovfeps,H,G),Fp);
770 fvdw6 = _mm_mul_ps(c6_00,FF);
772 /* CUBIC SPLINE TABLE REPULSION */
773 vfitab = _mm_add_epi32(vfitab,ifour);
774 Y = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,0) );
775 F = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,1) );
776 G = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,2) );
777 H = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,3) );
778 _MM_TRANSPOSE4_PS(Y,F,G,H);
779 Fp = _mm_macc_ps(vfeps,_mm_macc_ps(H,vfeps,G),F);
780 FF = _mm_macc_ps(vfeps,_mm_macc_ps(twovfeps,H,G),Fp);
781 fvdw12 = _mm_mul_ps(c12_00,FF);
782 fvdw = _mm_xor_ps(signbit,_mm_mul_ps(_mm_add_ps(fvdw6,fvdw12),_mm_mul_ps(vftabscale,rinv00)));
784 fscal = _mm_add_ps(felec,fvdw);
786 /* Update vectorial force */
787 fix0 = _mm_macc_ps(dx00,fscal,fix0);
788 fiy0 = _mm_macc_ps(dy00,fscal,fiy0);
789 fiz0 = _mm_macc_ps(dz00,fscal,fiz0);
791 fjptrA = f+j_coord_offsetA;
792 fjptrB = f+j_coord_offsetB;
793 fjptrC = f+j_coord_offsetC;
794 fjptrD = f+j_coord_offsetD;
795 gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,
796 _mm_mul_ps(dx00,fscal),
797 _mm_mul_ps(dy00,fscal),
798 _mm_mul_ps(dz00,fscal));
800 /* Inner loop uses 85 flops */
806 /* Get j neighbor index, and coordinate index */
807 jnrlistA = jjnr[jidx];
808 jnrlistB = jjnr[jidx+1];
809 jnrlistC = jjnr[jidx+2];
810 jnrlistD = jjnr[jidx+3];
811 /* Sign of each element will be negative for non-real atoms.
812 * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
813 * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
815 dummy_mask = gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
816 jnrA = (jnrlistA>=0) ? jnrlistA : 0;
817 jnrB = (jnrlistB>=0) ? jnrlistB : 0;
818 jnrC = (jnrlistC>=0) ? jnrlistC : 0;
819 jnrD = (jnrlistD>=0) ? jnrlistD : 0;
820 j_coord_offsetA = DIM*jnrA;
821 j_coord_offsetB = DIM*jnrB;
822 j_coord_offsetC = DIM*jnrC;
823 j_coord_offsetD = DIM*jnrD;
825 /* load j atom coordinates */
826 gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
827 x+j_coord_offsetC,x+j_coord_offsetD,
830 /* Calculate displacement vector */
831 dx00 = _mm_sub_ps(ix0,jx0);
832 dy00 = _mm_sub_ps(iy0,jy0);
833 dz00 = _mm_sub_ps(iz0,jz0);
835 /* Calculate squared distance and things based on it */
836 rsq00 = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
838 rinv00 = gmx_mm_invsqrt_ps(rsq00);
840 /* Load parameters for j particles */
841 jq0 = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
842 charge+jnrC+0,charge+jnrD+0);
843 isaj0 = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
844 invsqrta+jnrC+0,invsqrta+jnrD+0);
845 vdwjidx0A = 2*vdwtype[jnrA+0];
846 vdwjidx0B = 2*vdwtype[jnrB+0];
847 vdwjidx0C = 2*vdwtype[jnrC+0];
848 vdwjidx0D = 2*vdwtype[jnrD+0];
850 /**************************
851 * CALCULATE INTERACTIONS *
852 **************************/
854 r00 = _mm_mul_ps(rsq00,rinv00);
855 r00 = _mm_andnot_ps(dummy_mask,r00);
857 /* Compute parameters for interactions between i and j atoms */
858 qq00 = _mm_mul_ps(iq0,jq0);
859 gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
860 vdwparam+vdwioffset0+vdwjidx0B,
861 vdwparam+vdwioffset0+vdwjidx0C,
862 vdwparam+vdwioffset0+vdwjidx0D,
865 /* Calculate table index by multiplying r with table scale and truncate to integer */
866 rt = _mm_mul_ps(r00,vftabscale);
867 vfitab = _mm_cvttps_epi32(rt);
869 vfeps = _mm_frcz_ps(rt);
871 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
873 twovfeps = _mm_add_ps(vfeps,vfeps);
874 vfitab = _mm_slli_epi32(vfitab,3);
876 /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
877 isaprod = _mm_mul_ps(isai0,isaj0);
878 gbqqfactor = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
879 gbscale = _mm_mul_ps(isaprod,gbtabscale);
881 /* Calculate generalized born table index - this is a separate table from the normal one,
882 * but we use the same procedure by multiplying r with scale and truncating to integer.
884 rt = _mm_mul_ps(r00,gbscale);
885 gbitab = _mm_cvttps_epi32(rt);
887 gbeps = _mm_frcz_ps(rt);
889 gbeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
891 gbitab = _mm_slli_epi32(gbitab,2);
893 Y = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,0) );
894 F = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,1) );
895 G = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,2) );
896 H = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,3) );
897 _MM_TRANSPOSE4_PS(Y,F,G,H);
898 Fp = _mm_macc_ps(gbeps,_mm_macc_ps(gbeps,H,G),F);
899 VV = _mm_macc_ps(gbeps,Fp,Y);
900 vgb = _mm_mul_ps(gbqqfactor,VV);
902 twogbeps = _mm_add_ps(gbeps,gbeps);
903 FF = _mm_macc_ps(_mm_macc_ps(twogbeps,H,G),gbeps,Fp);
904 fgb = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
905 dvdatmp = _mm_mul_ps(minushalf,_mm_macc_ps(fgb,r00,vgb));
906 dvdasum = _mm_add_ps(dvdasum,dvdatmp);
907 /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
908 fjptrA = (jnrlistA>=0) ? dvda+jnrA : scratch;
909 fjptrB = (jnrlistB>=0) ? dvda+jnrB : scratch;
910 fjptrC = (jnrlistC>=0) ? dvda+jnrC : scratch;
911 fjptrD = (jnrlistD>=0) ? dvda+jnrD : scratch;
912 gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
913 velec = _mm_mul_ps(qq00,rinv00);
914 felec = _mm_mul_ps(_mm_msub_ps(velec,rinv00,fgb),rinv00);
916 /* CUBIC SPLINE TABLE DISPERSION */
917 Y = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,0) );
918 F = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,1) );
919 G = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,2) );
920 H = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,3) );
921 _MM_TRANSPOSE4_PS(Y,F,G,H);
922 Fp = _mm_macc_ps(vfeps,_mm_macc_ps(H,vfeps,G),F);
923 FF = _mm_macc_ps(vfeps,_mm_macc_ps(twovfeps,H,G),Fp);
924 fvdw6 = _mm_mul_ps(c6_00,FF);
926 /* CUBIC SPLINE TABLE REPULSION */
927 vfitab = _mm_add_epi32(vfitab,ifour);
928 Y = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,0) );
929 F = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,1) );
930 G = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,2) );
931 H = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,3) );
932 _MM_TRANSPOSE4_PS(Y,F,G,H);
933 Fp = _mm_macc_ps(vfeps,_mm_macc_ps(H,vfeps,G),F);
934 FF = _mm_macc_ps(vfeps,_mm_macc_ps(twovfeps,H,G),Fp);
935 fvdw12 = _mm_mul_ps(c12_00,FF);
936 fvdw = _mm_xor_ps(signbit,_mm_mul_ps(_mm_add_ps(fvdw6,fvdw12),_mm_mul_ps(vftabscale,rinv00)));
938 fscal = _mm_add_ps(felec,fvdw);
940 fscal = _mm_andnot_ps(dummy_mask,fscal);
942 /* Update vectorial force */
943 fix0 = _mm_macc_ps(dx00,fscal,fix0);
944 fiy0 = _mm_macc_ps(dy00,fscal,fiy0);
945 fiz0 = _mm_macc_ps(dz00,fscal,fiz0);
947 fjptrA = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
948 fjptrB = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
949 fjptrC = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
950 fjptrD = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
951 gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,
952 _mm_mul_ps(dx00,fscal),
953 _mm_mul_ps(dy00,fscal),
954 _mm_mul_ps(dz00,fscal));
956 /* Inner loop uses 86 flops */
959 /* End of innermost loop */
961 gmx_mm_update_iforce_1atom_swizzle_ps(fix0,fiy0,fiz0,
962 f+i_coord_offset,fshift+i_shift_offset);
964 dvdasum = _mm_mul_ps(dvdasum, _mm_mul_ps(isai0,isai0));
965 gmx_mm_update_1pot_ps(dvdasum,dvda+inr);
967 /* Increment number of inner iterations */
968 inneriter += j_index_end - j_index_start;
970 /* Outer loop uses 7 flops */
973 /* Increment number of outer iterations */
976 /* Update outer/inner flops */
978 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_F,outeriter*7 + inneriter*86);