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 sparc64_hpc_ace_double kernel generator.
42 #include "../nb_kernel.h"
43 #include "gromacs/legacyheaders/types/simple.h"
44 #include "gromacs/math/vec.h"
45 #include "gromacs/legacyheaders/nrnb.h"
47 #include "kernelutil_sparc64_hpc_ace_double.h"
50 * Gromacs nonbonded kernel: nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_sparc64_hpc_ace_double
51 * Electrostatics interaction: None
52 * VdW interaction: CubicSplineTable
53 * Geometry: Particle-Particle
54 * Calculate force/pot: PotentialAndForce
57 nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_sparc64_hpc_ace_double
58 (t_nblist * gmx_restrict nlist,
59 rvec * gmx_restrict xx,
60 rvec * gmx_restrict ff,
61 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 refer to j loop unrolling done with double precision SIMD, e.g. for the two 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;
74 int j_coord_offsetA,j_coord_offsetB;
75 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
77 real *shiftvec,*fshift,*x,*f;
78 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
80 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
81 int vdwjidx0A,vdwjidx0B;
82 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
83 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
85 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
88 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
89 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
90 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
93 _fjsp_v2r8 dummy_mask,cutoff_mask;
94 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
95 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
96 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
103 jindex = nlist->jindex;
105 shiftidx = nlist->shift;
107 shiftvec = fr->shift_vec[0];
108 fshift = fr->fshift[0];
109 nvdwtype = fr->ntype;
111 vdwtype = mdatoms->typeA;
113 vftab = kernel_data->table_vdw->data;
114 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
116 /* Avoid stupid compiler warnings */
124 /* Start outer loop over neighborlists */
125 for(iidx=0; iidx<nri; iidx++)
127 /* Load shift vector for this list */
128 i_shift_offset = DIM*shiftidx[iidx];
130 /* Load limits for loop over neighbors */
131 j_index_start = jindex[iidx];
132 j_index_end = jindex[iidx+1];
134 /* Get outer coordinate index */
136 i_coord_offset = DIM*inr;
138 /* Load i particle coords and add shift vector */
139 gmx_fjsp_load_shift_and_1rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
141 fix0 = _fjsp_setzero_v2r8();
142 fiy0 = _fjsp_setzero_v2r8();
143 fiz0 = _fjsp_setzero_v2r8();
145 /* Load parameters for i particles */
146 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
148 /* Reset potential sums */
149 vvdwsum = _fjsp_setzero_v2r8();
151 /* Start inner kernel loop */
152 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
155 /* Get j neighbor index, and coordinate index */
158 j_coord_offsetA = DIM*jnrA;
159 j_coord_offsetB = DIM*jnrB;
161 /* load j atom coordinates */
162 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
165 /* Calculate displacement vector */
166 dx00 = _fjsp_sub_v2r8(ix0,jx0);
167 dy00 = _fjsp_sub_v2r8(iy0,jy0);
168 dz00 = _fjsp_sub_v2r8(iz0,jz0);
170 /* Calculate squared distance and things based on it */
171 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
173 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
175 /* Load parameters for j particles */
176 vdwjidx0A = 2*vdwtype[jnrA+0];
177 vdwjidx0B = 2*vdwtype[jnrB+0];
179 /**************************
180 * CALCULATE INTERACTIONS *
181 **************************/
183 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
185 /* Compute parameters for interactions between i and j atoms */
186 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
187 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
189 /* Calculate table index by multiplying r with table scale and truncate to integer */
190 rt = _fjsp_mul_v2r8(r00,vftabscale);
191 itab_tmp = _fjsp_dtox_v2r8(rt);
192 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
193 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
194 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
199 /* CUBIC SPLINE TABLE DISPERSION */
200 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
201 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
202 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
203 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
204 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
205 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
206 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
207 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
208 vvdw6 = _fjsp_mul_v2r8(c6_00,VV);
209 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
210 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
212 /* CUBIC SPLINE TABLE REPULSION */
213 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
214 F = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
215 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
216 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
217 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
218 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
219 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
220 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
221 vvdw12 = _fjsp_mul_v2r8(c12_00,VV);
222 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
223 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
224 vvdw = _fjsp_add_v2r8(vvdw12,vvdw6);
225 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
227 /* Update potential sum for this i atom from the interaction with this j atom. */
228 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
232 /* Update vectorial force */
233 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
234 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
235 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
237 gmx_fjsp_decrement_fma_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fscal,dx00,dy00,dz00);
239 /* Inner loop uses 59 flops */
246 j_coord_offsetA = DIM*jnrA;
248 /* load j atom coordinates */
249 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
252 /* Calculate displacement vector */
253 dx00 = _fjsp_sub_v2r8(ix0,jx0);
254 dy00 = _fjsp_sub_v2r8(iy0,jy0);
255 dz00 = _fjsp_sub_v2r8(iz0,jz0);
257 /* Calculate squared distance and things based on it */
258 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
260 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
262 /* Load parameters for j particles */
263 vdwjidx0A = 2*vdwtype[jnrA+0];
265 /**************************
266 * CALCULATE INTERACTIONS *
267 **************************/
269 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
271 /* Compute parameters for interactions between i and j atoms */
272 gmx_fjsp_load_1pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
274 /* Calculate table index by multiplying r with table scale and truncate to integer */
275 rt = _fjsp_mul_v2r8(r00,vftabscale);
276 itab_tmp = _fjsp_dtox_v2r8(rt);
277 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
278 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
279 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
284 /* CUBIC SPLINE TABLE DISPERSION */
285 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
286 F = _fjsp_setzero_v2r8();
287 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
288 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
289 H = _fjsp_setzero_v2r8();
290 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
291 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
292 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
293 vvdw6 = _fjsp_mul_v2r8(c6_00,VV);
294 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
295 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
297 /* CUBIC SPLINE TABLE REPULSION */
298 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
299 F = _fjsp_setzero_v2r8();
300 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
301 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
302 H = _fjsp_setzero_v2r8();
303 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
304 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
305 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
306 vvdw12 = _fjsp_mul_v2r8(c12_00,VV);
307 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
308 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
309 vvdw = _fjsp_add_v2r8(vvdw12,vvdw6);
310 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
312 /* Update potential sum for this i atom from the interaction with this j atom. */
313 vvdw = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
314 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
318 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
320 /* Update vectorial force */
321 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
322 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
323 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
325 gmx_fjsp_decrement_fma_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fscal,dx00,dy00,dz00);
327 /* Inner loop uses 59 flops */
330 /* End of innermost loop */
332 gmx_fjsp_update_iforce_1atom_swizzle_v2r8(fix0,fiy0,fiz0,
333 f+i_coord_offset,fshift+i_shift_offset);
336 /* Update potential energies */
337 gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
339 /* Increment number of inner iterations */
340 inneriter += j_index_end - j_index_start;
342 /* Outer loop uses 7 flops */
345 /* Increment number of outer iterations */
348 /* Update outer/inner flops */
350 inc_nrnb(nrnb,eNR_NBKERNEL_VDW_VF,outeriter*7 + inneriter*59);
353 * Gromacs nonbonded kernel: nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double
354 * Electrostatics interaction: None
355 * VdW interaction: CubicSplineTable
356 * Geometry: Particle-Particle
357 * Calculate force/pot: Force
360 nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double
361 (t_nblist * gmx_restrict nlist,
362 rvec * gmx_restrict xx,
363 rvec * gmx_restrict ff,
364 t_forcerec * gmx_restrict fr,
365 t_mdatoms * gmx_restrict mdatoms,
366 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
367 t_nrnb * gmx_restrict nrnb)
369 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
370 * just 0 for non-waters.
371 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
372 * jnr indices corresponding to data put in the four positions in the SIMD register.
374 int i_shift_offset,i_coord_offset,outeriter,inneriter;
375 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
377 int j_coord_offsetA,j_coord_offsetB;
378 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
380 real *shiftvec,*fshift,*x,*f;
381 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
383 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
384 int vdwjidx0A,vdwjidx0B;
385 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
386 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
388 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
391 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
392 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
393 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
396 _fjsp_v2r8 dummy_mask,cutoff_mask;
397 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
398 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
399 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
406 jindex = nlist->jindex;
408 shiftidx = nlist->shift;
410 shiftvec = fr->shift_vec[0];
411 fshift = fr->fshift[0];
412 nvdwtype = fr->ntype;
414 vdwtype = mdatoms->typeA;
416 vftab = kernel_data->table_vdw->data;
417 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
419 /* Avoid stupid compiler warnings */
427 /* Start outer loop over neighborlists */
428 for(iidx=0; iidx<nri; iidx++)
430 /* Load shift vector for this list */
431 i_shift_offset = DIM*shiftidx[iidx];
433 /* Load limits for loop over neighbors */
434 j_index_start = jindex[iidx];
435 j_index_end = jindex[iidx+1];
437 /* Get outer coordinate index */
439 i_coord_offset = DIM*inr;
441 /* Load i particle coords and add shift vector */
442 gmx_fjsp_load_shift_and_1rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
444 fix0 = _fjsp_setzero_v2r8();
445 fiy0 = _fjsp_setzero_v2r8();
446 fiz0 = _fjsp_setzero_v2r8();
448 /* Load parameters for i particles */
449 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
451 /* Start inner kernel loop */
452 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
455 /* Get j neighbor index, and coordinate index */
458 j_coord_offsetA = DIM*jnrA;
459 j_coord_offsetB = DIM*jnrB;
461 /* load j atom coordinates */
462 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
465 /* Calculate displacement vector */
466 dx00 = _fjsp_sub_v2r8(ix0,jx0);
467 dy00 = _fjsp_sub_v2r8(iy0,jy0);
468 dz00 = _fjsp_sub_v2r8(iz0,jz0);
470 /* Calculate squared distance and things based on it */
471 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
473 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
475 /* Load parameters for j particles */
476 vdwjidx0A = 2*vdwtype[jnrA+0];
477 vdwjidx0B = 2*vdwtype[jnrB+0];
479 /**************************
480 * CALCULATE INTERACTIONS *
481 **************************/
483 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
485 /* Compute parameters for interactions between i and j atoms */
486 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
487 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
489 /* Calculate table index by multiplying r with table scale and truncate to integer */
490 rt = _fjsp_mul_v2r8(r00,vftabscale);
491 itab_tmp = _fjsp_dtox_v2r8(rt);
492 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
493 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
494 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
499 /* CUBIC SPLINE TABLE DISPERSION */
500 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
501 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
502 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
503 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
504 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
505 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
506 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
507 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
508 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
510 /* CUBIC SPLINE TABLE REPULSION */
511 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
512 F = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
513 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
514 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
515 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
516 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
517 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
518 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
519 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
520 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
524 /* Update vectorial force */
525 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
526 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
527 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
529 gmx_fjsp_decrement_fma_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fscal,dx00,dy00,dz00);
531 /* Inner loop uses 51 flops */
538 j_coord_offsetA = DIM*jnrA;
540 /* load j atom coordinates */
541 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
544 /* Calculate displacement vector */
545 dx00 = _fjsp_sub_v2r8(ix0,jx0);
546 dy00 = _fjsp_sub_v2r8(iy0,jy0);
547 dz00 = _fjsp_sub_v2r8(iz0,jz0);
549 /* Calculate squared distance and things based on it */
550 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
552 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
554 /* Load parameters for j particles */
555 vdwjidx0A = 2*vdwtype[jnrA+0];
557 /**************************
558 * CALCULATE INTERACTIONS *
559 **************************/
561 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
563 /* Compute parameters for interactions between i and j atoms */
564 gmx_fjsp_load_1pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
566 /* Calculate table index by multiplying r with table scale and truncate to integer */
567 rt = _fjsp_mul_v2r8(r00,vftabscale);
568 itab_tmp = _fjsp_dtox_v2r8(rt);
569 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
570 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
571 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
576 /* CUBIC SPLINE TABLE DISPERSION */
577 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
578 F = _fjsp_setzero_v2r8();
579 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
580 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
581 H = _fjsp_setzero_v2r8();
582 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
583 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
584 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
585 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
587 /* CUBIC SPLINE TABLE REPULSION */
588 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
589 F = _fjsp_setzero_v2r8();
590 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
591 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
592 H = _fjsp_setzero_v2r8();
593 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
594 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
595 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
596 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
597 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
601 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
603 /* Update vectorial force */
604 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
605 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
606 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
608 gmx_fjsp_decrement_fma_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fscal,dx00,dy00,dz00);
610 /* Inner loop uses 51 flops */
613 /* End of innermost loop */
615 gmx_fjsp_update_iforce_1atom_swizzle_v2r8(fix0,fiy0,fiz0,
616 f+i_coord_offset,fshift+i_shift_offset);
618 /* Increment number of inner iterations */
619 inneriter += j_index_end - j_index_start;
621 /* Outer loop uses 6 flops */
624 /* Increment number of outer iterations */
627 /* Update outer/inner flops */
629 inc_nrnb(nrnb,eNR_NBKERNEL_VDW_F,outeriter*6 + inneriter*51);