2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2012,2013,2014,2015,2017,2018, 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.
44 #include "../nb_kernel.h"
45 #include "gromacs/gmxlib/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 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 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_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
273 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
275 /* Calculate table index by multiplying r with table scale and truncate to integer */
276 rt = _fjsp_mul_v2r8(r00,vftabscale);
277 itab_tmp = _fjsp_dtox_v2r8(rt);
278 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
279 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
280 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
285 /* CUBIC SPLINE TABLE DISPERSION */
286 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
287 F = _fjsp_setzero_v2r8();
288 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
289 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
290 H = _fjsp_setzero_v2r8();
291 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
292 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
293 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
294 vvdw6 = _fjsp_mul_v2r8(c6_00,VV);
295 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
296 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
298 /* CUBIC SPLINE TABLE REPULSION */
299 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
300 F = _fjsp_setzero_v2r8();
301 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
302 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
303 H = _fjsp_setzero_v2r8();
304 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
305 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
306 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
307 vvdw12 = _fjsp_mul_v2r8(c12_00,VV);
308 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
309 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
310 vvdw = _fjsp_add_v2r8(vvdw12,vvdw6);
311 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
313 /* Update potential sum for this i atom from the interaction with this j atom. */
314 vvdw = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
315 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
319 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
321 /* Update vectorial force */
322 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
323 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
324 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
326 gmx_fjsp_decrement_fma_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fscal,dx00,dy00,dz00);
328 /* Inner loop uses 59 flops */
331 /* End of innermost loop */
333 gmx_fjsp_update_iforce_1atom_swizzle_v2r8(fix0,fiy0,fiz0,
334 f+i_coord_offset,fshift+i_shift_offset);
337 /* Update potential energies */
338 gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
340 /* Increment number of inner iterations */
341 inneriter += j_index_end - j_index_start;
343 /* Outer loop uses 7 flops */
346 /* Increment number of outer iterations */
349 /* Update outer/inner flops */
351 inc_nrnb(nrnb,eNR_NBKERNEL_VDW_VF,outeriter*7 + inneriter*59);
354 * Gromacs nonbonded kernel: nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double
355 * Electrostatics interaction: None
356 * VdW interaction: CubicSplineTable
357 * Geometry: Particle-Particle
358 * Calculate force/pot: Force
361 nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double
362 (t_nblist * gmx_restrict nlist,
363 rvec * gmx_restrict xx,
364 rvec * gmx_restrict ff,
365 struct t_forcerec * gmx_restrict fr,
366 t_mdatoms * gmx_restrict mdatoms,
367 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
368 t_nrnb * gmx_restrict nrnb)
370 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
371 * just 0 for non-waters.
372 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
373 * jnr indices corresponding to data put in the four positions in the SIMD register.
375 int i_shift_offset,i_coord_offset,outeriter,inneriter;
376 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
378 int j_coord_offsetA,j_coord_offsetB;
379 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
381 real *shiftvec,*fshift,*x,*f;
382 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
384 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
385 int vdwjidx0A,vdwjidx0B;
386 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
387 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
389 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
392 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
393 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
394 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
397 _fjsp_v2r8 dummy_mask,cutoff_mask;
398 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
399 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
400 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
407 jindex = nlist->jindex;
409 shiftidx = nlist->shift;
411 shiftvec = fr->shift_vec[0];
412 fshift = fr->fshift[0];
413 nvdwtype = fr->ntype;
415 vdwtype = mdatoms->typeA;
417 vftab = kernel_data->table_vdw->data;
418 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
420 /* Avoid stupid compiler warnings */
428 /* Start outer loop over neighborlists */
429 for(iidx=0; iidx<nri; iidx++)
431 /* Load shift vector for this list */
432 i_shift_offset = DIM*shiftidx[iidx];
434 /* Load limits for loop over neighbors */
435 j_index_start = jindex[iidx];
436 j_index_end = jindex[iidx+1];
438 /* Get outer coordinate index */
440 i_coord_offset = DIM*inr;
442 /* Load i particle coords and add shift vector */
443 gmx_fjsp_load_shift_and_1rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
445 fix0 = _fjsp_setzero_v2r8();
446 fiy0 = _fjsp_setzero_v2r8();
447 fiz0 = _fjsp_setzero_v2r8();
449 /* Load parameters for i particles */
450 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
452 /* Start inner kernel loop */
453 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
456 /* Get j neighbor index, and coordinate index */
459 j_coord_offsetA = DIM*jnrA;
460 j_coord_offsetB = DIM*jnrB;
462 /* load j atom coordinates */
463 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
466 /* Calculate displacement vector */
467 dx00 = _fjsp_sub_v2r8(ix0,jx0);
468 dy00 = _fjsp_sub_v2r8(iy0,jy0);
469 dz00 = _fjsp_sub_v2r8(iz0,jz0);
471 /* Calculate squared distance and things based on it */
472 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
474 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
476 /* Load parameters for j particles */
477 vdwjidx0A = 2*vdwtype[jnrA+0];
478 vdwjidx0B = 2*vdwtype[jnrB+0];
480 /**************************
481 * CALCULATE INTERACTIONS *
482 **************************/
484 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
486 /* Compute parameters for interactions between i and j atoms */
487 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
488 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
490 /* Calculate table index by multiplying r with table scale and truncate to integer */
491 rt = _fjsp_mul_v2r8(r00,vftabscale);
492 itab_tmp = _fjsp_dtox_v2r8(rt);
493 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
494 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
495 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
500 /* CUBIC SPLINE TABLE DISPERSION */
501 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
502 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
503 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
504 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
505 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
506 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
507 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
508 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
509 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
511 /* CUBIC SPLINE TABLE REPULSION */
512 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
513 F = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
514 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
515 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
516 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
517 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
518 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
519 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
520 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
521 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
525 /* Update vectorial force */
526 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
527 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
528 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
530 gmx_fjsp_decrement_fma_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fscal,dx00,dy00,dz00);
532 /* Inner loop uses 51 flops */
539 j_coord_offsetA = DIM*jnrA;
541 /* load j atom coordinates */
542 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
545 /* Calculate displacement vector */
546 dx00 = _fjsp_sub_v2r8(ix0,jx0);
547 dy00 = _fjsp_sub_v2r8(iy0,jy0);
548 dz00 = _fjsp_sub_v2r8(iz0,jz0);
550 /* Calculate squared distance and things based on it */
551 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
553 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
555 /* Load parameters for j particles */
556 vdwjidx0A = 2*vdwtype[jnrA+0];
558 /**************************
559 * CALCULATE INTERACTIONS *
560 **************************/
562 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
564 /* Compute parameters for interactions between i and j atoms */
565 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
566 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
568 /* Calculate table index by multiplying r with table scale and truncate to integer */
569 rt = _fjsp_mul_v2r8(r00,vftabscale);
570 itab_tmp = _fjsp_dtox_v2r8(rt);
571 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
572 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
573 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
578 /* CUBIC SPLINE TABLE DISPERSION */
579 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
580 F = _fjsp_setzero_v2r8();
581 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
582 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
583 H = _fjsp_setzero_v2r8();
584 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
585 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
586 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
587 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
589 /* CUBIC SPLINE TABLE REPULSION */
590 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
591 F = _fjsp_setzero_v2r8();
592 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
593 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
594 H = _fjsp_setzero_v2r8();
595 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
596 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
597 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
598 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
599 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
603 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
605 /* Update vectorial force */
606 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
607 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
608 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
610 gmx_fjsp_decrement_fma_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fscal,dx00,dy00,dz00);
612 /* Inner loop uses 51 flops */
615 /* End of innermost loop */
617 gmx_fjsp_update_iforce_1atom_swizzle_v2r8(fix0,fiy0,fiz0,
618 f+i_coord_offset,fshift+i_shift_offset);
620 /* Increment number of inner iterations */
621 inneriter += j_index_end - j_index_start;
623 /* Outer loop uses 6 flops */
626 /* Increment number of outer iterations */
629 /* Update outer/inner flops */
631 inc_nrnb(nrnb,eNR_NBKERNEL_VDW_F,outeriter*6 + inneriter*51);