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.
44 #include "../nb_kernel.h"
45 #include "gromacs/legacyheaders/types/simple.h"
46 #include "gromacs/math/vec.h"
47 #include "gromacs/legacyheaders/nrnb.h"
49 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
50 #include "kernelutil_x86_avx_128_fma_double.h"
53 * Gromacs nonbonded kernel: nb_kernel_ElecNone_VdwLJEw_GeomP1P1_VF_avx_128_fma_double
54 * Electrostatics interaction: None
55 * VdW interaction: LJEwald
56 * Geometry: Particle-Particle
57 * Calculate force/pot: PotentialAndForce
60 nb_kernel_ElecNone_VdwLJEw_GeomP1P1_VF_avx_128_fma_double
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 * 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 refer to j loop unrolling done with SSE double precision, e.g. for the two 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;
77 int j_coord_offsetA,j_coord_offsetB;
78 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
80 real *shiftvec,*fshift,*x,*f;
81 __m128d tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
83 __m128d ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
84 int vdwjidx0A,vdwjidx0B;
85 __m128d jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
86 __m128d dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
88 __m128d rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
91 __m128d one_sixth = _mm_set1_pd(1.0/6.0);
92 __m128d one_twelfth = _mm_set1_pd(1.0/12.0);
95 __m128d ewclj,ewclj2,ewclj6,ewcljrsq,poly,exponent,f6A,f6B,sh_lj_ewald;
96 __m128d one_half = _mm_set1_pd(0.5);
97 __m128d minus_one = _mm_set1_pd(-1.0);
98 __m128d dummy_mask,cutoff_mask;
99 __m128d signbit = gmx_mm_castsi128_pd( _mm_set_epi32(0x80000000,0x00000000,0x80000000,0x00000000) );
100 __m128d one = _mm_set1_pd(1.0);
101 __m128d two = _mm_set1_pd(2.0);
107 jindex = nlist->jindex;
109 shiftidx = nlist->shift;
111 shiftvec = fr->shift_vec[0];
112 fshift = fr->fshift[0];
113 nvdwtype = fr->ntype;
115 vdwtype = mdatoms->typeA;
116 vdwgridparam = fr->ljpme_c6grid;
117 sh_lj_ewald = _mm_set1_pd(fr->ic->sh_lj_ewald);
118 ewclj = _mm_set1_pd(fr->ewaldcoeff_lj);
119 ewclj2 = _mm_mul_pd(minus_one,_mm_mul_pd(ewclj,ewclj));
121 /* Avoid stupid compiler warnings */
129 /* Start outer loop over neighborlists */
130 for(iidx=0; iidx<nri; iidx++)
132 /* Load shift vector for this list */
133 i_shift_offset = DIM*shiftidx[iidx];
135 /* Load limits for loop over neighbors */
136 j_index_start = jindex[iidx];
137 j_index_end = jindex[iidx+1];
139 /* Get outer coordinate index */
141 i_coord_offset = DIM*inr;
143 /* Load i particle coords and add shift vector */
144 gmx_mm_load_shift_and_1rvec_broadcast_pd(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
146 fix0 = _mm_setzero_pd();
147 fiy0 = _mm_setzero_pd();
148 fiz0 = _mm_setzero_pd();
150 /* Load parameters for i particles */
151 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
153 /* Reset potential sums */
154 vvdwsum = _mm_setzero_pd();
156 /* Start inner kernel loop */
157 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
160 /* Get j neighbor index, and coordinate index */
163 j_coord_offsetA = DIM*jnrA;
164 j_coord_offsetB = DIM*jnrB;
166 /* load j atom coordinates */
167 gmx_mm_load_1rvec_2ptr_swizzle_pd(x+j_coord_offsetA,x+j_coord_offsetB,
170 /* Calculate displacement vector */
171 dx00 = _mm_sub_pd(ix0,jx0);
172 dy00 = _mm_sub_pd(iy0,jy0);
173 dz00 = _mm_sub_pd(iz0,jz0);
175 /* Calculate squared distance and things based on it */
176 rsq00 = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
178 rinv00 = gmx_mm_invsqrt_pd(rsq00);
180 rinvsq00 = _mm_mul_pd(rinv00,rinv00);
182 /* Load parameters for j particles */
183 vdwjidx0A = 2*vdwtype[jnrA+0];
184 vdwjidx0B = 2*vdwtype[jnrB+0];
186 /**************************
187 * CALCULATE INTERACTIONS *
188 **************************/
190 r00 = _mm_mul_pd(rsq00,rinv00);
192 /* Compute parameters for interactions between i and j atoms */
193 gmx_mm_load_2pair_swizzle_pd(vdwparam+vdwioffset0+vdwjidx0A,
194 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
195 c6grid_00 = gmx_mm_load_2real_swizzle_pd(vdwgridparam+vdwioffset0+vdwjidx0A,
196 vdwgridparam+vdwioffset0+vdwjidx0B);
198 /* Analytical LJ-PME */
199 rinvsix = _mm_mul_pd(_mm_mul_pd(rinvsq00,rinvsq00),rinvsq00);
200 ewcljrsq = _mm_mul_pd(ewclj2,rsq00);
201 ewclj6 = _mm_mul_pd(ewclj2,_mm_mul_pd(ewclj2,ewclj2));
202 exponent = gmx_simd_exp_d(ewcljrsq);
203 /* poly = exp(-(beta*r)^2) * (1 + (beta*r)^2 + (beta*r)^4 /2) */
204 poly = _mm_mul_pd(exponent,_mm_macc_pd(_mm_mul_pd(ewcljrsq,ewcljrsq),one_half,_mm_sub_pd(one,ewcljrsq)));
205 /* vvdw6 = [C6 - C6grid * (1-poly)]/r6 */
206 vvdw6 = _mm_mul_pd(_mm_macc_pd(-c6grid_00,_mm_sub_pd(one,poly),c6_00),rinvsix);
207 vvdw12 = _mm_mul_pd(c12_00,_mm_mul_pd(rinvsix,rinvsix));
208 vvdw = _mm_msub_pd(vvdw12,one_twelfth,_mm_mul_pd(vvdw6,one_sixth));
209 /* fvdw = vvdw12/r - (vvdw6/r + (C6grid * exponent * beta^6)/r) */
210 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);
212 /* Update potential sum for this i atom from the interaction with this j atom. */
213 vvdwsum = _mm_add_pd(vvdwsum,vvdw);
217 /* Update vectorial force */
218 fix0 = _mm_macc_pd(dx00,fscal,fix0);
219 fiy0 = _mm_macc_pd(dy00,fscal,fiy0);
220 fiz0 = _mm_macc_pd(dz00,fscal,fiz0);
222 gmx_mm_decrement_1rvec_2ptr_swizzle_pd(f+j_coord_offsetA,f+j_coord_offsetB,
223 _mm_mul_pd(dx00,fscal),
224 _mm_mul_pd(dy00,fscal),
225 _mm_mul_pd(dz00,fscal));
227 /* Inner loop uses 50 flops */
234 j_coord_offsetA = DIM*jnrA;
236 /* load j atom coordinates */
237 gmx_mm_load_1rvec_1ptr_swizzle_pd(x+j_coord_offsetA,
240 /* Calculate displacement vector */
241 dx00 = _mm_sub_pd(ix0,jx0);
242 dy00 = _mm_sub_pd(iy0,jy0);
243 dz00 = _mm_sub_pd(iz0,jz0);
245 /* Calculate squared distance and things based on it */
246 rsq00 = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
248 rinv00 = gmx_mm_invsqrt_pd(rsq00);
250 rinvsq00 = _mm_mul_pd(rinv00,rinv00);
252 /* Load parameters for j particles */
253 vdwjidx0A = 2*vdwtype[jnrA+0];
255 /**************************
256 * CALCULATE INTERACTIONS *
257 **************************/
259 r00 = _mm_mul_pd(rsq00,rinv00);
261 /* Compute parameters for interactions between i and j atoms */
262 gmx_mm_load_1pair_swizzle_pd(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
263 c6grid_00 = gmx_mm_load_1real_pd(vdwgridparam+vdwioffset0+vdwjidx0A);
265 /* Analytical LJ-PME */
266 rinvsix = _mm_mul_pd(_mm_mul_pd(rinvsq00,rinvsq00),rinvsq00);
267 ewcljrsq = _mm_mul_pd(ewclj2,rsq00);
268 ewclj6 = _mm_mul_pd(ewclj2,_mm_mul_pd(ewclj2,ewclj2));
269 exponent = gmx_simd_exp_d(ewcljrsq);
270 /* poly = exp(-(beta*r)^2) * (1 + (beta*r)^2 + (beta*r)^4 /2) */
271 poly = _mm_mul_pd(exponent,_mm_macc_pd(_mm_mul_pd(ewcljrsq,ewcljrsq),one_half,_mm_sub_pd(one,ewcljrsq)));
272 /* vvdw6 = [C6 - C6grid * (1-poly)]/r6 */
273 vvdw6 = _mm_mul_pd(_mm_macc_pd(-c6grid_00,_mm_sub_pd(one,poly),c6_00),rinvsix);
274 vvdw12 = _mm_mul_pd(c12_00,_mm_mul_pd(rinvsix,rinvsix));
275 vvdw = _mm_msub_pd(vvdw12,one_twelfth,_mm_mul_pd(vvdw6,one_sixth));
276 /* fvdw = vvdw12/r - (vvdw6/r + (C6grid * exponent * beta^6)/r) */
277 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);
279 /* Update potential sum for this i atom from the interaction with this j atom. */
280 vvdw = _mm_unpacklo_pd(vvdw,_mm_setzero_pd());
281 vvdwsum = _mm_add_pd(vvdwsum,vvdw);
285 fscal = _mm_unpacklo_pd(fscal,_mm_setzero_pd());
287 /* Update vectorial force */
288 fix0 = _mm_macc_pd(dx00,fscal,fix0);
289 fiy0 = _mm_macc_pd(dy00,fscal,fiy0);
290 fiz0 = _mm_macc_pd(dz00,fscal,fiz0);
292 gmx_mm_decrement_1rvec_1ptr_swizzle_pd(f+j_coord_offsetA,
293 _mm_mul_pd(dx00,fscal),
294 _mm_mul_pd(dy00,fscal),
295 _mm_mul_pd(dz00,fscal));
297 /* Inner loop uses 50 flops */
300 /* End of innermost loop */
302 gmx_mm_update_iforce_1atom_swizzle_pd(fix0,fiy0,fiz0,
303 f+i_coord_offset,fshift+i_shift_offset);
306 /* Update potential energies */
307 gmx_mm_update_1pot_pd(vvdwsum,kernel_data->energygrp_vdw+ggid);
309 /* Increment number of inner iterations */
310 inneriter += j_index_end - j_index_start;
312 /* Outer loop uses 7 flops */
315 /* Increment number of outer iterations */
318 /* Update outer/inner flops */
320 inc_nrnb(nrnb,eNR_NBKERNEL_VDW_VF,outeriter*7 + inneriter*50);
323 * Gromacs nonbonded kernel: nb_kernel_ElecNone_VdwLJEw_GeomP1P1_F_avx_128_fma_double
324 * Electrostatics interaction: None
325 * VdW interaction: LJEwald
326 * Geometry: Particle-Particle
327 * Calculate force/pot: Force
330 nb_kernel_ElecNone_VdwLJEw_GeomP1P1_F_avx_128_fma_double
331 (t_nblist * gmx_restrict nlist,
332 rvec * gmx_restrict xx,
333 rvec * gmx_restrict ff,
334 t_forcerec * gmx_restrict fr,
335 t_mdatoms * gmx_restrict mdatoms,
336 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
337 t_nrnb * gmx_restrict nrnb)
339 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
340 * just 0 for non-waters.
341 * Suffixes A,B refer to j loop unrolling done with SSE double precision, e.g. for the two different
342 * jnr indices corresponding to data put in the four positions in the SIMD register.
344 int i_shift_offset,i_coord_offset,outeriter,inneriter;
345 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
347 int j_coord_offsetA,j_coord_offsetB;
348 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
350 real *shiftvec,*fshift,*x,*f;
351 __m128d tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
353 __m128d ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
354 int vdwjidx0A,vdwjidx0B;
355 __m128d jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
356 __m128d dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
358 __m128d rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
361 __m128d one_sixth = _mm_set1_pd(1.0/6.0);
362 __m128d one_twelfth = _mm_set1_pd(1.0/12.0);
365 __m128d ewclj,ewclj2,ewclj6,ewcljrsq,poly,exponent,f6A,f6B,sh_lj_ewald;
366 __m128d one_half = _mm_set1_pd(0.5);
367 __m128d minus_one = _mm_set1_pd(-1.0);
368 __m128d dummy_mask,cutoff_mask;
369 __m128d signbit = gmx_mm_castsi128_pd( _mm_set_epi32(0x80000000,0x00000000,0x80000000,0x00000000) );
370 __m128d one = _mm_set1_pd(1.0);
371 __m128d two = _mm_set1_pd(2.0);
377 jindex = nlist->jindex;
379 shiftidx = nlist->shift;
381 shiftvec = fr->shift_vec[0];
382 fshift = fr->fshift[0];
383 nvdwtype = fr->ntype;
385 vdwtype = mdatoms->typeA;
386 vdwgridparam = fr->ljpme_c6grid;
387 sh_lj_ewald = _mm_set1_pd(fr->ic->sh_lj_ewald);
388 ewclj = _mm_set1_pd(fr->ewaldcoeff_lj);
389 ewclj2 = _mm_mul_pd(minus_one,_mm_mul_pd(ewclj,ewclj));
391 /* Avoid stupid compiler warnings */
399 /* Start outer loop over neighborlists */
400 for(iidx=0; iidx<nri; iidx++)
402 /* Load shift vector for this list */
403 i_shift_offset = DIM*shiftidx[iidx];
405 /* Load limits for loop over neighbors */
406 j_index_start = jindex[iidx];
407 j_index_end = jindex[iidx+1];
409 /* Get outer coordinate index */
411 i_coord_offset = DIM*inr;
413 /* Load i particle coords and add shift vector */
414 gmx_mm_load_shift_and_1rvec_broadcast_pd(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
416 fix0 = _mm_setzero_pd();
417 fiy0 = _mm_setzero_pd();
418 fiz0 = _mm_setzero_pd();
420 /* Load parameters for i particles */
421 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
423 /* Start inner kernel loop */
424 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
427 /* Get j neighbor index, and coordinate index */
430 j_coord_offsetA = DIM*jnrA;
431 j_coord_offsetB = DIM*jnrB;
433 /* load j atom coordinates */
434 gmx_mm_load_1rvec_2ptr_swizzle_pd(x+j_coord_offsetA,x+j_coord_offsetB,
437 /* Calculate displacement vector */
438 dx00 = _mm_sub_pd(ix0,jx0);
439 dy00 = _mm_sub_pd(iy0,jy0);
440 dz00 = _mm_sub_pd(iz0,jz0);
442 /* Calculate squared distance and things based on it */
443 rsq00 = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
445 rinv00 = gmx_mm_invsqrt_pd(rsq00);
447 rinvsq00 = _mm_mul_pd(rinv00,rinv00);
449 /* Load parameters for j particles */
450 vdwjidx0A = 2*vdwtype[jnrA+0];
451 vdwjidx0B = 2*vdwtype[jnrB+0];
453 /**************************
454 * CALCULATE INTERACTIONS *
455 **************************/
457 r00 = _mm_mul_pd(rsq00,rinv00);
459 /* Compute parameters for interactions between i and j atoms */
460 gmx_mm_load_2pair_swizzle_pd(vdwparam+vdwioffset0+vdwjidx0A,
461 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
462 c6grid_00 = gmx_mm_load_2real_swizzle_pd(vdwgridparam+vdwioffset0+vdwjidx0A,
463 vdwgridparam+vdwioffset0+vdwjidx0B);
465 /* Analytical LJ-PME */
466 rinvsix = _mm_mul_pd(_mm_mul_pd(rinvsq00,rinvsq00),rinvsq00);
467 ewcljrsq = _mm_mul_pd(ewclj2,rsq00);
468 ewclj6 = _mm_mul_pd(ewclj2,_mm_mul_pd(ewclj2,ewclj2));
469 exponent = gmx_simd_exp_d(ewcljrsq);
470 /* poly = exp(-(beta*r)^2) * (1 + (beta*r)^2 + (beta*r)^4 /2) */
471 poly = _mm_mul_pd(exponent,_mm_macc_pd(_mm_mul_pd(ewcljrsq,ewcljrsq),one_half,_mm_sub_pd(one,ewcljrsq)));
472 /* f6A = 6 * C6grid * (1 - poly) */
473 f6A = _mm_mul_pd(c6grid_00,_mm_sub_pd(one,poly));
474 /* f6B = C6grid * exponent * beta^6 */
475 f6B = _mm_mul_pd(_mm_mul_pd(c6grid_00,one_sixth),_mm_mul_pd(exponent,ewclj6));
476 /* fvdw = 12*C12/r13 - ((6*C6 - f6A)/r6 + f6B)/r */
477 fvdw = _mm_mul_pd(_mm_macc_pd(_mm_msub_pd(c12_00,rinvsix,_mm_sub_pd(c6_00,f6A)),rinvsix,f6B),rinvsq00);
481 /* Update vectorial force */
482 fix0 = _mm_macc_pd(dx00,fscal,fix0);
483 fiy0 = _mm_macc_pd(dy00,fscal,fiy0);
484 fiz0 = _mm_macc_pd(dz00,fscal,fiz0);
486 gmx_mm_decrement_1rvec_2ptr_swizzle_pd(f+j_coord_offsetA,f+j_coord_offsetB,
487 _mm_mul_pd(dx00,fscal),
488 _mm_mul_pd(dy00,fscal),
489 _mm_mul_pd(dz00,fscal));
491 /* Inner loop uses 47 flops */
498 j_coord_offsetA = DIM*jnrA;
500 /* load j atom coordinates */
501 gmx_mm_load_1rvec_1ptr_swizzle_pd(x+j_coord_offsetA,
504 /* Calculate displacement vector */
505 dx00 = _mm_sub_pd(ix0,jx0);
506 dy00 = _mm_sub_pd(iy0,jy0);
507 dz00 = _mm_sub_pd(iz0,jz0);
509 /* Calculate squared distance and things based on it */
510 rsq00 = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
512 rinv00 = gmx_mm_invsqrt_pd(rsq00);
514 rinvsq00 = _mm_mul_pd(rinv00,rinv00);
516 /* Load parameters for j particles */
517 vdwjidx0A = 2*vdwtype[jnrA+0];
519 /**************************
520 * CALCULATE INTERACTIONS *
521 **************************/
523 r00 = _mm_mul_pd(rsq00,rinv00);
525 /* Compute parameters for interactions between i and j atoms */
526 gmx_mm_load_1pair_swizzle_pd(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
527 c6grid_00 = gmx_mm_load_1real_pd(vdwgridparam+vdwioffset0+vdwjidx0A);
529 /* Analytical LJ-PME */
530 rinvsix = _mm_mul_pd(_mm_mul_pd(rinvsq00,rinvsq00),rinvsq00);
531 ewcljrsq = _mm_mul_pd(ewclj2,rsq00);
532 ewclj6 = _mm_mul_pd(ewclj2,_mm_mul_pd(ewclj2,ewclj2));
533 exponent = gmx_simd_exp_d(ewcljrsq);
534 /* poly = exp(-(beta*r)^2) * (1 + (beta*r)^2 + (beta*r)^4 /2) */
535 poly = _mm_mul_pd(exponent,_mm_macc_pd(_mm_mul_pd(ewcljrsq,ewcljrsq),one_half,_mm_sub_pd(one,ewcljrsq)));
536 /* f6A = 6 * C6grid * (1 - poly) */
537 f6A = _mm_mul_pd(c6grid_00,_mm_sub_pd(one,poly));
538 /* f6B = C6grid * exponent * beta^6 */
539 f6B = _mm_mul_pd(_mm_mul_pd(c6grid_00,one_sixth),_mm_mul_pd(exponent,ewclj6));
540 /* fvdw = 12*C12/r13 - ((6*C6 - f6A)/r6 + f6B)/r */
541 fvdw = _mm_mul_pd(_mm_macc_pd(_mm_msub_pd(c12_00,rinvsix,_mm_sub_pd(c6_00,f6A)),rinvsix,f6B),rinvsq00);
545 fscal = _mm_unpacklo_pd(fscal,_mm_setzero_pd());
547 /* Update vectorial force */
548 fix0 = _mm_macc_pd(dx00,fscal,fix0);
549 fiy0 = _mm_macc_pd(dy00,fscal,fiy0);
550 fiz0 = _mm_macc_pd(dz00,fscal,fiz0);
552 gmx_mm_decrement_1rvec_1ptr_swizzle_pd(f+j_coord_offsetA,
553 _mm_mul_pd(dx00,fscal),
554 _mm_mul_pd(dy00,fscal),
555 _mm_mul_pd(dz00,fscal));
557 /* Inner loop uses 47 flops */
560 /* End of innermost loop */
562 gmx_mm_update_iforce_1atom_swizzle_pd(fix0,fiy0,fiz0,
563 f+i_coord_offset,fshift+i_shift_offset);
565 /* Increment number of inner iterations */
566 inneriter += j_index_end - j_index_start;
568 /* Outer loop uses 6 flops */
571 /* Increment number of outer iterations */
574 /* Update outer/inner flops */
576 inc_nrnb(nrnb,eNR_NBKERNEL_VDW_F,outeriter*6 + inneriter*47);