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_ElecCSTab_VdwLJ_GeomW4P1_VF_sparc64_hpc_ace_double
53 * Electrostatics interaction: CubicSplineTable
54 * VdW interaction: LennardJones
55 * Geometry: Water4-Particle
56 * Calculate force/pot: PotentialAndForce
59 nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_sparc64_hpc_ace_double
60 (t_nblist * gmx_restrict nlist,
61 rvec * gmx_restrict xx,
62 rvec * gmx_restrict ff,
63 t_forcerec * gmx_restrict fr,
64 t_mdatoms * gmx_restrict mdatoms,
65 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
66 t_nrnb * gmx_restrict nrnb)
68 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
69 * just 0 for non-waters.
70 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
71 * jnr indices corresponding to data put in the four positions in the SIMD register.
73 int i_shift_offset,i_coord_offset,outeriter,inneriter;
74 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
76 int j_coord_offsetA,j_coord_offsetB;
77 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
79 real *shiftvec,*fshift,*x,*f;
80 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
82 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
84 _fjsp_v2r8 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
86 _fjsp_v2r8 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
88 _fjsp_v2r8 ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
89 int vdwjidx0A,vdwjidx0B;
90 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
91 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
92 _fjsp_v2r8 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
93 _fjsp_v2r8 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
94 _fjsp_v2r8 dx30,dy30,dz30,rsq30,rinv30,rinvsq30,r30,qq30,c6_30,c12_30;
95 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
98 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
101 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
102 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
103 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
106 _fjsp_v2r8 dummy_mask,cutoff_mask;
107 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
108 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
109 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
116 jindex = nlist->jindex;
118 shiftidx = nlist->shift;
120 shiftvec = fr->shift_vec[0];
121 fshift = fr->fshift[0];
122 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
123 charge = mdatoms->chargeA;
124 nvdwtype = fr->ntype;
126 vdwtype = mdatoms->typeA;
128 vftab = kernel_data->table_elec->data;
129 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_elec->scale);
131 /* Setup water-specific parameters */
132 inr = nlist->iinr[0];
133 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
134 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
135 iq3 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+3]));
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_4rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
162 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
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();
173 fix3 = _fjsp_setzero_v2r8();
174 fiy3 = _fjsp_setzero_v2r8();
175 fiz3 = _fjsp_setzero_v2r8();
177 /* Reset potential sums */
178 velecsum = _fjsp_setzero_v2r8();
179 vvdwsum = _fjsp_setzero_v2r8();
181 /* Start inner kernel loop */
182 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
185 /* Get j neighbor index, and coordinate index */
188 j_coord_offsetA = DIM*jnrA;
189 j_coord_offsetB = DIM*jnrB;
191 /* load j atom coordinates */
192 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
195 /* Calculate displacement vector */
196 dx00 = _fjsp_sub_v2r8(ix0,jx0);
197 dy00 = _fjsp_sub_v2r8(iy0,jy0);
198 dz00 = _fjsp_sub_v2r8(iz0,jz0);
199 dx10 = _fjsp_sub_v2r8(ix1,jx0);
200 dy10 = _fjsp_sub_v2r8(iy1,jy0);
201 dz10 = _fjsp_sub_v2r8(iz1,jz0);
202 dx20 = _fjsp_sub_v2r8(ix2,jx0);
203 dy20 = _fjsp_sub_v2r8(iy2,jy0);
204 dz20 = _fjsp_sub_v2r8(iz2,jz0);
205 dx30 = _fjsp_sub_v2r8(ix3,jx0);
206 dy30 = _fjsp_sub_v2r8(iy3,jy0);
207 dz30 = _fjsp_sub_v2r8(iz3,jz0);
209 /* Calculate squared distance and things based on it */
210 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
211 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
212 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
213 rsq30 = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
215 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
216 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
217 rinv30 = gmx_fjsp_invsqrt_v2r8(rsq30);
219 rinvsq00 = gmx_fjsp_inv_v2r8(rsq00);
221 /* Load parameters for j particles */
222 jq0 = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
223 vdwjidx0A = 2*vdwtype[jnrA+0];
224 vdwjidx0B = 2*vdwtype[jnrB+0];
226 fjx0 = _fjsp_setzero_v2r8();
227 fjy0 = _fjsp_setzero_v2r8();
228 fjz0 = _fjsp_setzero_v2r8();
230 /**************************
231 * CALCULATE INTERACTIONS *
232 **************************/
234 /* Compute parameters for interactions between i and j atoms */
235 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
236 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
238 /* LENNARD-JONES DISPERSION/REPULSION */
240 rinvsix = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
241 vvdw6 = _fjsp_mul_v2r8(c6_00,rinvsix);
242 vvdw12 = _fjsp_mul_v2r8(c12_00,_fjsp_mul_v2r8(rinvsix,rinvsix));
243 vvdw = _fjsp_msub_v2r8( vvdw12,one_twelfth, _fjsp_mul_v2r8(vvdw6,one_sixth) );
244 fvdw = _fjsp_mul_v2r8(_fjsp_sub_v2r8(vvdw12,vvdw6),rinvsq00);
246 /* Update potential sum for this i atom from the interaction with this j atom. */
247 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
251 /* Update vectorial force */
252 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
253 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
254 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
256 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
257 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
258 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
260 /**************************
261 * CALCULATE INTERACTIONS *
262 **************************/
264 r10 = _fjsp_mul_v2r8(rsq10,rinv10);
266 /* Compute parameters for interactions between i and j atoms */
267 qq10 = _fjsp_mul_v2r8(iq1,jq0);
269 /* Calculate table index by multiplying r with table scale and truncate to integer */
270 rt = _fjsp_mul_v2r8(r10,vftabscale);
271 itab_tmp = _fjsp_dtox_v2r8(rt);
272 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
273 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
274 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
279 /* CUBIC SPLINE TABLE ELECTROSTATICS */
280 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
281 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
282 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
283 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
284 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
285 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
286 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
287 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
288 velec = _fjsp_mul_v2r8(qq10,VV);
289 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
290 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,FF),_fjsp_mul_v2r8(vftabscale,rinv10)));
292 /* Update potential sum for this i atom from the interaction with this j atom. */
293 velecsum = _fjsp_add_v2r8(velecsum,velec);
297 /* Update vectorial force */
298 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
299 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
300 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
302 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
303 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
304 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
306 /**************************
307 * CALCULATE INTERACTIONS *
308 **************************/
310 r20 = _fjsp_mul_v2r8(rsq20,rinv20);
312 /* Compute parameters for interactions between i and j atoms */
313 qq20 = _fjsp_mul_v2r8(iq2,jq0);
315 /* Calculate table index by multiplying r with table scale and truncate to integer */
316 rt = _fjsp_mul_v2r8(r20,vftabscale);
317 itab_tmp = _fjsp_dtox_v2r8(rt);
318 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
319 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
320 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
325 /* CUBIC SPLINE TABLE ELECTROSTATICS */
326 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
327 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
328 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
329 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
330 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
331 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
332 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
333 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
334 velec = _fjsp_mul_v2r8(qq20,VV);
335 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
336 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,FF),_fjsp_mul_v2r8(vftabscale,rinv20)));
338 /* Update potential sum for this i atom from the interaction with this j atom. */
339 velecsum = _fjsp_add_v2r8(velecsum,velec);
343 /* Update vectorial force */
344 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
345 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
346 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
348 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
349 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
350 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
352 /**************************
353 * CALCULATE INTERACTIONS *
354 **************************/
356 r30 = _fjsp_mul_v2r8(rsq30,rinv30);
358 /* Compute parameters for interactions between i and j atoms */
359 qq30 = _fjsp_mul_v2r8(iq3,jq0);
361 /* Calculate table index by multiplying r with table scale and truncate to integer */
362 rt = _fjsp_mul_v2r8(r30,vftabscale);
363 itab_tmp = _fjsp_dtox_v2r8(rt);
364 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
365 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
366 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
371 /* CUBIC SPLINE TABLE ELECTROSTATICS */
372 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
373 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
374 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
375 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
376 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
377 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
378 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
379 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
380 velec = _fjsp_mul_v2r8(qq30,VV);
381 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
382 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq30,FF),_fjsp_mul_v2r8(vftabscale,rinv30)));
384 /* Update potential sum for this i atom from the interaction with this j atom. */
385 velecsum = _fjsp_add_v2r8(velecsum,velec);
389 /* Update vectorial force */
390 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
391 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
392 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
394 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
395 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
396 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
398 gmx_fjsp_decrement_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0);
400 /* Inner loop uses 176 flops */
407 j_coord_offsetA = DIM*jnrA;
409 /* load j atom coordinates */
410 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
413 /* Calculate displacement vector */
414 dx00 = _fjsp_sub_v2r8(ix0,jx0);
415 dy00 = _fjsp_sub_v2r8(iy0,jy0);
416 dz00 = _fjsp_sub_v2r8(iz0,jz0);
417 dx10 = _fjsp_sub_v2r8(ix1,jx0);
418 dy10 = _fjsp_sub_v2r8(iy1,jy0);
419 dz10 = _fjsp_sub_v2r8(iz1,jz0);
420 dx20 = _fjsp_sub_v2r8(ix2,jx0);
421 dy20 = _fjsp_sub_v2r8(iy2,jy0);
422 dz20 = _fjsp_sub_v2r8(iz2,jz0);
423 dx30 = _fjsp_sub_v2r8(ix3,jx0);
424 dy30 = _fjsp_sub_v2r8(iy3,jy0);
425 dz30 = _fjsp_sub_v2r8(iz3,jz0);
427 /* Calculate squared distance and things based on it */
428 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
429 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
430 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
431 rsq30 = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
433 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
434 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
435 rinv30 = gmx_fjsp_invsqrt_v2r8(rsq30);
437 rinvsq00 = gmx_fjsp_inv_v2r8(rsq00);
439 /* Load parameters for j particles */
440 jq0 = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
441 vdwjidx0A = 2*vdwtype[jnrA+0];
443 fjx0 = _fjsp_setzero_v2r8();
444 fjy0 = _fjsp_setzero_v2r8();
445 fjz0 = _fjsp_setzero_v2r8();
447 /**************************
448 * CALCULATE INTERACTIONS *
449 **************************/
451 /* Compute parameters for interactions between i and j atoms */
452 gmx_fjsp_load_1pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
454 /* LENNARD-JONES DISPERSION/REPULSION */
456 rinvsix = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
457 vvdw6 = _fjsp_mul_v2r8(c6_00,rinvsix);
458 vvdw12 = _fjsp_mul_v2r8(c12_00,_fjsp_mul_v2r8(rinvsix,rinvsix));
459 vvdw = _fjsp_msub_v2r8( vvdw12,one_twelfth, _fjsp_mul_v2r8(vvdw6,one_sixth) );
460 fvdw = _fjsp_mul_v2r8(_fjsp_sub_v2r8(vvdw12,vvdw6),rinvsq00);
462 /* Update potential sum for this i atom from the interaction with this j atom. */
463 vvdw = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
464 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
468 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
470 /* Update vectorial force */
471 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
472 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
473 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
475 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
476 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
477 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
479 /**************************
480 * CALCULATE INTERACTIONS *
481 **************************/
483 r10 = _fjsp_mul_v2r8(rsq10,rinv10);
485 /* Compute parameters for interactions between i and j atoms */
486 qq10 = _fjsp_mul_v2r8(iq1,jq0);
488 /* Calculate table index by multiplying r with table scale and truncate to integer */
489 rt = _fjsp_mul_v2r8(r10,vftabscale);
490 itab_tmp = _fjsp_dtox_v2r8(rt);
491 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
492 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
493 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
498 /* CUBIC SPLINE TABLE ELECTROSTATICS */
499 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
500 F = _fjsp_setzero_v2r8();
501 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
502 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
503 H = _fjsp_setzero_v2r8();
504 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
505 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
506 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
507 velec = _fjsp_mul_v2r8(qq10,VV);
508 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
509 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,FF),_fjsp_mul_v2r8(vftabscale,rinv10)));
511 /* Update potential sum for this i atom from the interaction with this j atom. */
512 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
513 velecsum = _fjsp_add_v2r8(velecsum,velec);
517 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
519 /* Update vectorial force */
520 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
521 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
522 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
524 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
525 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
526 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
528 /**************************
529 * CALCULATE INTERACTIONS *
530 **************************/
532 r20 = _fjsp_mul_v2r8(rsq20,rinv20);
534 /* Compute parameters for interactions between i and j atoms */
535 qq20 = _fjsp_mul_v2r8(iq2,jq0);
537 /* Calculate table index by multiplying r with table scale and truncate to integer */
538 rt = _fjsp_mul_v2r8(r20,vftabscale);
539 itab_tmp = _fjsp_dtox_v2r8(rt);
540 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
541 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
542 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
547 /* CUBIC SPLINE TABLE ELECTROSTATICS */
548 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
549 F = _fjsp_setzero_v2r8();
550 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
551 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
552 H = _fjsp_setzero_v2r8();
553 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
554 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
555 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
556 velec = _fjsp_mul_v2r8(qq20,VV);
557 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
558 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,FF),_fjsp_mul_v2r8(vftabscale,rinv20)));
560 /* Update potential sum for this i atom from the interaction with this j atom. */
561 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
562 velecsum = _fjsp_add_v2r8(velecsum,velec);
566 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
568 /* Update vectorial force */
569 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
570 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
571 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
573 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
574 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
575 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
577 /**************************
578 * CALCULATE INTERACTIONS *
579 **************************/
581 r30 = _fjsp_mul_v2r8(rsq30,rinv30);
583 /* Compute parameters for interactions between i and j atoms */
584 qq30 = _fjsp_mul_v2r8(iq3,jq0);
586 /* Calculate table index by multiplying r with table scale and truncate to integer */
587 rt = _fjsp_mul_v2r8(r30,vftabscale);
588 itab_tmp = _fjsp_dtox_v2r8(rt);
589 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
590 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
591 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
596 /* CUBIC SPLINE TABLE ELECTROSTATICS */
597 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
598 F = _fjsp_setzero_v2r8();
599 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
600 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
601 H = _fjsp_setzero_v2r8();
602 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
603 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
604 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
605 velec = _fjsp_mul_v2r8(qq30,VV);
606 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
607 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq30,FF),_fjsp_mul_v2r8(vftabscale,rinv30)));
609 /* Update potential sum for this i atom from the interaction with this j atom. */
610 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
611 velecsum = _fjsp_add_v2r8(velecsum,velec);
615 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
617 /* Update vectorial force */
618 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
619 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
620 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
622 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
623 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
624 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
626 gmx_fjsp_decrement_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0);
628 /* Inner loop uses 176 flops */
631 /* End of innermost loop */
633 gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
634 f+i_coord_offset,fshift+i_shift_offset);
637 /* Update potential energies */
638 gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
639 gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
641 /* Increment number of inner iterations */
642 inneriter += j_index_end - j_index_start;
644 /* Outer loop uses 26 flops */
647 /* Increment number of outer iterations */
650 /* Update outer/inner flops */
652 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4_VF,outeriter*26 + inneriter*176);
655 * Gromacs nonbonded kernel: nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sparc64_hpc_ace_double
656 * Electrostatics interaction: CubicSplineTable
657 * VdW interaction: LennardJones
658 * Geometry: Water4-Particle
659 * Calculate force/pot: Force
662 nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sparc64_hpc_ace_double
663 (t_nblist * gmx_restrict nlist,
664 rvec * gmx_restrict xx,
665 rvec * gmx_restrict ff,
666 t_forcerec * gmx_restrict fr,
667 t_mdatoms * gmx_restrict mdatoms,
668 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
669 t_nrnb * gmx_restrict nrnb)
671 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
672 * just 0 for non-waters.
673 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
674 * jnr indices corresponding to data put in the four positions in the SIMD register.
676 int i_shift_offset,i_coord_offset,outeriter,inneriter;
677 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
679 int j_coord_offsetA,j_coord_offsetB;
680 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
682 real *shiftvec,*fshift,*x,*f;
683 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
685 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
687 _fjsp_v2r8 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
689 _fjsp_v2r8 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
691 _fjsp_v2r8 ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
692 int vdwjidx0A,vdwjidx0B;
693 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
694 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
695 _fjsp_v2r8 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
696 _fjsp_v2r8 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
697 _fjsp_v2r8 dx30,dy30,dz30,rsq30,rinv30,rinvsq30,r30,qq30,c6_30,c12_30;
698 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
701 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
704 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
705 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
706 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
709 _fjsp_v2r8 dummy_mask,cutoff_mask;
710 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
711 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
712 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
719 jindex = nlist->jindex;
721 shiftidx = nlist->shift;
723 shiftvec = fr->shift_vec[0];
724 fshift = fr->fshift[0];
725 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
726 charge = mdatoms->chargeA;
727 nvdwtype = fr->ntype;
729 vdwtype = mdatoms->typeA;
731 vftab = kernel_data->table_elec->data;
732 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_elec->scale);
734 /* Setup water-specific parameters */
735 inr = nlist->iinr[0];
736 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
737 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
738 iq3 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+3]));
739 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
741 /* Avoid stupid compiler warnings */
749 /* Start outer loop over neighborlists */
750 for(iidx=0; iidx<nri; iidx++)
752 /* Load shift vector for this list */
753 i_shift_offset = DIM*shiftidx[iidx];
755 /* Load limits for loop over neighbors */
756 j_index_start = jindex[iidx];
757 j_index_end = jindex[iidx+1];
759 /* Get outer coordinate index */
761 i_coord_offset = DIM*inr;
763 /* Load i particle coords and add shift vector */
764 gmx_fjsp_load_shift_and_4rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
765 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
767 fix0 = _fjsp_setzero_v2r8();
768 fiy0 = _fjsp_setzero_v2r8();
769 fiz0 = _fjsp_setzero_v2r8();
770 fix1 = _fjsp_setzero_v2r8();
771 fiy1 = _fjsp_setzero_v2r8();
772 fiz1 = _fjsp_setzero_v2r8();
773 fix2 = _fjsp_setzero_v2r8();
774 fiy2 = _fjsp_setzero_v2r8();
775 fiz2 = _fjsp_setzero_v2r8();
776 fix3 = _fjsp_setzero_v2r8();
777 fiy3 = _fjsp_setzero_v2r8();
778 fiz3 = _fjsp_setzero_v2r8();
780 /* Start inner kernel loop */
781 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
784 /* Get j neighbor index, and coordinate index */
787 j_coord_offsetA = DIM*jnrA;
788 j_coord_offsetB = DIM*jnrB;
790 /* load j atom coordinates */
791 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
794 /* Calculate displacement vector */
795 dx00 = _fjsp_sub_v2r8(ix0,jx0);
796 dy00 = _fjsp_sub_v2r8(iy0,jy0);
797 dz00 = _fjsp_sub_v2r8(iz0,jz0);
798 dx10 = _fjsp_sub_v2r8(ix1,jx0);
799 dy10 = _fjsp_sub_v2r8(iy1,jy0);
800 dz10 = _fjsp_sub_v2r8(iz1,jz0);
801 dx20 = _fjsp_sub_v2r8(ix2,jx0);
802 dy20 = _fjsp_sub_v2r8(iy2,jy0);
803 dz20 = _fjsp_sub_v2r8(iz2,jz0);
804 dx30 = _fjsp_sub_v2r8(ix3,jx0);
805 dy30 = _fjsp_sub_v2r8(iy3,jy0);
806 dz30 = _fjsp_sub_v2r8(iz3,jz0);
808 /* Calculate squared distance and things based on it */
809 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
810 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
811 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
812 rsq30 = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
814 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
815 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
816 rinv30 = gmx_fjsp_invsqrt_v2r8(rsq30);
818 rinvsq00 = gmx_fjsp_inv_v2r8(rsq00);
820 /* Load parameters for j particles */
821 jq0 = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
822 vdwjidx0A = 2*vdwtype[jnrA+0];
823 vdwjidx0B = 2*vdwtype[jnrB+0];
825 fjx0 = _fjsp_setzero_v2r8();
826 fjy0 = _fjsp_setzero_v2r8();
827 fjz0 = _fjsp_setzero_v2r8();
829 /**************************
830 * CALCULATE INTERACTIONS *
831 **************************/
833 /* Compute parameters for interactions between i and j atoms */
834 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
835 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
837 /* LENNARD-JONES DISPERSION/REPULSION */
839 rinvsix = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
840 fvdw = _fjsp_mul_v2r8(_fjsp_msub_v2r8(c12_00,rinvsix,c6_00),_fjsp_mul_v2r8(rinvsix,rinvsq00));
844 /* Update vectorial force */
845 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
846 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
847 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
849 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
850 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
851 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
853 /**************************
854 * CALCULATE INTERACTIONS *
855 **************************/
857 r10 = _fjsp_mul_v2r8(rsq10,rinv10);
859 /* Compute parameters for interactions between i and j atoms */
860 qq10 = _fjsp_mul_v2r8(iq1,jq0);
862 /* Calculate table index by multiplying r with table scale and truncate to integer */
863 rt = _fjsp_mul_v2r8(r10,vftabscale);
864 itab_tmp = _fjsp_dtox_v2r8(rt);
865 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
866 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
867 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
872 /* CUBIC SPLINE TABLE ELECTROSTATICS */
873 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
874 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
875 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
876 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
877 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
878 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
879 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
880 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
881 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,FF),_fjsp_mul_v2r8(vftabscale,rinv10)));
885 /* Update vectorial force */
886 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
887 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
888 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
890 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
891 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
892 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
894 /**************************
895 * CALCULATE INTERACTIONS *
896 **************************/
898 r20 = _fjsp_mul_v2r8(rsq20,rinv20);
900 /* Compute parameters for interactions between i and j atoms */
901 qq20 = _fjsp_mul_v2r8(iq2,jq0);
903 /* Calculate table index by multiplying r with table scale and truncate to integer */
904 rt = _fjsp_mul_v2r8(r20,vftabscale);
905 itab_tmp = _fjsp_dtox_v2r8(rt);
906 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
907 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
908 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
913 /* CUBIC SPLINE TABLE ELECTROSTATICS */
914 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
915 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
916 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
917 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
918 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
919 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
920 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
921 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
922 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,FF),_fjsp_mul_v2r8(vftabscale,rinv20)));
926 /* Update vectorial force */
927 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
928 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
929 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
931 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
932 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
933 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
935 /**************************
936 * CALCULATE INTERACTIONS *
937 **************************/
939 r30 = _fjsp_mul_v2r8(rsq30,rinv30);
941 /* Compute parameters for interactions between i and j atoms */
942 qq30 = _fjsp_mul_v2r8(iq3,jq0);
944 /* Calculate table index by multiplying r with table scale and truncate to integer */
945 rt = _fjsp_mul_v2r8(r30,vftabscale);
946 itab_tmp = _fjsp_dtox_v2r8(rt);
947 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
948 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
949 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
954 /* CUBIC SPLINE TABLE ELECTROSTATICS */
955 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
956 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
957 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
958 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
959 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
960 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
961 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
962 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
963 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq30,FF),_fjsp_mul_v2r8(vftabscale,rinv30)));
967 /* Update vectorial force */
968 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
969 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
970 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
972 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
973 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
974 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
976 gmx_fjsp_decrement_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0);
978 /* Inner loop uses 159 flops */
985 j_coord_offsetA = DIM*jnrA;
987 /* load j atom coordinates */
988 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
991 /* Calculate displacement vector */
992 dx00 = _fjsp_sub_v2r8(ix0,jx0);
993 dy00 = _fjsp_sub_v2r8(iy0,jy0);
994 dz00 = _fjsp_sub_v2r8(iz0,jz0);
995 dx10 = _fjsp_sub_v2r8(ix1,jx0);
996 dy10 = _fjsp_sub_v2r8(iy1,jy0);
997 dz10 = _fjsp_sub_v2r8(iz1,jz0);
998 dx20 = _fjsp_sub_v2r8(ix2,jx0);
999 dy20 = _fjsp_sub_v2r8(iy2,jy0);
1000 dz20 = _fjsp_sub_v2r8(iz2,jz0);
1001 dx30 = _fjsp_sub_v2r8(ix3,jx0);
1002 dy30 = _fjsp_sub_v2r8(iy3,jy0);
1003 dz30 = _fjsp_sub_v2r8(iz3,jz0);
1005 /* Calculate squared distance and things based on it */
1006 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
1007 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
1008 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
1009 rsq30 = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
1011 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
1012 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
1013 rinv30 = gmx_fjsp_invsqrt_v2r8(rsq30);
1015 rinvsq00 = gmx_fjsp_inv_v2r8(rsq00);
1017 /* Load parameters for j particles */
1018 jq0 = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
1019 vdwjidx0A = 2*vdwtype[jnrA+0];
1021 fjx0 = _fjsp_setzero_v2r8();
1022 fjy0 = _fjsp_setzero_v2r8();
1023 fjz0 = _fjsp_setzero_v2r8();
1025 /**************************
1026 * CALCULATE INTERACTIONS *
1027 **************************/
1029 /* Compute parameters for interactions between i and j atoms */
1030 gmx_fjsp_load_1pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
1032 /* LENNARD-JONES DISPERSION/REPULSION */
1034 rinvsix = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
1035 fvdw = _fjsp_mul_v2r8(_fjsp_msub_v2r8(c12_00,rinvsix,c6_00),_fjsp_mul_v2r8(rinvsix,rinvsq00));
1039 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1041 /* Update vectorial force */
1042 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
1043 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
1044 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
1046 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
1047 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
1048 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
1050 /**************************
1051 * CALCULATE INTERACTIONS *
1052 **************************/
1054 r10 = _fjsp_mul_v2r8(rsq10,rinv10);
1056 /* Compute parameters for interactions between i and j atoms */
1057 qq10 = _fjsp_mul_v2r8(iq1,jq0);
1059 /* Calculate table index by multiplying r with table scale and truncate to integer */
1060 rt = _fjsp_mul_v2r8(r10,vftabscale);
1061 itab_tmp = _fjsp_dtox_v2r8(rt);
1062 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1063 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1064 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1069 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1070 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1071 F = _fjsp_setzero_v2r8();
1072 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1073 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1074 H = _fjsp_setzero_v2r8();
1075 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1076 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1077 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1078 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,FF),_fjsp_mul_v2r8(vftabscale,rinv10)));
1082 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1084 /* Update vectorial force */
1085 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
1086 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
1087 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
1089 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
1090 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
1091 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
1093 /**************************
1094 * CALCULATE INTERACTIONS *
1095 **************************/
1097 r20 = _fjsp_mul_v2r8(rsq20,rinv20);
1099 /* Compute parameters for interactions between i and j atoms */
1100 qq20 = _fjsp_mul_v2r8(iq2,jq0);
1102 /* Calculate table index by multiplying r with table scale and truncate to integer */
1103 rt = _fjsp_mul_v2r8(r20,vftabscale);
1104 itab_tmp = _fjsp_dtox_v2r8(rt);
1105 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1106 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1107 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1112 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1113 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1114 F = _fjsp_setzero_v2r8();
1115 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1116 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1117 H = _fjsp_setzero_v2r8();
1118 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1119 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1120 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1121 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,FF),_fjsp_mul_v2r8(vftabscale,rinv20)));
1125 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1127 /* Update vectorial force */
1128 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
1129 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
1130 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
1132 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
1133 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
1134 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
1136 /**************************
1137 * CALCULATE INTERACTIONS *
1138 **************************/
1140 r30 = _fjsp_mul_v2r8(rsq30,rinv30);
1142 /* Compute parameters for interactions between i and j atoms */
1143 qq30 = _fjsp_mul_v2r8(iq3,jq0);
1145 /* Calculate table index by multiplying r with table scale and truncate to integer */
1146 rt = _fjsp_mul_v2r8(r30,vftabscale);
1147 itab_tmp = _fjsp_dtox_v2r8(rt);
1148 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1149 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1150 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1155 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1156 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1157 F = _fjsp_setzero_v2r8();
1158 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1159 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1160 H = _fjsp_setzero_v2r8();
1161 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1162 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1163 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1164 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq30,FF),_fjsp_mul_v2r8(vftabscale,rinv30)));
1168 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1170 /* Update vectorial force */
1171 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
1172 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
1173 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
1175 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
1176 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
1177 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
1179 gmx_fjsp_decrement_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0);
1181 /* Inner loop uses 159 flops */
1184 /* End of innermost loop */
1186 gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
1187 f+i_coord_offset,fshift+i_shift_offset);
1189 /* Increment number of inner iterations */
1190 inneriter += j_index_end - j_index_start;
1192 /* Outer loop uses 24 flops */
1195 /* Increment number of outer iterations */
1198 /* Update outer/inner flops */
1200 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4_F,outeriter*24 + inneriter*159);