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_GeomW4P1_VF_sparc64_hpc_ace_double
51 * Electrostatics interaction: Coulomb
52 * VdW interaction: CubicSplineTable
53 * Geometry: Water4-Particle
54 * Calculate force/pot: PotentialAndForce
57 nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_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;
82 _fjsp_v2r8 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
84 _fjsp_v2r8 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
86 _fjsp_v2r8 ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
87 int vdwjidx0A,vdwjidx0B;
88 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
89 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
90 _fjsp_v2r8 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
91 _fjsp_v2r8 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
92 _fjsp_v2r8 dx30,dy30,dz30,rsq30,rinv30,rinvsq30,r30,qq30,c6_30,c12_30;
93 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
96 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
99 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
100 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
101 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
104 _fjsp_v2r8 dummy_mask,cutoff_mask;
105 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
106 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
107 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
114 jindex = nlist->jindex;
116 shiftidx = nlist->shift;
118 shiftvec = fr->shift_vec[0];
119 fshift = fr->fshift[0];
120 facel = gmx_fjsp_set1_v2r8(fr->ic->epsfac);
121 charge = mdatoms->chargeA;
122 nvdwtype = fr->ntype;
124 vdwtype = mdatoms->typeA;
126 vftab = kernel_data->table_vdw->data;
127 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
129 /* Setup water-specific parameters */
130 inr = nlist->iinr[0];
131 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
132 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
133 iq3 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+3]));
134 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
136 /* Avoid stupid compiler warnings */
144 /* Start outer loop over neighborlists */
145 for(iidx=0; iidx<nri; iidx++)
147 /* Load shift vector for this list */
148 i_shift_offset = DIM*shiftidx[iidx];
150 /* Load limits for loop over neighbors */
151 j_index_start = jindex[iidx];
152 j_index_end = jindex[iidx+1];
154 /* Get outer coordinate index */
156 i_coord_offset = DIM*inr;
158 /* Load i particle coords and add shift vector */
159 gmx_fjsp_load_shift_and_4rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
160 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
162 fix0 = _fjsp_setzero_v2r8();
163 fiy0 = _fjsp_setzero_v2r8();
164 fiz0 = _fjsp_setzero_v2r8();
165 fix1 = _fjsp_setzero_v2r8();
166 fiy1 = _fjsp_setzero_v2r8();
167 fiz1 = _fjsp_setzero_v2r8();
168 fix2 = _fjsp_setzero_v2r8();
169 fiy2 = _fjsp_setzero_v2r8();
170 fiz2 = _fjsp_setzero_v2r8();
171 fix3 = _fjsp_setzero_v2r8();
172 fiy3 = _fjsp_setzero_v2r8();
173 fiz3 = _fjsp_setzero_v2r8();
175 /* Reset potential sums */
176 velecsum = _fjsp_setzero_v2r8();
177 vvdwsum = _fjsp_setzero_v2r8();
179 /* Start inner kernel loop */
180 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
183 /* Get j neighbor index, and coordinate index */
186 j_coord_offsetA = DIM*jnrA;
187 j_coord_offsetB = DIM*jnrB;
189 /* load j atom coordinates */
190 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
193 /* Calculate displacement vector */
194 dx00 = _fjsp_sub_v2r8(ix0,jx0);
195 dy00 = _fjsp_sub_v2r8(iy0,jy0);
196 dz00 = _fjsp_sub_v2r8(iz0,jz0);
197 dx10 = _fjsp_sub_v2r8(ix1,jx0);
198 dy10 = _fjsp_sub_v2r8(iy1,jy0);
199 dz10 = _fjsp_sub_v2r8(iz1,jz0);
200 dx20 = _fjsp_sub_v2r8(ix2,jx0);
201 dy20 = _fjsp_sub_v2r8(iy2,jy0);
202 dz20 = _fjsp_sub_v2r8(iz2,jz0);
203 dx30 = _fjsp_sub_v2r8(ix3,jx0);
204 dy30 = _fjsp_sub_v2r8(iy3,jy0);
205 dz30 = _fjsp_sub_v2r8(iz3,jz0);
207 /* Calculate squared distance and things based on it */
208 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
209 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
210 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
211 rsq30 = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
213 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
214 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
215 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
216 rinv30 = gmx_fjsp_invsqrt_v2r8(rsq30);
218 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
219 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
220 rinvsq30 = _fjsp_mul_v2r8(rinv30,rinv30);
222 /* Load parameters for j particles */
223 jq0 = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
224 vdwjidx0A = 2*vdwtype[jnrA+0];
225 vdwjidx0B = 2*vdwtype[jnrB+0];
227 fjx0 = _fjsp_setzero_v2r8();
228 fjy0 = _fjsp_setzero_v2r8();
229 fjz0 = _fjsp_setzero_v2r8();
231 /**************************
232 * CALCULATE INTERACTIONS *
233 **************************/
235 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
237 /* Compute parameters for interactions between i and j atoms */
238 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
239 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
241 /* Calculate table index by multiplying r with table scale and truncate to integer */
242 rt = _fjsp_mul_v2r8(r00,vftabscale);
243 itab_tmp = _fjsp_dtox_v2r8(rt);
244 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
245 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
246 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
251 /* CUBIC SPLINE TABLE DISPERSION */
252 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
253 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
254 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
255 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
256 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
257 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
258 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
259 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
260 vvdw6 = _fjsp_mul_v2r8(c6_00,VV);
261 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
262 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
264 /* CUBIC SPLINE TABLE REPULSION */
265 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
266 F = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
267 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
268 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
269 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
270 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
271 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
272 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
273 vvdw12 = _fjsp_mul_v2r8(c12_00,VV);
274 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
275 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
276 vvdw = _fjsp_add_v2r8(vvdw12,vvdw6);
277 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
279 /* Update potential sum for this i atom from the interaction with this j atom. */
280 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
284 /* Update vectorial force */
285 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
286 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
287 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
289 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
290 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
291 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
293 /**************************
294 * CALCULATE INTERACTIONS *
295 **************************/
297 /* Compute parameters for interactions between i and j atoms */
298 qq10 = _fjsp_mul_v2r8(iq1,jq0);
300 /* COULOMB ELECTROSTATICS */
301 velec = _fjsp_mul_v2r8(qq10,rinv10);
302 felec = _fjsp_mul_v2r8(velec,rinvsq10);
304 /* Update potential sum for this i atom from the interaction with this j atom. */
305 velecsum = _fjsp_add_v2r8(velecsum,velec);
309 /* Update vectorial force */
310 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
311 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
312 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
314 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
315 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
316 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
318 /**************************
319 * CALCULATE INTERACTIONS *
320 **************************/
322 /* Compute parameters for interactions between i and j atoms */
323 qq20 = _fjsp_mul_v2r8(iq2,jq0);
325 /* COULOMB ELECTROSTATICS */
326 velec = _fjsp_mul_v2r8(qq20,rinv20);
327 felec = _fjsp_mul_v2r8(velec,rinvsq20);
329 /* Update potential sum for this i atom from the interaction with this j atom. */
330 velecsum = _fjsp_add_v2r8(velecsum,velec);
334 /* Update vectorial force */
335 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
336 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
337 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
339 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
340 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
341 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
343 /**************************
344 * CALCULATE INTERACTIONS *
345 **************************/
347 /* Compute parameters for interactions between i and j atoms */
348 qq30 = _fjsp_mul_v2r8(iq3,jq0);
350 /* COULOMB ELECTROSTATICS */
351 velec = _fjsp_mul_v2r8(qq30,rinv30);
352 felec = _fjsp_mul_v2r8(velec,rinvsq30);
354 /* Update potential sum for this i atom from the interaction with this j atom. */
355 velecsum = _fjsp_add_v2r8(velecsum,velec);
359 /* Update vectorial force */
360 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
361 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
362 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
364 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
365 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
366 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
368 gmx_fjsp_decrement_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0);
370 /* Inner loop uses 155 flops */
377 j_coord_offsetA = DIM*jnrA;
379 /* load j atom coordinates */
380 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
383 /* Calculate displacement vector */
384 dx00 = _fjsp_sub_v2r8(ix0,jx0);
385 dy00 = _fjsp_sub_v2r8(iy0,jy0);
386 dz00 = _fjsp_sub_v2r8(iz0,jz0);
387 dx10 = _fjsp_sub_v2r8(ix1,jx0);
388 dy10 = _fjsp_sub_v2r8(iy1,jy0);
389 dz10 = _fjsp_sub_v2r8(iz1,jz0);
390 dx20 = _fjsp_sub_v2r8(ix2,jx0);
391 dy20 = _fjsp_sub_v2r8(iy2,jy0);
392 dz20 = _fjsp_sub_v2r8(iz2,jz0);
393 dx30 = _fjsp_sub_v2r8(ix3,jx0);
394 dy30 = _fjsp_sub_v2r8(iy3,jy0);
395 dz30 = _fjsp_sub_v2r8(iz3,jz0);
397 /* Calculate squared distance and things based on it */
398 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
399 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
400 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
401 rsq30 = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
403 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
404 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
405 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
406 rinv30 = gmx_fjsp_invsqrt_v2r8(rsq30);
408 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
409 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
410 rinvsq30 = _fjsp_mul_v2r8(rinv30,rinv30);
412 /* Load parameters for j particles */
413 jq0 = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
414 vdwjidx0A = 2*vdwtype[jnrA+0];
416 fjx0 = _fjsp_setzero_v2r8();
417 fjy0 = _fjsp_setzero_v2r8();
418 fjz0 = _fjsp_setzero_v2r8();
420 /**************************
421 * CALCULATE INTERACTIONS *
422 **************************/
424 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
426 /* Compute parameters for interactions between i and j atoms */
427 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
428 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
430 /* Calculate table index by multiplying r with table scale and truncate to integer */
431 rt = _fjsp_mul_v2r8(r00,vftabscale);
432 itab_tmp = _fjsp_dtox_v2r8(rt);
433 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
434 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
435 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
440 /* CUBIC SPLINE TABLE DISPERSION */
441 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
442 F = _fjsp_setzero_v2r8();
443 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
444 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
445 H = _fjsp_setzero_v2r8();
446 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
447 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
448 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
449 vvdw6 = _fjsp_mul_v2r8(c6_00,VV);
450 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
451 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
453 /* CUBIC SPLINE TABLE REPULSION */
454 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
455 F = _fjsp_setzero_v2r8();
456 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
457 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
458 H = _fjsp_setzero_v2r8();
459 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
460 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
461 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
462 vvdw12 = _fjsp_mul_v2r8(c12_00,VV);
463 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
464 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
465 vvdw = _fjsp_add_v2r8(vvdw12,vvdw6);
466 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
468 /* Update potential sum for this i atom from the interaction with this j atom. */
469 vvdw = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
470 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
474 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
476 /* Update vectorial force */
477 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
478 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
479 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
481 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
482 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
483 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
485 /**************************
486 * CALCULATE INTERACTIONS *
487 **************************/
489 /* Compute parameters for interactions between i and j atoms */
490 qq10 = _fjsp_mul_v2r8(iq1,jq0);
492 /* COULOMB ELECTROSTATICS */
493 velec = _fjsp_mul_v2r8(qq10,rinv10);
494 felec = _fjsp_mul_v2r8(velec,rinvsq10);
496 /* Update potential sum for this i atom from the interaction with this j atom. */
497 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
498 velecsum = _fjsp_add_v2r8(velecsum,velec);
502 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
504 /* Update vectorial force */
505 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
506 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
507 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
509 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
510 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
511 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
513 /**************************
514 * CALCULATE INTERACTIONS *
515 **************************/
517 /* Compute parameters for interactions between i and j atoms */
518 qq20 = _fjsp_mul_v2r8(iq2,jq0);
520 /* COULOMB ELECTROSTATICS */
521 velec = _fjsp_mul_v2r8(qq20,rinv20);
522 felec = _fjsp_mul_v2r8(velec,rinvsq20);
524 /* Update potential sum for this i atom from the interaction with this j atom. */
525 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
526 velecsum = _fjsp_add_v2r8(velecsum,velec);
530 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
532 /* Update vectorial force */
533 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
534 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
535 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
537 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
538 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
539 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
541 /**************************
542 * CALCULATE INTERACTIONS *
543 **************************/
545 /* Compute parameters for interactions between i and j atoms */
546 qq30 = _fjsp_mul_v2r8(iq3,jq0);
548 /* COULOMB ELECTROSTATICS */
549 velec = _fjsp_mul_v2r8(qq30,rinv30);
550 felec = _fjsp_mul_v2r8(velec,rinvsq30);
552 /* Update potential sum for this i atom from the interaction with this j atom. */
553 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
554 velecsum = _fjsp_add_v2r8(velecsum,velec);
558 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
560 /* Update vectorial force */
561 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
562 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
563 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
565 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
566 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
567 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
569 gmx_fjsp_decrement_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0);
571 /* Inner loop uses 155 flops */
574 /* End of innermost loop */
576 gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
577 f+i_coord_offset,fshift+i_shift_offset);
580 /* Update potential energies */
581 gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
582 gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
584 /* Increment number of inner iterations */
585 inneriter += j_index_end - j_index_start;
587 /* Outer loop uses 26 flops */
590 /* Increment number of outer iterations */
593 /* Update outer/inner flops */
595 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4_VF,outeriter*26 + inneriter*155);
598 * Gromacs nonbonded kernel: nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sparc64_hpc_ace_double
599 * Electrostatics interaction: Coulomb
600 * VdW interaction: CubicSplineTable
601 * Geometry: Water4-Particle
602 * Calculate force/pot: Force
605 nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sparc64_hpc_ace_double
606 (t_nblist * gmx_restrict nlist,
607 rvec * gmx_restrict xx,
608 rvec * gmx_restrict ff,
609 struct t_forcerec * gmx_restrict fr,
610 t_mdatoms * gmx_restrict mdatoms,
611 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
612 t_nrnb * gmx_restrict nrnb)
614 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
615 * just 0 for non-waters.
616 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
617 * jnr indices corresponding to data put in the four positions in the SIMD register.
619 int i_shift_offset,i_coord_offset,outeriter,inneriter;
620 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
622 int j_coord_offsetA,j_coord_offsetB;
623 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
625 real *shiftvec,*fshift,*x,*f;
626 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
628 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
630 _fjsp_v2r8 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
632 _fjsp_v2r8 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
634 _fjsp_v2r8 ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
635 int vdwjidx0A,vdwjidx0B;
636 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
637 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
638 _fjsp_v2r8 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
639 _fjsp_v2r8 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
640 _fjsp_v2r8 dx30,dy30,dz30,rsq30,rinv30,rinvsq30,r30,qq30,c6_30,c12_30;
641 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
644 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
647 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
648 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
649 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
652 _fjsp_v2r8 dummy_mask,cutoff_mask;
653 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
654 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
655 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
662 jindex = nlist->jindex;
664 shiftidx = nlist->shift;
666 shiftvec = fr->shift_vec[0];
667 fshift = fr->fshift[0];
668 facel = gmx_fjsp_set1_v2r8(fr->ic->epsfac);
669 charge = mdatoms->chargeA;
670 nvdwtype = fr->ntype;
672 vdwtype = mdatoms->typeA;
674 vftab = kernel_data->table_vdw->data;
675 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
677 /* Setup water-specific parameters */
678 inr = nlist->iinr[0];
679 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
680 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
681 iq3 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+3]));
682 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
684 /* Avoid stupid compiler warnings */
692 /* Start outer loop over neighborlists */
693 for(iidx=0; iidx<nri; iidx++)
695 /* Load shift vector for this list */
696 i_shift_offset = DIM*shiftidx[iidx];
698 /* Load limits for loop over neighbors */
699 j_index_start = jindex[iidx];
700 j_index_end = jindex[iidx+1];
702 /* Get outer coordinate index */
704 i_coord_offset = DIM*inr;
706 /* Load i particle coords and add shift vector */
707 gmx_fjsp_load_shift_and_4rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
708 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
710 fix0 = _fjsp_setzero_v2r8();
711 fiy0 = _fjsp_setzero_v2r8();
712 fiz0 = _fjsp_setzero_v2r8();
713 fix1 = _fjsp_setzero_v2r8();
714 fiy1 = _fjsp_setzero_v2r8();
715 fiz1 = _fjsp_setzero_v2r8();
716 fix2 = _fjsp_setzero_v2r8();
717 fiy2 = _fjsp_setzero_v2r8();
718 fiz2 = _fjsp_setzero_v2r8();
719 fix3 = _fjsp_setzero_v2r8();
720 fiy3 = _fjsp_setzero_v2r8();
721 fiz3 = _fjsp_setzero_v2r8();
723 /* Start inner kernel loop */
724 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
727 /* Get j neighbor index, and coordinate index */
730 j_coord_offsetA = DIM*jnrA;
731 j_coord_offsetB = DIM*jnrB;
733 /* load j atom coordinates */
734 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
737 /* Calculate displacement vector */
738 dx00 = _fjsp_sub_v2r8(ix0,jx0);
739 dy00 = _fjsp_sub_v2r8(iy0,jy0);
740 dz00 = _fjsp_sub_v2r8(iz0,jz0);
741 dx10 = _fjsp_sub_v2r8(ix1,jx0);
742 dy10 = _fjsp_sub_v2r8(iy1,jy0);
743 dz10 = _fjsp_sub_v2r8(iz1,jz0);
744 dx20 = _fjsp_sub_v2r8(ix2,jx0);
745 dy20 = _fjsp_sub_v2r8(iy2,jy0);
746 dz20 = _fjsp_sub_v2r8(iz2,jz0);
747 dx30 = _fjsp_sub_v2r8(ix3,jx0);
748 dy30 = _fjsp_sub_v2r8(iy3,jy0);
749 dz30 = _fjsp_sub_v2r8(iz3,jz0);
751 /* Calculate squared distance and things based on it */
752 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
753 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
754 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
755 rsq30 = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
757 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
758 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
759 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
760 rinv30 = gmx_fjsp_invsqrt_v2r8(rsq30);
762 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
763 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
764 rinvsq30 = _fjsp_mul_v2r8(rinv30,rinv30);
766 /* Load parameters for j particles */
767 jq0 = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
768 vdwjidx0A = 2*vdwtype[jnrA+0];
769 vdwjidx0B = 2*vdwtype[jnrB+0];
771 fjx0 = _fjsp_setzero_v2r8();
772 fjy0 = _fjsp_setzero_v2r8();
773 fjz0 = _fjsp_setzero_v2r8();
775 /**************************
776 * CALCULATE INTERACTIONS *
777 **************************/
779 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
781 /* Compute parameters for interactions between i and j atoms */
782 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
783 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
785 /* Calculate table index by multiplying r with table scale and truncate to integer */
786 rt = _fjsp_mul_v2r8(r00,vftabscale);
787 itab_tmp = _fjsp_dtox_v2r8(rt);
788 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
789 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
790 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
795 /* CUBIC SPLINE TABLE DISPERSION */
796 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
797 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
798 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
799 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
800 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
801 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
802 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
803 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
804 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
806 /* CUBIC SPLINE TABLE REPULSION */
807 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
808 F = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
809 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
810 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
811 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
812 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
813 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
814 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
815 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
816 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
820 /* Update vectorial force */
821 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
822 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
823 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
825 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
826 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
827 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
829 /**************************
830 * CALCULATE INTERACTIONS *
831 **************************/
833 /* Compute parameters for interactions between i and j atoms */
834 qq10 = _fjsp_mul_v2r8(iq1,jq0);
836 /* COULOMB ELECTROSTATICS */
837 velec = _fjsp_mul_v2r8(qq10,rinv10);
838 felec = _fjsp_mul_v2r8(velec,rinvsq10);
842 /* Update vectorial force */
843 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
844 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
845 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
847 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
848 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
849 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
851 /**************************
852 * CALCULATE INTERACTIONS *
853 **************************/
855 /* Compute parameters for interactions between i and j atoms */
856 qq20 = _fjsp_mul_v2r8(iq2,jq0);
858 /* COULOMB ELECTROSTATICS */
859 velec = _fjsp_mul_v2r8(qq20,rinv20);
860 felec = _fjsp_mul_v2r8(velec,rinvsq20);
864 /* Update vectorial force */
865 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
866 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
867 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
869 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
870 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
871 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
873 /**************************
874 * CALCULATE INTERACTIONS *
875 **************************/
877 /* Compute parameters for interactions between i and j atoms */
878 qq30 = _fjsp_mul_v2r8(iq3,jq0);
880 /* COULOMB ELECTROSTATICS */
881 velec = _fjsp_mul_v2r8(qq30,rinv30);
882 felec = _fjsp_mul_v2r8(velec,rinvsq30);
886 /* Update vectorial force */
887 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
888 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
889 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
891 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
892 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
893 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
895 gmx_fjsp_decrement_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0);
897 /* Inner loop uses 144 flops */
904 j_coord_offsetA = DIM*jnrA;
906 /* load j atom coordinates */
907 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
910 /* Calculate displacement vector */
911 dx00 = _fjsp_sub_v2r8(ix0,jx0);
912 dy00 = _fjsp_sub_v2r8(iy0,jy0);
913 dz00 = _fjsp_sub_v2r8(iz0,jz0);
914 dx10 = _fjsp_sub_v2r8(ix1,jx0);
915 dy10 = _fjsp_sub_v2r8(iy1,jy0);
916 dz10 = _fjsp_sub_v2r8(iz1,jz0);
917 dx20 = _fjsp_sub_v2r8(ix2,jx0);
918 dy20 = _fjsp_sub_v2r8(iy2,jy0);
919 dz20 = _fjsp_sub_v2r8(iz2,jz0);
920 dx30 = _fjsp_sub_v2r8(ix3,jx0);
921 dy30 = _fjsp_sub_v2r8(iy3,jy0);
922 dz30 = _fjsp_sub_v2r8(iz3,jz0);
924 /* Calculate squared distance and things based on it */
925 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
926 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
927 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
928 rsq30 = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
930 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
931 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
932 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
933 rinv30 = gmx_fjsp_invsqrt_v2r8(rsq30);
935 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
936 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
937 rinvsq30 = _fjsp_mul_v2r8(rinv30,rinv30);
939 /* Load parameters for j particles */
940 jq0 = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
941 vdwjidx0A = 2*vdwtype[jnrA+0];
943 fjx0 = _fjsp_setzero_v2r8();
944 fjy0 = _fjsp_setzero_v2r8();
945 fjz0 = _fjsp_setzero_v2r8();
947 /**************************
948 * CALCULATE INTERACTIONS *
949 **************************/
951 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
953 /* Compute parameters for interactions between i and j atoms */
954 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
955 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
957 /* Calculate table index by multiplying r with table scale and truncate to integer */
958 rt = _fjsp_mul_v2r8(r00,vftabscale);
959 itab_tmp = _fjsp_dtox_v2r8(rt);
960 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
961 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
962 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
967 /* CUBIC SPLINE TABLE DISPERSION */
968 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
969 F = _fjsp_setzero_v2r8();
970 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
971 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
972 H = _fjsp_setzero_v2r8();
973 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
974 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
975 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
976 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
978 /* CUBIC SPLINE TABLE REPULSION */
979 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
980 F = _fjsp_setzero_v2r8();
981 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
982 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
983 H = _fjsp_setzero_v2r8();
984 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
985 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
986 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
987 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
988 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
992 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
994 /* Update vectorial force */
995 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
996 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
997 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
999 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
1000 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
1001 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
1003 /**************************
1004 * CALCULATE INTERACTIONS *
1005 **************************/
1007 /* Compute parameters for interactions between i and j atoms */
1008 qq10 = _fjsp_mul_v2r8(iq1,jq0);
1010 /* COULOMB ELECTROSTATICS */
1011 velec = _fjsp_mul_v2r8(qq10,rinv10);
1012 felec = _fjsp_mul_v2r8(velec,rinvsq10);
1016 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1018 /* Update vectorial force */
1019 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
1020 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
1021 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
1023 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
1024 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
1025 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
1027 /**************************
1028 * CALCULATE INTERACTIONS *
1029 **************************/
1031 /* Compute parameters for interactions between i and j atoms */
1032 qq20 = _fjsp_mul_v2r8(iq2,jq0);
1034 /* COULOMB ELECTROSTATICS */
1035 velec = _fjsp_mul_v2r8(qq20,rinv20);
1036 felec = _fjsp_mul_v2r8(velec,rinvsq20);
1040 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1042 /* Update vectorial force */
1043 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
1044 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
1045 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
1047 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
1048 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
1049 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
1051 /**************************
1052 * CALCULATE INTERACTIONS *
1053 **************************/
1055 /* Compute parameters for interactions between i and j atoms */
1056 qq30 = _fjsp_mul_v2r8(iq3,jq0);
1058 /* COULOMB ELECTROSTATICS */
1059 velec = _fjsp_mul_v2r8(qq30,rinv30);
1060 felec = _fjsp_mul_v2r8(velec,rinvsq30);
1064 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1066 /* Update vectorial force */
1067 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
1068 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
1069 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
1071 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
1072 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
1073 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
1075 gmx_fjsp_decrement_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0);
1077 /* Inner loop uses 144 flops */
1080 /* End of innermost loop */
1082 gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
1083 f+i_coord_offset,fshift+i_shift_offset);
1085 /* Increment number of inner iterations */
1086 inneriter += j_index_end - j_index_start;
1088 /* Outer loop uses 24 flops */
1091 /* Increment number of outer iterations */
1094 /* Update outer/inner flops */
1096 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4_F,outeriter*24 + inneriter*144);