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/legacyheaders/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_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
275 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
277 /* Calculate table index by multiplying r with table scale and truncate to integer */
278 rt = _fjsp_mul_v2r8(r00,vftabscale);
279 itab_tmp = _fjsp_dtox_v2r8(rt);
280 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
281 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
282 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
287 /* CUBIC SPLINE TABLE DISPERSION */
288 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
289 F = _fjsp_setzero_v2r8();
290 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
291 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
292 H = _fjsp_setzero_v2r8();
293 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
294 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
295 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
296 vvdw6 = _fjsp_mul_v2r8(c6_00,VV);
297 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
298 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
300 /* CUBIC SPLINE TABLE REPULSION */
301 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
302 F = _fjsp_setzero_v2r8();
303 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
304 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
305 H = _fjsp_setzero_v2r8();
306 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
307 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
308 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
309 vvdw12 = _fjsp_mul_v2r8(c12_00,VV);
310 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
311 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
312 vvdw = _fjsp_add_v2r8(vvdw12,vvdw6);
313 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
315 /* Update potential sum for this i atom from the interaction with this j atom. */
316 vvdw = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
317 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
321 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
323 /* Update vectorial force */
324 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
325 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
326 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
328 gmx_fjsp_decrement_fma_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fscal,dx00,dy00,dz00);
330 /* Inner loop uses 59 flops */
333 /* End of innermost loop */
335 gmx_fjsp_update_iforce_1atom_swizzle_v2r8(fix0,fiy0,fiz0,
336 f+i_coord_offset,fshift+i_shift_offset);
339 /* Update potential energies */
340 gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
342 /* Increment number of inner iterations */
343 inneriter += j_index_end - j_index_start;
345 /* Outer loop uses 7 flops */
348 /* Increment number of outer iterations */
351 /* Update outer/inner flops */
353 inc_nrnb(nrnb,eNR_NBKERNEL_VDW_VF,outeriter*7 + inneriter*59);
356 * Gromacs nonbonded kernel: nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double
357 * Electrostatics interaction: None
358 * VdW interaction: CubicSplineTable
359 * Geometry: Particle-Particle
360 * Calculate force/pot: Force
363 nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double
364 (t_nblist * gmx_restrict nlist,
365 rvec * gmx_restrict xx,
366 rvec * gmx_restrict ff,
367 t_forcerec * gmx_restrict fr,
368 t_mdatoms * gmx_restrict mdatoms,
369 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
370 t_nrnb * gmx_restrict nrnb)
372 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
373 * just 0 for non-waters.
374 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
375 * jnr indices corresponding to data put in the four positions in the SIMD register.
377 int i_shift_offset,i_coord_offset,outeriter,inneriter;
378 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
380 int j_coord_offsetA,j_coord_offsetB;
381 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
383 real *shiftvec,*fshift,*x,*f;
384 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
386 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
387 int vdwjidx0A,vdwjidx0B;
388 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
389 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
391 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
394 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
395 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
396 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
399 _fjsp_v2r8 dummy_mask,cutoff_mask;
400 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
401 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
402 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
409 jindex = nlist->jindex;
411 shiftidx = nlist->shift;
413 shiftvec = fr->shift_vec[0];
414 fshift = fr->fshift[0];
415 nvdwtype = fr->ntype;
417 vdwtype = mdatoms->typeA;
419 vftab = kernel_data->table_vdw->data;
420 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
422 /* Avoid stupid compiler warnings */
430 /* Start outer loop over neighborlists */
431 for(iidx=0; iidx<nri; iidx++)
433 /* Load shift vector for this list */
434 i_shift_offset = DIM*shiftidx[iidx];
436 /* Load limits for loop over neighbors */
437 j_index_start = jindex[iidx];
438 j_index_end = jindex[iidx+1];
440 /* Get outer coordinate index */
442 i_coord_offset = DIM*inr;
444 /* Load i particle coords and add shift vector */
445 gmx_fjsp_load_shift_and_1rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
447 fix0 = _fjsp_setzero_v2r8();
448 fiy0 = _fjsp_setzero_v2r8();
449 fiz0 = _fjsp_setzero_v2r8();
451 /* Load parameters for i particles */
452 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
454 /* Start inner kernel loop */
455 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
458 /* Get j neighbor index, and coordinate index */
461 j_coord_offsetA = DIM*jnrA;
462 j_coord_offsetB = DIM*jnrB;
464 /* load j atom coordinates */
465 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
468 /* Calculate displacement vector */
469 dx00 = _fjsp_sub_v2r8(ix0,jx0);
470 dy00 = _fjsp_sub_v2r8(iy0,jy0);
471 dz00 = _fjsp_sub_v2r8(iz0,jz0);
473 /* Calculate squared distance and things based on it */
474 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
476 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
478 /* Load parameters for j particles */
479 vdwjidx0A = 2*vdwtype[jnrA+0];
480 vdwjidx0B = 2*vdwtype[jnrB+0];
482 /**************************
483 * CALCULATE INTERACTIONS *
484 **************************/
486 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
488 /* Compute parameters for interactions between i and j atoms */
489 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
490 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
492 /* Calculate table index by multiplying r with table scale and truncate to integer */
493 rt = _fjsp_mul_v2r8(r00,vftabscale);
494 itab_tmp = _fjsp_dtox_v2r8(rt);
495 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
496 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
497 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
502 /* CUBIC SPLINE TABLE DISPERSION */
503 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
504 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
505 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
506 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
507 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
508 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
509 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
510 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
511 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
513 /* CUBIC SPLINE TABLE REPULSION */
514 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
515 F = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
516 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
517 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
518 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
519 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
520 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
521 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
522 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
523 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
527 /* Update vectorial force */
528 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
529 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
530 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
532 gmx_fjsp_decrement_fma_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fscal,dx00,dy00,dz00);
534 /* Inner loop uses 51 flops */
541 j_coord_offsetA = DIM*jnrA;
543 /* load j atom coordinates */
544 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
547 /* Calculate displacement vector */
548 dx00 = _fjsp_sub_v2r8(ix0,jx0);
549 dy00 = _fjsp_sub_v2r8(iy0,jy0);
550 dz00 = _fjsp_sub_v2r8(iz0,jz0);
552 /* Calculate squared distance and things based on it */
553 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
555 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
557 /* Load parameters for j particles */
558 vdwjidx0A = 2*vdwtype[jnrA+0];
560 /**************************
561 * CALCULATE INTERACTIONS *
562 **************************/
564 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
566 /* Compute parameters for interactions between i and j atoms */
567 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
568 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
570 /* Calculate table index by multiplying r with table scale and truncate to integer */
571 rt = _fjsp_mul_v2r8(r00,vftabscale);
572 itab_tmp = _fjsp_dtox_v2r8(rt);
573 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
574 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
575 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
580 /* CUBIC SPLINE TABLE DISPERSION */
581 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
582 F = _fjsp_setzero_v2r8();
583 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
584 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
585 H = _fjsp_setzero_v2r8();
586 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
587 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
588 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
589 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
591 /* CUBIC SPLINE TABLE REPULSION */
592 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
593 F = _fjsp_setzero_v2r8();
594 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
595 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
596 H = _fjsp_setzero_v2r8();
597 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
598 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
599 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
600 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
601 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
605 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
607 /* Update vectorial force */
608 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
609 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
610 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
612 gmx_fjsp_decrement_fma_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fscal,dx00,dy00,dz00);
614 /* Inner loop uses 51 flops */
617 /* End of innermost loop */
619 gmx_fjsp_update_iforce_1atom_swizzle_v2r8(fix0,fiy0,fiz0,
620 f+i_coord_offset,fshift+i_shift_offset);
622 /* Increment number of inner iterations */
623 inneriter += j_index_end - j_index_start;
625 /* Outer loop uses 6 flops */
628 /* Increment number of outer iterations */
631 /* Update outer/inner flops */
633 inc_nrnb(nrnb,eNR_NBKERNEL_VDW_F,outeriter*6 + inneriter*51);