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/math/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_1pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
400 /* Calculate table index by multiplying r with table scale and truncate to integer */
401 rt = _fjsp_mul_v2r8(r00,vftabscale);
402 itab_tmp = _fjsp_dtox_v2r8(rt);
403 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
404 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
405 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
410 /* REACTION-FIELD ELECTROSTATICS */
411 velec = _fjsp_mul_v2r8(qq00,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq00,rinv00),crf));
412 felec = _fjsp_mul_v2r8(qq00,_fjsp_msub_v2r8(rinv00,rinvsq00,krf2));
414 /* CUBIC SPLINE TABLE DISPERSION */
415 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
416 F = _fjsp_setzero_v2r8();
417 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
418 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
419 H = _fjsp_setzero_v2r8();
420 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
421 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
422 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
423 vvdw6 = _fjsp_mul_v2r8(c6_00,VV);
424 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
425 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
427 /* CUBIC SPLINE TABLE REPULSION */
428 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
429 F = _fjsp_setzero_v2r8();
430 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
431 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
432 H = _fjsp_setzero_v2r8();
433 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
434 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
435 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
436 vvdw12 = _fjsp_mul_v2r8(c12_00,VV);
437 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
438 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
439 vvdw = _fjsp_add_v2r8(vvdw12,vvdw6);
440 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
442 /* Update potential sum for this i atom from the interaction with this j atom. */
443 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
444 velecsum = _fjsp_add_v2r8(velecsum,velec);
445 vvdw = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
446 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
448 fscal = _fjsp_add_v2r8(felec,fvdw);
450 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
452 /* Update vectorial force */
453 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
454 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
455 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
457 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
458 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
459 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
461 /**************************
462 * CALCULATE INTERACTIONS *
463 **************************/
465 /* Compute parameters for interactions between i and j atoms */
466 qq10 = _fjsp_mul_v2r8(iq1,jq0);
468 /* REACTION-FIELD ELECTROSTATICS */
469 velec = _fjsp_mul_v2r8(qq10,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq10,rinv10),crf));
470 felec = _fjsp_mul_v2r8(qq10,_fjsp_msub_v2r8(rinv10,rinvsq10,krf2));
472 /* Update potential sum for this i atom from the interaction with this j atom. */
473 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
474 velecsum = _fjsp_add_v2r8(velecsum,velec);
478 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
480 /* Update vectorial force */
481 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
482 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
483 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
485 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
486 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
487 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
489 /**************************
490 * CALCULATE INTERACTIONS *
491 **************************/
493 /* Compute parameters for interactions between i and j atoms */
494 qq20 = _fjsp_mul_v2r8(iq2,jq0);
496 /* REACTION-FIELD ELECTROSTATICS */
497 velec = _fjsp_mul_v2r8(qq20,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq20,rinv20),crf));
498 felec = _fjsp_mul_v2r8(qq20,_fjsp_msub_v2r8(rinv20,rinvsq20,krf2));
500 /* Update potential sum for this i atom from the interaction with this j atom. */
501 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
502 velecsum = _fjsp_add_v2r8(velecsum,velec);
506 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
508 /* Update vectorial force */
509 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
510 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
511 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
513 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
514 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
515 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
517 gmx_fjsp_decrement_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0);
519 /* Inner loop uses 143 flops */
522 /* End of innermost loop */
524 gmx_fjsp_update_iforce_3atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,
525 f+i_coord_offset,fshift+i_shift_offset);
528 /* Update potential energies */
529 gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
530 gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
532 /* Increment number of inner iterations */
533 inneriter += j_index_end - j_index_start;
535 /* Outer loop uses 20 flops */
538 /* Increment number of outer iterations */
541 /* Update outer/inner flops */
543 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3_VF,outeriter*20 + inneriter*143);
546 * Gromacs nonbonded kernel: nb_kernel_ElecRF_VdwCSTab_GeomW3P1_F_sparc64_hpc_ace_double
547 * Electrostatics interaction: ReactionField
548 * VdW interaction: CubicSplineTable
549 * Geometry: Water3-Particle
550 * Calculate force/pot: Force
553 nb_kernel_ElecRF_VdwCSTab_GeomW3P1_F_sparc64_hpc_ace_double
554 (t_nblist * gmx_restrict nlist,
555 rvec * gmx_restrict xx,
556 rvec * gmx_restrict ff,
557 t_forcerec * gmx_restrict fr,
558 t_mdatoms * gmx_restrict mdatoms,
559 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
560 t_nrnb * gmx_restrict nrnb)
562 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
563 * just 0 for non-waters.
564 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
565 * jnr indices corresponding to data put in the four positions in the SIMD register.
567 int i_shift_offset,i_coord_offset,outeriter,inneriter;
568 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
570 int j_coord_offsetA,j_coord_offsetB;
571 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
573 real *shiftvec,*fshift,*x,*f;
574 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
576 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
578 _fjsp_v2r8 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
580 _fjsp_v2r8 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
581 int vdwjidx0A,vdwjidx0B;
582 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
583 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
584 _fjsp_v2r8 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
585 _fjsp_v2r8 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
586 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
589 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
592 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
593 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
594 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
597 _fjsp_v2r8 dummy_mask,cutoff_mask;
598 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
599 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
600 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
607 jindex = nlist->jindex;
609 shiftidx = nlist->shift;
611 shiftvec = fr->shift_vec[0];
612 fshift = fr->fshift[0];
613 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
614 charge = mdatoms->chargeA;
615 krf = gmx_fjsp_set1_v2r8(fr->ic->k_rf);
616 krf2 = gmx_fjsp_set1_v2r8(fr->ic->k_rf*2.0);
617 crf = gmx_fjsp_set1_v2r8(fr->ic->c_rf);
618 nvdwtype = fr->ntype;
620 vdwtype = mdatoms->typeA;
622 vftab = kernel_data->table_vdw->data;
623 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
625 /* Setup water-specific parameters */
626 inr = nlist->iinr[0];
627 iq0 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+0]));
628 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
629 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
630 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
632 /* Avoid stupid compiler warnings */
640 /* Start outer loop over neighborlists */
641 for(iidx=0; iidx<nri; iidx++)
643 /* Load shift vector for this list */
644 i_shift_offset = DIM*shiftidx[iidx];
646 /* Load limits for loop over neighbors */
647 j_index_start = jindex[iidx];
648 j_index_end = jindex[iidx+1];
650 /* Get outer coordinate index */
652 i_coord_offset = DIM*inr;
654 /* Load i particle coords and add shift vector */
655 gmx_fjsp_load_shift_and_3rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
656 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2);
658 fix0 = _fjsp_setzero_v2r8();
659 fiy0 = _fjsp_setzero_v2r8();
660 fiz0 = _fjsp_setzero_v2r8();
661 fix1 = _fjsp_setzero_v2r8();
662 fiy1 = _fjsp_setzero_v2r8();
663 fiz1 = _fjsp_setzero_v2r8();
664 fix2 = _fjsp_setzero_v2r8();
665 fiy2 = _fjsp_setzero_v2r8();
666 fiz2 = _fjsp_setzero_v2r8();
668 /* Start inner kernel loop */
669 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
672 /* Get j neighbor index, and coordinate index */
675 j_coord_offsetA = DIM*jnrA;
676 j_coord_offsetB = DIM*jnrB;
678 /* load j atom coordinates */
679 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
682 /* Calculate displacement vector */
683 dx00 = _fjsp_sub_v2r8(ix0,jx0);
684 dy00 = _fjsp_sub_v2r8(iy0,jy0);
685 dz00 = _fjsp_sub_v2r8(iz0,jz0);
686 dx10 = _fjsp_sub_v2r8(ix1,jx0);
687 dy10 = _fjsp_sub_v2r8(iy1,jy0);
688 dz10 = _fjsp_sub_v2r8(iz1,jz0);
689 dx20 = _fjsp_sub_v2r8(ix2,jx0);
690 dy20 = _fjsp_sub_v2r8(iy2,jy0);
691 dz20 = _fjsp_sub_v2r8(iz2,jz0);
693 /* Calculate squared distance and things based on it */
694 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
695 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
696 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
698 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
699 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
700 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
702 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
703 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
704 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
706 /* Load parameters for j particles */
707 jq0 = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
708 vdwjidx0A = 2*vdwtype[jnrA+0];
709 vdwjidx0B = 2*vdwtype[jnrB+0];
711 fjx0 = _fjsp_setzero_v2r8();
712 fjy0 = _fjsp_setzero_v2r8();
713 fjz0 = _fjsp_setzero_v2r8();
715 /**************************
716 * CALCULATE INTERACTIONS *
717 **************************/
719 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
721 /* Compute parameters for interactions between i and j atoms */
722 qq00 = _fjsp_mul_v2r8(iq0,jq0);
723 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
724 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
726 /* Calculate table index by multiplying r with table scale and truncate to integer */
727 rt = _fjsp_mul_v2r8(r00,vftabscale);
728 itab_tmp = _fjsp_dtox_v2r8(rt);
729 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
730 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
731 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
736 /* REACTION-FIELD ELECTROSTATICS */
737 felec = _fjsp_mul_v2r8(qq00,_fjsp_msub_v2r8(rinv00,rinvsq00,krf2));
739 /* CUBIC SPLINE TABLE DISPERSION */
740 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
741 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
742 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
743 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
744 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
745 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
746 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
747 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
748 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
750 /* CUBIC SPLINE TABLE REPULSION */
751 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
752 F = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
753 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
754 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
755 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
756 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
757 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
758 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
759 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
760 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
762 fscal = _fjsp_add_v2r8(felec,fvdw);
764 /* Update vectorial force */
765 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
766 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
767 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
769 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
770 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
771 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
773 /**************************
774 * CALCULATE INTERACTIONS *
775 **************************/
777 /* Compute parameters for interactions between i and j atoms */
778 qq10 = _fjsp_mul_v2r8(iq1,jq0);
780 /* REACTION-FIELD ELECTROSTATICS */
781 felec = _fjsp_mul_v2r8(qq10,_fjsp_msub_v2r8(rinv10,rinvsq10,krf2));
785 /* Update vectorial force */
786 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
787 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
788 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
790 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
791 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
792 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
794 /**************************
795 * CALCULATE INTERACTIONS *
796 **************************/
798 /* Compute parameters for interactions between i and j atoms */
799 qq20 = _fjsp_mul_v2r8(iq2,jq0);
801 /* REACTION-FIELD ELECTROSTATICS */
802 felec = _fjsp_mul_v2r8(qq20,_fjsp_msub_v2r8(rinv20,rinvsq20,krf2));
806 /* Update vectorial force */
807 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
808 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
809 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
811 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
812 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
813 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
815 gmx_fjsp_decrement_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0);
817 /* Inner loop uses 120 flops */
824 j_coord_offsetA = DIM*jnrA;
826 /* load j atom coordinates */
827 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
830 /* Calculate displacement vector */
831 dx00 = _fjsp_sub_v2r8(ix0,jx0);
832 dy00 = _fjsp_sub_v2r8(iy0,jy0);
833 dz00 = _fjsp_sub_v2r8(iz0,jz0);
834 dx10 = _fjsp_sub_v2r8(ix1,jx0);
835 dy10 = _fjsp_sub_v2r8(iy1,jy0);
836 dz10 = _fjsp_sub_v2r8(iz1,jz0);
837 dx20 = _fjsp_sub_v2r8(ix2,jx0);
838 dy20 = _fjsp_sub_v2r8(iy2,jy0);
839 dz20 = _fjsp_sub_v2r8(iz2,jz0);
841 /* Calculate squared distance and things based on it */
842 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
843 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
844 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
846 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
847 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
848 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
850 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
851 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
852 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
854 /* Load parameters for j particles */
855 jq0 = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
856 vdwjidx0A = 2*vdwtype[jnrA+0];
858 fjx0 = _fjsp_setzero_v2r8();
859 fjy0 = _fjsp_setzero_v2r8();
860 fjz0 = _fjsp_setzero_v2r8();
862 /**************************
863 * CALCULATE INTERACTIONS *
864 **************************/
866 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
868 /* Compute parameters for interactions between i and j atoms */
869 qq00 = _fjsp_mul_v2r8(iq0,jq0);
870 gmx_fjsp_load_1pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
872 /* Calculate table index by multiplying r with table scale and truncate to integer */
873 rt = _fjsp_mul_v2r8(r00,vftabscale);
874 itab_tmp = _fjsp_dtox_v2r8(rt);
875 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
876 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
877 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
882 /* REACTION-FIELD ELECTROSTATICS */
883 felec = _fjsp_mul_v2r8(qq00,_fjsp_msub_v2r8(rinv00,rinvsq00,krf2));
885 /* CUBIC SPLINE TABLE DISPERSION */
886 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
887 F = _fjsp_setzero_v2r8();
888 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
889 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
890 H = _fjsp_setzero_v2r8();
891 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
892 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
893 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
894 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
896 /* CUBIC SPLINE TABLE REPULSION */
897 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
898 F = _fjsp_setzero_v2r8();
899 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
900 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
901 H = _fjsp_setzero_v2r8();
902 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
903 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
904 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
905 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
906 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
908 fscal = _fjsp_add_v2r8(felec,fvdw);
910 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
912 /* Update vectorial force */
913 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
914 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
915 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
917 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
918 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
919 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
921 /**************************
922 * CALCULATE INTERACTIONS *
923 **************************/
925 /* Compute parameters for interactions between i and j atoms */
926 qq10 = _fjsp_mul_v2r8(iq1,jq0);
928 /* REACTION-FIELD ELECTROSTATICS */
929 felec = _fjsp_mul_v2r8(qq10,_fjsp_msub_v2r8(rinv10,rinvsq10,krf2));
933 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
935 /* Update vectorial force */
936 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
937 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
938 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
940 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
941 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
942 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
944 /**************************
945 * CALCULATE INTERACTIONS *
946 **************************/
948 /* Compute parameters for interactions between i and j atoms */
949 qq20 = _fjsp_mul_v2r8(iq2,jq0);
951 /* REACTION-FIELD ELECTROSTATICS */
952 felec = _fjsp_mul_v2r8(qq20,_fjsp_msub_v2r8(rinv20,rinvsq20,krf2));
956 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
958 /* Update vectorial force */
959 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
960 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
961 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
963 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
964 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
965 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
967 gmx_fjsp_decrement_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0);
969 /* Inner loop uses 120 flops */
972 /* End of innermost loop */
974 gmx_fjsp_update_iforce_3atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,
975 f+i_coord_offset,fshift+i_shift_offset);
977 /* Increment number of inner iterations */
978 inneriter += j_index_end - j_index_start;
980 /* Outer loop uses 18 flops */
983 /* Increment number of outer iterations */
986 /* Update outer/inner flops */
988 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3_F,outeriter*18 + inneriter*120);