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.
44 #include "../nb_kernel.h"
45 #include "types/simple.h"
46 #include "gromacs/math/vec.h"
49 #include "kernelutil_sparc64_hpc_ace_double.h"
52 * Gromacs nonbonded kernel: nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_sparc64_hpc_ace_double
53 * Electrostatics interaction: None
54 * VdW interaction: CubicSplineTable
55 * Geometry: Particle-Particle
56 * Calculate force/pot: PotentialAndForce
59 nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_sparc64_hpc_ace_double
60 (t_nblist * gmx_restrict nlist,
61 rvec * gmx_restrict xx,
62 rvec * gmx_restrict ff,
63 t_forcerec * gmx_restrict fr,
64 t_mdatoms * gmx_restrict mdatoms,
65 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
66 t_nrnb * gmx_restrict nrnb)
68 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
69 * just 0 for non-waters.
70 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
71 * jnr indices corresponding to data put in the four positions in the SIMD register.
73 int i_shift_offset,i_coord_offset,outeriter,inneriter;
74 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
76 int j_coord_offsetA,j_coord_offsetB;
77 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
79 real *shiftvec,*fshift,*x,*f;
80 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
82 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
83 int vdwjidx0A,vdwjidx0B;
84 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
85 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
87 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
90 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
91 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
92 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
95 _fjsp_v2r8 dummy_mask,cutoff_mask;
96 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
97 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
98 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
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;
115 vftab = kernel_data->table_vdw->data;
116 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
118 /* Avoid stupid compiler warnings */
126 /* Start outer loop over neighborlists */
127 for(iidx=0; iidx<nri; iidx++)
129 /* Load shift vector for this list */
130 i_shift_offset = DIM*shiftidx[iidx];
132 /* Load limits for loop over neighbors */
133 j_index_start = jindex[iidx];
134 j_index_end = jindex[iidx+1];
136 /* Get outer coordinate index */
138 i_coord_offset = DIM*inr;
140 /* Load i particle coords and add shift vector */
141 gmx_fjsp_load_shift_and_1rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
143 fix0 = _fjsp_setzero_v2r8();
144 fiy0 = _fjsp_setzero_v2r8();
145 fiz0 = _fjsp_setzero_v2r8();
147 /* Load parameters for i particles */
148 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
150 /* Reset potential sums */
151 vvdwsum = _fjsp_setzero_v2r8();
153 /* Start inner kernel loop */
154 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
157 /* Get j neighbor index, and coordinate index */
160 j_coord_offsetA = DIM*jnrA;
161 j_coord_offsetB = DIM*jnrB;
163 /* load j atom coordinates */
164 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
167 /* Calculate displacement vector */
168 dx00 = _fjsp_sub_v2r8(ix0,jx0);
169 dy00 = _fjsp_sub_v2r8(iy0,jy0);
170 dz00 = _fjsp_sub_v2r8(iz0,jz0);
172 /* Calculate squared distance and things based on it */
173 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
175 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
177 /* Load parameters for j particles */
178 vdwjidx0A = 2*vdwtype[jnrA+0];
179 vdwjidx0B = 2*vdwtype[jnrB+0];
181 /**************************
182 * CALCULATE INTERACTIONS *
183 **************************/
185 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
187 /* Compute parameters for interactions between i and j atoms */
188 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
189 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
191 /* Calculate table index by multiplying r with table scale and truncate to integer */
192 rt = _fjsp_mul_v2r8(r00,vftabscale);
193 itab_tmp = _fjsp_dtox_v2r8(rt);
194 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
195 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
196 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
201 /* CUBIC SPLINE TABLE DISPERSION */
202 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
203 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
204 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
205 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
206 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
207 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
208 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
209 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
210 vvdw6 = _fjsp_mul_v2r8(c6_00,VV);
211 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
212 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
214 /* CUBIC SPLINE TABLE REPULSION */
215 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
216 F = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
217 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
218 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
219 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
220 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
221 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
222 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
223 vvdw12 = _fjsp_mul_v2r8(c12_00,VV);
224 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
225 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
226 vvdw = _fjsp_add_v2r8(vvdw12,vvdw6);
227 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
229 /* Update potential sum for this i atom from the interaction with this j atom. */
230 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
234 /* Update vectorial force */
235 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
236 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
237 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
239 gmx_fjsp_decrement_fma_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fscal,dx00,dy00,dz00);
241 /* Inner loop uses 59 flops */
248 j_coord_offsetA = DIM*jnrA;
250 /* load j atom coordinates */
251 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
254 /* Calculate displacement vector */
255 dx00 = _fjsp_sub_v2r8(ix0,jx0);
256 dy00 = _fjsp_sub_v2r8(iy0,jy0);
257 dz00 = _fjsp_sub_v2r8(iz0,jz0);
259 /* Calculate squared distance and things based on it */
260 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
262 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
264 /* Load parameters for j particles */
265 vdwjidx0A = 2*vdwtype[jnrA+0];
267 /**************************
268 * CALCULATE INTERACTIONS *
269 **************************/
271 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
273 /* Compute parameters for interactions between i and j atoms */
274 gmx_fjsp_load_1pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
276 /* Calculate table index by multiplying r with table scale and truncate to integer */
277 rt = _fjsp_mul_v2r8(r00,vftabscale);
278 itab_tmp = _fjsp_dtox_v2r8(rt);
279 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
280 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
281 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
286 /* CUBIC SPLINE TABLE DISPERSION */
287 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
288 F = _fjsp_setzero_v2r8();
289 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
290 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
291 H = _fjsp_setzero_v2r8();
292 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
293 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
294 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
295 vvdw6 = _fjsp_mul_v2r8(c6_00,VV);
296 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
297 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
299 /* CUBIC SPLINE TABLE REPULSION */
300 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
301 F = _fjsp_setzero_v2r8();
302 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
303 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
304 H = _fjsp_setzero_v2r8();
305 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
306 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
307 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
308 vvdw12 = _fjsp_mul_v2r8(c12_00,VV);
309 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
310 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
311 vvdw = _fjsp_add_v2r8(vvdw12,vvdw6);
312 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
314 /* Update potential sum for this i atom from the interaction with this j atom. */
315 vvdw = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
316 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
320 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
322 /* Update vectorial force */
323 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
324 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
325 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
327 gmx_fjsp_decrement_fma_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fscal,dx00,dy00,dz00);
329 /* Inner loop uses 59 flops */
332 /* End of innermost loop */
334 gmx_fjsp_update_iforce_1atom_swizzle_v2r8(fix0,fiy0,fiz0,
335 f+i_coord_offset,fshift+i_shift_offset);
338 /* Update potential energies */
339 gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
341 /* Increment number of inner iterations */
342 inneriter += j_index_end - j_index_start;
344 /* Outer loop uses 7 flops */
347 /* Increment number of outer iterations */
350 /* Update outer/inner flops */
352 inc_nrnb(nrnb,eNR_NBKERNEL_VDW_VF,outeriter*7 + inneriter*59);
355 * Gromacs nonbonded kernel: nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double
356 * Electrostatics interaction: None
357 * VdW interaction: CubicSplineTable
358 * Geometry: Particle-Particle
359 * Calculate force/pot: Force
362 nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double
363 (t_nblist * gmx_restrict nlist,
364 rvec * gmx_restrict xx,
365 rvec * gmx_restrict ff,
366 t_forcerec * gmx_restrict fr,
367 t_mdatoms * gmx_restrict mdatoms,
368 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
369 t_nrnb * gmx_restrict nrnb)
371 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
372 * just 0 for non-waters.
373 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
374 * jnr indices corresponding to data put in the four positions in the SIMD register.
376 int i_shift_offset,i_coord_offset,outeriter,inneriter;
377 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
379 int j_coord_offsetA,j_coord_offsetB;
380 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
382 real *shiftvec,*fshift,*x,*f;
383 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
385 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
386 int vdwjidx0A,vdwjidx0B;
387 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
388 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
390 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
393 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
394 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
395 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
398 _fjsp_v2r8 dummy_mask,cutoff_mask;
399 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
400 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
401 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
408 jindex = nlist->jindex;
410 shiftidx = nlist->shift;
412 shiftvec = fr->shift_vec[0];
413 fshift = fr->fshift[0];
414 nvdwtype = fr->ntype;
416 vdwtype = mdatoms->typeA;
418 vftab = kernel_data->table_vdw->data;
419 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
421 /* Avoid stupid compiler warnings */
429 /* Start outer loop over neighborlists */
430 for(iidx=0; iidx<nri; iidx++)
432 /* Load shift vector for this list */
433 i_shift_offset = DIM*shiftidx[iidx];
435 /* Load limits for loop over neighbors */
436 j_index_start = jindex[iidx];
437 j_index_end = jindex[iidx+1];
439 /* Get outer coordinate index */
441 i_coord_offset = DIM*inr;
443 /* Load i particle coords and add shift vector */
444 gmx_fjsp_load_shift_and_1rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
446 fix0 = _fjsp_setzero_v2r8();
447 fiy0 = _fjsp_setzero_v2r8();
448 fiz0 = _fjsp_setzero_v2r8();
450 /* Load parameters for i particles */
451 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
453 /* Start inner kernel loop */
454 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
457 /* Get j neighbor index, and coordinate index */
460 j_coord_offsetA = DIM*jnrA;
461 j_coord_offsetB = DIM*jnrB;
463 /* load j atom coordinates */
464 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
467 /* Calculate displacement vector */
468 dx00 = _fjsp_sub_v2r8(ix0,jx0);
469 dy00 = _fjsp_sub_v2r8(iy0,jy0);
470 dz00 = _fjsp_sub_v2r8(iz0,jz0);
472 /* Calculate squared distance and things based on it */
473 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
475 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
477 /* Load parameters for j particles */
478 vdwjidx0A = 2*vdwtype[jnrA+0];
479 vdwjidx0B = 2*vdwtype[jnrB+0];
481 /**************************
482 * CALCULATE INTERACTIONS *
483 **************************/
485 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
487 /* Compute parameters for interactions between i and j atoms */
488 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
489 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
491 /* Calculate table index by multiplying r with table scale and truncate to integer */
492 rt = _fjsp_mul_v2r8(r00,vftabscale);
493 itab_tmp = _fjsp_dtox_v2r8(rt);
494 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
495 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
496 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
501 /* CUBIC SPLINE TABLE DISPERSION */
502 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
503 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
504 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
505 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
506 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
507 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
508 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
509 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
510 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
512 /* CUBIC SPLINE TABLE REPULSION */
513 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
514 F = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
515 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
516 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
517 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
518 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
519 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
520 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
521 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
522 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
526 /* Update vectorial force */
527 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
528 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
529 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
531 gmx_fjsp_decrement_fma_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fscal,dx00,dy00,dz00);
533 /* Inner loop uses 51 flops */
540 j_coord_offsetA = DIM*jnrA;
542 /* load j atom coordinates */
543 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
546 /* Calculate displacement vector */
547 dx00 = _fjsp_sub_v2r8(ix0,jx0);
548 dy00 = _fjsp_sub_v2r8(iy0,jy0);
549 dz00 = _fjsp_sub_v2r8(iz0,jz0);
551 /* Calculate squared distance and things based on it */
552 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
554 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
556 /* Load parameters for j particles */
557 vdwjidx0A = 2*vdwtype[jnrA+0];
559 /**************************
560 * CALCULATE INTERACTIONS *
561 **************************/
563 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
565 /* Compute parameters for interactions between i and j atoms */
566 gmx_fjsp_load_1pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,&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);