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_ElecCSTab_VdwLJ_GeomW3P1_VF_sparc64_hpc_ace_double
53 * Electrostatics interaction: CubicSplineTable
54 * VdW interaction: LennardJones
55 * Geometry: Water3-Particle
56 * Calculate force/pot: PotentialAndForce
59 nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_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;
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 velec,felec,velecsum,facel,crf,krf,krf2;
95 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
98 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
99 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
100 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
103 _fjsp_v2r8 dummy_mask,cutoff_mask;
104 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
105 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
106 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
113 jindex = nlist->jindex;
115 shiftidx = nlist->shift;
117 shiftvec = fr->shift_vec[0];
118 fshift = fr->fshift[0];
119 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
120 charge = mdatoms->chargeA;
121 nvdwtype = fr->ntype;
123 vdwtype = mdatoms->typeA;
125 vftab = kernel_data->table_elec->data;
126 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_elec->scale);
128 /* Setup water-specific parameters */
129 inr = nlist->iinr[0];
130 iq0 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+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 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
135 /* Avoid stupid compiler warnings */
143 /* Start outer loop over neighborlists */
144 for(iidx=0; iidx<nri; iidx++)
146 /* Load shift vector for this list */
147 i_shift_offset = DIM*shiftidx[iidx];
149 /* Load limits for loop over neighbors */
150 j_index_start = jindex[iidx];
151 j_index_end = jindex[iidx+1];
153 /* Get outer coordinate index */
155 i_coord_offset = DIM*inr;
157 /* Load i particle coords and add shift vector */
158 gmx_fjsp_load_shift_and_3rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
159 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2);
161 fix0 = _fjsp_setzero_v2r8();
162 fiy0 = _fjsp_setzero_v2r8();
163 fiz0 = _fjsp_setzero_v2r8();
164 fix1 = _fjsp_setzero_v2r8();
165 fiy1 = _fjsp_setzero_v2r8();
166 fiz1 = _fjsp_setzero_v2r8();
167 fix2 = _fjsp_setzero_v2r8();
168 fiy2 = _fjsp_setzero_v2r8();
169 fiz2 = _fjsp_setzero_v2r8();
171 /* Reset potential sums */
172 velecsum = _fjsp_setzero_v2r8();
173 vvdwsum = _fjsp_setzero_v2r8();
175 /* Start inner kernel loop */
176 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
179 /* Get j neighbor index, and coordinate index */
182 j_coord_offsetA = DIM*jnrA;
183 j_coord_offsetB = DIM*jnrB;
185 /* load j atom coordinates */
186 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
189 /* Calculate displacement vector */
190 dx00 = _fjsp_sub_v2r8(ix0,jx0);
191 dy00 = _fjsp_sub_v2r8(iy0,jy0);
192 dz00 = _fjsp_sub_v2r8(iz0,jz0);
193 dx10 = _fjsp_sub_v2r8(ix1,jx0);
194 dy10 = _fjsp_sub_v2r8(iy1,jy0);
195 dz10 = _fjsp_sub_v2r8(iz1,jz0);
196 dx20 = _fjsp_sub_v2r8(ix2,jx0);
197 dy20 = _fjsp_sub_v2r8(iy2,jy0);
198 dz20 = _fjsp_sub_v2r8(iz2,jz0);
200 /* Calculate squared distance and things based on it */
201 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
202 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
203 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
205 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
206 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
207 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
209 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
211 /* Load parameters for j particles */
212 jq0 = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
213 vdwjidx0A = 2*vdwtype[jnrA+0];
214 vdwjidx0B = 2*vdwtype[jnrB+0];
216 fjx0 = _fjsp_setzero_v2r8();
217 fjy0 = _fjsp_setzero_v2r8();
218 fjz0 = _fjsp_setzero_v2r8();
220 /**************************
221 * CALCULATE INTERACTIONS *
222 **************************/
224 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
226 /* Compute parameters for interactions between i and j atoms */
227 qq00 = _fjsp_mul_v2r8(iq0,jq0);
228 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
229 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
231 /* Calculate table index by multiplying r with table scale and truncate to integer */
232 rt = _fjsp_mul_v2r8(r00,vftabscale);
233 itab_tmp = _fjsp_dtox_v2r8(rt);
234 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
235 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
236 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
241 /* CUBIC SPLINE TABLE ELECTROSTATICS */
242 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
243 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
244 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
245 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
246 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
247 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
248 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
249 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
250 velec = _fjsp_mul_v2r8(qq00,VV);
251 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
252 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq00,FF),_fjsp_mul_v2r8(vftabscale,rinv00)));
254 /* LENNARD-JONES DISPERSION/REPULSION */
256 rinvsix = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
257 vvdw6 = _fjsp_mul_v2r8(c6_00,rinvsix);
258 vvdw12 = _fjsp_mul_v2r8(c12_00,_fjsp_mul_v2r8(rinvsix,rinvsix));
259 vvdw = _fjsp_msub_v2r8( vvdw12,one_twelfth, _fjsp_mul_v2r8(vvdw6,one_sixth) );
260 fvdw = _fjsp_mul_v2r8(_fjsp_sub_v2r8(vvdw12,vvdw6),rinvsq00);
262 /* Update potential sum for this i atom from the interaction with this j atom. */
263 velecsum = _fjsp_add_v2r8(velecsum,velec);
264 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
266 fscal = _fjsp_add_v2r8(felec,fvdw);
268 /* Update vectorial force */
269 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
270 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
271 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
273 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
274 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
275 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
277 /**************************
278 * CALCULATE INTERACTIONS *
279 **************************/
281 r10 = _fjsp_mul_v2r8(rsq10,rinv10);
283 /* Compute parameters for interactions between i and j atoms */
284 qq10 = _fjsp_mul_v2r8(iq1,jq0);
286 /* Calculate table index by multiplying r with table scale and truncate to integer */
287 rt = _fjsp_mul_v2r8(r10,vftabscale);
288 itab_tmp = _fjsp_dtox_v2r8(rt);
289 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
290 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
291 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
296 /* CUBIC SPLINE TABLE ELECTROSTATICS */
297 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
298 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
299 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
300 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
301 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
302 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
303 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
304 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
305 velec = _fjsp_mul_v2r8(qq10,VV);
306 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
307 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,FF),_fjsp_mul_v2r8(vftabscale,rinv10)));
309 /* Update potential sum for this i atom from the interaction with this j atom. */
310 velecsum = _fjsp_add_v2r8(velecsum,velec);
314 /* Update vectorial force */
315 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
316 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
317 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
319 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
320 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
321 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
323 /**************************
324 * CALCULATE INTERACTIONS *
325 **************************/
327 r20 = _fjsp_mul_v2r8(rsq20,rinv20);
329 /* Compute parameters for interactions between i and j atoms */
330 qq20 = _fjsp_mul_v2r8(iq2,jq0);
332 /* Calculate table index by multiplying r with table scale and truncate to integer */
333 rt = _fjsp_mul_v2r8(r20,vftabscale);
334 itab_tmp = _fjsp_dtox_v2r8(rt);
335 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
336 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
337 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
342 /* CUBIC SPLINE TABLE ELECTROSTATICS */
343 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
344 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
345 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
346 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
347 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
348 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
349 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
350 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
351 velec = _fjsp_mul_v2r8(qq20,VV);
352 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
353 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,FF),_fjsp_mul_v2r8(vftabscale,rinv20)));
355 /* Update potential sum for this i atom from the interaction with this j atom. */
356 velecsum = _fjsp_add_v2r8(velecsum,velec);
360 /* Update vectorial force */
361 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
362 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
363 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
365 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
366 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
367 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
369 gmx_fjsp_decrement_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0);
371 /* Inner loop uses 154 flops */
378 j_coord_offsetA = DIM*jnrA;
380 /* load j atom coordinates */
381 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
384 /* Calculate displacement vector */
385 dx00 = _fjsp_sub_v2r8(ix0,jx0);
386 dy00 = _fjsp_sub_v2r8(iy0,jy0);
387 dz00 = _fjsp_sub_v2r8(iz0,jz0);
388 dx10 = _fjsp_sub_v2r8(ix1,jx0);
389 dy10 = _fjsp_sub_v2r8(iy1,jy0);
390 dz10 = _fjsp_sub_v2r8(iz1,jz0);
391 dx20 = _fjsp_sub_v2r8(ix2,jx0);
392 dy20 = _fjsp_sub_v2r8(iy2,jy0);
393 dz20 = _fjsp_sub_v2r8(iz2,jz0);
395 /* Calculate squared distance and things based on it */
396 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
397 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
398 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
400 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
401 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
402 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
404 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
406 /* Load parameters for j particles */
407 jq0 = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
408 vdwjidx0A = 2*vdwtype[jnrA+0];
410 fjx0 = _fjsp_setzero_v2r8();
411 fjy0 = _fjsp_setzero_v2r8();
412 fjz0 = _fjsp_setzero_v2r8();
414 /**************************
415 * CALCULATE INTERACTIONS *
416 **************************/
418 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
420 /* Compute parameters for interactions between i and j atoms */
421 qq00 = _fjsp_mul_v2r8(iq0,jq0);
422 gmx_fjsp_load_1pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
424 /* Calculate table index by multiplying r with table scale and truncate to integer */
425 rt = _fjsp_mul_v2r8(r00,vftabscale);
426 itab_tmp = _fjsp_dtox_v2r8(rt);
427 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
428 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
429 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
434 /* CUBIC SPLINE TABLE ELECTROSTATICS */
435 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
436 F = _fjsp_setzero_v2r8();
437 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
438 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
439 H = _fjsp_setzero_v2r8();
440 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
441 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
442 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
443 velec = _fjsp_mul_v2r8(qq00,VV);
444 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
445 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq00,FF),_fjsp_mul_v2r8(vftabscale,rinv00)));
447 /* LENNARD-JONES DISPERSION/REPULSION */
449 rinvsix = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
450 vvdw6 = _fjsp_mul_v2r8(c6_00,rinvsix);
451 vvdw12 = _fjsp_mul_v2r8(c12_00,_fjsp_mul_v2r8(rinvsix,rinvsix));
452 vvdw = _fjsp_msub_v2r8( vvdw12,one_twelfth, _fjsp_mul_v2r8(vvdw6,one_sixth) );
453 fvdw = _fjsp_mul_v2r8(_fjsp_sub_v2r8(vvdw12,vvdw6),rinvsq00);
455 /* Update potential sum for this i atom from the interaction with this j atom. */
456 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
457 velecsum = _fjsp_add_v2r8(velecsum,velec);
458 vvdw = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
459 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
461 fscal = _fjsp_add_v2r8(felec,fvdw);
463 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
465 /* Update vectorial force */
466 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
467 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
468 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
470 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
471 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
472 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
474 /**************************
475 * CALCULATE INTERACTIONS *
476 **************************/
478 r10 = _fjsp_mul_v2r8(rsq10,rinv10);
480 /* Compute parameters for interactions between i and j atoms */
481 qq10 = _fjsp_mul_v2r8(iq1,jq0);
483 /* Calculate table index by multiplying r with table scale and truncate to integer */
484 rt = _fjsp_mul_v2r8(r10,vftabscale);
485 itab_tmp = _fjsp_dtox_v2r8(rt);
486 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
487 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
488 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
493 /* CUBIC SPLINE TABLE ELECTROSTATICS */
494 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
495 F = _fjsp_setzero_v2r8();
496 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
497 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
498 H = _fjsp_setzero_v2r8();
499 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
500 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
501 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
502 velec = _fjsp_mul_v2r8(qq10,VV);
503 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
504 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,FF),_fjsp_mul_v2r8(vftabscale,rinv10)));
506 /* Update potential sum for this i atom from the interaction with this j atom. */
507 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
508 velecsum = _fjsp_add_v2r8(velecsum,velec);
512 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
514 /* Update vectorial force */
515 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
516 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
517 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
519 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
520 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
521 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
523 /**************************
524 * CALCULATE INTERACTIONS *
525 **************************/
527 r20 = _fjsp_mul_v2r8(rsq20,rinv20);
529 /* Compute parameters for interactions between i and j atoms */
530 qq20 = _fjsp_mul_v2r8(iq2,jq0);
532 /* Calculate table index by multiplying r with table scale and truncate to integer */
533 rt = _fjsp_mul_v2r8(r20,vftabscale);
534 itab_tmp = _fjsp_dtox_v2r8(rt);
535 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
536 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
537 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
542 /* CUBIC SPLINE TABLE ELECTROSTATICS */
543 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
544 F = _fjsp_setzero_v2r8();
545 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
546 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
547 H = _fjsp_setzero_v2r8();
548 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
549 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
550 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
551 velec = _fjsp_mul_v2r8(qq20,VV);
552 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
553 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,FF),_fjsp_mul_v2r8(vftabscale,rinv20)));
555 /* Update potential sum for this i atom from the interaction with this j atom. */
556 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
557 velecsum = _fjsp_add_v2r8(velecsum,velec);
561 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
563 /* Update vectorial force */
564 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
565 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
566 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
568 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
569 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
570 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
572 gmx_fjsp_decrement_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0);
574 /* Inner loop uses 154 flops */
577 /* End of innermost loop */
579 gmx_fjsp_update_iforce_3atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,
580 f+i_coord_offset,fshift+i_shift_offset);
583 /* Update potential energies */
584 gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
585 gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
587 /* Increment number of inner iterations */
588 inneriter += j_index_end - j_index_start;
590 /* Outer loop uses 20 flops */
593 /* Increment number of outer iterations */
596 /* Update outer/inner flops */
598 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3_VF,outeriter*20 + inneriter*154);
601 * Gromacs nonbonded kernel: nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sparc64_hpc_ace_double
602 * Electrostatics interaction: CubicSplineTable
603 * VdW interaction: LennardJones
604 * Geometry: Water3-Particle
605 * Calculate force/pot: Force
608 nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sparc64_hpc_ace_double
609 (t_nblist * gmx_restrict nlist,
610 rvec * gmx_restrict xx,
611 rvec * gmx_restrict ff,
612 t_forcerec * gmx_restrict fr,
613 t_mdatoms * gmx_restrict mdatoms,
614 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
615 t_nrnb * gmx_restrict nrnb)
617 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
618 * just 0 for non-waters.
619 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
620 * jnr indices corresponding to data put in the four positions in the SIMD register.
622 int i_shift_offset,i_coord_offset,outeriter,inneriter;
623 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
625 int j_coord_offsetA,j_coord_offsetB;
626 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
628 real *shiftvec,*fshift,*x,*f;
629 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
631 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
633 _fjsp_v2r8 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
635 _fjsp_v2r8 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
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 velec,felec,velecsum,facel,crf,krf,krf2;
644 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
647 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
648 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
649 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
652 _fjsp_v2r8 dummy_mask,cutoff_mask;
653 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
654 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
655 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
662 jindex = nlist->jindex;
664 shiftidx = nlist->shift;
666 shiftvec = fr->shift_vec[0];
667 fshift = fr->fshift[0];
668 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
669 charge = mdatoms->chargeA;
670 nvdwtype = fr->ntype;
672 vdwtype = mdatoms->typeA;
674 vftab = kernel_data->table_elec->data;
675 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_elec->scale);
677 /* Setup water-specific parameters */
678 inr = nlist->iinr[0];
679 iq0 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+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 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
684 /* Avoid stupid compiler warnings */
692 /* Start outer loop over neighborlists */
693 for(iidx=0; iidx<nri; iidx++)
695 /* Load shift vector for this list */
696 i_shift_offset = DIM*shiftidx[iidx];
698 /* Load limits for loop over neighbors */
699 j_index_start = jindex[iidx];
700 j_index_end = jindex[iidx+1];
702 /* Get outer coordinate index */
704 i_coord_offset = DIM*inr;
706 /* Load i particle coords and add shift vector */
707 gmx_fjsp_load_shift_and_3rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
708 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2);
710 fix0 = _fjsp_setzero_v2r8();
711 fiy0 = _fjsp_setzero_v2r8();
712 fiz0 = _fjsp_setzero_v2r8();
713 fix1 = _fjsp_setzero_v2r8();
714 fiy1 = _fjsp_setzero_v2r8();
715 fiz1 = _fjsp_setzero_v2r8();
716 fix2 = _fjsp_setzero_v2r8();
717 fiy2 = _fjsp_setzero_v2r8();
718 fiz2 = _fjsp_setzero_v2r8();
720 /* Start inner kernel loop */
721 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
724 /* Get j neighbor index, and coordinate index */
727 j_coord_offsetA = DIM*jnrA;
728 j_coord_offsetB = DIM*jnrB;
730 /* load j atom coordinates */
731 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
734 /* Calculate displacement vector */
735 dx00 = _fjsp_sub_v2r8(ix0,jx0);
736 dy00 = _fjsp_sub_v2r8(iy0,jy0);
737 dz00 = _fjsp_sub_v2r8(iz0,jz0);
738 dx10 = _fjsp_sub_v2r8(ix1,jx0);
739 dy10 = _fjsp_sub_v2r8(iy1,jy0);
740 dz10 = _fjsp_sub_v2r8(iz1,jz0);
741 dx20 = _fjsp_sub_v2r8(ix2,jx0);
742 dy20 = _fjsp_sub_v2r8(iy2,jy0);
743 dz20 = _fjsp_sub_v2r8(iz2,jz0);
745 /* Calculate squared distance and things based on it */
746 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
747 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
748 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
750 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
751 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
752 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
754 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
756 /* Load parameters for j particles */
757 jq0 = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
758 vdwjidx0A = 2*vdwtype[jnrA+0];
759 vdwjidx0B = 2*vdwtype[jnrB+0];
761 fjx0 = _fjsp_setzero_v2r8();
762 fjy0 = _fjsp_setzero_v2r8();
763 fjz0 = _fjsp_setzero_v2r8();
765 /**************************
766 * CALCULATE INTERACTIONS *
767 **************************/
769 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
771 /* Compute parameters for interactions between i and j atoms */
772 qq00 = _fjsp_mul_v2r8(iq0,jq0);
773 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
774 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
776 /* Calculate table index by multiplying r with table scale and truncate to integer */
777 rt = _fjsp_mul_v2r8(r00,vftabscale);
778 itab_tmp = _fjsp_dtox_v2r8(rt);
779 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
780 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
781 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
786 /* CUBIC SPLINE TABLE ELECTROSTATICS */
787 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
788 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
789 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
790 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
791 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
792 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
793 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
794 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
795 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq00,FF),_fjsp_mul_v2r8(vftabscale,rinv00)));
797 /* LENNARD-JONES DISPERSION/REPULSION */
799 rinvsix = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
800 fvdw = _fjsp_mul_v2r8(_fjsp_msub_v2r8(c12_00,rinvsix,c6_00),_fjsp_mul_v2r8(rinvsix,rinvsq00));
802 fscal = _fjsp_add_v2r8(felec,fvdw);
804 /* Update vectorial force */
805 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
806 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
807 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
809 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
810 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
811 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
813 /**************************
814 * CALCULATE INTERACTIONS *
815 **************************/
817 r10 = _fjsp_mul_v2r8(rsq10,rinv10);
819 /* Compute parameters for interactions between i and j atoms */
820 qq10 = _fjsp_mul_v2r8(iq1,jq0);
822 /* Calculate table index by multiplying r with table scale and truncate to integer */
823 rt = _fjsp_mul_v2r8(r10,vftabscale);
824 itab_tmp = _fjsp_dtox_v2r8(rt);
825 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
826 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
827 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
832 /* CUBIC SPLINE TABLE ELECTROSTATICS */
833 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
834 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
835 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
836 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
837 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
838 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
839 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
840 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
841 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,FF),_fjsp_mul_v2r8(vftabscale,rinv10)));
845 /* Update vectorial force */
846 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
847 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
848 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
850 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
851 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
852 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
854 /**************************
855 * CALCULATE INTERACTIONS *
856 **************************/
858 r20 = _fjsp_mul_v2r8(rsq20,rinv20);
860 /* Compute parameters for interactions between i and j atoms */
861 qq20 = _fjsp_mul_v2r8(iq2,jq0);
863 /* Calculate table index by multiplying r with table scale and truncate to integer */
864 rt = _fjsp_mul_v2r8(r20,vftabscale);
865 itab_tmp = _fjsp_dtox_v2r8(rt);
866 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
867 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
868 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
873 /* CUBIC SPLINE TABLE ELECTROSTATICS */
874 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
875 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
876 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
877 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
878 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
879 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
880 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
881 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
882 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,FF),_fjsp_mul_v2r8(vftabscale,rinv20)));
886 /* Update vectorial force */
887 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
888 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
889 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
891 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
892 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
893 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
895 gmx_fjsp_decrement_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0);
897 /* Inner loop uses 137 flops */
904 j_coord_offsetA = DIM*jnrA;
906 /* load j atom coordinates */
907 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
910 /* Calculate displacement vector */
911 dx00 = _fjsp_sub_v2r8(ix0,jx0);
912 dy00 = _fjsp_sub_v2r8(iy0,jy0);
913 dz00 = _fjsp_sub_v2r8(iz0,jz0);
914 dx10 = _fjsp_sub_v2r8(ix1,jx0);
915 dy10 = _fjsp_sub_v2r8(iy1,jy0);
916 dz10 = _fjsp_sub_v2r8(iz1,jz0);
917 dx20 = _fjsp_sub_v2r8(ix2,jx0);
918 dy20 = _fjsp_sub_v2r8(iy2,jy0);
919 dz20 = _fjsp_sub_v2r8(iz2,jz0);
921 /* Calculate squared distance and things based on it */
922 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
923 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
924 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
926 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
927 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
928 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
930 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
932 /* Load parameters for j particles */
933 jq0 = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
934 vdwjidx0A = 2*vdwtype[jnrA+0];
936 fjx0 = _fjsp_setzero_v2r8();
937 fjy0 = _fjsp_setzero_v2r8();
938 fjz0 = _fjsp_setzero_v2r8();
940 /**************************
941 * CALCULATE INTERACTIONS *
942 **************************/
944 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
946 /* Compute parameters for interactions between i and j atoms */
947 qq00 = _fjsp_mul_v2r8(iq0,jq0);
948 gmx_fjsp_load_1pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
950 /* Calculate table index by multiplying r with table scale and truncate to integer */
951 rt = _fjsp_mul_v2r8(r00,vftabscale);
952 itab_tmp = _fjsp_dtox_v2r8(rt);
953 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
954 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
955 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
960 /* CUBIC SPLINE TABLE ELECTROSTATICS */
961 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
962 F = _fjsp_setzero_v2r8();
963 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
964 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
965 H = _fjsp_setzero_v2r8();
966 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
967 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
968 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
969 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq00,FF),_fjsp_mul_v2r8(vftabscale,rinv00)));
971 /* LENNARD-JONES DISPERSION/REPULSION */
973 rinvsix = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
974 fvdw = _fjsp_mul_v2r8(_fjsp_msub_v2r8(c12_00,rinvsix,c6_00),_fjsp_mul_v2r8(rinvsix,rinvsq00));
976 fscal = _fjsp_add_v2r8(felec,fvdw);
978 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
980 /* Update vectorial force */
981 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
982 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
983 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
985 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
986 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
987 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
989 /**************************
990 * CALCULATE INTERACTIONS *
991 **************************/
993 r10 = _fjsp_mul_v2r8(rsq10,rinv10);
995 /* Compute parameters for interactions between i and j atoms */
996 qq10 = _fjsp_mul_v2r8(iq1,jq0);
998 /* Calculate table index by multiplying r with table scale and truncate to integer */
999 rt = _fjsp_mul_v2r8(r10,vftabscale);
1000 itab_tmp = _fjsp_dtox_v2r8(rt);
1001 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1002 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1003 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1008 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1009 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1010 F = _fjsp_setzero_v2r8();
1011 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1012 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1013 H = _fjsp_setzero_v2r8();
1014 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1015 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1016 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1017 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,FF),_fjsp_mul_v2r8(vftabscale,rinv10)));
1021 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1023 /* Update vectorial force */
1024 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
1025 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
1026 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
1028 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
1029 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
1030 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
1032 /**************************
1033 * CALCULATE INTERACTIONS *
1034 **************************/
1036 r20 = _fjsp_mul_v2r8(rsq20,rinv20);
1038 /* Compute parameters for interactions between i and j atoms */
1039 qq20 = _fjsp_mul_v2r8(iq2,jq0);
1041 /* Calculate table index by multiplying r with table scale and truncate to integer */
1042 rt = _fjsp_mul_v2r8(r20,vftabscale);
1043 itab_tmp = _fjsp_dtox_v2r8(rt);
1044 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1045 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1046 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1051 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1052 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1053 F = _fjsp_setzero_v2r8();
1054 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1055 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1056 H = _fjsp_setzero_v2r8();
1057 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1058 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1059 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1060 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,FF),_fjsp_mul_v2r8(vftabscale,rinv20)));
1064 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1066 /* Update vectorial force */
1067 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
1068 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
1069 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
1071 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
1072 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
1073 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
1075 gmx_fjsp_decrement_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0);
1077 /* Inner loop uses 137 flops */
1080 /* End of innermost loop */
1082 gmx_fjsp_update_iforce_3atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,
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 18 flops */
1091 /* Increment number of outer iterations */
1094 /* Update outer/inner flops */
1096 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3_F,outeriter*18 + inneriter*137);