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_ElecCoul_VdwCSTab_GeomW4P1_VF_sparc64_hpc_ace_double
53 * Electrostatics interaction: Coulomb
54 * VdW interaction: CubicSplineTable
55 * Geometry: Water4-Particle
56 * Calculate force/pot: PotentialAndForce
59 nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_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;
84 _fjsp_v2r8 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
86 _fjsp_v2r8 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
88 _fjsp_v2r8 ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
89 int vdwjidx0A,vdwjidx0B;
90 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
91 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
92 _fjsp_v2r8 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
93 _fjsp_v2r8 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
94 _fjsp_v2r8 dx30,dy30,dz30,rsq30,rinv30,rinvsq30,r30,qq30,c6_30,c12_30;
95 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
98 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
101 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
102 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
103 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
106 _fjsp_v2r8 dummy_mask,cutoff_mask;
107 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
108 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
109 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
116 jindex = nlist->jindex;
118 shiftidx = nlist->shift;
120 shiftvec = fr->shift_vec[0];
121 fshift = fr->fshift[0];
122 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
123 charge = mdatoms->chargeA;
124 nvdwtype = fr->ntype;
126 vdwtype = mdatoms->typeA;
128 vftab = kernel_data->table_vdw->data;
129 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
131 /* Setup water-specific parameters */
132 inr = nlist->iinr[0];
133 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
134 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
135 iq3 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+3]));
136 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
138 /* Avoid stupid compiler warnings */
146 /* Start outer loop over neighborlists */
147 for(iidx=0; iidx<nri; iidx++)
149 /* Load shift vector for this list */
150 i_shift_offset = DIM*shiftidx[iidx];
152 /* Load limits for loop over neighbors */
153 j_index_start = jindex[iidx];
154 j_index_end = jindex[iidx+1];
156 /* Get outer coordinate index */
158 i_coord_offset = DIM*inr;
160 /* Load i particle coords and add shift vector */
161 gmx_fjsp_load_shift_and_4rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
162 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
164 fix0 = _fjsp_setzero_v2r8();
165 fiy0 = _fjsp_setzero_v2r8();
166 fiz0 = _fjsp_setzero_v2r8();
167 fix1 = _fjsp_setzero_v2r8();
168 fiy1 = _fjsp_setzero_v2r8();
169 fiz1 = _fjsp_setzero_v2r8();
170 fix2 = _fjsp_setzero_v2r8();
171 fiy2 = _fjsp_setzero_v2r8();
172 fiz2 = _fjsp_setzero_v2r8();
173 fix3 = _fjsp_setzero_v2r8();
174 fiy3 = _fjsp_setzero_v2r8();
175 fiz3 = _fjsp_setzero_v2r8();
177 /* Reset potential sums */
178 velecsum = _fjsp_setzero_v2r8();
179 vvdwsum = _fjsp_setzero_v2r8();
181 /* Start inner kernel loop */
182 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
185 /* Get j neighbor index, and coordinate index */
188 j_coord_offsetA = DIM*jnrA;
189 j_coord_offsetB = DIM*jnrB;
191 /* load j atom coordinates */
192 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
195 /* Calculate displacement vector */
196 dx00 = _fjsp_sub_v2r8(ix0,jx0);
197 dy00 = _fjsp_sub_v2r8(iy0,jy0);
198 dz00 = _fjsp_sub_v2r8(iz0,jz0);
199 dx10 = _fjsp_sub_v2r8(ix1,jx0);
200 dy10 = _fjsp_sub_v2r8(iy1,jy0);
201 dz10 = _fjsp_sub_v2r8(iz1,jz0);
202 dx20 = _fjsp_sub_v2r8(ix2,jx0);
203 dy20 = _fjsp_sub_v2r8(iy2,jy0);
204 dz20 = _fjsp_sub_v2r8(iz2,jz0);
205 dx30 = _fjsp_sub_v2r8(ix3,jx0);
206 dy30 = _fjsp_sub_v2r8(iy3,jy0);
207 dz30 = _fjsp_sub_v2r8(iz3,jz0);
209 /* Calculate squared distance and things based on it */
210 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
211 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
212 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
213 rsq30 = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
215 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
216 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
217 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
218 rinv30 = gmx_fjsp_invsqrt_v2r8(rsq30);
220 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
221 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
222 rinvsq30 = _fjsp_mul_v2r8(rinv30,rinv30);
224 /* Load parameters for j particles */
225 jq0 = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
226 vdwjidx0A = 2*vdwtype[jnrA+0];
227 vdwjidx0B = 2*vdwtype[jnrB+0];
229 fjx0 = _fjsp_setzero_v2r8();
230 fjy0 = _fjsp_setzero_v2r8();
231 fjz0 = _fjsp_setzero_v2r8();
233 /**************************
234 * CALCULATE INTERACTIONS *
235 **************************/
237 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
239 /* Compute parameters for interactions between i and j atoms */
240 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
241 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
243 /* Calculate table index by multiplying r with table scale and truncate to integer */
244 rt = _fjsp_mul_v2r8(r00,vftabscale);
245 itab_tmp = _fjsp_dtox_v2r8(rt);
246 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
247 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
248 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
253 /* CUBIC SPLINE TABLE DISPERSION */
254 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
255 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
256 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
257 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
258 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
259 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
260 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
261 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
262 vvdw6 = _fjsp_mul_v2r8(c6_00,VV);
263 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
264 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
266 /* CUBIC SPLINE TABLE REPULSION */
267 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
268 F = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
269 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
270 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
271 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
272 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
273 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
274 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
275 vvdw12 = _fjsp_mul_v2r8(c12_00,VV);
276 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
277 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
278 vvdw = _fjsp_add_v2r8(vvdw12,vvdw6);
279 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
281 /* Update potential sum for this i atom from the interaction with this j atom. */
282 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
286 /* Update vectorial force */
287 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
288 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
289 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
291 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
292 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
293 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
295 /**************************
296 * CALCULATE INTERACTIONS *
297 **************************/
299 /* Compute parameters for interactions between i and j atoms */
300 qq10 = _fjsp_mul_v2r8(iq1,jq0);
302 /* COULOMB ELECTROSTATICS */
303 velec = _fjsp_mul_v2r8(qq10,rinv10);
304 felec = _fjsp_mul_v2r8(velec,rinvsq10);
306 /* Update potential sum for this i atom from the interaction with this j atom. */
307 velecsum = _fjsp_add_v2r8(velecsum,velec);
311 /* Update vectorial force */
312 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
313 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
314 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
316 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
317 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
318 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
320 /**************************
321 * CALCULATE INTERACTIONS *
322 **************************/
324 /* Compute parameters for interactions between i and j atoms */
325 qq20 = _fjsp_mul_v2r8(iq2,jq0);
327 /* COULOMB ELECTROSTATICS */
328 velec = _fjsp_mul_v2r8(qq20,rinv20);
329 felec = _fjsp_mul_v2r8(velec,rinvsq20);
331 /* Update potential sum for this i atom from the interaction with this j atom. */
332 velecsum = _fjsp_add_v2r8(velecsum,velec);
336 /* Update vectorial force */
337 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
338 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
339 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
341 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
342 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
343 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
345 /**************************
346 * CALCULATE INTERACTIONS *
347 **************************/
349 /* Compute parameters for interactions between i and j atoms */
350 qq30 = _fjsp_mul_v2r8(iq3,jq0);
352 /* COULOMB ELECTROSTATICS */
353 velec = _fjsp_mul_v2r8(qq30,rinv30);
354 felec = _fjsp_mul_v2r8(velec,rinvsq30);
356 /* Update potential sum for this i atom from the interaction with this j atom. */
357 velecsum = _fjsp_add_v2r8(velecsum,velec);
361 /* Update vectorial force */
362 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
363 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
364 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
366 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
367 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
368 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
370 gmx_fjsp_decrement_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0);
372 /* Inner loop uses 155 flops */
379 j_coord_offsetA = DIM*jnrA;
381 /* load j atom coordinates */
382 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
385 /* Calculate displacement vector */
386 dx00 = _fjsp_sub_v2r8(ix0,jx0);
387 dy00 = _fjsp_sub_v2r8(iy0,jy0);
388 dz00 = _fjsp_sub_v2r8(iz0,jz0);
389 dx10 = _fjsp_sub_v2r8(ix1,jx0);
390 dy10 = _fjsp_sub_v2r8(iy1,jy0);
391 dz10 = _fjsp_sub_v2r8(iz1,jz0);
392 dx20 = _fjsp_sub_v2r8(ix2,jx0);
393 dy20 = _fjsp_sub_v2r8(iy2,jy0);
394 dz20 = _fjsp_sub_v2r8(iz2,jz0);
395 dx30 = _fjsp_sub_v2r8(ix3,jx0);
396 dy30 = _fjsp_sub_v2r8(iy3,jy0);
397 dz30 = _fjsp_sub_v2r8(iz3,jz0);
399 /* Calculate squared distance and things based on it */
400 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
401 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
402 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
403 rsq30 = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
405 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
406 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
407 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
408 rinv30 = gmx_fjsp_invsqrt_v2r8(rsq30);
410 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
411 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
412 rinvsq30 = _fjsp_mul_v2r8(rinv30,rinv30);
414 /* Load parameters for j particles */
415 jq0 = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
416 vdwjidx0A = 2*vdwtype[jnrA+0];
418 fjx0 = _fjsp_setzero_v2r8();
419 fjy0 = _fjsp_setzero_v2r8();
420 fjz0 = _fjsp_setzero_v2r8();
422 /**************************
423 * CALCULATE INTERACTIONS *
424 **************************/
426 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
428 /* Compute parameters for interactions between i and j atoms */
429 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
430 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
432 /* Calculate table index by multiplying r with table scale and truncate to integer */
433 rt = _fjsp_mul_v2r8(r00,vftabscale);
434 itab_tmp = _fjsp_dtox_v2r8(rt);
435 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
436 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
437 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
442 /* CUBIC SPLINE TABLE DISPERSION */
443 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
444 F = _fjsp_setzero_v2r8();
445 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
446 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
447 H = _fjsp_setzero_v2r8();
448 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
449 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
450 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
451 vvdw6 = _fjsp_mul_v2r8(c6_00,VV);
452 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
453 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
455 /* CUBIC SPLINE TABLE REPULSION */
456 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
457 F = _fjsp_setzero_v2r8();
458 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
459 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
460 H = _fjsp_setzero_v2r8();
461 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
462 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
463 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
464 vvdw12 = _fjsp_mul_v2r8(c12_00,VV);
465 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
466 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
467 vvdw = _fjsp_add_v2r8(vvdw12,vvdw6);
468 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
470 /* Update potential sum for this i atom from the interaction with this j atom. */
471 vvdw = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
472 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
476 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
478 /* Update vectorial force */
479 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
480 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
481 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
483 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
484 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
485 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
487 /**************************
488 * CALCULATE INTERACTIONS *
489 **************************/
491 /* Compute parameters for interactions between i and j atoms */
492 qq10 = _fjsp_mul_v2r8(iq1,jq0);
494 /* COULOMB ELECTROSTATICS */
495 velec = _fjsp_mul_v2r8(qq10,rinv10);
496 felec = _fjsp_mul_v2r8(velec,rinvsq10);
498 /* Update potential sum for this i atom from the interaction with this j atom. */
499 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
500 velecsum = _fjsp_add_v2r8(velecsum,velec);
504 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
506 /* Update vectorial force */
507 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
508 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
509 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
511 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
512 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
513 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
515 /**************************
516 * CALCULATE INTERACTIONS *
517 **************************/
519 /* Compute parameters for interactions between i and j atoms */
520 qq20 = _fjsp_mul_v2r8(iq2,jq0);
522 /* COULOMB ELECTROSTATICS */
523 velec = _fjsp_mul_v2r8(qq20,rinv20);
524 felec = _fjsp_mul_v2r8(velec,rinvsq20);
526 /* Update potential sum for this i atom from the interaction with this j atom. */
527 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
528 velecsum = _fjsp_add_v2r8(velecsum,velec);
532 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
534 /* Update vectorial force */
535 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
536 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
537 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
539 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
540 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
541 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
543 /**************************
544 * CALCULATE INTERACTIONS *
545 **************************/
547 /* Compute parameters for interactions between i and j atoms */
548 qq30 = _fjsp_mul_v2r8(iq3,jq0);
550 /* COULOMB ELECTROSTATICS */
551 velec = _fjsp_mul_v2r8(qq30,rinv30);
552 felec = _fjsp_mul_v2r8(velec,rinvsq30);
554 /* Update potential sum for this i atom from the interaction with this j atom. */
555 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
556 velecsum = _fjsp_add_v2r8(velecsum,velec);
560 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
562 /* Update vectorial force */
563 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
564 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
565 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
567 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
568 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
569 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
571 gmx_fjsp_decrement_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0);
573 /* Inner loop uses 155 flops */
576 /* End of innermost loop */
578 gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
579 f+i_coord_offset,fshift+i_shift_offset);
582 /* Update potential energies */
583 gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
584 gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
586 /* Increment number of inner iterations */
587 inneriter += j_index_end - j_index_start;
589 /* Outer loop uses 26 flops */
592 /* Increment number of outer iterations */
595 /* Update outer/inner flops */
597 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4_VF,outeriter*26 + inneriter*155);
600 * Gromacs nonbonded kernel: nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sparc64_hpc_ace_double
601 * Electrostatics interaction: Coulomb
602 * VdW interaction: CubicSplineTable
603 * Geometry: Water4-Particle
604 * Calculate force/pot: Force
607 nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sparc64_hpc_ace_double
608 (t_nblist * gmx_restrict nlist,
609 rvec * gmx_restrict xx,
610 rvec * gmx_restrict ff,
611 t_forcerec * gmx_restrict fr,
612 t_mdatoms * gmx_restrict mdatoms,
613 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
614 t_nrnb * gmx_restrict nrnb)
616 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
617 * just 0 for non-waters.
618 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
619 * jnr indices corresponding to data put in the four positions in the SIMD register.
621 int i_shift_offset,i_coord_offset,outeriter,inneriter;
622 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
624 int j_coord_offsetA,j_coord_offsetB;
625 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
627 real *shiftvec,*fshift,*x,*f;
628 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
630 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
632 _fjsp_v2r8 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
634 _fjsp_v2r8 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
636 _fjsp_v2r8 ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
637 int vdwjidx0A,vdwjidx0B;
638 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
639 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
640 _fjsp_v2r8 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
641 _fjsp_v2r8 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
642 _fjsp_v2r8 dx30,dy30,dz30,rsq30,rinv30,rinvsq30,r30,qq30,c6_30,c12_30;
643 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
646 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
649 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
650 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
651 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
654 _fjsp_v2r8 dummy_mask,cutoff_mask;
655 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
656 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
657 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
664 jindex = nlist->jindex;
666 shiftidx = nlist->shift;
668 shiftvec = fr->shift_vec[0];
669 fshift = fr->fshift[0];
670 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
671 charge = mdatoms->chargeA;
672 nvdwtype = fr->ntype;
674 vdwtype = mdatoms->typeA;
676 vftab = kernel_data->table_vdw->data;
677 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
679 /* Setup water-specific parameters */
680 inr = nlist->iinr[0];
681 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
682 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
683 iq3 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+3]));
684 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
686 /* Avoid stupid compiler warnings */
694 /* Start outer loop over neighborlists */
695 for(iidx=0; iidx<nri; iidx++)
697 /* Load shift vector for this list */
698 i_shift_offset = DIM*shiftidx[iidx];
700 /* Load limits for loop over neighbors */
701 j_index_start = jindex[iidx];
702 j_index_end = jindex[iidx+1];
704 /* Get outer coordinate index */
706 i_coord_offset = DIM*inr;
708 /* Load i particle coords and add shift vector */
709 gmx_fjsp_load_shift_and_4rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
710 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
712 fix0 = _fjsp_setzero_v2r8();
713 fiy0 = _fjsp_setzero_v2r8();
714 fiz0 = _fjsp_setzero_v2r8();
715 fix1 = _fjsp_setzero_v2r8();
716 fiy1 = _fjsp_setzero_v2r8();
717 fiz1 = _fjsp_setzero_v2r8();
718 fix2 = _fjsp_setzero_v2r8();
719 fiy2 = _fjsp_setzero_v2r8();
720 fiz2 = _fjsp_setzero_v2r8();
721 fix3 = _fjsp_setzero_v2r8();
722 fiy3 = _fjsp_setzero_v2r8();
723 fiz3 = _fjsp_setzero_v2r8();
725 /* Start inner kernel loop */
726 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
729 /* Get j neighbor index, and coordinate index */
732 j_coord_offsetA = DIM*jnrA;
733 j_coord_offsetB = DIM*jnrB;
735 /* load j atom coordinates */
736 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
739 /* Calculate displacement vector */
740 dx00 = _fjsp_sub_v2r8(ix0,jx0);
741 dy00 = _fjsp_sub_v2r8(iy0,jy0);
742 dz00 = _fjsp_sub_v2r8(iz0,jz0);
743 dx10 = _fjsp_sub_v2r8(ix1,jx0);
744 dy10 = _fjsp_sub_v2r8(iy1,jy0);
745 dz10 = _fjsp_sub_v2r8(iz1,jz0);
746 dx20 = _fjsp_sub_v2r8(ix2,jx0);
747 dy20 = _fjsp_sub_v2r8(iy2,jy0);
748 dz20 = _fjsp_sub_v2r8(iz2,jz0);
749 dx30 = _fjsp_sub_v2r8(ix3,jx0);
750 dy30 = _fjsp_sub_v2r8(iy3,jy0);
751 dz30 = _fjsp_sub_v2r8(iz3,jz0);
753 /* Calculate squared distance and things based on it */
754 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
755 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
756 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
757 rsq30 = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
759 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
760 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
761 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
762 rinv30 = gmx_fjsp_invsqrt_v2r8(rsq30);
764 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
765 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
766 rinvsq30 = _fjsp_mul_v2r8(rinv30,rinv30);
768 /* Load parameters for j particles */
769 jq0 = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
770 vdwjidx0A = 2*vdwtype[jnrA+0];
771 vdwjidx0B = 2*vdwtype[jnrB+0];
773 fjx0 = _fjsp_setzero_v2r8();
774 fjy0 = _fjsp_setzero_v2r8();
775 fjz0 = _fjsp_setzero_v2r8();
777 /**************************
778 * CALCULATE INTERACTIONS *
779 **************************/
781 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
783 /* Compute parameters for interactions between i and j atoms */
784 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
785 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
787 /* Calculate table index by multiplying r with table scale and truncate to integer */
788 rt = _fjsp_mul_v2r8(r00,vftabscale);
789 itab_tmp = _fjsp_dtox_v2r8(rt);
790 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
791 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
792 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
797 /* CUBIC SPLINE TABLE DISPERSION */
798 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
799 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
800 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
801 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
802 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
803 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
804 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
805 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
806 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
808 /* CUBIC SPLINE TABLE REPULSION */
809 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
810 F = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
811 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
812 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
813 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
814 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
815 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
816 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
817 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
818 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
822 /* Update vectorial force */
823 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
824 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
825 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
827 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
828 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
829 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
831 /**************************
832 * CALCULATE INTERACTIONS *
833 **************************/
835 /* Compute parameters for interactions between i and j atoms */
836 qq10 = _fjsp_mul_v2r8(iq1,jq0);
838 /* COULOMB ELECTROSTATICS */
839 velec = _fjsp_mul_v2r8(qq10,rinv10);
840 felec = _fjsp_mul_v2r8(velec,rinvsq10);
844 /* Update vectorial force */
845 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
846 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
847 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
849 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
850 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
851 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
853 /**************************
854 * CALCULATE INTERACTIONS *
855 **************************/
857 /* Compute parameters for interactions between i and j atoms */
858 qq20 = _fjsp_mul_v2r8(iq2,jq0);
860 /* COULOMB ELECTROSTATICS */
861 velec = _fjsp_mul_v2r8(qq20,rinv20);
862 felec = _fjsp_mul_v2r8(velec,rinvsq20);
866 /* Update vectorial force */
867 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
868 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
869 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
871 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
872 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
873 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
875 /**************************
876 * CALCULATE INTERACTIONS *
877 **************************/
879 /* Compute parameters for interactions between i and j atoms */
880 qq30 = _fjsp_mul_v2r8(iq3,jq0);
882 /* COULOMB ELECTROSTATICS */
883 velec = _fjsp_mul_v2r8(qq30,rinv30);
884 felec = _fjsp_mul_v2r8(velec,rinvsq30);
888 /* Update vectorial force */
889 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
890 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
891 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
893 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
894 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
895 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
897 gmx_fjsp_decrement_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0);
899 /* Inner loop uses 144 flops */
906 j_coord_offsetA = DIM*jnrA;
908 /* load j atom coordinates */
909 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
912 /* Calculate displacement vector */
913 dx00 = _fjsp_sub_v2r8(ix0,jx0);
914 dy00 = _fjsp_sub_v2r8(iy0,jy0);
915 dz00 = _fjsp_sub_v2r8(iz0,jz0);
916 dx10 = _fjsp_sub_v2r8(ix1,jx0);
917 dy10 = _fjsp_sub_v2r8(iy1,jy0);
918 dz10 = _fjsp_sub_v2r8(iz1,jz0);
919 dx20 = _fjsp_sub_v2r8(ix2,jx0);
920 dy20 = _fjsp_sub_v2r8(iy2,jy0);
921 dz20 = _fjsp_sub_v2r8(iz2,jz0);
922 dx30 = _fjsp_sub_v2r8(ix3,jx0);
923 dy30 = _fjsp_sub_v2r8(iy3,jy0);
924 dz30 = _fjsp_sub_v2r8(iz3,jz0);
926 /* Calculate squared distance and things based on it */
927 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
928 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
929 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
930 rsq30 = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
932 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
933 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
934 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
935 rinv30 = gmx_fjsp_invsqrt_v2r8(rsq30);
937 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
938 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
939 rinvsq30 = _fjsp_mul_v2r8(rinv30,rinv30);
941 /* Load parameters for j particles */
942 jq0 = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
943 vdwjidx0A = 2*vdwtype[jnrA+0];
945 fjx0 = _fjsp_setzero_v2r8();
946 fjy0 = _fjsp_setzero_v2r8();
947 fjz0 = _fjsp_setzero_v2r8();
949 /**************************
950 * CALCULATE INTERACTIONS *
951 **************************/
953 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
955 /* Compute parameters for interactions between i and j atoms */
956 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
957 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
959 /* Calculate table index by multiplying r with table scale and truncate to integer */
960 rt = _fjsp_mul_v2r8(r00,vftabscale);
961 itab_tmp = _fjsp_dtox_v2r8(rt);
962 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
963 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
964 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
969 /* CUBIC SPLINE TABLE DISPERSION */
970 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
971 F = _fjsp_setzero_v2r8();
972 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
973 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
974 H = _fjsp_setzero_v2r8();
975 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
976 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
977 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
978 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
980 /* CUBIC SPLINE TABLE REPULSION */
981 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
982 F = _fjsp_setzero_v2r8();
983 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
984 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
985 H = _fjsp_setzero_v2r8();
986 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
987 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
988 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
989 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
990 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
994 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
996 /* Update vectorial force */
997 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
998 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
999 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
1001 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
1002 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
1003 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
1005 /**************************
1006 * CALCULATE INTERACTIONS *
1007 **************************/
1009 /* Compute parameters for interactions between i and j atoms */
1010 qq10 = _fjsp_mul_v2r8(iq1,jq0);
1012 /* COULOMB ELECTROSTATICS */
1013 velec = _fjsp_mul_v2r8(qq10,rinv10);
1014 felec = _fjsp_mul_v2r8(velec,rinvsq10);
1018 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1020 /* Update vectorial force */
1021 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
1022 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
1023 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
1025 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
1026 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
1027 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
1029 /**************************
1030 * CALCULATE INTERACTIONS *
1031 **************************/
1033 /* Compute parameters for interactions between i and j atoms */
1034 qq20 = _fjsp_mul_v2r8(iq2,jq0);
1036 /* COULOMB ELECTROSTATICS */
1037 velec = _fjsp_mul_v2r8(qq20,rinv20);
1038 felec = _fjsp_mul_v2r8(velec,rinvsq20);
1042 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1044 /* Update vectorial force */
1045 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
1046 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
1047 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
1049 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
1050 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
1051 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
1053 /**************************
1054 * CALCULATE INTERACTIONS *
1055 **************************/
1057 /* Compute parameters for interactions between i and j atoms */
1058 qq30 = _fjsp_mul_v2r8(iq3,jq0);
1060 /* COULOMB ELECTROSTATICS */
1061 velec = _fjsp_mul_v2r8(qq30,rinv30);
1062 felec = _fjsp_mul_v2r8(velec,rinvsq30);
1066 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1068 /* Update vectorial force */
1069 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
1070 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
1071 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
1073 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
1074 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
1075 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
1077 gmx_fjsp_decrement_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0);
1079 /* Inner loop uses 144 flops */
1082 /* End of innermost loop */
1084 gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
1085 f+i_coord_offset,fshift+i_shift_offset);
1087 /* Increment number of inner iterations */
1088 inneriter += j_index_end - j_index_start;
1090 /* Outer loop uses 24 flops */
1093 /* Increment number of outer iterations */
1096 /* Update outer/inner flops */
1098 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4_F,outeriter*24 + inneriter*144);