2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
5 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6 * and including many others, as listed in the AUTHORS file in the
7 * top-level source directory and at http://www.gromacs.org.
9 * GROMACS is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 2.1
12 * of the License, or (at your option) any later version.
14 * GROMACS is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with GROMACS; if not, see
21 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 * If you want to redistribute modifications to GROMACS, please
25 * consider that scientific software is very special. Version
26 * control is crucial - bugs must be traceable. We will be happy to
27 * consider code for inclusion in the official distribution, but
28 * derived work must not be called official GROMACS. Details are found
29 * in the README & COPYING files - if they are missing, get the
30 * official version at http://www.gromacs.org.
32 * To help us fund GROMACS development, we humbly ask that you cite
33 * the research papers on the package. Check out http://www.gromacs.org.
36 * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
44 #include "../nb_kernel.h"
45 #include "types/simple.h"
46 #include "gromacs/legacyheaders/vec.h"
49 #include "kernelutil_sparc64_hpc_ace_double.h"
52 * Gromacs nonbonded kernel: nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_sparc64_hpc_ace_double
53 * Electrostatics interaction: ReactionField
54 * VdW interaction: CubicSplineTable
55 * Geometry: Water4-Particle
56 * Calculate force/pot: PotentialAndForce
59 nb_kernel_ElecRF_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 krf = gmx_fjsp_set1_v2r8(fr->ic->k_rf);
125 krf2 = gmx_fjsp_set1_v2r8(fr->ic->k_rf*2.0);
126 crf = gmx_fjsp_set1_v2r8(fr->ic->c_rf);
127 nvdwtype = fr->ntype;
129 vdwtype = mdatoms->typeA;
131 vftab = kernel_data->table_vdw->data;
132 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
134 /* Setup water-specific parameters */
135 inr = nlist->iinr[0];
136 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
137 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
138 iq3 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+3]));
139 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
141 /* Avoid stupid compiler warnings */
149 /* Start outer loop over neighborlists */
150 for(iidx=0; iidx<nri; iidx++)
152 /* Load shift vector for this list */
153 i_shift_offset = DIM*shiftidx[iidx];
155 /* Load limits for loop over neighbors */
156 j_index_start = jindex[iidx];
157 j_index_end = jindex[iidx+1];
159 /* Get outer coordinate index */
161 i_coord_offset = DIM*inr;
163 /* Load i particle coords and add shift vector */
164 gmx_fjsp_load_shift_and_4rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
165 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
167 fix0 = _fjsp_setzero_v2r8();
168 fiy0 = _fjsp_setzero_v2r8();
169 fiz0 = _fjsp_setzero_v2r8();
170 fix1 = _fjsp_setzero_v2r8();
171 fiy1 = _fjsp_setzero_v2r8();
172 fiz1 = _fjsp_setzero_v2r8();
173 fix2 = _fjsp_setzero_v2r8();
174 fiy2 = _fjsp_setzero_v2r8();
175 fiz2 = _fjsp_setzero_v2r8();
176 fix3 = _fjsp_setzero_v2r8();
177 fiy3 = _fjsp_setzero_v2r8();
178 fiz3 = _fjsp_setzero_v2r8();
180 /* Reset potential sums */
181 velecsum = _fjsp_setzero_v2r8();
182 vvdwsum = _fjsp_setzero_v2r8();
184 /* Start inner kernel loop */
185 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
188 /* Get j neighbor index, and coordinate index */
191 j_coord_offsetA = DIM*jnrA;
192 j_coord_offsetB = DIM*jnrB;
194 /* load j atom coordinates */
195 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
198 /* Calculate displacement vector */
199 dx00 = _fjsp_sub_v2r8(ix0,jx0);
200 dy00 = _fjsp_sub_v2r8(iy0,jy0);
201 dz00 = _fjsp_sub_v2r8(iz0,jz0);
202 dx10 = _fjsp_sub_v2r8(ix1,jx0);
203 dy10 = _fjsp_sub_v2r8(iy1,jy0);
204 dz10 = _fjsp_sub_v2r8(iz1,jz0);
205 dx20 = _fjsp_sub_v2r8(ix2,jx0);
206 dy20 = _fjsp_sub_v2r8(iy2,jy0);
207 dz20 = _fjsp_sub_v2r8(iz2,jz0);
208 dx30 = _fjsp_sub_v2r8(ix3,jx0);
209 dy30 = _fjsp_sub_v2r8(iy3,jy0);
210 dz30 = _fjsp_sub_v2r8(iz3,jz0);
212 /* Calculate squared distance and things based on it */
213 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
214 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
215 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
216 rsq30 = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
218 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
219 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
220 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
221 rinv30 = gmx_fjsp_invsqrt_v2r8(rsq30);
223 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
224 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
225 rinvsq30 = _fjsp_mul_v2r8(rinv30,rinv30);
227 /* Load parameters for j particles */
228 jq0 = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
229 vdwjidx0A = 2*vdwtype[jnrA+0];
230 vdwjidx0B = 2*vdwtype[jnrB+0];
232 fjx0 = _fjsp_setzero_v2r8();
233 fjy0 = _fjsp_setzero_v2r8();
234 fjz0 = _fjsp_setzero_v2r8();
236 /**************************
237 * CALCULATE INTERACTIONS *
238 **************************/
240 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
242 /* Compute parameters for interactions between i and j atoms */
243 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
244 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
246 /* Calculate table index by multiplying r with table scale and truncate to integer */
247 rt = _fjsp_mul_v2r8(r00,vftabscale);
248 itab_tmp = _fjsp_dtox_v2r8(rt);
249 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
250 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
251 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
256 /* CUBIC SPLINE TABLE DISPERSION */
257 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
258 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
259 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
260 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
261 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
262 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
263 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
264 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
265 vvdw6 = _fjsp_mul_v2r8(c6_00,VV);
266 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
267 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
269 /* CUBIC SPLINE TABLE REPULSION */
270 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
271 F = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
272 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
273 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
274 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
275 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
276 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
277 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
278 vvdw12 = _fjsp_mul_v2r8(c12_00,VV);
279 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
280 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
281 vvdw = _fjsp_add_v2r8(vvdw12,vvdw6);
282 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
284 /* Update potential sum for this i atom from the interaction with this j atom. */
285 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
289 /* Update vectorial force */
290 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
291 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
292 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
294 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
295 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
296 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
298 /**************************
299 * CALCULATE INTERACTIONS *
300 **************************/
302 /* Compute parameters for interactions between i and j atoms */
303 qq10 = _fjsp_mul_v2r8(iq1,jq0);
305 /* REACTION-FIELD ELECTROSTATICS */
306 velec = _fjsp_mul_v2r8(qq10,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq10,rinv10),crf));
307 felec = _fjsp_mul_v2r8(qq10,_fjsp_msub_v2r8(rinv10,rinvsq10,krf2));
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 /* Compute parameters for interactions between i and j atoms */
328 qq20 = _fjsp_mul_v2r8(iq2,jq0);
330 /* REACTION-FIELD ELECTROSTATICS */
331 velec = _fjsp_mul_v2r8(qq20,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq20,rinv20),crf));
332 felec = _fjsp_mul_v2r8(qq20,_fjsp_msub_v2r8(rinv20,rinvsq20,krf2));
334 /* Update potential sum for this i atom from the interaction with this j atom. */
335 velecsum = _fjsp_add_v2r8(velecsum,velec);
339 /* Update vectorial force */
340 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
341 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
342 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
344 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
345 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
346 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
348 /**************************
349 * CALCULATE INTERACTIONS *
350 **************************/
352 /* Compute parameters for interactions between i and j atoms */
353 qq30 = _fjsp_mul_v2r8(iq3,jq0);
355 /* REACTION-FIELD ELECTROSTATICS */
356 velec = _fjsp_mul_v2r8(qq30,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq30,rinv30),crf));
357 felec = _fjsp_mul_v2r8(qq30,_fjsp_msub_v2r8(rinv30,rinvsq30,krf2));
359 /* Update potential sum for this i atom from the interaction with this j atom. */
360 velecsum = _fjsp_add_v2r8(velecsum,velec);
364 /* Update vectorial force */
365 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
366 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
367 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
369 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
370 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
371 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
373 gmx_fjsp_decrement_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0);
375 /* Inner loop uses 167 flops */
382 j_coord_offsetA = DIM*jnrA;
384 /* load j atom coordinates */
385 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
388 /* Calculate displacement vector */
389 dx00 = _fjsp_sub_v2r8(ix0,jx0);
390 dy00 = _fjsp_sub_v2r8(iy0,jy0);
391 dz00 = _fjsp_sub_v2r8(iz0,jz0);
392 dx10 = _fjsp_sub_v2r8(ix1,jx0);
393 dy10 = _fjsp_sub_v2r8(iy1,jy0);
394 dz10 = _fjsp_sub_v2r8(iz1,jz0);
395 dx20 = _fjsp_sub_v2r8(ix2,jx0);
396 dy20 = _fjsp_sub_v2r8(iy2,jy0);
397 dz20 = _fjsp_sub_v2r8(iz2,jz0);
398 dx30 = _fjsp_sub_v2r8(ix3,jx0);
399 dy30 = _fjsp_sub_v2r8(iy3,jy0);
400 dz30 = _fjsp_sub_v2r8(iz3,jz0);
402 /* Calculate squared distance and things based on it */
403 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
404 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
405 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
406 rsq30 = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
408 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
409 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
410 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
411 rinv30 = gmx_fjsp_invsqrt_v2r8(rsq30);
413 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
414 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
415 rinvsq30 = _fjsp_mul_v2r8(rinv30,rinv30);
417 /* Load parameters for j particles */
418 jq0 = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
419 vdwjidx0A = 2*vdwtype[jnrA+0];
421 fjx0 = _fjsp_setzero_v2r8();
422 fjy0 = _fjsp_setzero_v2r8();
423 fjz0 = _fjsp_setzero_v2r8();
425 /**************************
426 * CALCULATE INTERACTIONS *
427 **************************/
429 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
431 /* Compute parameters for interactions between i and j atoms */
432 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
433 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
435 /* Calculate table index by multiplying r with table scale and truncate to integer */
436 rt = _fjsp_mul_v2r8(r00,vftabscale);
437 itab_tmp = _fjsp_dtox_v2r8(rt);
438 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
439 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
440 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
445 /* CUBIC SPLINE TABLE DISPERSION */
446 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
447 F = _fjsp_setzero_v2r8();
448 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
449 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
450 H = _fjsp_setzero_v2r8();
451 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
452 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
453 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
454 vvdw6 = _fjsp_mul_v2r8(c6_00,VV);
455 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
456 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
458 /* CUBIC SPLINE TABLE REPULSION */
459 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
460 F = _fjsp_setzero_v2r8();
461 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
462 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
463 H = _fjsp_setzero_v2r8();
464 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
465 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
466 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
467 vvdw12 = _fjsp_mul_v2r8(c12_00,VV);
468 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
469 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
470 vvdw = _fjsp_add_v2r8(vvdw12,vvdw6);
471 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
473 /* Update potential sum for this i atom from the interaction with this j atom. */
474 vvdw = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
475 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
479 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
481 /* Update vectorial force */
482 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
483 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
484 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
486 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
487 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
488 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
490 /**************************
491 * CALCULATE INTERACTIONS *
492 **************************/
494 /* Compute parameters for interactions between i and j atoms */
495 qq10 = _fjsp_mul_v2r8(iq1,jq0);
497 /* REACTION-FIELD ELECTROSTATICS */
498 velec = _fjsp_mul_v2r8(qq10,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq10,rinv10),crf));
499 felec = _fjsp_mul_v2r8(qq10,_fjsp_msub_v2r8(rinv10,rinvsq10,krf2));
501 /* Update potential sum for this i atom from the interaction with this j atom. */
502 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
503 velecsum = _fjsp_add_v2r8(velecsum,velec);
507 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
509 /* Update vectorial force */
510 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
511 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
512 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
514 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
515 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
516 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
518 /**************************
519 * CALCULATE INTERACTIONS *
520 **************************/
522 /* Compute parameters for interactions between i and j atoms */
523 qq20 = _fjsp_mul_v2r8(iq2,jq0);
525 /* REACTION-FIELD ELECTROSTATICS */
526 velec = _fjsp_mul_v2r8(qq20,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq20,rinv20),crf));
527 felec = _fjsp_mul_v2r8(qq20,_fjsp_msub_v2r8(rinv20,rinvsq20,krf2));
529 /* Update potential sum for this i atom from the interaction with this j atom. */
530 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
531 velecsum = _fjsp_add_v2r8(velecsum,velec);
535 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
537 /* Update vectorial force */
538 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
539 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
540 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
542 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
543 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
544 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
546 /**************************
547 * CALCULATE INTERACTIONS *
548 **************************/
550 /* Compute parameters for interactions between i and j atoms */
551 qq30 = _fjsp_mul_v2r8(iq3,jq0);
553 /* REACTION-FIELD ELECTROSTATICS */
554 velec = _fjsp_mul_v2r8(qq30,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq30,rinv30),crf));
555 felec = _fjsp_mul_v2r8(qq30,_fjsp_msub_v2r8(rinv30,rinvsq30,krf2));
557 /* Update potential sum for this i atom from the interaction with this j atom. */
558 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
559 velecsum = _fjsp_add_v2r8(velecsum,velec);
563 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
565 /* Update vectorial force */
566 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
567 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
568 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
570 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
571 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
572 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
574 gmx_fjsp_decrement_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0);
576 /* Inner loop uses 167 flops */
579 /* End of innermost loop */
581 gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
582 f+i_coord_offset,fshift+i_shift_offset);
585 /* Update potential energies */
586 gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
587 gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
589 /* Increment number of inner iterations */
590 inneriter += j_index_end - j_index_start;
592 /* Outer loop uses 26 flops */
595 /* Increment number of outer iterations */
598 /* Update outer/inner flops */
600 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4_VF,outeriter*26 + inneriter*167);
603 * Gromacs nonbonded kernel: nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_sparc64_hpc_ace_double
604 * Electrostatics interaction: ReactionField
605 * VdW interaction: CubicSplineTable
606 * Geometry: Water4-Particle
607 * Calculate force/pot: Force
610 nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_sparc64_hpc_ace_double
611 (t_nblist * gmx_restrict nlist,
612 rvec * gmx_restrict xx,
613 rvec * gmx_restrict ff,
614 t_forcerec * gmx_restrict fr,
615 t_mdatoms * gmx_restrict mdatoms,
616 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
617 t_nrnb * gmx_restrict nrnb)
619 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
620 * just 0 for non-waters.
621 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
622 * jnr indices corresponding to data put in the four positions in the SIMD register.
624 int i_shift_offset,i_coord_offset,outeriter,inneriter;
625 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
627 int j_coord_offsetA,j_coord_offsetB;
628 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
630 real *shiftvec,*fshift,*x,*f;
631 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
633 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
635 _fjsp_v2r8 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
637 _fjsp_v2r8 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
639 _fjsp_v2r8 ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
640 int vdwjidx0A,vdwjidx0B;
641 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
642 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
643 _fjsp_v2r8 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
644 _fjsp_v2r8 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
645 _fjsp_v2r8 dx30,dy30,dz30,rsq30,rinv30,rinvsq30,r30,qq30,c6_30,c12_30;
646 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
649 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
652 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
653 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
654 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
657 _fjsp_v2r8 dummy_mask,cutoff_mask;
658 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
659 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
660 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
667 jindex = nlist->jindex;
669 shiftidx = nlist->shift;
671 shiftvec = fr->shift_vec[0];
672 fshift = fr->fshift[0];
673 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
674 charge = mdatoms->chargeA;
675 krf = gmx_fjsp_set1_v2r8(fr->ic->k_rf);
676 krf2 = gmx_fjsp_set1_v2r8(fr->ic->k_rf*2.0);
677 crf = gmx_fjsp_set1_v2r8(fr->ic->c_rf);
678 nvdwtype = fr->ntype;
680 vdwtype = mdatoms->typeA;
682 vftab = kernel_data->table_vdw->data;
683 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
685 /* Setup water-specific parameters */
686 inr = nlist->iinr[0];
687 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
688 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
689 iq3 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+3]));
690 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
692 /* Avoid stupid compiler warnings */
700 /* Start outer loop over neighborlists */
701 for(iidx=0; iidx<nri; iidx++)
703 /* Load shift vector for this list */
704 i_shift_offset = DIM*shiftidx[iidx];
706 /* Load limits for loop over neighbors */
707 j_index_start = jindex[iidx];
708 j_index_end = jindex[iidx+1];
710 /* Get outer coordinate index */
712 i_coord_offset = DIM*inr;
714 /* Load i particle coords and add shift vector */
715 gmx_fjsp_load_shift_and_4rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
716 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
718 fix0 = _fjsp_setzero_v2r8();
719 fiy0 = _fjsp_setzero_v2r8();
720 fiz0 = _fjsp_setzero_v2r8();
721 fix1 = _fjsp_setzero_v2r8();
722 fiy1 = _fjsp_setzero_v2r8();
723 fiz1 = _fjsp_setzero_v2r8();
724 fix2 = _fjsp_setzero_v2r8();
725 fiy2 = _fjsp_setzero_v2r8();
726 fiz2 = _fjsp_setzero_v2r8();
727 fix3 = _fjsp_setzero_v2r8();
728 fiy3 = _fjsp_setzero_v2r8();
729 fiz3 = _fjsp_setzero_v2r8();
731 /* Start inner kernel loop */
732 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
735 /* Get j neighbor index, and coordinate index */
738 j_coord_offsetA = DIM*jnrA;
739 j_coord_offsetB = DIM*jnrB;
741 /* load j atom coordinates */
742 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
745 /* Calculate displacement vector */
746 dx00 = _fjsp_sub_v2r8(ix0,jx0);
747 dy00 = _fjsp_sub_v2r8(iy0,jy0);
748 dz00 = _fjsp_sub_v2r8(iz0,jz0);
749 dx10 = _fjsp_sub_v2r8(ix1,jx0);
750 dy10 = _fjsp_sub_v2r8(iy1,jy0);
751 dz10 = _fjsp_sub_v2r8(iz1,jz0);
752 dx20 = _fjsp_sub_v2r8(ix2,jx0);
753 dy20 = _fjsp_sub_v2r8(iy2,jy0);
754 dz20 = _fjsp_sub_v2r8(iz2,jz0);
755 dx30 = _fjsp_sub_v2r8(ix3,jx0);
756 dy30 = _fjsp_sub_v2r8(iy3,jy0);
757 dz30 = _fjsp_sub_v2r8(iz3,jz0);
759 /* Calculate squared distance and things based on it */
760 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
761 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
762 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
763 rsq30 = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
765 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
766 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
767 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
768 rinv30 = gmx_fjsp_invsqrt_v2r8(rsq30);
770 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
771 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
772 rinvsq30 = _fjsp_mul_v2r8(rinv30,rinv30);
774 /* Load parameters for j particles */
775 jq0 = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
776 vdwjidx0A = 2*vdwtype[jnrA+0];
777 vdwjidx0B = 2*vdwtype[jnrB+0];
779 fjx0 = _fjsp_setzero_v2r8();
780 fjy0 = _fjsp_setzero_v2r8();
781 fjz0 = _fjsp_setzero_v2r8();
783 /**************************
784 * CALCULATE INTERACTIONS *
785 **************************/
787 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
789 /* Compute parameters for interactions between i and j atoms */
790 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
791 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
793 /* Calculate table index by multiplying r with table scale and truncate to integer */
794 rt = _fjsp_mul_v2r8(r00,vftabscale);
795 itab_tmp = _fjsp_dtox_v2r8(rt);
796 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
797 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
798 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
803 /* CUBIC SPLINE TABLE DISPERSION */
804 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
805 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
806 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
807 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
808 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
809 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
810 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
811 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
812 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
814 /* CUBIC SPLINE TABLE REPULSION */
815 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
816 F = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
817 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
818 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
819 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
820 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
821 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
822 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
823 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
824 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
828 /* Update vectorial force */
829 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
830 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
831 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
833 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
834 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
835 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
837 /**************************
838 * CALCULATE INTERACTIONS *
839 **************************/
841 /* Compute parameters for interactions between i and j atoms */
842 qq10 = _fjsp_mul_v2r8(iq1,jq0);
844 /* REACTION-FIELD ELECTROSTATICS */
845 felec = _fjsp_mul_v2r8(qq10,_fjsp_msub_v2r8(rinv10,rinvsq10,krf2));
849 /* Update vectorial force */
850 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
851 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
852 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
854 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
855 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
856 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
858 /**************************
859 * CALCULATE INTERACTIONS *
860 **************************/
862 /* Compute parameters for interactions between i and j atoms */
863 qq20 = _fjsp_mul_v2r8(iq2,jq0);
865 /* REACTION-FIELD ELECTROSTATICS */
866 felec = _fjsp_mul_v2r8(qq20,_fjsp_msub_v2r8(rinv20,rinvsq20,krf2));
870 /* Update vectorial force */
871 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
872 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
873 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
875 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
876 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
877 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
879 /**************************
880 * CALCULATE INTERACTIONS *
881 **************************/
883 /* Compute parameters for interactions between i and j atoms */
884 qq30 = _fjsp_mul_v2r8(iq3,jq0);
886 /* REACTION-FIELD ELECTROSTATICS */
887 felec = _fjsp_mul_v2r8(qq30,_fjsp_msub_v2r8(rinv30,rinvsq30,krf2));
891 /* Update vectorial force */
892 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
893 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
894 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
896 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
897 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
898 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
900 gmx_fjsp_decrement_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0);
902 /* Inner loop uses 144 flops */
909 j_coord_offsetA = DIM*jnrA;
911 /* load j atom coordinates */
912 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
915 /* Calculate displacement vector */
916 dx00 = _fjsp_sub_v2r8(ix0,jx0);
917 dy00 = _fjsp_sub_v2r8(iy0,jy0);
918 dz00 = _fjsp_sub_v2r8(iz0,jz0);
919 dx10 = _fjsp_sub_v2r8(ix1,jx0);
920 dy10 = _fjsp_sub_v2r8(iy1,jy0);
921 dz10 = _fjsp_sub_v2r8(iz1,jz0);
922 dx20 = _fjsp_sub_v2r8(ix2,jx0);
923 dy20 = _fjsp_sub_v2r8(iy2,jy0);
924 dz20 = _fjsp_sub_v2r8(iz2,jz0);
925 dx30 = _fjsp_sub_v2r8(ix3,jx0);
926 dy30 = _fjsp_sub_v2r8(iy3,jy0);
927 dz30 = _fjsp_sub_v2r8(iz3,jz0);
929 /* Calculate squared distance and things based on it */
930 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
931 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
932 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
933 rsq30 = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
935 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
936 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
937 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
938 rinv30 = gmx_fjsp_invsqrt_v2r8(rsq30);
940 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
941 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
942 rinvsq30 = _fjsp_mul_v2r8(rinv30,rinv30);
944 /* Load parameters for j particles */
945 jq0 = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
946 vdwjidx0A = 2*vdwtype[jnrA+0];
948 fjx0 = _fjsp_setzero_v2r8();
949 fjy0 = _fjsp_setzero_v2r8();
950 fjz0 = _fjsp_setzero_v2r8();
952 /**************************
953 * CALCULATE INTERACTIONS *
954 **************************/
956 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
958 /* Compute parameters for interactions between i and j atoms */
959 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
960 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
962 /* Calculate table index by multiplying r with table scale and truncate to integer */
963 rt = _fjsp_mul_v2r8(r00,vftabscale);
964 itab_tmp = _fjsp_dtox_v2r8(rt);
965 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
966 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
967 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
972 /* CUBIC SPLINE TABLE DISPERSION */
973 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
974 F = _fjsp_setzero_v2r8();
975 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
976 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
977 H = _fjsp_setzero_v2r8();
978 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
979 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
980 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
981 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
983 /* CUBIC SPLINE TABLE REPULSION */
984 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
985 F = _fjsp_setzero_v2r8();
986 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
987 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
988 H = _fjsp_setzero_v2r8();
989 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
990 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
991 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
992 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
993 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
997 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
999 /* Update vectorial force */
1000 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
1001 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
1002 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
1004 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
1005 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
1006 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
1008 /**************************
1009 * CALCULATE INTERACTIONS *
1010 **************************/
1012 /* Compute parameters for interactions between i and j atoms */
1013 qq10 = _fjsp_mul_v2r8(iq1,jq0);
1015 /* REACTION-FIELD ELECTROSTATICS */
1016 felec = _fjsp_mul_v2r8(qq10,_fjsp_msub_v2r8(rinv10,rinvsq10,krf2));
1020 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1022 /* Update vectorial force */
1023 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
1024 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
1025 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
1027 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
1028 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
1029 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
1031 /**************************
1032 * CALCULATE INTERACTIONS *
1033 **************************/
1035 /* Compute parameters for interactions between i and j atoms */
1036 qq20 = _fjsp_mul_v2r8(iq2,jq0);
1038 /* REACTION-FIELD ELECTROSTATICS */
1039 felec = _fjsp_mul_v2r8(qq20,_fjsp_msub_v2r8(rinv20,rinvsq20,krf2));
1043 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1045 /* Update vectorial force */
1046 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
1047 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
1048 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
1050 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
1051 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
1052 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
1054 /**************************
1055 * CALCULATE INTERACTIONS *
1056 **************************/
1058 /* Compute parameters for interactions between i and j atoms */
1059 qq30 = _fjsp_mul_v2r8(iq3,jq0);
1061 /* REACTION-FIELD ELECTROSTATICS */
1062 felec = _fjsp_mul_v2r8(qq30,_fjsp_msub_v2r8(rinv30,rinvsq30,krf2));
1066 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1068 /* Update vectorial force */
1069 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
1070 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
1071 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
1073 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
1074 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
1075 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
1077 gmx_fjsp_decrement_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0);
1079 /* Inner loop uses 144 flops */
1082 /* End of innermost loop */
1084 gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
1085 f+i_coord_offset,fshift+i_shift_offset);
1087 /* Increment number of inner iterations */
1088 inneriter += j_index_end - j_index_start;
1090 /* Outer loop uses 24 flops */
1093 /* Increment number of outer iterations */
1096 /* Update outer/inner flops */
1098 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4_F,outeriter*24 + inneriter*144);