2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2012, by the GROMACS development team, led by
5 * David van der Spoel, Berk Hess, Erik Lindahl, and including many
6 * others, as listed in the AUTHORS file in the top-level source
7 * directory and at http://www.gromacs.org.
9 * GROMACS is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 2.1
12 * of the License, or (at your option) any later version.
14 * GROMACS is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with GROMACS; if not, see
21 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 * If you want to redistribute modifications to GROMACS, please
25 * consider that scientific software is very special. Version
26 * control is crucial - bugs must be traceable. We will be happy to
27 * consider code for inclusion in the official distribution, but
28 * derived work must not be called official GROMACS. Details are found
29 * in the README & COPYING files - if they are missing, get the
30 * official version at http://www.gromacs.org.
32 * To help us fund GROMACS development, we humbly ask that you cite
33 * the research papers on the package. Check out http://www.gromacs.org.
36 * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
44 #include "../nb_kernel.h"
45 #include "types/simple.h"
49 #include "kernelutil_sparc64_hpc_ace_double.h"
52 * Gromacs nonbonded kernel: nb_kernel_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_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_1pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
434 /* Calculate table index by multiplying r with table scale and truncate to integer */
435 rt = _fjsp_mul_v2r8(r00,vftabscale);
436 itab_tmp = _fjsp_dtox_v2r8(rt);
437 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
438 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
439 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
444 /* CUBIC SPLINE TABLE DISPERSION */
445 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
446 F = _fjsp_setzero_v2r8();
447 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
448 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
449 H = _fjsp_setzero_v2r8();
450 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
451 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
452 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
453 vvdw6 = _fjsp_mul_v2r8(c6_00,VV);
454 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
455 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
457 /* CUBIC SPLINE TABLE REPULSION */
458 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
459 F = _fjsp_setzero_v2r8();
460 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
461 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
462 H = _fjsp_setzero_v2r8();
463 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
464 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
465 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
466 vvdw12 = _fjsp_mul_v2r8(c12_00,VV);
467 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
468 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
469 vvdw = _fjsp_add_v2r8(vvdw12,vvdw6);
470 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
472 /* Update potential sum for this i atom from the interaction with this j atom. */
473 vvdw = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
474 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
478 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
480 /* Update vectorial force */
481 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
482 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
483 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
485 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
486 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
487 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
489 /**************************
490 * CALCULATE INTERACTIONS *
491 **************************/
493 /* Compute parameters for interactions between i and j atoms */
494 qq10 = _fjsp_mul_v2r8(iq1,jq0);
496 /* REACTION-FIELD ELECTROSTATICS */
497 velec = _fjsp_mul_v2r8(qq10,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq10,rinv10),crf));
498 felec = _fjsp_mul_v2r8(qq10,_fjsp_msub_v2r8(rinv10,rinvsq10,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 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
510 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
511 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
513 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
514 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
515 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
517 /**************************
518 * CALCULATE INTERACTIONS *
519 **************************/
521 /* Compute parameters for interactions between i and j atoms */
522 qq20 = _fjsp_mul_v2r8(iq2,jq0);
524 /* REACTION-FIELD ELECTROSTATICS */
525 velec = _fjsp_mul_v2r8(qq20,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq20,rinv20),crf));
526 felec = _fjsp_mul_v2r8(qq20,_fjsp_msub_v2r8(rinv20,rinvsq20,krf2));
528 /* Update potential sum for this i atom from the interaction with this j atom. */
529 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
530 velecsum = _fjsp_add_v2r8(velecsum,velec);
534 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
536 /* Update vectorial force */
537 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
538 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
539 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
541 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
542 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
543 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
545 /**************************
546 * CALCULATE INTERACTIONS *
547 **************************/
549 /* Compute parameters for interactions between i and j atoms */
550 qq30 = _fjsp_mul_v2r8(iq3,jq0);
552 /* REACTION-FIELD ELECTROSTATICS */
553 velec = _fjsp_mul_v2r8(qq30,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq30,rinv30),crf));
554 felec = _fjsp_mul_v2r8(qq30,_fjsp_msub_v2r8(rinv30,rinvsq30,krf2));
556 /* Update potential sum for this i atom from the interaction with this j atom. */
557 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
558 velecsum = _fjsp_add_v2r8(velecsum,velec);
562 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
564 /* Update vectorial force */
565 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
566 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
567 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
569 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
570 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
571 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
573 gmx_fjsp_decrement_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0);
575 /* Inner loop uses 167 flops */
578 /* End of innermost loop */
580 gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
581 f+i_coord_offset,fshift+i_shift_offset);
584 /* Update potential energies */
585 gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
586 gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
588 /* Increment number of inner iterations */
589 inneriter += j_index_end - j_index_start;
591 /* Outer loop uses 26 flops */
594 /* Increment number of outer iterations */
597 /* Update outer/inner flops */
599 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4_VF,outeriter*26 + inneriter*167);
602 * Gromacs nonbonded kernel: nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_sparc64_hpc_ace_double
603 * Electrostatics interaction: ReactionField
604 * VdW interaction: CubicSplineTable
605 * Geometry: Water4-Particle
606 * Calculate force/pot: Force
609 nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_sparc64_hpc_ace_double
610 (t_nblist * gmx_restrict nlist,
611 rvec * gmx_restrict xx,
612 rvec * gmx_restrict ff,
613 t_forcerec * gmx_restrict fr,
614 t_mdatoms * gmx_restrict mdatoms,
615 nb_kernel_data_t * gmx_restrict kernel_data,
616 t_nrnb * gmx_restrict nrnb)
618 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
619 * just 0 for non-waters.
620 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
621 * jnr indices corresponding to data put in the four positions in the SIMD register.
623 int i_shift_offset,i_coord_offset,outeriter,inneriter;
624 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
626 int j_coord_offsetA,j_coord_offsetB;
627 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
629 real *shiftvec,*fshift,*x,*f;
630 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
632 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
634 _fjsp_v2r8 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
636 _fjsp_v2r8 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
638 _fjsp_v2r8 ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
639 int vdwjidx0A,vdwjidx0B;
640 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
641 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
642 _fjsp_v2r8 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
643 _fjsp_v2r8 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
644 _fjsp_v2r8 dx30,dy30,dz30,rsq30,rinv30,rinvsq30,r30,qq30,c6_30,c12_30;
645 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
648 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
651 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
652 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
653 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
656 _fjsp_v2r8 dummy_mask,cutoff_mask;
657 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
658 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
659 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
666 jindex = nlist->jindex;
668 shiftidx = nlist->shift;
670 shiftvec = fr->shift_vec[0];
671 fshift = fr->fshift[0];
672 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
673 charge = mdatoms->chargeA;
674 krf = gmx_fjsp_set1_v2r8(fr->ic->k_rf);
675 krf2 = gmx_fjsp_set1_v2r8(fr->ic->k_rf*2.0);
676 crf = gmx_fjsp_set1_v2r8(fr->ic->c_rf);
677 nvdwtype = fr->ntype;
679 vdwtype = mdatoms->typeA;
681 vftab = kernel_data->table_vdw->data;
682 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
684 /* Setup water-specific parameters */
685 inr = nlist->iinr[0];
686 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
687 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
688 iq3 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+3]));
689 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
691 /* Avoid stupid compiler warnings */
699 /* Start outer loop over neighborlists */
700 for(iidx=0; iidx<nri; iidx++)
702 /* Load shift vector for this list */
703 i_shift_offset = DIM*shiftidx[iidx];
705 /* Load limits for loop over neighbors */
706 j_index_start = jindex[iidx];
707 j_index_end = jindex[iidx+1];
709 /* Get outer coordinate index */
711 i_coord_offset = DIM*inr;
713 /* Load i particle coords and add shift vector */
714 gmx_fjsp_load_shift_and_4rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
715 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
717 fix0 = _fjsp_setzero_v2r8();
718 fiy0 = _fjsp_setzero_v2r8();
719 fiz0 = _fjsp_setzero_v2r8();
720 fix1 = _fjsp_setzero_v2r8();
721 fiy1 = _fjsp_setzero_v2r8();
722 fiz1 = _fjsp_setzero_v2r8();
723 fix2 = _fjsp_setzero_v2r8();
724 fiy2 = _fjsp_setzero_v2r8();
725 fiz2 = _fjsp_setzero_v2r8();
726 fix3 = _fjsp_setzero_v2r8();
727 fiy3 = _fjsp_setzero_v2r8();
728 fiz3 = _fjsp_setzero_v2r8();
730 /* Start inner kernel loop */
731 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
734 /* Get j neighbor index, and coordinate index */
737 j_coord_offsetA = DIM*jnrA;
738 j_coord_offsetB = DIM*jnrB;
740 /* load j atom coordinates */
741 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
744 /* Calculate displacement vector */
745 dx00 = _fjsp_sub_v2r8(ix0,jx0);
746 dy00 = _fjsp_sub_v2r8(iy0,jy0);
747 dz00 = _fjsp_sub_v2r8(iz0,jz0);
748 dx10 = _fjsp_sub_v2r8(ix1,jx0);
749 dy10 = _fjsp_sub_v2r8(iy1,jy0);
750 dz10 = _fjsp_sub_v2r8(iz1,jz0);
751 dx20 = _fjsp_sub_v2r8(ix2,jx0);
752 dy20 = _fjsp_sub_v2r8(iy2,jy0);
753 dz20 = _fjsp_sub_v2r8(iz2,jz0);
754 dx30 = _fjsp_sub_v2r8(ix3,jx0);
755 dy30 = _fjsp_sub_v2r8(iy3,jy0);
756 dz30 = _fjsp_sub_v2r8(iz3,jz0);
758 /* Calculate squared distance and things based on it */
759 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
760 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
761 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
762 rsq30 = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
764 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
765 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
766 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
767 rinv30 = gmx_fjsp_invsqrt_v2r8(rsq30);
769 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
770 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
771 rinvsq30 = _fjsp_mul_v2r8(rinv30,rinv30);
773 /* Load parameters for j particles */
774 jq0 = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
775 vdwjidx0A = 2*vdwtype[jnrA+0];
776 vdwjidx0B = 2*vdwtype[jnrB+0];
778 fjx0 = _fjsp_setzero_v2r8();
779 fjy0 = _fjsp_setzero_v2r8();
780 fjz0 = _fjsp_setzero_v2r8();
782 /**************************
783 * CALCULATE INTERACTIONS *
784 **************************/
786 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
788 /* Compute parameters for interactions between i and j atoms */
789 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
790 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
792 /* Calculate table index by multiplying r with table scale and truncate to integer */
793 rt = _fjsp_mul_v2r8(r00,vftabscale);
794 itab_tmp = _fjsp_dtox_v2r8(rt);
795 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
796 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
797 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
802 /* CUBIC SPLINE TABLE DISPERSION */
803 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
804 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
805 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
806 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
807 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
808 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
809 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
810 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
811 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
813 /* CUBIC SPLINE TABLE REPULSION */
814 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
815 F = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
816 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
817 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
818 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
819 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
820 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
821 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
822 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
823 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
827 /* Update vectorial force */
828 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
829 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
830 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
832 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
833 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
834 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
836 /**************************
837 * CALCULATE INTERACTIONS *
838 **************************/
840 /* Compute parameters for interactions between i and j atoms */
841 qq10 = _fjsp_mul_v2r8(iq1,jq0);
843 /* REACTION-FIELD ELECTROSTATICS */
844 felec = _fjsp_mul_v2r8(qq10,_fjsp_msub_v2r8(rinv10,rinvsq10,krf2));
848 /* Update vectorial force */
849 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
850 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
851 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
853 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
854 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
855 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
857 /**************************
858 * CALCULATE INTERACTIONS *
859 **************************/
861 /* Compute parameters for interactions between i and j atoms */
862 qq20 = _fjsp_mul_v2r8(iq2,jq0);
864 /* REACTION-FIELD ELECTROSTATICS */
865 felec = _fjsp_mul_v2r8(qq20,_fjsp_msub_v2r8(rinv20,rinvsq20,krf2));
869 /* Update vectorial force */
870 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
871 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
872 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
874 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
875 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
876 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
878 /**************************
879 * CALCULATE INTERACTIONS *
880 **************************/
882 /* Compute parameters for interactions between i and j atoms */
883 qq30 = _fjsp_mul_v2r8(iq3,jq0);
885 /* REACTION-FIELD ELECTROSTATICS */
886 felec = _fjsp_mul_v2r8(qq30,_fjsp_msub_v2r8(rinv30,rinvsq30,krf2));
890 /* Update vectorial force */
891 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
892 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
893 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
895 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
896 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
897 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
899 gmx_fjsp_decrement_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0);
901 /* Inner loop uses 144 flops */
908 j_coord_offsetA = DIM*jnrA;
910 /* load j atom coordinates */
911 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
914 /* Calculate displacement vector */
915 dx00 = _fjsp_sub_v2r8(ix0,jx0);
916 dy00 = _fjsp_sub_v2r8(iy0,jy0);
917 dz00 = _fjsp_sub_v2r8(iz0,jz0);
918 dx10 = _fjsp_sub_v2r8(ix1,jx0);
919 dy10 = _fjsp_sub_v2r8(iy1,jy0);
920 dz10 = _fjsp_sub_v2r8(iz1,jz0);
921 dx20 = _fjsp_sub_v2r8(ix2,jx0);
922 dy20 = _fjsp_sub_v2r8(iy2,jy0);
923 dz20 = _fjsp_sub_v2r8(iz2,jz0);
924 dx30 = _fjsp_sub_v2r8(ix3,jx0);
925 dy30 = _fjsp_sub_v2r8(iy3,jy0);
926 dz30 = _fjsp_sub_v2r8(iz3,jz0);
928 /* Calculate squared distance and things based on it */
929 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
930 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
931 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
932 rsq30 = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
934 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
935 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
936 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
937 rinv30 = gmx_fjsp_invsqrt_v2r8(rsq30);
939 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
940 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
941 rinvsq30 = _fjsp_mul_v2r8(rinv30,rinv30);
943 /* Load parameters for j particles */
944 jq0 = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
945 vdwjidx0A = 2*vdwtype[jnrA+0];
947 fjx0 = _fjsp_setzero_v2r8();
948 fjy0 = _fjsp_setzero_v2r8();
949 fjz0 = _fjsp_setzero_v2r8();
951 /**************************
952 * CALCULATE INTERACTIONS *
953 **************************/
955 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
957 /* Compute parameters for interactions between i and j atoms */
958 gmx_fjsp_load_1pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
960 /* Calculate table index by multiplying r with table scale and truncate to integer */
961 rt = _fjsp_mul_v2r8(r00,vftabscale);
962 itab_tmp = _fjsp_dtox_v2r8(rt);
963 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
964 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
965 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
970 /* CUBIC SPLINE TABLE DISPERSION */
971 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
972 F = _fjsp_setzero_v2r8();
973 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
974 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
975 H = _fjsp_setzero_v2r8();
976 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
977 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
978 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
979 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
981 /* CUBIC SPLINE TABLE REPULSION */
982 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
983 F = _fjsp_setzero_v2r8();
984 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
985 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
986 H = _fjsp_setzero_v2r8();
987 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
988 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
989 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
990 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
991 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
995 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
997 /* Update vectorial force */
998 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
999 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
1000 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
1002 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
1003 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
1004 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
1006 /**************************
1007 * CALCULATE INTERACTIONS *
1008 **************************/
1010 /* Compute parameters for interactions between i and j atoms */
1011 qq10 = _fjsp_mul_v2r8(iq1,jq0);
1013 /* REACTION-FIELD ELECTROSTATICS */
1014 felec = _fjsp_mul_v2r8(qq10,_fjsp_msub_v2r8(rinv10,rinvsq10,krf2));
1018 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1020 /* Update vectorial force */
1021 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
1022 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
1023 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
1025 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
1026 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
1027 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
1029 /**************************
1030 * CALCULATE INTERACTIONS *
1031 **************************/
1033 /* Compute parameters for interactions between i and j atoms */
1034 qq20 = _fjsp_mul_v2r8(iq2,jq0);
1036 /* REACTION-FIELD ELECTROSTATICS */
1037 felec = _fjsp_mul_v2r8(qq20,_fjsp_msub_v2r8(rinv20,rinvsq20,krf2));
1041 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1043 /* Update vectorial force */
1044 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
1045 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
1046 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
1048 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
1049 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
1050 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
1052 /**************************
1053 * CALCULATE INTERACTIONS *
1054 **************************/
1056 /* Compute parameters for interactions between i and j atoms */
1057 qq30 = _fjsp_mul_v2r8(iq3,jq0);
1059 /* REACTION-FIELD ELECTROSTATICS */
1060 felec = _fjsp_mul_v2r8(qq30,_fjsp_msub_v2r8(rinv30,rinvsq30,krf2));
1064 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1066 /* Update vectorial force */
1067 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
1068 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
1069 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
1071 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
1072 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
1073 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
1075 gmx_fjsp_decrement_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0);
1077 /* Inner loop uses 144 flops */
1080 /* End of innermost loop */
1082 gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
1083 f+i_coord_offset,fshift+i_shift_offset);
1085 /* Increment number of inner iterations */
1086 inneriter += j_index_end - j_index_start;
1088 /* Outer loop uses 24 flops */
1091 /* Increment number of outer iterations */
1094 /* Update outer/inner flops */
1096 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4_F,outeriter*24 + inneriter*144);