2 * This file is part of the GROMACS molecular simulation package.
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.
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_double kernel generator.
42 #include "../nb_kernel.h"
43 #include "types/simple.h"
44 #include "gromacs/math/vec.h"
47 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
48 #include "kernelutil_x86_avx_128_fma_double.h"
51 * Gromacs nonbonded kernel: nb_kernel_ElecNone_VdwLJEw_GeomP1P1_VF_avx_128_fma_double
52 * Electrostatics interaction: None
53 * VdW interaction: LJEwald
54 * Geometry: Particle-Particle
55 * Calculate force/pot: PotentialAndForce
58 nb_kernel_ElecNone_VdwLJEw_GeomP1P1_VF_avx_128_fma_double
59 (t_nblist * gmx_restrict nlist,
60 rvec * gmx_restrict xx,
61 rvec * gmx_restrict ff,
62 t_forcerec * gmx_restrict fr,
63 t_mdatoms * gmx_restrict mdatoms,
64 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
65 t_nrnb * gmx_restrict nrnb)
67 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
68 * just 0 for non-waters.
69 * Suffixes A,B refer to j loop unrolling done with SSE double precision, e.g. for the two different
70 * jnr indices corresponding to data put in the four positions in the SIMD register.
72 int i_shift_offset,i_coord_offset,outeriter,inneriter;
73 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
75 int j_coord_offsetA,j_coord_offsetB;
76 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
78 real *shiftvec,*fshift,*x,*f;
79 __m128d tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
81 __m128d ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
82 int vdwjidx0A,vdwjidx0B;
83 __m128d jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
84 __m128d dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
86 __m128d rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
89 __m128d one_sixth = _mm_set1_pd(1.0/6.0);
90 __m128d one_twelfth = _mm_set1_pd(1.0/12.0);
93 __m128d ewclj,ewclj2,ewclj6,ewcljrsq,poly,exponent,f6A,f6B,sh_lj_ewald;
94 __m128d one_half = _mm_set1_pd(0.5);
95 __m128d minus_one = _mm_set1_pd(-1.0);
96 __m128d dummy_mask,cutoff_mask;
97 __m128d signbit = gmx_mm_castsi128_pd( _mm_set_epi32(0x80000000,0x00000000,0x80000000,0x00000000) );
98 __m128d one = _mm_set1_pd(1.0);
99 __m128d two = _mm_set1_pd(2.0);
105 jindex = nlist->jindex;
107 shiftidx = nlist->shift;
109 shiftvec = fr->shift_vec[0];
110 fshift = fr->fshift[0];
111 nvdwtype = fr->ntype;
113 vdwtype = mdatoms->typeA;
114 vdwgridparam = fr->ljpme_c6grid;
115 sh_lj_ewald = _mm_set1_pd(fr->ic->sh_lj_ewald);
116 ewclj = _mm_set1_pd(fr->ewaldcoeff_lj);
117 ewclj2 = _mm_mul_pd(minus_one,_mm_mul_pd(ewclj,ewclj));
119 /* Avoid stupid compiler warnings */
127 /* Start outer loop over neighborlists */
128 for(iidx=0; iidx<nri; iidx++)
130 /* Load shift vector for this list */
131 i_shift_offset = DIM*shiftidx[iidx];
133 /* Load limits for loop over neighbors */
134 j_index_start = jindex[iidx];
135 j_index_end = jindex[iidx+1];
137 /* Get outer coordinate index */
139 i_coord_offset = DIM*inr;
141 /* Load i particle coords and add shift vector */
142 gmx_mm_load_shift_and_1rvec_broadcast_pd(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
144 fix0 = _mm_setzero_pd();
145 fiy0 = _mm_setzero_pd();
146 fiz0 = _mm_setzero_pd();
148 /* Load parameters for i particles */
149 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
151 /* Reset potential sums */
152 vvdwsum = _mm_setzero_pd();
154 /* Start inner kernel loop */
155 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
158 /* Get j neighbor index, and coordinate index */
161 j_coord_offsetA = DIM*jnrA;
162 j_coord_offsetB = DIM*jnrB;
164 /* load j atom coordinates */
165 gmx_mm_load_1rvec_2ptr_swizzle_pd(x+j_coord_offsetA,x+j_coord_offsetB,
168 /* Calculate displacement vector */
169 dx00 = _mm_sub_pd(ix0,jx0);
170 dy00 = _mm_sub_pd(iy0,jy0);
171 dz00 = _mm_sub_pd(iz0,jz0);
173 /* Calculate squared distance and things based on it */
174 rsq00 = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
176 rinv00 = gmx_mm_invsqrt_pd(rsq00);
178 rinvsq00 = _mm_mul_pd(rinv00,rinv00);
180 /* Load parameters for j particles */
181 vdwjidx0A = 2*vdwtype[jnrA+0];
182 vdwjidx0B = 2*vdwtype[jnrB+0];
184 /**************************
185 * CALCULATE INTERACTIONS *
186 **************************/
188 r00 = _mm_mul_pd(rsq00,rinv00);
190 /* Compute parameters for interactions between i and j atoms */
191 gmx_mm_load_2pair_swizzle_pd(vdwparam+vdwioffset0+vdwjidx0A,
192 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
193 c6grid_00 = gmx_mm_load_2real_swizzle_pd(vdwgridparam+vdwioffset0+vdwjidx0A,
194 vdwgridparam+vdwioffset0+vdwjidx0B);
196 /* Analytical LJ-PME */
197 rinvsix = _mm_mul_pd(_mm_mul_pd(rinvsq00,rinvsq00),rinvsq00);
198 ewcljrsq = _mm_mul_pd(ewclj2,rsq00);
199 ewclj6 = _mm_mul_pd(ewclj2,_mm_mul_pd(ewclj2,ewclj2));
200 exponent = gmx_simd_exp_d(ewcljrsq);
201 /* poly = exp(-(beta*r)^2) * (1 + (beta*r)^2 + (beta*r)^4 /2) */
202 poly = _mm_mul_pd(exponent,_mm_macc_pd(_mm_mul_pd(ewcljrsq,ewcljrsq),one_half,_mm_sub_pd(one,ewcljrsq)));
203 /* vvdw6 = [C6 - C6grid * (1-poly)]/r6 */
204 vvdw6 = _mm_mul_pd(_mm_macc_pd(-c6grid_00,_mm_sub_pd(one,poly),c6_00),rinvsix);
205 vvdw12 = _mm_mul_pd(c12_00,_mm_mul_pd(rinvsix,rinvsix));
206 vvdw = _mm_msub_pd(vvdw12,one_twelfth,_mm_mul_pd(vvdw6,one_sixth));
207 /* fvdw = vvdw12/r - (vvdw6/r + (C6grid * exponent * beta^6)/r) */
208 fvdw = _mm_mul_pd(_mm_add_pd(vvdw12,_mm_msub_pd(_mm_mul_pd(c6grid_00,one_sixth),_mm_mul_pd(exponent,ewclj6),vvdw6)),rinvsq00);
210 /* Update potential sum for this i atom from the interaction with this j atom. */
211 vvdwsum = _mm_add_pd(vvdwsum,vvdw);
215 /* Update vectorial force */
216 fix0 = _mm_macc_pd(dx00,fscal,fix0);
217 fiy0 = _mm_macc_pd(dy00,fscal,fiy0);
218 fiz0 = _mm_macc_pd(dz00,fscal,fiz0);
220 gmx_mm_decrement_1rvec_2ptr_swizzle_pd(f+j_coord_offsetA,f+j_coord_offsetB,
221 _mm_mul_pd(dx00,fscal),
222 _mm_mul_pd(dy00,fscal),
223 _mm_mul_pd(dz00,fscal));
225 /* Inner loop uses 50 flops */
232 j_coord_offsetA = DIM*jnrA;
234 /* load j atom coordinates */
235 gmx_mm_load_1rvec_1ptr_swizzle_pd(x+j_coord_offsetA,
238 /* Calculate displacement vector */
239 dx00 = _mm_sub_pd(ix0,jx0);
240 dy00 = _mm_sub_pd(iy0,jy0);
241 dz00 = _mm_sub_pd(iz0,jz0);
243 /* Calculate squared distance and things based on it */
244 rsq00 = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
246 rinv00 = gmx_mm_invsqrt_pd(rsq00);
248 rinvsq00 = _mm_mul_pd(rinv00,rinv00);
250 /* Load parameters for j particles */
251 vdwjidx0A = 2*vdwtype[jnrA+0];
253 /**************************
254 * CALCULATE INTERACTIONS *
255 **************************/
257 r00 = _mm_mul_pd(rsq00,rinv00);
259 /* Compute parameters for interactions between i and j atoms */
260 gmx_mm_load_1pair_swizzle_pd(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
261 c6grid_00 = gmx_mm_load_1real_pd(vdwgridparam+vdwioffset0+vdwjidx0A);
263 /* Analytical LJ-PME */
264 rinvsix = _mm_mul_pd(_mm_mul_pd(rinvsq00,rinvsq00),rinvsq00);
265 ewcljrsq = _mm_mul_pd(ewclj2,rsq00);
266 ewclj6 = _mm_mul_pd(ewclj2,_mm_mul_pd(ewclj2,ewclj2));
267 exponent = gmx_simd_exp_d(ewcljrsq);
268 /* poly = exp(-(beta*r)^2) * (1 + (beta*r)^2 + (beta*r)^4 /2) */
269 poly = _mm_mul_pd(exponent,_mm_macc_pd(_mm_mul_pd(ewcljrsq,ewcljrsq),one_half,_mm_sub_pd(one,ewcljrsq)));
270 /* vvdw6 = [C6 - C6grid * (1-poly)]/r6 */
271 vvdw6 = _mm_mul_pd(_mm_macc_pd(-c6grid_00,_mm_sub_pd(one,poly),c6_00),rinvsix);
272 vvdw12 = _mm_mul_pd(c12_00,_mm_mul_pd(rinvsix,rinvsix));
273 vvdw = _mm_msub_pd(vvdw12,one_twelfth,_mm_mul_pd(vvdw6,one_sixth));
274 /* fvdw = vvdw12/r - (vvdw6/r + (C6grid * exponent * beta^6)/r) */
275 fvdw = _mm_mul_pd(_mm_add_pd(vvdw12,_mm_msub_pd(_mm_mul_pd(c6grid_00,one_sixth),_mm_mul_pd(exponent,ewclj6),vvdw6)),rinvsq00);
277 /* Update potential sum for this i atom from the interaction with this j atom. */
278 vvdw = _mm_unpacklo_pd(vvdw,_mm_setzero_pd());
279 vvdwsum = _mm_add_pd(vvdwsum,vvdw);
283 fscal = _mm_unpacklo_pd(fscal,_mm_setzero_pd());
285 /* Update vectorial force */
286 fix0 = _mm_macc_pd(dx00,fscal,fix0);
287 fiy0 = _mm_macc_pd(dy00,fscal,fiy0);
288 fiz0 = _mm_macc_pd(dz00,fscal,fiz0);
290 gmx_mm_decrement_1rvec_1ptr_swizzle_pd(f+j_coord_offsetA,
291 _mm_mul_pd(dx00,fscal),
292 _mm_mul_pd(dy00,fscal),
293 _mm_mul_pd(dz00,fscal));
295 /* Inner loop uses 50 flops */
298 /* End of innermost loop */
300 gmx_mm_update_iforce_1atom_swizzle_pd(fix0,fiy0,fiz0,
301 f+i_coord_offset,fshift+i_shift_offset);
304 /* Update potential energies */
305 gmx_mm_update_1pot_pd(vvdwsum,kernel_data->energygrp_vdw+ggid);
307 /* Increment number of inner iterations */
308 inneriter += j_index_end - j_index_start;
310 /* Outer loop uses 7 flops */
313 /* Increment number of outer iterations */
316 /* Update outer/inner flops */
318 inc_nrnb(nrnb,eNR_NBKERNEL_VDW_VF,outeriter*7 + inneriter*50);
321 * Gromacs nonbonded kernel: nb_kernel_ElecNone_VdwLJEw_GeomP1P1_F_avx_128_fma_double
322 * Electrostatics interaction: None
323 * VdW interaction: LJEwald
324 * Geometry: Particle-Particle
325 * Calculate force/pot: Force
328 nb_kernel_ElecNone_VdwLJEw_GeomP1P1_F_avx_128_fma_double
329 (t_nblist * gmx_restrict nlist,
330 rvec * gmx_restrict xx,
331 rvec * gmx_restrict ff,
332 t_forcerec * gmx_restrict fr,
333 t_mdatoms * gmx_restrict mdatoms,
334 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
335 t_nrnb * gmx_restrict nrnb)
337 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
338 * just 0 for non-waters.
339 * Suffixes A,B refer to j loop unrolling done with SSE double precision, e.g. for the two different
340 * jnr indices corresponding to data put in the four positions in the SIMD register.
342 int i_shift_offset,i_coord_offset,outeriter,inneriter;
343 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
345 int j_coord_offsetA,j_coord_offsetB;
346 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
348 real *shiftvec,*fshift,*x,*f;
349 __m128d tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
351 __m128d ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
352 int vdwjidx0A,vdwjidx0B;
353 __m128d jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
354 __m128d dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
356 __m128d rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
359 __m128d one_sixth = _mm_set1_pd(1.0/6.0);
360 __m128d one_twelfth = _mm_set1_pd(1.0/12.0);
363 __m128d ewclj,ewclj2,ewclj6,ewcljrsq,poly,exponent,f6A,f6B,sh_lj_ewald;
364 __m128d one_half = _mm_set1_pd(0.5);
365 __m128d minus_one = _mm_set1_pd(-1.0);
366 __m128d dummy_mask,cutoff_mask;
367 __m128d signbit = gmx_mm_castsi128_pd( _mm_set_epi32(0x80000000,0x00000000,0x80000000,0x00000000) );
368 __m128d one = _mm_set1_pd(1.0);
369 __m128d two = _mm_set1_pd(2.0);
375 jindex = nlist->jindex;
377 shiftidx = nlist->shift;
379 shiftvec = fr->shift_vec[0];
380 fshift = fr->fshift[0];
381 nvdwtype = fr->ntype;
383 vdwtype = mdatoms->typeA;
384 vdwgridparam = fr->ljpme_c6grid;
385 sh_lj_ewald = _mm_set1_pd(fr->ic->sh_lj_ewald);
386 ewclj = _mm_set1_pd(fr->ewaldcoeff_lj);
387 ewclj2 = _mm_mul_pd(minus_one,_mm_mul_pd(ewclj,ewclj));
389 /* Avoid stupid compiler warnings */
397 /* Start outer loop over neighborlists */
398 for(iidx=0; iidx<nri; iidx++)
400 /* Load shift vector for this list */
401 i_shift_offset = DIM*shiftidx[iidx];
403 /* Load limits for loop over neighbors */
404 j_index_start = jindex[iidx];
405 j_index_end = jindex[iidx+1];
407 /* Get outer coordinate index */
409 i_coord_offset = DIM*inr;
411 /* Load i particle coords and add shift vector */
412 gmx_mm_load_shift_and_1rvec_broadcast_pd(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
414 fix0 = _mm_setzero_pd();
415 fiy0 = _mm_setzero_pd();
416 fiz0 = _mm_setzero_pd();
418 /* Load parameters for i particles */
419 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
421 /* Start inner kernel loop */
422 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
425 /* Get j neighbor index, and coordinate index */
428 j_coord_offsetA = DIM*jnrA;
429 j_coord_offsetB = DIM*jnrB;
431 /* load j atom coordinates */
432 gmx_mm_load_1rvec_2ptr_swizzle_pd(x+j_coord_offsetA,x+j_coord_offsetB,
435 /* Calculate displacement vector */
436 dx00 = _mm_sub_pd(ix0,jx0);
437 dy00 = _mm_sub_pd(iy0,jy0);
438 dz00 = _mm_sub_pd(iz0,jz0);
440 /* Calculate squared distance and things based on it */
441 rsq00 = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
443 rinv00 = gmx_mm_invsqrt_pd(rsq00);
445 rinvsq00 = _mm_mul_pd(rinv00,rinv00);
447 /* Load parameters for j particles */
448 vdwjidx0A = 2*vdwtype[jnrA+0];
449 vdwjidx0B = 2*vdwtype[jnrB+0];
451 /**************************
452 * CALCULATE INTERACTIONS *
453 **************************/
455 r00 = _mm_mul_pd(rsq00,rinv00);
457 /* Compute parameters for interactions between i and j atoms */
458 gmx_mm_load_2pair_swizzle_pd(vdwparam+vdwioffset0+vdwjidx0A,
459 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
460 c6grid_00 = gmx_mm_load_2real_swizzle_pd(vdwgridparam+vdwioffset0+vdwjidx0A,
461 vdwgridparam+vdwioffset0+vdwjidx0B);
463 /* Analytical LJ-PME */
464 rinvsix = _mm_mul_pd(_mm_mul_pd(rinvsq00,rinvsq00),rinvsq00);
465 ewcljrsq = _mm_mul_pd(ewclj2,rsq00);
466 ewclj6 = _mm_mul_pd(ewclj2,_mm_mul_pd(ewclj2,ewclj2));
467 exponent = gmx_simd_exp_d(ewcljrsq);
468 /* poly = exp(-(beta*r)^2) * (1 + (beta*r)^2 + (beta*r)^4 /2) */
469 poly = _mm_mul_pd(exponent,_mm_macc_pd(_mm_mul_pd(ewcljrsq,ewcljrsq),one_half,_mm_sub_pd(one,ewcljrsq)));
470 /* f6A = 6 * C6grid * (1 - poly) */
471 f6A = _mm_mul_pd(c6grid_00,_mm_sub_pd(one,poly));
472 /* f6B = C6grid * exponent * beta^6 */
473 f6B = _mm_mul_pd(_mm_mul_pd(c6grid_00,one_sixth),_mm_mul_pd(exponent,ewclj6));
474 /* fvdw = 12*C12/r13 - ((6*C6 - f6A)/r6 + f6B)/r */
475 fvdw = _mm_mul_pd(_mm_macc_pd(_mm_msub_pd(c12_00,rinvsix,_mm_sub_pd(c6_00,f6A)),rinvsix,f6B),rinvsq00);
479 /* Update vectorial force */
480 fix0 = _mm_macc_pd(dx00,fscal,fix0);
481 fiy0 = _mm_macc_pd(dy00,fscal,fiy0);
482 fiz0 = _mm_macc_pd(dz00,fscal,fiz0);
484 gmx_mm_decrement_1rvec_2ptr_swizzle_pd(f+j_coord_offsetA,f+j_coord_offsetB,
485 _mm_mul_pd(dx00,fscal),
486 _mm_mul_pd(dy00,fscal),
487 _mm_mul_pd(dz00,fscal));
489 /* Inner loop uses 47 flops */
496 j_coord_offsetA = DIM*jnrA;
498 /* load j atom coordinates */
499 gmx_mm_load_1rvec_1ptr_swizzle_pd(x+j_coord_offsetA,
502 /* Calculate displacement vector */
503 dx00 = _mm_sub_pd(ix0,jx0);
504 dy00 = _mm_sub_pd(iy0,jy0);
505 dz00 = _mm_sub_pd(iz0,jz0);
507 /* Calculate squared distance and things based on it */
508 rsq00 = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
510 rinv00 = gmx_mm_invsqrt_pd(rsq00);
512 rinvsq00 = _mm_mul_pd(rinv00,rinv00);
514 /* Load parameters for j particles */
515 vdwjidx0A = 2*vdwtype[jnrA+0];
517 /**************************
518 * CALCULATE INTERACTIONS *
519 **************************/
521 r00 = _mm_mul_pd(rsq00,rinv00);
523 /* Compute parameters for interactions between i and j atoms */
524 gmx_mm_load_1pair_swizzle_pd(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
525 c6grid_00 = gmx_mm_load_1real_pd(vdwgridparam+vdwioffset0+vdwjidx0A);
527 /* Analytical LJ-PME */
528 rinvsix = _mm_mul_pd(_mm_mul_pd(rinvsq00,rinvsq00),rinvsq00);
529 ewcljrsq = _mm_mul_pd(ewclj2,rsq00);
530 ewclj6 = _mm_mul_pd(ewclj2,_mm_mul_pd(ewclj2,ewclj2));
531 exponent = gmx_simd_exp_d(ewcljrsq);
532 /* poly = exp(-(beta*r)^2) * (1 + (beta*r)^2 + (beta*r)^4 /2) */
533 poly = _mm_mul_pd(exponent,_mm_macc_pd(_mm_mul_pd(ewcljrsq,ewcljrsq),one_half,_mm_sub_pd(one,ewcljrsq)));
534 /* f6A = 6 * C6grid * (1 - poly) */
535 f6A = _mm_mul_pd(c6grid_00,_mm_sub_pd(one,poly));
536 /* f6B = C6grid * exponent * beta^6 */
537 f6B = _mm_mul_pd(_mm_mul_pd(c6grid_00,one_sixth),_mm_mul_pd(exponent,ewclj6));
538 /* fvdw = 12*C12/r13 - ((6*C6 - f6A)/r6 + f6B)/r */
539 fvdw = _mm_mul_pd(_mm_macc_pd(_mm_msub_pd(c12_00,rinvsix,_mm_sub_pd(c6_00,f6A)),rinvsix,f6B),rinvsq00);
543 fscal = _mm_unpacklo_pd(fscal,_mm_setzero_pd());
545 /* Update vectorial force */
546 fix0 = _mm_macc_pd(dx00,fscal,fix0);
547 fiy0 = _mm_macc_pd(dy00,fscal,fiy0);
548 fiz0 = _mm_macc_pd(dz00,fscal,fiz0);
550 gmx_mm_decrement_1rvec_1ptr_swizzle_pd(f+j_coord_offsetA,
551 _mm_mul_pd(dx00,fscal),
552 _mm_mul_pd(dy00,fscal),
553 _mm_mul_pd(dz00,fscal));
555 /* Inner loop uses 47 flops */
558 /* End of innermost loop */
560 gmx_mm_update_iforce_1atom_swizzle_pd(fix0,fiy0,fiz0,
561 f+i_coord_offset,fshift+i_shift_offset);
563 /* Increment number of inner iterations */
564 inneriter += j_index_end - j_index_start;
566 /* Outer loop uses 6 flops */
569 /* Increment number of outer iterations */
572 /* Update outer/inner flops */
574 inc_nrnb(nrnb,eNR_NBKERNEL_VDW_F,outeriter*6 + inneriter*47);