2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2012,2013, 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"
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_1pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
431 /* Calculate table index by multiplying r with table scale and truncate to integer */
432 rt = _fjsp_mul_v2r8(r00,vftabscale);
433 itab_tmp = _fjsp_dtox_v2r8(rt);
434 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
435 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
436 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
441 /* CUBIC SPLINE TABLE DISPERSION */
442 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
443 F = _fjsp_setzero_v2r8();
444 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
445 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
446 H = _fjsp_setzero_v2r8();
447 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
448 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
449 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
450 vvdw6 = _fjsp_mul_v2r8(c6_00,VV);
451 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
452 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
454 /* CUBIC SPLINE TABLE REPULSION */
455 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
456 F = _fjsp_setzero_v2r8();
457 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
458 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
459 H = _fjsp_setzero_v2r8();
460 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
461 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
462 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
463 vvdw12 = _fjsp_mul_v2r8(c12_00,VV);
464 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
465 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
466 vvdw = _fjsp_add_v2r8(vvdw12,vvdw6);
467 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
469 /* Update potential sum for this i atom from the interaction with this j atom. */
470 vvdw = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
471 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
475 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
477 /* Update vectorial force */
478 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
479 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
480 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
482 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
483 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
484 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
486 /**************************
487 * CALCULATE INTERACTIONS *
488 **************************/
490 /* Compute parameters for interactions between i and j atoms */
491 qq10 = _fjsp_mul_v2r8(iq1,jq0);
493 /* COULOMB ELECTROSTATICS */
494 velec = _fjsp_mul_v2r8(qq10,rinv10);
495 felec = _fjsp_mul_v2r8(velec,rinvsq10);
497 /* Update potential sum for this i atom from the interaction with this j atom. */
498 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
499 velecsum = _fjsp_add_v2r8(velecsum,velec);
503 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
505 /* Update vectorial force */
506 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
507 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
508 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
510 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
511 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
512 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
514 /**************************
515 * CALCULATE INTERACTIONS *
516 **************************/
518 /* Compute parameters for interactions between i and j atoms */
519 qq20 = _fjsp_mul_v2r8(iq2,jq0);
521 /* COULOMB ELECTROSTATICS */
522 velec = _fjsp_mul_v2r8(qq20,rinv20);
523 felec = _fjsp_mul_v2r8(velec,rinvsq20);
525 /* Update potential sum for this i atom from the interaction with this j atom. */
526 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
527 velecsum = _fjsp_add_v2r8(velecsum,velec);
531 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
533 /* Update vectorial force */
534 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
535 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
536 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
538 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
539 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
540 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
542 /**************************
543 * CALCULATE INTERACTIONS *
544 **************************/
546 /* Compute parameters for interactions between i and j atoms */
547 qq30 = _fjsp_mul_v2r8(iq3,jq0);
549 /* COULOMB ELECTROSTATICS */
550 velec = _fjsp_mul_v2r8(qq30,rinv30);
551 felec = _fjsp_mul_v2r8(velec,rinvsq30);
553 /* Update potential sum for this i atom from the interaction with this j atom. */
554 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
555 velecsum = _fjsp_add_v2r8(velecsum,velec);
559 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
561 /* Update vectorial force */
562 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
563 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
564 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
566 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
567 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
568 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
570 gmx_fjsp_decrement_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0);
572 /* Inner loop uses 155 flops */
575 /* End of innermost loop */
577 gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
578 f+i_coord_offset,fshift+i_shift_offset);
581 /* Update potential energies */
582 gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
583 gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
585 /* Increment number of inner iterations */
586 inneriter += j_index_end - j_index_start;
588 /* Outer loop uses 26 flops */
591 /* Increment number of outer iterations */
594 /* Update outer/inner flops */
596 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4_VF,outeriter*26 + inneriter*155);
599 * Gromacs nonbonded kernel: nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sparc64_hpc_ace_double
600 * Electrostatics interaction: Coulomb
601 * VdW interaction: CubicSplineTable
602 * Geometry: Water4-Particle
603 * Calculate force/pot: Force
606 nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sparc64_hpc_ace_double
607 (t_nblist * gmx_restrict nlist,
608 rvec * gmx_restrict xx,
609 rvec * gmx_restrict ff,
610 t_forcerec * gmx_restrict fr,
611 t_mdatoms * gmx_restrict mdatoms,
612 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
613 t_nrnb * gmx_restrict nrnb)
615 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
616 * just 0 for non-waters.
617 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
618 * jnr indices corresponding to data put in the four positions in the SIMD register.
620 int i_shift_offset,i_coord_offset,outeriter,inneriter;
621 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
623 int j_coord_offsetA,j_coord_offsetB;
624 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
626 real *shiftvec,*fshift,*x,*f;
627 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
629 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
631 _fjsp_v2r8 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
633 _fjsp_v2r8 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
635 _fjsp_v2r8 ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
636 int vdwjidx0A,vdwjidx0B;
637 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
638 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
639 _fjsp_v2r8 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
640 _fjsp_v2r8 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
641 _fjsp_v2r8 dx30,dy30,dz30,rsq30,rinv30,rinvsq30,r30,qq30,c6_30,c12_30;
642 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
645 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
648 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
649 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
650 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
653 _fjsp_v2r8 dummy_mask,cutoff_mask;
654 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
655 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
656 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
663 jindex = nlist->jindex;
665 shiftidx = nlist->shift;
667 shiftvec = fr->shift_vec[0];
668 fshift = fr->fshift[0];
669 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
670 charge = mdatoms->chargeA;
671 nvdwtype = fr->ntype;
673 vdwtype = mdatoms->typeA;
675 vftab = kernel_data->table_vdw->data;
676 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
678 /* Setup water-specific parameters */
679 inr = nlist->iinr[0];
680 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
681 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
682 iq3 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+3]));
683 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
685 /* Avoid stupid compiler warnings */
693 /* Start outer loop over neighborlists */
694 for(iidx=0; iidx<nri; iidx++)
696 /* Load shift vector for this list */
697 i_shift_offset = DIM*shiftidx[iidx];
699 /* Load limits for loop over neighbors */
700 j_index_start = jindex[iidx];
701 j_index_end = jindex[iidx+1];
703 /* Get outer coordinate index */
705 i_coord_offset = DIM*inr;
707 /* Load i particle coords and add shift vector */
708 gmx_fjsp_load_shift_and_4rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
709 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
711 fix0 = _fjsp_setzero_v2r8();
712 fiy0 = _fjsp_setzero_v2r8();
713 fiz0 = _fjsp_setzero_v2r8();
714 fix1 = _fjsp_setzero_v2r8();
715 fiy1 = _fjsp_setzero_v2r8();
716 fiz1 = _fjsp_setzero_v2r8();
717 fix2 = _fjsp_setzero_v2r8();
718 fiy2 = _fjsp_setzero_v2r8();
719 fiz2 = _fjsp_setzero_v2r8();
720 fix3 = _fjsp_setzero_v2r8();
721 fiy3 = _fjsp_setzero_v2r8();
722 fiz3 = _fjsp_setzero_v2r8();
724 /* Start inner kernel loop */
725 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
728 /* Get j neighbor index, and coordinate index */
731 j_coord_offsetA = DIM*jnrA;
732 j_coord_offsetB = DIM*jnrB;
734 /* load j atom coordinates */
735 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
738 /* Calculate displacement vector */
739 dx00 = _fjsp_sub_v2r8(ix0,jx0);
740 dy00 = _fjsp_sub_v2r8(iy0,jy0);
741 dz00 = _fjsp_sub_v2r8(iz0,jz0);
742 dx10 = _fjsp_sub_v2r8(ix1,jx0);
743 dy10 = _fjsp_sub_v2r8(iy1,jy0);
744 dz10 = _fjsp_sub_v2r8(iz1,jz0);
745 dx20 = _fjsp_sub_v2r8(ix2,jx0);
746 dy20 = _fjsp_sub_v2r8(iy2,jy0);
747 dz20 = _fjsp_sub_v2r8(iz2,jz0);
748 dx30 = _fjsp_sub_v2r8(ix3,jx0);
749 dy30 = _fjsp_sub_v2r8(iy3,jy0);
750 dz30 = _fjsp_sub_v2r8(iz3,jz0);
752 /* Calculate squared distance and things based on it */
753 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
754 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
755 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
756 rsq30 = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
758 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
759 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
760 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
761 rinv30 = gmx_fjsp_invsqrt_v2r8(rsq30);
763 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
764 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
765 rinvsq30 = _fjsp_mul_v2r8(rinv30,rinv30);
767 /* Load parameters for j particles */
768 jq0 = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
769 vdwjidx0A = 2*vdwtype[jnrA+0];
770 vdwjidx0B = 2*vdwtype[jnrB+0];
772 fjx0 = _fjsp_setzero_v2r8();
773 fjy0 = _fjsp_setzero_v2r8();
774 fjz0 = _fjsp_setzero_v2r8();
776 /**************************
777 * CALCULATE INTERACTIONS *
778 **************************/
780 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
782 /* Compute parameters for interactions between i and j atoms */
783 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
784 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
786 /* Calculate table index by multiplying r with table scale and truncate to integer */
787 rt = _fjsp_mul_v2r8(r00,vftabscale);
788 itab_tmp = _fjsp_dtox_v2r8(rt);
789 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
790 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
791 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
796 /* CUBIC SPLINE TABLE DISPERSION */
797 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
798 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
799 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
800 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
801 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
802 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
803 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
804 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
805 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
807 /* CUBIC SPLINE TABLE REPULSION */
808 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
809 F = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
810 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
811 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
812 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
813 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
814 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
815 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
816 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
817 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
821 /* Update vectorial force */
822 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
823 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
824 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
826 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
827 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
828 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
830 /**************************
831 * CALCULATE INTERACTIONS *
832 **************************/
834 /* Compute parameters for interactions between i and j atoms */
835 qq10 = _fjsp_mul_v2r8(iq1,jq0);
837 /* COULOMB ELECTROSTATICS */
838 velec = _fjsp_mul_v2r8(qq10,rinv10);
839 felec = _fjsp_mul_v2r8(velec,rinvsq10);
843 /* Update vectorial force */
844 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
845 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
846 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
848 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
849 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
850 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
852 /**************************
853 * CALCULATE INTERACTIONS *
854 **************************/
856 /* Compute parameters for interactions between i and j atoms */
857 qq20 = _fjsp_mul_v2r8(iq2,jq0);
859 /* COULOMB ELECTROSTATICS */
860 velec = _fjsp_mul_v2r8(qq20,rinv20);
861 felec = _fjsp_mul_v2r8(velec,rinvsq20);
865 /* Update vectorial force */
866 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
867 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
868 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
870 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
871 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
872 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
874 /**************************
875 * CALCULATE INTERACTIONS *
876 **************************/
878 /* Compute parameters for interactions between i and j atoms */
879 qq30 = _fjsp_mul_v2r8(iq3,jq0);
881 /* COULOMB ELECTROSTATICS */
882 velec = _fjsp_mul_v2r8(qq30,rinv30);
883 felec = _fjsp_mul_v2r8(velec,rinvsq30);
887 /* Update vectorial force */
888 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
889 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
890 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
892 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
893 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
894 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
896 gmx_fjsp_decrement_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0);
898 /* Inner loop uses 144 flops */
905 j_coord_offsetA = DIM*jnrA;
907 /* load j atom coordinates */
908 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
911 /* Calculate displacement vector */
912 dx00 = _fjsp_sub_v2r8(ix0,jx0);
913 dy00 = _fjsp_sub_v2r8(iy0,jy0);
914 dz00 = _fjsp_sub_v2r8(iz0,jz0);
915 dx10 = _fjsp_sub_v2r8(ix1,jx0);
916 dy10 = _fjsp_sub_v2r8(iy1,jy0);
917 dz10 = _fjsp_sub_v2r8(iz1,jz0);
918 dx20 = _fjsp_sub_v2r8(ix2,jx0);
919 dy20 = _fjsp_sub_v2r8(iy2,jy0);
920 dz20 = _fjsp_sub_v2r8(iz2,jz0);
921 dx30 = _fjsp_sub_v2r8(ix3,jx0);
922 dy30 = _fjsp_sub_v2r8(iy3,jy0);
923 dz30 = _fjsp_sub_v2r8(iz3,jz0);
925 /* Calculate squared distance and things based on it */
926 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
927 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
928 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
929 rsq30 = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
931 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
932 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
933 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
934 rinv30 = gmx_fjsp_invsqrt_v2r8(rsq30);
936 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
937 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
938 rinvsq30 = _fjsp_mul_v2r8(rinv30,rinv30);
940 /* Load parameters for j particles */
941 jq0 = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
942 vdwjidx0A = 2*vdwtype[jnrA+0];
944 fjx0 = _fjsp_setzero_v2r8();
945 fjy0 = _fjsp_setzero_v2r8();
946 fjz0 = _fjsp_setzero_v2r8();
948 /**************************
949 * CALCULATE INTERACTIONS *
950 **************************/
952 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
954 /* Compute parameters for interactions between i and j atoms */
955 gmx_fjsp_load_1pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,&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);