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.
42 #include "../nb_kernel.h"
43 #include "gromacs/legacyheaders/types/simple.h"
44 #include "gromacs/math/vec.h"
45 #include "gromacs/legacyheaders/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 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->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_1pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
429 /* Calculate table index by multiplying r with table scale and truncate to integer */
430 rt = _fjsp_mul_v2r8(r00,vftabscale);
431 itab_tmp = _fjsp_dtox_v2r8(rt);
432 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
433 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
434 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
439 /* CUBIC SPLINE TABLE DISPERSION */
440 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
441 F = _fjsp_setzero_v2r8();
442 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
443 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
444 H = _fjsp_setzero_v2r8();
445 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
446 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
447 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
448 vvdw6 = _fjsp_mul_v2r8(c6_00,VV);
449 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
450 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
452 /* CUBIC SPLINE TABLE REPULSION */
453 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
454 F = _fjsp_setzero_v2r8();
455 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
456 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
457 H = _fjsp_setzero_v2r8();
458 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
459 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
460 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
461 vvdw12 = _fjsp_mul_v2r8(c12_00,VV);
462 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
463 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
464 vvdw = _fjsp_add_v2r8(vvdw12,vvdw6);
465 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
467 /* Update potential sum for this i atom from the interaction with this j atom. */
468 vvdw = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
469 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
473 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
475 /* Update vectorial force */
476 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
477 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
478 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
480 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
481 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
482 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
484 /**************************
485 * CALCULATE INTERACTIONS *
486 **************************/
488 /* Compute parameters for interactions between i and j atoms */
489 qq10 = _fjsp_mul_v2r8(iq1,jq0);
491 /* COULOMB ELECTROSTATICS */
492 velec = _fjsp_mul_v2r8(qq10,rinv10);
493 felec = _fjsp_mul_v2r8(velec,rinvsq10);
495 /* Update potential sum for this i atom from the interaction with this j atom. */
496 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
497 velecsum = _fjsp_add_v2r8(velecsum,velec);
501 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
503 /* Update vectorial force */
504 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
505 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
506 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
508 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
509 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
510 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
512 /**************************
513 * CALCULATE INTERACTIONS *
514 **************************/
516 /* Compute parameters for interactions between i and j atoms */
517 qq20 = _fjsp_mul_v2r8(iq2,jq0);
519 /* COULOMB ELECTROSTATICS */
520 velec = _fjsp_mul_v2r8(qq20,rinv20);
521 felec = _fjsp_mul_v2r8(velec,rinvsq20);
523 /* Update potential sum for this i atom from the interaction with this j atom. */
524 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
525 velecsum = _fjsp_add_v2r8(velecsum,velec);
529 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
531 /* Update vectorial force */
532 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
533 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
534 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
536 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
537 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
538 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
540 /**************************
541 * CALCULATE INTERACTIONS *
542 **************************/
544 /* Compute parameters for interactions between i and j atoms */
545 qq30 = _fjsp_mul_v2r8(iq3,jq0);
547 /* COULOMB ELECTROSTATICS */
548 velec = _fjsp_mul_v2r8(qq30,rinv30);
549 felec = _fjsp_mul_v2r8(velec,rinvsq30);
551 /* Update potential sum for this i atom from the interaction with this j atom. */
552 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
553 velecsum = _fjsp_add_v2r8(velecsum,velec);
557 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
559 /* Update vectorial force */
560 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
561 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
562 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
564 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
565 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
566 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
568 gmx_fjsp_decrement_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0);
570 /* Inner loop uses 155 flops */
573 /* End of innermost loop */
575 gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
576 f+i_coord_offset,fshift+i_shift_offset);
579 /* Update potential energies */
580 gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
581 gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
583 /* Increment number of inner iterations */
584 inneriter += j_index_end - j_index_start;
586 /* Outer loop uses 26 flops */
589 /* Increment number of outer iterations */
592 /* Update outer/inner flops */
594 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4_VF,outeriter*26 + inneriter*155);
597 * Gromacs nonbonded kernel: nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sparc64_hpc_ace_double
598 * Electrostatics interaction: Coulomb
599 * VdW interaction: CubicSplineTable
600 * Geometry: Water4-Particle
601 * Calculate force/pot: Force
604 nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sparc64_hpc_ace_double
605 (t_nblist * gmx_restrict nlist,
606 rvec * gmx_restrict xx,
607 rvec * gmx_restrict ff,
608 t_forcerec * gmx_restrict fr,
609 t_mdatoms * gmx_restrict mdatoms,
610 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
611 t_nrnb * gmx_restrict nrnb)
613 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
614 * just 0 for non-waters.
615 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
616 * jnr indices corresponding to data put in the four positions in the SIMD register.
618 int i_shift_offset,i_coord_offset,outeriter,inneriter;
619 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
621 int j_coord_offsetA,j_coord_offsetB;
622 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
624 real *shiftvec,*fshift,*x,*f;
625 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
627 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
629 _fjsp_v2r8 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
631 _fjsp_v2r8 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
633 _fjsp_v2r8 ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
634 int vdwjidx0A,vdwjidx0B;
635 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
636 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
637 _fjsp_v2r8 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
638 _fjsp_v2r8 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
639 _fjsp_v2r8 dx30,dy30,dz30,rsq30,rinv30,rinvsq30,r30,qq30,c6_30,c12_30;
640 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
643 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
646 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
647 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
648 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
651 _fjsp_v2r8 dummy_mask,cutoff_mask;
652 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
653 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
654 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
661 jindex = nlist->jindex;
663 shiftidx = nlist->shift;
665 shiftvec = fr->shift_vec[0];
666 fshift = fr->fshift[0];
667 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
668 charge = mdatoms->chargeA;
669 nvdwtype = fr->ntype;
671 vdwtype = mdatoms->typeA;
673 vftab = kernel_data->table_vdw->data;
674 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
676 /* Setup water-specific parameters */
677 inr = nlist->iinr[0];
678 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
679 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
680 iq3 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+3]));
681 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
683 /* Avoid stupid compiler warnings */
691 /* Start outer loop over neighborlists */
692 for(iidx=0; iidx<nri; iidx++)
694 /* Load shift vector for this list */
695 i_shift_offset = DIM*shiftidx[iidx];
697 /* Load limits for loop over neighbors */
698 j_index_start = jindex[iidx];
699 j_index_end = jindex[iidx+1];
701 /* Get outer coordinate index */
703 i_coord_offset = DIM*inr;
705 /* Load i particle coords and add shift vector */
706 gmx_fjsp_load_shift_and_4rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
707 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
709 fix0 = _fjsp_setzero_v2r8();
710 fiy0 = _fjsp_setzero_v2r8();
711 fiz0 = _fjsp_setzero_v2r8();
712 fix1 = _fjsp_setzero_v2r8();
713 fiy1 = _fjsp_setzero_v2r8();
714 fiz1 = _fjsp_setzero_v2r8();
715 fix2 = _fjsp_setzero_v2r8();
716 fiy2 = _fjsp_setzero_v2r8();
717 fiz2 = _fjsp_setzero_v2r8();
718 fix3 = _fjsp_setzero_v2r8();
719 fiy3 = _fjsp_setzero_v2r8();
720 fiz3 = _fjsp_setzero_v2r8();
722 /* Start inner kernel loop */
723 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
726 /* Get j neighbor index, and coordinate index */
729 j_coord_offsetA = DIM*jnrA;
730 j_coord_offsetB = DIM*jnrB;
732 /* load j atom coordinates */
733 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
736 /* Calculate displacement vector */
737 dx00 = _fjsp_sub_v2r8(ix0,jx0);
738 dy00 = _fjsp_sub_v2r8(iy0,jy0);
739 dz00 = _fjsp_sub_v2r8(iz0,jz0);
740 dx10 = _fjsp_sub_v2r8(ix1,jx0);
741 dy10 = _fjsp_sub_v2r8(iy1,jy0);
742 dz10 = _fjsp_sub_v2r8(iz1,jz0);
743 dx20 = _fjsp_sub_v2r8(ix2,jx0);
744 dy20 = _fjsp_sub_v2r8(iy2,jy0);
745 dz20 = _fjsp_sub_v2r8(iz2,jz0);
746 dx30 = _fjsp_sub_v2r8(ix3,jx0);
747 dy30 = _fjsp_sub_v2r8(iy3,jy0);
748 dz30 = _fjsp_sub_v2r8(iz3,jz0);
750 /* Calculate squared distance and things based on it */
751 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
752 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
753 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
754 rsq30 = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
756 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
757 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
758 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
759 rinv30 = gmx_fjsp_invsqrt_v2r8(rsq30);
761 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
762 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
763 rinvsq30 = _fjsp_mul_v2r8(rinv30,rinv30);
765 /* Load parameters for j particles */
766 jq0 = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
767 vdwjidx0A = 2*vdwtype[jnrA+0];
768 vdwjidx0B = 2*vdwtype[jnrB+0];
770 fjx0 = _fjsp_setzero_v2r8();
771 fjy0 = _fjsp_setzero_v2r8();
772 fjz0 = _fjsp_setzero_v2r8();
774 /**************************
775 * CALCULATE INTERACTIONS *
776 **************************/
778 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
780 /* Compute parameters for interactions between i and j atoms */
781 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
782 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
784 /* Calculate table index by multiplying r with table scale and truncate to integer */
785 rt = _fjsp_mul_v2r8(r00,vftabscale);
786 itab_tmp = _fjsp_dtox_v2r8(rt);
787 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
788 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
789 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
794 /* CUBIC SPLINE TABLE DISPERSION */
795 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
796 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
797 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
798 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
799 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
800 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
801 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
802 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
803 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
805 /* CUBIC SPLINE TABLE REPULSION */
806 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
807 F = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
808 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
809 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
810 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
811 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
812 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
813 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
814 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
815 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
819 /* Update vectorial force */
820 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
821 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
822 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
824 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
825 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
826 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
828 /**************************
829 * CALCULATE INTERACTIONS *
830 **************************/
832 /* Compute parameters for interactions between i and j atoms */
833 qq10 = _fjsp_mul_v2r8(iq1,jq0);
835 /* COULOMB ELECTROSTATICS */
836 velec = _fjsp_mul_v2r8(qq10,rinv10);
837 felec = _fjsp_mul_v2r8(velec,rinvsq10);
841 /* Update vectorial force */
842 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
843 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
844 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
846 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
847 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
848 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
850 /**************************
851 * CALCULATE INTERACTIONS *
852 **************************/
854 /* Compute parameters for interactions between i and j atoms */
855 qq20 = _fjsp_mul_v2r8(iq2,jq0);
857 /* COULOMB ELECTROSTATICS */
858 velec = _fjsp_mul_v2r8(qq20,rinv20);
859 felec = _fjsp_mul_v2r8(velec,rinvsq20);
863 /* Update vectorial force */
864 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
865 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
866 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
868 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
869 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
870 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
872 /**************************
873 * CALCULATE INTERACTIONS *
874 **************************/
876 /* Compute parameters for interactions between i and j atoms */
877 qq30 = _fjsp_mul_v2r8(iq3,jq0);
879 /* COULOMB ELECTROSTATICS */
880 velec = _fjsp_mul_v2r8(qq30,rinv30);
881 felec = _fjsp_mul_v2r8(velec,rinvsq30);
885 /* Update vectorial force */
886 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
887 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
888 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
890 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
891 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
892 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
894 gmx_fjsp_decrement_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0);
896 /* Inner loop uses 144 flops */
903 j_coord_offsetA = DIM*jnrA;
905 /* load j atom coordinates */
906 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
909 /* Calculate displacement vector */
910 dx00 = _fjsp_sub_v2r8(ix0,jx0);
911 dy00 = _fjsp_sub_v2r8(iy0,jy0);
912 dz00 = _fjsp_sub_v2r8(iz0,jz0);
913 dx10 = _fjsp_sub_v2r8(ix1,jx0);
914 dy10 = _fjsp_sub_v2r8(iy1,jy0);
915 dz10 = _fjsp_sub_v2r8(iz1,jz0);
916 dx20 = _fjsp_sub_v2r8(ix2,jx0);
917 dy20 = _fjsp_sub_v2r8(iy2,jy0);
918 dz20 = _fjsp_sub_v2r8(iz2,jz0);
919 dx30 = _fjsp_sub_v2r8(ix3,jx0);
920 dy30 = _fjsp_sub_v2r8(iy3,jy0);
921 dz30 = _fjsp_sub_v2r8(iz3,jz0);
923 /* Calculate squared distance and things based on it */
924 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
925 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
926 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
927 rsq30 = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
929 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
930 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
931 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
932 rinv30 = gmx_fjsp_invsqrt_v2r8(rsq30);
934 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
935 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
936 rinvsq30 = _fjsp_mul_v2r8(rinv30,rinv30);
938 /* Load parameters for j particles */
939 jq0 = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
940 vdwjidx0A = 2*vdwtype[jnrA+0];
942 fjx0 = _fjsp_setzero_v2r8();
943 fjy0 = _fjsp_setzero_v2r8();
944 fjz0 = _fjsp_setzero_v2r8();
946 /**************************
947 * CALCULATE INTERACTIONS *
948 **************************/
950 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
952 /* Compute parameters for interactions between i and j atoms */
953 gmx_fjsp_load_1pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
955 /* Calculate table index by multiplying r with table scale and truncate to integer */
956 rt = _fjsp_mul_v2r8(r00,vftabscale);
957 itab_tmp = _fjsp_dtox_v2r8(rt);
958 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
959 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
960 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
965 /* CUBIC SPLINE TABLE DISPERSION */
966 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
967 F = _fjsp_setzero_v2r8();
968 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
969 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
970 H = _fjsp_setzero_v2r8();
971 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
972 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
973 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
974 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
976 /* CUBIC SPLINE TABLE REPULSION */
977 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
978 F = _fjsp_setzero_v2r8();
979 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
980 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
981 H = _fjsp_setzero_v2r8();
982 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
983 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
984 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
985 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
986 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
990 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
992 /* Update vectorial force */
993 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
994 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
995 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
997 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
998 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
999 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
1001 /**************************
1002 * CALCULATE INTERACTIONS *
1003 **************************/
1005 /* Compute parameters for interactions between i and j atoms */
1006 qq10 = _fjsp_mul_v2r8(iq1,jq0);
1008 /* COULOMB ELECTROSTATICS */
1009 velec = _fjsp_mul_v2r8(qq10,rinv10);
1010 felec = _fjsp_mul_v2r8(velec,rinvsq10);
1014 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1016 /* Update vectorial force */
1017 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
1018 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
1019 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
1021 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
1022 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
1023 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
1025 /**************************
1026 * CALCULATE INTERACTIONS *
1027 **************************/
1029 /* Compute parameters for interactions between i and j atoms */
1030 qq20 = _fjsp_mul_v2r8(iq2,jq0);
1032 /* COULOMB ELECTROSTATICS */
1033 velec = _fjsp_mul_v2r8(qq20,rinv20);
1034 felec = _fjsp_mul_v2r8(velec,rinvsq20);
1038 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1040 /* Update vectorial force */
1041 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
1042 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
1043 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
1045 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
1046 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
1047 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
1049 /**************************
1050 * CALCULATE INTERACTIONS *
1051 **************************/
1053 /* Compute parameters for interactions between i and j atoms */
1054 qq30 = _fjsp_mul_v2r8(iq3,jq0);
1056 /* COULOMB ELECTROSTATICS */
1057 velec = _fjsp_mul_v2r8(qq30,rinv30);
1058 felec = _fjsp_mul_v2r8(velec,rinvsq30);
1062 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1064 /* Update vectorial force */
1065 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
1066 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
1067 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
1069 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
1070 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
1071 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
1073 gmx_fjsp_decrement_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0);
1075 /* Inner loop uses 144 flops */
1078 /* End of innermost loop */
1080 gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
1081 f+i_coord_offset,fshift+i_shift_offset);
1083 /* Increment number of inner iterations */
1084 inneriter += j_index_end - j_index_start;
1086 /* Outer loop uses 24 flops */
1089 /* Increment number of outer iterations */
1092 /* Update outer/inner flops */
1094 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4_F,outeriter*24 + inneriter*144);