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_GeomW3P1_VF_sparc64_hpc_ace_double
53 * Electrostatics interaction: ReactionField
54 * VdW interaction: CubicSplineTable
55 * Geometry: Water3-Particle
56 * Calculate force/pot: PotentialAndForce
59 nb_kernel_ElecRF_VdwCSTab_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 krf = gmx_fjsp_set1_v2r8(fr->ic->k_rf);
122 krf2 = gmx_fjsp_set1_v2r8(fr->ic->k_rf*2.0);
123 crf = gmx_fjsp_set1_v2r8(fr->ic->c_rf);
124 nvdwtype = fr->ntype;
126 vdwtype = mdatoms->typeA;
128 vftab = kernel_data->table_vdw->data;
129 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
131 /* Setup water-specific parameters */
132 inr = nlist->iinr[0];
133 iq0 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+0]));
134 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
135 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
136 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
138 /* Avoid stupid compiler warnings */
146 /* Start outer loop over neighborlists */
147 for(iidx=0; iidx<nri; iidx++)
149 /* Load shift vector for this list */
150 i_shift_offset = DIM*shiftidx[iidx];
152 /* Load limits for loop over neighbors */
153 j_index_start = jindex[iidx];
154 j_index_end = jindex[iidx+1];
156 /* Get outer coordinate index */
158 i_coord_offset = DIM*inr;
160 /* Load i particle coords and add shift vector */
161 gmx_fjsp_load_shift_and_3rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
162 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2);
164 fix0 = _fjsp_setzero_v2r8();
165 fiy0 = _fjsp_setzero_v2r8();
166 fiz0 = _fjsp_setzero_v2r8();
167 fix1 = _fjsp_setzero_v2r8();
168 fiy1 = _fjsp_setzero_v2r8();
169 fiz1 = _fjsp_setzero_v2r8();
170 fix2 = _fjsp_setzero_v2r8();
171 fiy2 = _fjsp_setzero_v2r8();
172 fiz2 = _fjsp_setzero_v2r8();
174 /* Reset potential sums */
175 velecsum = _fjsp_setzero_v2r8();
176 vvdwsum = _fjsp_setzero_v2r8();
178 /* Start inner kernel loop */
179 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
182 /* Get j neighbor index, and coordinate index */
185 j_coord_offsetA = DIM*jnrA;
186 j_coord_offsetB = DIM*jnrB;
188 /* load j atom coordinates */
189 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
192 /* Calculate displacement vector */
193 dx00 = _fjsp_sub_v2r8(ix0,jx0);
194 dy00 = _fjsp_sub_v2r8(iy0,jy0);
195 dz00 = _fjsp_sub_v2r8(iz0,jz0);
196 dx10 = _fjsp_sub_v2r8(ix1,jx0);
197 dy10 = _fjsp_sub_v2r8(iy1,jy0);
198 dz10 = _fjsp_sub_v2r8(iz1,jz0);
199 dx20 = _fjsp_sub_v2r8(ix2,jx0);
200 dy20 = _fjsp_sub_v2r8(iy2,jy0);
201 dz20 = _fjsp_sub_v2r8(iz2,jz0);
203 /* Calculate squared distance and things based on it */
204 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
205 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
206 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
208 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
209 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
210 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
212 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
213 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
214 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
216 /* Load parameters for j particles */
217 jq0 = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
218 vdwjidx0A = 2*vdwtype[jnrA+0];
219 vdwjidx0B = 2*vdwtype[jnrB+0];
221 fjx0 = _fjsp_setzero_v2r8();
222 fjy0 = _fjsp_setzero_v2r8();
223 fjz0 = _fjsp_setzero_v2r8();
225 /**************************
226 * CALCULATE INTERACTIONS *
227 **************************/
229 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
231 /* Compute parameters for interactions between i and j atoms */
232 qq00 = _fjsp_mul_v2r8(iq0,jq0);
233 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
234 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
236 /* Calculate table index by multiplying r with table scale and truncate to integer */
237 rt = _fjsp_mul_v2r8(r00,vftabscale);
238 itab_tmp = _fjsp_dtox_v2r8(rt);
239 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
240 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
241 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
246 /* REACTION-FIELD ELECTROSTATICS */
247 velec = _fjsp_mul_v2r8(qq00,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq00,rinv00),crf));
248 felec = _fjsp_mul_v2r8(qq00,_fjsp_msub_v2r8(rinv00,rinvsq00,krf2));
250 /* CUBIC SPLINE TABLE DISPERSION */
251 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
252 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
253 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
254 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
255 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
256 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
257 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
258 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
259 vvdw6 = _fjsp_mul_v2r8(c6_00,VV);
260 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
261 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
263 /* CUBIC SPLINE TABLE REPULSION */
264 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
265 F = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
266 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
267 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
268 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
269 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
270 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
271 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
272 vvdw12 = _fjsp_mul_v2r8(c12_00,VV);
273 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
274 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
275 vvdw = _fjsp_add_v2r8(vvdw12,vvdw6);
276 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
278 /* Update potential sum for this i atom from the interaction with this j atom. */
279 velecsum = _fjsp_add_v2r8(velecsum,velec);
280 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
282 fscal = _fjsp_add_v2r8(felec,fvdw);
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 /* REACTION-FIELD ELECTROSTATICS */
301 velec = _fjsp_mul_v2r8(qq10,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq10,rinv10),crf));
302 felec = _fjsp_mul_v2r8(qq10,_fjsp_msub_v2r8(rinv10,rinvsq10,krf2));
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 /* REACTION-FIELD ELECTROSTATICS */
326 velec = _fjsp_mul_v2r8(qq20,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq20,rinv20),crf));
327 felec = _fjsp_mul_v2r8(qq20,_fjsp_msub_v2r8(rinv20,rinvsq20,krf2));
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 gmx_fjsp_decrement_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0);
345 /* Inner loop uses 143 flops */
352 j_coord_offsetA = DIM*jnrA;
354 /* load j atom coordinates */
355 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
358 /* Calculate displacement vector */
359 dx00 = _fjsp_sub_v2r8(ix0,jx0);
360 dy00 = _fjsp_sub_v2r8(iy0,jy0);
361 dz00 = _fjsp_sub_v2r8(iz0,jz0);
362 dx10 = _fjsp_sub_v2r8(ix1,jx0);
363 dy10 = _fjsp_sub_v2r8(iy1,jy0);
364 dz10 = _fjsp_sub_v2r8(iz1,jz0);
365 dx20 = _fjsp_sub_v2r8(ix2,jx0);
366 dy20 = _fjsp_sub_v2r8(iy2,jy0);
367 dz20 = _fjsp_sub_v2r8(iz2,jz0);
369 /* Calculate squared distance and things based on it */
370 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
371 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
372 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
374 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
375 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
376 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
378 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
379 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
380 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
382 /* Load parameters for j particles */
383 jq0 = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
384 vdwjidx0A = 2*vdwtype[jnrA+0];
386 fjx0 = _fjsp_setzero_v2r8();
387 fjy0 = _fjsp_setzero_v2r8();
388 fjz0 = _fjsp_setzero_v2r8();
390 /**************************
391 * CALCULATE INTERACTIONS *
392 **************************/
394 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
396 /* Compute parameters for interactions between i and j atoms */
397 qq00 = _fjsp_mul_v2r8(iq0,jq0);
398 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
399 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
401 /* Calculate table index by multiplying r with table scale and truncate to integer */
402 rt = _fjsp_mul_v2r8(r00,vftabscale);
403 itab_tmp = _fjsp_dtox_v2r8(rt);
404 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
405 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
406 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
411 /* REACTION-FIELD ELECTROSTATICS */
412 velec = _fjsp_mul_v2r8(qq00,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq00,rinv00),crf));
413 felec = _fjsp_mul_v2r8(qq00,_fjsp_msub_v2r8(rinv00,rinvsq00,krf2));
415 /* CUBIC SPLINE TABLE DISPERSION */
416 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
417 F = _fjsp_setzero_v2r8();
418 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
419 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
420 H = _fjsp_setzero_v2r8();
421 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
422 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
423 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
424 vvdw6 = _fjsp_mul_v2r8(c6_00,VV);
425 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
426 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
428 /* CUBIC SPLINE TABLE REPULSION */
429 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
430 F = _fjsp_setzero_v2r8();
431 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
432 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
433 H = _fjsp_setzero_v2r8();
434 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
435 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
436 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
437 vvdw12 = _fjsp_mul_v2r8(c12_00,VV);
438 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
439 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
440 vvdw = _fjsp_add_v2r8(vvdw12,vvdw6);
441 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
443 /* Update potential sum for this i atom from the interaction with this j atom. */
444 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
445 velecsum = _fjsp_add_v2r8(velecsum,velec);
446 vvdw = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
447 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
449 fscal = _fjsp_add_v2r8(felec,fvdw);
451 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
453 /* Update vectorial force */
454 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
455 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
456 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
458 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
459 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
460 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
462 /**************************
463 * CALCULATE INTERACTIONS *
464 **************************/
466 /* Compute parameters for interactions between i and j atoms */
467 qq10 = _fjsp_mul_v2r8(iq1,jq0);
469 /* REACTION-FIELD ELECTROSTATICS */
470 velec = _fjsp_mul_v2r8(qq10,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq10,rinv10),crf));
471 felec = _fjsp_mul_v2r8(qq10,_fjsp_msub_v2r8(rinv10,rinvsq10,krf2));
473 /* Update potential sum for this i atom from the interaction with this j atom. */
474 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
475 velecsum = _fjsp_add_v2r8(velecsum,velec);
479 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
481 /* Update vectorial force */
482 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
483 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
484 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
486 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
487 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
488 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
490 /**************************
491 * CALCULATE INTERACTIONS *
492 **************************/
494 /* Compute parameters for interactions between i and j atoms */
495 qq20 = _fjsp_mul_v2r8(iq2,jq0);
497 /* REACTION-FIELD ELECTROSTATICS */
498 velec = _fjsp_mul_v2r8(qq20,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq20,rinv20),crf));
499 felec = _fjsp_mul_v2r8(qq20,_fjsp_msub_v2r8(rinv20,rinvsq20,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 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
511 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
512 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
514 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
515 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
516 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
518 gmx_fjsp_decrement_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0);
520 /* Inner loop uses 143 flops */
523 /* End of innermost loop */
525 gmx_fjsp_update_iforce_3atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,
526 f+i_coord_offset,fshift+i_shift_offset);
529 /* Update potential energies */
530 gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
531 gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
533 /* Increment number of inner iterations */
534 inneriter += j_index_end - j_index_start;
536 /* Outer loop uses 20 flops */
539 /* Increment number of outer iterations */
542 /* Update outer/inner flops */
544 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3_VF,outeriter*20 + inneriter*143);
547 * Gromacs nonbonded kernel: nb_kernel_ElecRF_VdwCSTab_GeomW3P1_F_sparc64_hpc_ace_double
548 * Electrostatics interaction: ReactionField
549 * VdW interaction: CubicSplineTable
550 * Geometry: Water3-Particle
551 * Calculate force/pot: Force
554 nb_kernel_ElecRF_VdwCSTab_GeomW3P1_F_sparc64_hpc_ace_double
555 (t_nblist * gmx_restrict nlist,
556 rvec * gmx_restrict xx,
557 rvec * gmx_restrict ff,
558 t_forcerec * gmx_restrict fr,
559 t_mdatoms * gmx_restrict mdatoms,
560 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
561 t_nrnb * gmx_restrict nrnb)
563 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
564 * just 0 for non-waters.
565 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
566 * jnr indices corresponding to data put in the four positions in the SIMD register.
568 int i_shift_offset,i_coord_offset,outeriter,inneriter;
569 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
571 int j_coord_offsetA,j_coord_offsetB;
572 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
574 real *shiftvec,*fshift,*x,*f;
575 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
577 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
579 _fjsp_v2r8 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
581 _fjsp_v2r8 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
582 int vdwjidx0A,vdwjidx0B;
583 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
584 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
585 _fjsp_v2r8 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
586 _fjsp_v2r8 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
587 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
590 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
593 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
594 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
595 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
598 _fjsp_v2r8 dummy_mask,cutoff_mask;
599 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
600 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
601 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
608 jindex = nlist->jindex;
610 shiftidx = nlist->shift;
612 shiftvec = fr->shift_vec[0];
613 fshift = fr->fshift[0];
614 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
615 charge = mdatoms->chargeA;
616 krf = gmx_fjsp_set1_v2r8(fr->ic->k_rf);
617 krf2 = gmx_fjsp_set1_v2r8(fr->ic->k_rf*2.0);
618 crf = gmx_fjsp_set1_v2r8(fr->ic->c_rf);
619 nvdwtype = fr->ntype;
621 vdwtype = mdatoms->typeA;
623 vftab = kernel_data->table_vdw->data;
624 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
626 /* Setup water-specific parameters */
627 inr = nlist->iinr[0];
628 iq0 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+0]));
629 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
630 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
631 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
633 /* Avoid stupid compiler warnings */
641 /* Start outer loop over neighborlists */
642 for(iidx=0; iidx<nri; iidx++)
644 /* Load shift vector for this list */
645 i_shift_offset = DIM*shiftidx[iidx];
647 /* Load limits for loop over neighbors */
648 j_index_start = jindex[iidx];
649 j_index_end = jindex[iidx+1];
651 /* Get outer coordinate index */
653 i_coord_offset = DIM*inr;
655 /* Load i particle coords and add shift vector */
656 gmx_fjsp_load_shift_and_3rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
657 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2);
659 fix0 = _fjsp_setzero_v2r8();
660 fiy0 = _fjsp_setzero_v2r8();
661 fiz0 = _fjsp_setzero_v2r8();
662 fix1 = _fjsp_setzero_v2r8();
663 fiy1 = _fjsp_setzero_v2r8();
664 fiz1 = _fjsp_setzero_v2r8();
665 fix2 = _fjsp_setzero_v2r8();
666 fiy2 = _fjsp_setzero_v2r8();
667 fiz2 = _fjsp_setzero_v2r8();
669 /* Start inner kernel loop */
670 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
673 /* Get j neighbor index, and coordinate index */
676 j_coord_offsetA = DIM*jnrA;
677 j_coord_offsetB = DIM*jnrB;
679 /* load j atom coordinates */
680 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
683 /* Calculate displacement vector */
684 dx00 = _fjsp_sub_v2r8(ix0,jx0);
685 dy00 = _fjsp_sub_v2r8(iy0,jy0);
686 dz00 = _fjsp_sub_v2r8(iz0,jz0);
687 dx10 = _fjsp_sub_v2r8(ix1,jx0);
688 dy10 = _fjsp_sub_v2r8(iy1,jy0);
689 dz10 = _fjsp_sub_v2r8(iz1,jz0);
690 dx20 = _fjsp_sub_v2r8(ix2,jx0);
691 dy20 = _fjsp_sub_v2r8(iy2,jy0);
692 dz20 = _fjsp_sub_v2r8(iz2,jz0);
694 /* Calculate squared distance and things based on it */
695 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
696 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
697 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
699 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
700 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
701 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
703 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
704 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
705 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
707 /* Load parameters for j particles */
708 jq0 = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
709 vdwjidx0A = 2*vdwtype[jnrA+0];
710 vdwjidx0B = 2*vdwtype[jnrB+0];
712 fjx0 = _fjsp_setzero_v2r8();
713 fjy0 = _fjsp_setzero_v2r8();
714 fjz0 = _fjsp_setzero_v2r8();
716 /**************************
717 * CALCULATE INTERACTIONS *
718 **************************/
720 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
722 /* Compute parameters for interactions between i and j atoms */
723 qq00 = _fjsp_mul_v2r8(iq0,jq0);
724 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
725 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
727 /* Calculate table index by multiplying r with table scale and truncate to integer */
728 rt = _fjsp_mul_v2r8(r00,vftabscale);
729 itab_tmp = _fjsp_dtox_v2r8(rt);
730 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
731 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
732 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
737 /* REACTION-FIELD ELECTROSTATICS */
738 felec = _fjsp_mul_v2r8(qq00,_fjsp_msub_v2r8(rinv00,rinvsq00,krf2));
740 /* CUBIC SPLINE TABLE DISPERSION */
741 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
742 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
743 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
744 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
745 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
746 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
747 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
748 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
749 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
751 /* CUBIC SPLINE TABLE REPULSION */
752 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
753 F = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
754 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
755 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
756 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
757 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
758 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
759 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
760 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
761 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
763 fscal = _fjsp_add_v2r8(felec,fvdw);
765 /* Update vectorial force */
766 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
767 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
768 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
770 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
771 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
772 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
774 /**************************
775 * CALCULATE INTERACTIONS *
776 **************************/
778 /* Compute parameters for interactions between i and j atoms */
779 qq10 = _fjsp_mul_v2r8(iq1,jq0);
781 /* REACTION-FIELD ELECTROSTATICS */
782 felec = _fjsp_mul_v2r8(qq10,_fjsp_msub_v2r8(rinv10,rinvsq10,krf2));
786 /* Update vectorial force */
787 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
788 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
789 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
791 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
792 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
793 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
795 /**************************
796 * CALCULATE INTERACTIONS *
797 **************************/
799 /* Compute parameters for interactions between i and j atoms */
800 qq20 = _fjsp_mul_v2r8(iq2,jq0);
802 /* REACTION-FIELD ELECTROSTATICS */
803 felec = _fjsp_mul_v2r8(qq20,_fjsp_msub_v2r8(rinv20,rinvsq20,krf2));
807 /* Update vectorial force */
808 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
809 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
810 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
812 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
813 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
814 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
816 gmx_fjsp_decrement_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0);
818 /* Inner loop uses 120 flops */
825 j_coord_offsetA = DIM*jnrA;
827 /* load j atom coordinates */
828 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
831 /* Calculate displacement vector */
832 dx00 = _fjsp_sub_v2r8(ix0,jx0);
833 dy00 = _fjsp_sub_v2r8(iy0,jy0);
834 dz00 = _fjsp_sub_v2r8(iz0,jz0);
835 dx10 = _fjsp_sub_v2r8(ix1,jx0);
836 dy10 = _fjsp_sub_v2r8(iy1,jy0);
837 dz10 = _fjsp_sub_v2r8(iz1,jz0);
838 dx20 = _fjsp_sub_v2r8(ix2,jx0);
839 dy20 = _fjsp_sub_v2r8(iy2,jy0);
840 dz20 = _fjsp_sub_v2r8(iz2,jz0);
842 /* Calculate squared distance and things based on it */
843 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
844 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
845 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
847 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
848 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
849 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
851 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
852 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
853 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
855 /* Load parameters for j particles */
856 jq0 = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
857 vdwjidx0A = 2*vdwtype[jnrA+0];
859 fjx0 = _fjsp_setzero_v2r8();
860 fjy0 = _fjsp_setzero_v2r8();
861 fjz0 = _fjsp_setzero_v2r8();
863 /**************************
864 * CALCULATE INTERACTIONS *
865 **************************/
867 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
869 /* Compute parameters for interactions between i and j atoms */
870 qq00 = _fjsp_mul_v2r8(iq0,jq0);
871 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
872 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
874 /* Calculate table index by multiplying r with table scale and truncate to integer */
875 rt = _fjsp_mul_v2r8(r00,vftabscale);
876 itab_tmp = _fjsp_dtox_v2r8(rt);
877 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
878 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
879 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
884 /* REACTION-FIELD ELECTROSTATICS */
885 felec = _fjsp_mul_v2r8(qq00,_fjsp_msub_v2r8(rinv00,rinvsq00,krf2));
887 /* CUBIC SPLINE TABLE DISPERSION */
888 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
889 F = _fjsp_setzero_v2r8();
890 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
891 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
892 H = _fjsp_setzero_v2r8();
893 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
894 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
895 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
896 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
898 /* CUBIC SPLINE TABLE REPULSION */
899 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
900 F = _fjsp_setzero_v2r8();
901 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
902 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
903 H = _fjsp_setzero_v2r8();
904 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
905 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
906 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
907 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
908 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
910 fscal = _fjsp_add_v2r8(felec,fvdw);
912 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
914 /* Update vectorial force */
915 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
916 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
917 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
919 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
920 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
921 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
923 /**************************
924 * CALCULATE INTERACTIONS *
925 **************************/
927 /* Compute parameters for interactions between i and j atoms */
928 qq10 = _fjsp_mul_v2r8(iq1,jq0);
930 /* REACTION-FIELD ELECTROSTATICS */
931 felec = _fjsp_mul_v2r8(qq10,_fjsp_msub_v2r8(rinv10,rinvsq10,krf2));
935 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
937 /* Update vectorial force */
938 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
939 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
940 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
942 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
943 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
944 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
946 /**************************
947 * CALCULATE INTERACTIONS *
948 **************************/
950 /* Compute parameters for interactions between i and j atoms */
951 qq20 = _fjsp_mul_v2r8(iq2,jq0);
953 /* REACTION-FIELD ELECTROSTATICS */
954 felec = _fjsp_mul_v2r8(qq20,_fjsp_msub_v2r8(rinv20,rinvsq20,krf2));
958 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
960 /* Update vectorial force */
961 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
962 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
963 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
965 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
966 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
967 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
969 gmx_fjsp_decrement_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0);
971 /* Inner loop uses 120 flops */
974 /* End of innermost loop */
976 gmx_fjsp_update_iforce_3atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,
977 f+i_coord_offset,fshift+i_shift_offset);
979 /* Increment number of inner iterations */
980 inneriter += j_index_end - j_index_start;
982 /* Outer loop uses 18 flops */
985 /* Increment number of outer iterations */
988 /* Update outer/inner flops */
990 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3_F,outeriter*18 + inneriter*120);