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_ElecCoul_VdwCSTab_GeomP1P1_VF_sparc64_hpc_ace_double
51 * Electrostatics interaction: Coulomb
52 * VdW interaction: CubicSplineTable
53 * Geometry: Particle-Particle
54 * Calculate force/pot: PotentialAndForce
57 nb_kernel_ElecCoul_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;
84 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
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 facel = gmx_fjsp_set1_v2r8(fr->ic->epsfac);
112 charge = mdatoms->chargeA;
113 nvdwtype = fr->ntype;
115 vdwtype = mdatoms->typeA;
117 vftab = kernel_data->table_vdw->data;
118 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
120 /* Avoid stupid compiler warnings */
128 /* Start outer loop over neighborlists */
129 for(iidx=0; iidx<nri; iidx++)
131 /* Load shift vector for this list */
132 i_shift_offset = DIM*shiftidx[iidx];
134 /* Load limits for loop over neighbors */
135 j_index_start = jindex[iidx];
136 j_index_end = jindex[iidx+1];
138 /* Get outer coordinate index */
140 i_coord_offset = DIM*inr;
142 /* Load i particle coords and add shift vector */
143 gmx_fjsp_load_shift_and_1rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
145 fix0 = _fjsp_setzero_v2r8();
146 fiy0 = _fjsp_setzero_v2r8();
147 fiz0 = _fjsp_setzero_v2r8();
149 /* Load parameters for i particles */
150 iq0 = _fjsp_mul_v2r8(facel,gmx_fjsp_load1_v2r8(charge+inr+0));
151 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
153 /* Reset potential sums */
154 velecsum = _fjsp_setzero_v2r8();
155 vvdwsum = _fjsp_setzero_v2r8();
157 /* Start inner kernel loop */
158 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
161 /* Get j neighbor index, and coordinate index */
164 j_coord_offsetA = DIM*jnrA;
165 j_coord_offsetB = DIM*jnrB;
167 /* load j atom coordinates */
168 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
171 /* Calculate displacement vector */
172 dx00 = _fjsp_sub_v2r8(ix0,jx0);
173 dy00 = _fjsp_sub_v2r8(iy0,jy0);
174 dz00 = _fjsp_sub_v2r8(iz0,jz0);
176 /* Calculate squared distance and things based on it */
177 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
179 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
181 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
183 /* Load parameters for j particles */
184 jq0 = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
185 vdwjidx0A = 2*vdwtype[jnrA+0];
186 vdwjidx0B = 2*vdwtype[jnrB+0];
188 /**************************
189 * CALCULATE INTERACTIONS *
190 **************************/
192 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
194 /* Compute parameters for interactions between i and j atoms */
195 qq00 = _fjsp_mul_v2r8(iq0,jq0);
196 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
197 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
199 /* Calculate table index by multiplying r with table scale and truncate to integer */
200 rt = _fjsp_mul_v2r8(r00,vftabscale);
201 itab_tmp = _fjsp_dtox_v2r8(rt);
202 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
203 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
204 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
209 /* COULOMB ELECTROSTATICS */
210 velec = _fjsp_mul_v2r8(qq00,rinv00);
211 felec = _fjsp_mul_v2r8(velec,rinvsq00);
213 /* CUBIC SPLINE TABLE DISPERSION */
214 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
215 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
216 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
217 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
218 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
219 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
220 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
221 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
222 vvdw6 = _fjsp_mul_v2r8(c6_00,VV);
223 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
224 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
226 /* CUBIC SPLINE TABLE REPULSION */
227 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
228 F = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
229 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
230 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
231 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
232 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
233 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
234 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
235 vvdw12 = _fjsp_mul_v2r8(c12_00,VV);
236 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
237 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
238 vvdw = _fjsp_add_v2r8(vvdw12,vvdw6);
239 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
241 /* Update potential sum for this i atom from the interaction with this j atom. */
242 velecsum = _fjsp_add_v2r8(velecsum,velec);
243 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
245 fscal = _fjsp_add_v2r8(felec,fvdw);
247 /* Update vectorial force */
248 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
249 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
250 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
252 gmx_fjsp_decrement_fma_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fscal,dx00,dy00,dz00);
254 /* Inner loop uses 66 flops */
261 j_coord_offsetA = DIM*jnrA;
263 /* load j atom coordinates */
264 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
267 /* Calculate displacement vector */
268 dx00 = _fjsp_sub_v2r8(ix0,jx0);
269 dy00 = _fjsp_sub_v2r8(iy0,jy0);
270 dz00 = _fjsp_sub_v2r8(iz0,jz0);
272 /* Calculate squared distance and things based on it */
273 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
275 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
277 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
279 /* Load parameters for j particles */
280 jq0 = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
281 vdwjidx0A = 2*vdwtype[jnrA+0];
283 /**************************
284 * CALCULATE INTERACTIONS *
285 **************************/
287 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
289 /* Compute parameters for interactions between i and j atoms */
290 qq00 = _fjsp_mul_v2r8(iq0,jq0);
291 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
292 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
294 /* Calculate table index by multiplying r with table scale and truncate to integer */
295 rt = _fjsp_mul_v2r8(r00,vftabscale);
296 itab_tmp = _fjsp_dtox_v2r8(rt);
297 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
298 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
299 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
304 /* COULOMB ELECTROSTATICS */
305 velec = _fjsp_mul_v2r8(qq00,rinv00);
306 felec = _fjsp_mul_v2r8(velec,rinvsq00);
308 /* CUBIC SPLINE TABLE DISPERSION */
309 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
310 F = _fjsp_setzero_v2r8();
311 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
312 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
313 H = _fjsp_setzero_v2r8();
314 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
315 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
316 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
317 vvdw6 = _fjsp_mul_v2r8(c6_00,VV);
318 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
319 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
321 /* CUBIC SPLINE TABLE REPULSION */
322 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
323 F = _fjsp_setzero_v2r8();
324 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
325 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
326 H = _fjsp_setzero_v2r8();
327 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
328 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
329 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
330 vvdw12 = _fjsp_mul_v2r8(c12_00,VV);
331 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
332 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
333 vvdw = _fjsp_add_v2r8(vvdw12,vvdw6);
334 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
336 /* Update potential sum for this i atom from the interaction with this j atom. */
337 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
338 velecsum = _fjsp_add_v2r8(velecsum,velec);
339 vvdw = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
340 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
342 fscal = _fjsp_add_v2r8(felec,fvdw);
344 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
346 /* Update vectorial force */
347 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
348 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
349 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
351 gmx_fjsp_decrement_fma_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fscal,dx00,dy00,dz00);
353 /* Inner loop uses 66 flops */
356 /* End of innermost loop */
358 gmx_fjsp_update_iforce_1atom_swizzle_v2r8(fix0,fiy0,fiz0,
359 f+i_coord_offset,fshift+i_shift_offset);
362 /* Update potential energies */
363 gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
364 gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
366 /* Increment number of inner iterations */
367 inneriter += j_index_end - j_index_start;
369 /* Outer loop uses 9 flops */
372 /* Increment number of outer iterations */
375 /* Update outer/inner flops */
377 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_VF,outeriter*9 + inneriter*66);
380 * Gromacs nonbonded kernel: nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double
381 * Electrostatics interaction: Coulomb
382 * VdW interaction: CubicSplineTable
383 * Geometry: Particle-Particle
384 * Calculate force/pot: Force
387 nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double
388 (t_nblist * gmx_restrict nlist,
389 rvec * gmx_restrict xx,
390 rvec * gmx_restrict ff,
391 struct t_forcerec * gmx_restrict fr,
392 t_mdatoms * gmx_restrict mdatoms,
393 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
394 t_nrnb * gmx_restrict nrnb)
396 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
397 * just 0 for non-waters.
398 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
399 * jnr indices corresponding to data put in the four positions in the SIMD register.
401 int i_shift_offset,i_coord_offset,outeriter,inneriter;
402 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
404 int j_coord_offsetA,j_coord_offsetB;
405 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
407 real *shiftvec,*fshift,*x,*f;
408 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
410 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
411 int vdwjidx0A,vdwjidx0B;
412 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
413 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
414 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
417 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
420 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
421 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
422 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
425 _fjsp_v2r8 dummy_mask,cutoff_mask;
426 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
427 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
428 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
435 jindex = nlist->jindex;
437 shiftidx = nlist->shift;
439 shiftvec = fr->shift_vec[0];
440 fshift = fr->fshift[0];
441 facel = gmx_fjsp_set1_v2r8(fr->ic->epsfac);
442 charge = mdatoms->chargeA;
443 nvdwtype = fr->ntype;
445 vdwtype = mdatoms->typeA;
447 vftab = kernel_data->table_vdw->data;
448 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
450 /* Avoid stupid compiler warnings */
458 /* Start outer loop over neighborlists */
459 for(iidx=0; iidx<nri; iidx++)
461 /* Load shift vector for this list */
462 i_shift_offset = DIM*shiftidx[iidx];
464 /* Load limits for loop over neighbors */
465 j_index_start = jindex[iidx];
466 j_index_end = jindex[iidx+1];
468 /* Get outer coordinate index */
470 i_coord_offset = DIM*inr;
472 /* Load i particle coords and add shift vector */
473 gmx_fjsp_load_shift_and_1rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
475 fix0 = _fjsp_setzero_v2r8();
476 fiy0 = _fjsp_setzero_v2r8();
477 fiz0 = _fjsp_setzero_v2r8();
479 /* Load parameters for i particles */
480 iq0 = _fjsp_mul_v2r8(facel,gmx_fjsp_load1_v2r8(charge+inr+0));
481 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
483 /* Start inner kernel loop */
484 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
487 /* Get j neighbor index, and coordinate index */
490 j_coord_offsetA = DIM*jnrA;
491 j_coord_offsetB = DIM*jnrB;
493 /* load j atom coordinates */
494 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
497 /* Calculate displacement vector */
498 dx00 = _fjsp_sub_v2r8(ix0,jx0);
499 dy00 = _fjsp_sub_v2r8(iy0,jy0);
500 dz00 = _fjsp_sub_v2r8(iz0,jz0);
502 /* Calculate squared distance and things based on it */
503 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
505 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
507 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
509 /* Load parameters for j particles */
510 jq0 = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
511 vdwjidx0A = 2*vdwtype[jnrA+0];
512 vdwjidx0B = 2*vdwtype[jnrB+0];
514 /**************************
515 * CALCULATE INTERACTIONS *
516 **************************/
518 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
520 /* Compute parameters for interactions between i and j atoms */
521 qq00 = _fjsp_mul_v2r8(iq0,jq0);
522 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
523 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
525 /* Calculate table index by multiplying r with table scale and truncate to integer */
526 rt = _fjsp_mul_v2r8(r00,vftabscale);
527 itab_tmp = _fjsp_dtox_v2r8(rt);
528 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
529 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
530 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
535 /* COULOMB ELECTROSTATICS */
536 velec = _fjsp_mul_v2r8(qq00,rinv00);
537 felec = _fjsp_mul_v2r8(velec,rinvsq00);
539 /* CUBIC SPLINE TABLE DISPERSION */
540 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
541 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
542 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
543 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
544 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
545 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
546 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
547 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
548 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
550 /* CUBIC SPLINE TABLE REPULSION */
551 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
552 F = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
553 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
554 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
555 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
556 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
557 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
558 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
559 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
560 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
562 fscal = _fjsp_add_v2r8(felec,fvdw);
564 /* Update vectorial force */
565 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
566 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
567 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
569 gmx_fjsp_decrement_fma_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fscal,dx00,dy00,dz00);
571 /* Inner loop uses 57 flops */
578 j_coord_offsetA = DIM*jnrA;
580 /* load j atom coordinates */
581 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
584 /* Calculate displacement vector */
585 dx00 = _fjsp_sub_v2r8(ix0,jx0);
586 dy00 = _fjsp_sub_v2r8(iy0,jy0);
587 dz00 = _fjsp_sub_v2r8(iz0,jz0);
589 /* Calculate squared distance and things based on it */
590 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
592 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
594 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
596 /* Load parameters for j particles */
597 jq0 = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
598 vdwjidx0A = 2*vdwtype[jnrA+0];
600 /**************************
601 * CALCULATE INTERACTIONS *
602 **************************/
604 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
606 /* Compute parameters for interactions between i and j atoms */
607 qq00 = _fjsp_mul_v2r8(iq0,jq0);
608 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
609 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
611 /* Calculate table index by multiplying r with table scale and truncate to integer */
612 rt = _fjsp_mul_v2r8(r00,vftabscale);
613 itab_tmp = _fjsp_dtox_v2r8(rt);
614 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
615 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
616 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
621 /* COULOMB ELECTROSTATICS */
622 velec = _fjsp_mul_v2r8(qq00,rinv00);
623 felec = _fjsp_mul_v2r8(velec,rinvsq00);
625 /* CUBIC SPLINE TABLE DISPERSION */
626 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
627 F = _fjsp_setzero_v2r8();
628 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
629 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
630 H = _fjsp_setzero_v2r8();
631 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
632 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
633 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
634 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
636 /* CUBIC SPLINE TABLE REPULSION */
637 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
638 F = _fjsp_setzero_v2r8();
639 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
640 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
641 H = _fjsp_setzero_v2r8();
642 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
643 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
644 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
645 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
646 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
648 fscal = _fjsp_add_v2r8(felec,fvdw);
650 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
652 /* Update vectorial force */
653 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
654 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
655 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
657 gmx_fjsp_decrement_fma_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fscal,dx00,dy00,dz00);
659 /* Inner loop uses 57 flops */
662 /* End of innermost loop */
664 gmx_fjsp_update_iforce_1atom_swizzle_v2r8(fix0,fiy0,fiz0,
665 f+i_coord_offset,fshift+i_shift_offset);
667 /* Increment number of inner iterations */
668 inneriter += j_index_end - j_index_start;
670 /* Outer loop uses 7 flops */
673 /* Increment number of outer iterations */
676 /* Update outer/inner flops */
678 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_F,outeriter*7 + inneriter*57);