2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
5 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6 * and including many others, as listed in the AUTHORS file in the
7 * top-level source directory and at http://www.gromacs.org.
9 * GROMACS is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 2.1
12 * of the License, or (at your option) any later version.
14 * GROMACS is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with GROMACS; if not, see
21 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 * If you want to redistribute modifications to GROMACS, please
25 * consider that scientific software is very special. Version
26 * control is crucial - bugs must be traceable. We will be happy to
27 * consider code for inclusion in the official distribution, but
28 * derived work must not be called official GROMACS. Details are found
29 * in the README & COPYING files - if they are missing, get the
30 * official version at http://www.gromacs.org.
32 * To help us fund GROMACS development, we humbly ask that you cite
33 * the research papers on the package. Check out http://www.gromacs.org.
36 * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
44 #include "../nb_kernel.h"
45 #include "types/simple.h"
46 #include "gromacs/legacyheaders/vec.h"
49 #include "kernelutil_sparc64_hpc_ace_double.h"
52 * Gromacs nonbonded kernel: nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sparc64_hpc_ace_double
53 * Electrostatics interaction: CubicSplineTable
54 * VdW interaction: CubicSplineTable
55 * Geometry: Water4-Particle
56 * Calculate force/pot: PotentialAndForce
59 nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sparc64_hpc_ace_double
60 (t_nblist * gmx_restrict nlist,
61 rvec * gmx_restrict xx,
62 rvec * gmx_restrict ff,
63 t_forcerec * gmx_restrict fr,
64 t_mdatoms * gmx_restrict mdatoms,
65 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
66 t_nrnb * gmx_restrict nrnb)
68 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
69 * just 0 for non-waters.
70 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
71 * jnr indices corresponding to data put in the four positions in the SIMD register.
73 int i_shift_offset,i_coord_offset,outeriter,inneriter;
74 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
76 int j_coord_offsetA,j_coord_offsetB;
77 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
79 real *shiftvec,*fshift,*x,*f;
80 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
82 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
84 _fjsp_v2r8 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
86 _fjsp_v2r8 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
88 _fjsp_v2r8 ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
89 int vdwjidx0A,vdwjidx0B;
90 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
91 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
92 _fjsp_v2r8 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
93 _fjsp_v2r8 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
94 _fjsp_v2r8 dx30,dy30,dz30,rsq30,rinv30,rinvsq30,r30,qq30,c6_30,c12_30;
95 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
98 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
101 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
102 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
103 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
106 _fjsp_v2r8 dummy_mask,cutoff_mask;
107 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
108 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
109 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
116 jindex = nlist->jindex;
118 shiftidx = nlist->shift;
120 shiftvec = fr->shift_vec[0];
121 fshift = fr->fshift[0];
122 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
123 charge = mdatoms->chargeA;
124 nvdwtype = fr->ntype;
126 vdwtype = mdatoms->typeA;
128 vftab = kernel_data->table_elec_vdw->data;
129 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_elec_vdw->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 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
216 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
217 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
218 rinv30 = gmx_fjsp_invsqrt_v2r8(rsq30);
220 /* Load parameters for j particles */
221 jq0 = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
222 vdwjidx0A = 2*vdwtype[jnrA+0];
223 vdwjidx0B = 2*vdwtype[jnrB+0];
225 fjx0 = _fjsp_setzero_v2r8();
226 fjy0 = _fjsp_setzero_v2r8();
227 fjz0 = _fjsp_setzero_v2r8();
229 /**************************
230 * CALCULATE INTERACTIONS *
231 **************************/
233 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
235 /* Compute parameters for interactions between i and j atoms */
236 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
237 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
239 /* Calculate table index by multiplying r with table scale and truncate to integer */
240 rt = _fjsp_mul_v2r8(r00,vftabscale);
241 itab_tmp = _fjsp_dtox_v2r8(rt);
242 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
243 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
244 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
249 /* CUBIC SPLINE TABLE DISPERSION */
252 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
253 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
254 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
255 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
256 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
257 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
258 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
259 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
260 vvdw6 = _fjsp_mul_v2r8(c6_00,VV);
261 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
262 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
264 /* CUBIC SPLINE TABLE REPULSION */
265 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
266 F = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
267 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
268 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
269 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
270 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
271 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
272 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
273 vvdw12 = _fjsp_mul_v2r8(c12_00,VV);
274 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
275 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
276 vvdw = _fjsp_add_v2r8(vvdw12,vvdw6);
277 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
279 /* Update potential sum for this i atom from the interaction with this j atom. */
280 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
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 r10 = _fjsp_mul_v2r8(rsq10,rinv10);
299 /* Compute parameters for interactions between i and j atoms */
300 qq10 = _fjsp_mul_v2r8(iq1,jq0);
302 /* Calculate table index by multiplying r with table scale and truncate to integer */
303 rt = _fjsp_mul_v2r8(r10,vftabscale);
304 itab_tmp = _fjsp_dtox_v2r8(rt);
305 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
306 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
307 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
312 /* CUBIC SPLINE TABLE ELECTROSTATICS */
313 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
314 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
315 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
316 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
317 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
318 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
319 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
320 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
321 velec = _fjsp_mul_v2r8(qq10,VV);
322 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
323 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,FF),_fjsp_mul_v2r8(vftabscale,rinv10)));
325 /* Update potential sum for this i atom from the interaction with this j atom. */
326 velecsum = _fjsp_add_v2r8(velecsum,velec);
330 /* Update vectorial force */
331 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
332 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
333 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
335 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
336 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
337 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
339 /**************************
340 * CALCULATE INTERACTIONS *
341 **************************/
343 r20 = _fjsp_mul_v2r8(rsq20,rinv20);
345 /* Compute parameters for interactions between i and j atoms */
346 qq20 = _fjsp_mul_v2r8(iq2,jq0);
348 /* Calculate table index by multiplying r with table scale and truncate to integer */
349 rt = _fjsp_mul_v2r8(r20,vftabscale);
350 itab_tmp = _fjsp_dtox_v2r8(rt);
351 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
352 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
353 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
358 /* CUBIC SPLINE TABLE ELECTROSTATICS */
359 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
360 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
361 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
362 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
363 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
364 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
365 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
366 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
367 velec = _fjsp_mul_v2r8(qq20,VV);
368 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
369 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,FF),_fjsp_mul_v2r8(vftabscale,rinv20)));
371 /* Update potential sum for this i atom from the interaction with this j atom. */
372 velecsum = _fjsp_add_v2r8(velecsum,velec);
376 /* Update vectorial force */
377 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
378 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
379 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
381 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
382 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
383 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
385 /**************************
386 * CALCULATE INTERACTIONS *
387 **************************/
389 r30 = _fjsp_mul_v2r8(rsq30,rinv30);
391 /* Compute parameters for interactions between i and j atoms */
392 qq30 = _fjsp_mul_v2r8(iq3,jq0);
394 /* Calculate table index by multiplying r with table scale and truncate to integer */
395 rt = _fjsp_mul_v2r8(r30,vftabscale);
396 itab_tmp = _fjsp_dtox_v2r8(rt);
397 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
398 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
399 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
404 /* CUBIC SPLINE TABLE ELECTROSTATICS */
405 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
406 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
407 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
408 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
409 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
410 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
411 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
412 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
413 velec = _fjsp_mul_v2r8(qq30,VV);
414 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
415 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq30,FF),_fjsp_mul_v2r8(vftabscale,rinv30)));
417 /* Update potential sum for this i atom from the interaction with this j atom. */
418 velecsum = _fjsp_add_v2r8(velecsum,velec);
422 /* Update vectorial force */
423 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
424 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
425 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
427 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
428 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
429 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
431 gmx_fjsp_decrement_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0);
433 /* Inner loop uses 200 flops */
440 j_coord_offsetA = DIM*jnrA;
442 /* load j atom coordinates */
443 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
446 /* Calculate displacement vector */
447 dx00 = _fjsp_sub_v2r8(ix0,jx0);
448 dy00 = _fjsp_sub_v2r8(iy0,jy0);
449 dz00 = _fjsp_sub_v2r8(iz0,jz0);
450 dx10 = _fjsp_sub_v2r8(ix1,jx0);
451 dy10 = _fjsp_sub_v2r8(iy1,jy0);
452 dz10 = _fjsp_sub_v2r8(iz1,jz0);
453 dx20 = _fjsp_sub_v2r8(ix2,jx0);
454 dy20 = _fjsp_sub_v2r8(iy2,jy0);
455 dz20 = _fjsp_sub_v2r8(iz2,jz0);
456 dx30 = _fjsp_sub_v2r8(ix3,jx0);
457 dy30 = _fjsp_sub_v2r8(iy3,jy0);
458 dz30 = _fjsp_sub_v2r8(iz3,jz0);
460 /* Calculate squared distance and things based on it */
461 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
462 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
463 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
464 rsq30 = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
466 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
467 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
468 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
469 rinv30 = gmx_fjsp_invsqrt_v2r8(rsq30);
471 /* Load parameters for j particles */
472 jq0 = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
473 vdwjidx0A = 2*vdwtype[jnrA+0];
475 fjx0 = _fjsp_setzero_v2r8();
476 fjy0 = _fjsp_setzero_v2r8();
477 fjz0 = _fjsp_setzero_v2r8();
479 /**************************
480 * CALCULATE INTERACTIONS *
481 **************************/
483 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
485 /* Compute parameters for interactions between i and j atoms */
486 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
487 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
489 /* Calculate table index by multiplying r with table scale and truncate to integer */
490 rt = _fjsp_mul_v2r8(r00,vftabscale);
491 itab_tmp = _fjsp_dtox_v2r8(rt);
492 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
493 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
494 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
499 /* CUBIC SPLINE TABLE DISPERSION */
502 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
503 F = _fjsp_setzero_v2r8();
504 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
505 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
506 H = _fjsp_setzero_v2r8();
507 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
508 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
509 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
510 vvdw6 = _fjsp_mul_v2r8(c6_00,VV);
511 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
512 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
514 /* CUBIC SPLINE TABLE REPULSION */
515 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
516 F = _fjsp_setzero_v2r8();
517 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
518 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
519 H = _fjsp_setzero_v2r8();
520 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
521 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
522 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
523 vvdw12 = _fjsp_mul_v2r8(c12_00,VV);
524 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
525 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
526 vvdw = _fjsp_add_v2r8(vvdw12,vvdw6);
527 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
529 /* Update potential sum for this i atom from the interaction with this j atom. */
530 vvdw = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
531 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
535 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
537 /* Update vectorial force */
538 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
539 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
540 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
542 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
543 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
544 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
546 /**************************
547 * CALCULATE INTERACTIONS *
548 **************************/
550 r10 = _fjsp_mul_v2r8(rsq10,rinv10);
552 /* Compute parameters for interactions between i and j atoms */
553 qq10 = _fjsp_mul_v2r8(iq1,jq0);
555 /* Calculate table index by multiplying r with table scale and truncate to integer */
556 rt = _fjsp_mul_v2r8(r10,vftabscale);
557 itab_tmp = _fjsp_dtox_v2r8(rt);
558 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
559 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
560 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
565 /* CUBIC SPLINE TABLE ELECTROSTATICS */
566 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
567 F = _fjsp_setzero_v2r8();
568 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
569 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
570 H = _fjsp_setzero_v2r8();
571 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
572 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
573 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
574 velec = _fjsp_mul_v2r8(qq10,VV);
575 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
576 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,FF),_fjsp_mul_v2r8(vftabscale,rinv10)));
578 /* Update potential sum for this i atom from the interaction with this j atom. */
579 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
580 velecsum = _fjsp_add_v2r8(velecsum,velec);
584 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
586 /* Update vectorial force */
587 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
588 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
589 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
591 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
592 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
593 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
595 /**************************
596 * CALCULATE INTERACTIONS *
597 **************************/
599 r20 = _fjsp_mul_v2r8(rsq20,rinv20);
601 /* Compute parameters for interactions between i and j atoms */
602 qq20 = _fjsp_mul_v2r8(iq2,jq0);
604 /* Calculate table index by multiplying r with table scale and truncate to integer */
605 rt = _fjsp_mul_v2r8(r20,vftabscale);
606 itab_tmp = _fjsp_dtox_v2r8(rt);
607 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
608 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
609 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
614 /* CUBIC SPLINE TABLE ELECTROSTATICS */
615 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
616 F = _fjsp_setzero_v2r8();
617 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
618 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
619 H = _fjsp_setzero_v2r8();
620 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
621 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
622 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
623 velec = _fjsp_mul_v2r8(qq20,VV);
624 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
625 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,FF),_fjsp_mul_v2r8(vftabscale,rinv20)));
627 /* Update potential sum for this i atom from the interaction with this j atom. */
628 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
629 velecsum = _fjsp_add_v2r8(velecsum,velec);
633 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
635 /* Update vectorial force */
636 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
637 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
638 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
640 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
641 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
642 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
644 /**************************
645 * CALCULATE INTERACTIONS *
646 **************************/
648 r30 = _fjsp_mul_v2r8(rsq30,rinv30);
650 /* Compute parameters for interactions between i and j atoms */
651 qq30 = _fjsp_mul_v2r8(iq3,jq0);
653 /* Calculate table index by multiplying r with table scale and truncate to integer */
654 rt = _fjsp_mul_v2r8(r30,vftabscale);
655 itab_tmp = _fjsp_dtox_v2r8(rt);
656 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
657 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
658 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
663 /* CUBIC SPLINE TABLE ELECTROSTATICS */
664 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
665 F = _fjsp_setzero_v2r8();
666 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
667 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
668 H = _fjsp_setzero_v2r8();
669 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
670 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
671 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
672 velec = _fjsp_mul_v2r8(qq30,VV);
673 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
674 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq30,FF),_fjsp_mul_v2r8(vftabscale,rinv30)));
676 /* Update potential sum for this i atom from the interaction with this j atom. */
677 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
678 velecsum = _fjsp_add_v2r8(velecsum,velec);
682 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
684 /* Update vectorial force */
685 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
686 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
687 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
689 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
690 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
691 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
693 gmx_fjsp_decrement_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0);
695 /* Inner loop uses 200 flops */
698 /* End of innermost loop */
700 gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
701 f+i_coord_offset,fshift+i_shift_offset);
704 /* Update potential energies */
705 gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
706 gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
708 /* Increment number of inner iterations */
709 inneriter += j_index_end - j_index_start;
711 /* Outer loop uses 26 flops */
714 /* Increment number of outer iterations */
717 /* Update outer/inner flops */
719 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4_VF,outeriter*26 + inneriter*200);
722 * Gromacs nonbonded kernel: nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sparc64_hpc_ace_double
723 * Electrostatics interaction: CubicSplineTable
724 * VdW interaction: CubicSplineTable
725 * Geometry: Water4-Particle
726 * Calculate force/pot: Force
729 nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sparc64_hpc_ace_double
730 (t_nblist * gmx_restrict nlist,
731 rvec * gmx_restrict xx,
732 rvec * gmx_restrict ff,
733 t_forcerec * gmx_restrict fr,
734 t_mdatoms * gmx_restrict mdatoms,
735 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
736 t_nrnb * gmx_restrict nrnb)
738 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
739 * just 0 for non-waters.
740 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
741 * jnr indices corresponding to data put in the four positions in the SIMD register.
743 int i_shift_offset,i_coord_offset,outeriter,inneriter;
744 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
746 int j_coord_offsetA,j_coord_offsetB;
747 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
749 real *shiftvec,*fshift,*x,*f;
750 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
752 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
754 _fjsp_v2r8 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
756 _fjsp_v2r8 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
758 _fjsp_v2r8 ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
759 int vdwjidx0A,vdwjidx0B;
760 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
761 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
762 _fjsp_v2r8 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
763 _fjsp_v2r8 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
764 _fjsp_v2r8 dx30,dy30,dz30,rsq30,rinv30,rinvsq30,r30,qq30,c6_30,c12_30;
765 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
768 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
771 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
772 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
773 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
776 _fjsp_v2r8 dummy_mask,cutoff_mask;
777 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
778 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
779 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
786 jindex = nlist->jindex;
788 shiftidx = nlist->shift;
790 shiftvec = fr->shift_vec[0];
791 fshift = fr->fshift[0];
792 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
793 charge = mdatoms->chargeA;
794 nvdwtype = fr->ntype;
796 vdwtype = mdatoms->typeA;
798 vftab = kernel_data->table_elec_vdw->data;
799 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_elec_vdw->scale);
801 /* Setup water-specific parameters */
802 inr = nlist->iinr[0];
803 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
804 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
805 iq3 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+3]));
806 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
808 /* Avoid stupid compiler warnings */
816 /* Start outer loop over neighborlists */
817 for(iidx=0; iidx<nri; iidx++)
819 /* Load shift vector for this list */
820 i_shift_offset = DIM*shiftidx[iidx];
822 /* Load limits for loop over neighbors */
823 j_index_start = jindex[iidx];
824 j_index_end = jindex[iidx+1];
826 /* Get outer coordinate index */
828 i_coord_offset = DIM*inr;
830 /* Load i particle coords and add shift vector */
831 gmx_fjsp_load_shift_and_4rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
832 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
834 fix0 = _fjsp_setzero_v2r8();
835 fiy0 = _fjsp_setzero_v2r8();
836 fiz0 = _fjsp_setzero_v2r8();
837 fix1 = _fjsp_setzero_v2r8();
838 fiy1 = _fjsp_setzero_v2r8();
839 fiz1 = _fjsp_setzero_v2r8();
840 fix2 = _fjsp_setzero_v2r8();
841 fiy2 = _fjsp_setzero_v2r8();
842 fiz2 = _fjsp_setzero_v2r8();
843 fix3 = _fjsp_setzero_v2r8();
844 fiy3 = _fjsp_setzero_v2r8();
845 fiz3 = _fjsp_setzero_v2r8();
847 /* Start inner kernel loop */
848 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
851 /* Get j neighbor index, and coordinate index */
854 j_coord_offsetA = DIM*jnrA;
855 j_coord_offsetB = DIM*jnrB;
857 /* load j atom coordinates */
858 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
861 /* Calculate displacement vector */
862 dx00 = _fjsp_sub_v2r8(ix0,jx0);
863 dy00 = _fjsp_sub_v2r8(iy0,jy0);
864 dz00 = _fjsp_sub_v2r8(iz0,jz0);
865 dx10 = _fjsp_sub_v2r8(ix1,jx0);
866 dy10 = _fjsp_sub_v2r8(iy1,jy0);
867 dz10 = _fjsp_sub_v2r8(iz1,jz0);
868 dx20 = _fjsp_sub_v2r8(ix2,jx0);
869 dy20 = _fjsp_sub_v2r8(iy2,jy0);
870 dz20 = _fjsp_sub_v2r8(iz2,jz0);
871 dx30 = _fjsp_sub_v2r8(ix3,jx0);
872 dy30 = _fjsp_sub_v2r8(iy3,jy0);
873 dz30 = _fjsp_sub_v2r8(iz3,jz0);
875 /* Calculate squared distance and things based on it */
876 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
877 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
878 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
879 rsq30 = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
881 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
882 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
883 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
884 rinv30 = gmx_fjsp_invsqrt_v2r8(rsq30);
886 /* Load parameters for j particles */
887 jq0 = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
888 vdwjidx0A = 2*vdwtype[jnrA+0];
889 vdwjidx0B = 2*vdwtype[jnrB+0];
891 fjx0 = _fjsp_setzero_v2r8();
892 fjy0 = _fjsp_setzero_v2r8();
893 fjz0 = _fjsp_setzero_v2r8();
895 /**************************
896 * CALCULATE INTERACTIONS *
897 **************************/
899 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
901 /* Compute parameters for interactions between i and j atoms */
902 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
903 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
905 /* Calculate table index by multiplying r with table scale and truncate to integer */
906 rt = _fjsp_mul_v2r8(r00,vftabscale);
907 itab_tmp = _fjsp_dtox_v2r8(rt);
908 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
909 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
910 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
915 /* CUBIC SPLINE TABLE DISPERSION */
918 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
919 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
920 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
921 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
922 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
923 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
924 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
925 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
926 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
928 /* CUBIC SPLINE TABLE REPULSION */
929 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
930 F = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
931 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
932 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
933 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
934 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
935 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
936 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
937 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
938 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
942 /* Update vectorial force */
943 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
944 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
945 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
947 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
948 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
949 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
951 /**************************
952 * CALCULATE INTERACTIONS *
953 **************************/
955 r10 = _fjsp_mul_v2r8(rsq10,rinv10);
957 /* Compute parameters for interactions between i and j atoms */
958 qq10 = _fjsp_mul_v2r8(iq1,jq0);
960 /* Calculate table index by multiplying r with table scale and truncate to integer */
961 rt = _fjsp_mul_v2r8(r10,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 ELECTROSTATICS */
971 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
972 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
973 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
974 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
975 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
976 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
977 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
978 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
979 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,FF),_fjsp_mul_v2r8(vftabscale,rinv10)));
983 /* Update vectorial force */
984 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
985 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
986 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
988 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
989 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
990 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
992 /**************************
993 * CALCULATE INTERACTIONS *
994 **************************/
996 r20 = _fjsp_mul_v2r8(rsq20,rinv20);
998 /* Compute parameters for interactions between i and j atoms */
999 qq20 = _fjsp_mul_v2r8(iq2,jq0);
1001 /* Calculate table index by multiplying r with table scale and truncate to integer */
1002 rt = _fjsp_mul_v2r8(r20,vftabscale);
1003 itab_tmp = _fjsp_dtox_v2r8(rt);
1004 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1005 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1006 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1011 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1012 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1013 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
1014 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1015 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1016 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
1017 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1018 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1019 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1020 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,FF),_fjsp_mul_v2r8(vftabscale,rinv20)));
1024 /* Update vectorial force */
1025 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
1026 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
1027 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
1029 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
1030 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
1031 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
1033 /**************************
1034 * CALCULATE INTERACTIONS *
1035 **************************/
1037 r30 = _fjsp_mul_v2r8(rsq30,rinv30);
1039 /* Compute parameters for interactions between i and j atoms */
1040 qq30 = _fjsp_mul_v2r8(iq3,jq0);
1042 /* Calculate table index by multiplying r with table scale and truncate to integer */
1043 rt = _fjsp_mul_v2r8(r30,vftabscale);
1044 itab_tmp = _fjsp_dtox_v2r8(rt);
1045 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1046 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1047 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1052 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1053 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1054 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
1055 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1056 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1057 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
1058 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1059 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1060 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1061 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq30,FF),_fjsp_mul_v2r8(vftabscale,rinv30)));
1065 /* Update vectorial force */
1066 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
1067 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
1068 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
1070 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
1071 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
1072 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
1074 gmx_fjsp_decrement_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0);
1076 /* Inner loop uses 180 flops */
1079 if(jidx<j_index_end)
1083 j_coord_offsetA = DIM*jnrA;
1085 /* load j atom coordinates */
1086 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
1089 /* Calculate displacement vector */
1090 dx00 = _fjsp_sub_v2r8(ix0,jx0);
1091 dy00 = _fjsp_sub_v2r8(iy0,jy0);
1092 dz00 = _fjsp_sub_v2r8(iz0,jz0);
1093 dx10 = _fjsp_sub_v2r8(ix1,jx0);
1094 dy10 = _fjsp_sub_v2r8(iy1,jy0);
1095 dz10 = _fjsp_sub_v2r8(iz1,jz0);
1096 dx20 = _fjsp_sub_v2r8(ix2,jx0);
1097 dy20 = _fjsp_sub_v2r8(iy2,jy0);
1098 dz20 = _fjsp_sub_v2r8(iz2,jz0);
1099 dx30 = _fjsp_sub_v2r8(ix3,jx0);
1100 dy30 = _fjsp_sub_v2r8(iy3,jy0);
1101 dz30 = _fjsp_sub_v2r8(iz3,jz0);
1103 /* Calculate squared distance and things based on it */
1104 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
1105 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
1106 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
1107 rsq30 = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
1109 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
1110 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
1111 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
1112 rinv30 = gmx_fjsp_invsqrt_v2r8(rsq30);
1114 /* Load parameters for j particles */
1115 jq0 = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
1116 vdwjidx0A = 2*vdwtype[jnrA+0];
1118 fjx0 = _fjsp_setzero_v2r8();
1119 fjy0 = _fjsp_setzero_v2r8();
1120 fjz0 = _fjsp_setzero_v2r8();
1122 /**************************
1123 * CALCULATE INTERACTIONS *
1124 **************************/
1126 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
1128 /* Compute parameters for interactions between i and j atoms */
1129 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
1130 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
1132 /* Calculate table index by multiplying r with table scale and truncate to integer */
1133 rt = _fjsp_mul_v2r8(r00,vftabscale);
1134 itab_tmp = _fjsp_dtox_v2r8(rt);
1135 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1136 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1137 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1142 /* CUBIC SPLINE TABLE DISPERSION */
1145 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1146 F = _fjsp_setzero_v2r8();
1147 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1148 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
1149 H = _fjsp_setzero_v2r8();
1150 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1151 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
1152 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
1153 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
1155 /* CUBIC SPLINE TABLE REPULSION */
1156 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
1157 F = _fjsp_setzero_v2r8();
1158 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1159 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
1160 H = _fjsp_setzero_v2r8();
1161 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1162 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
1163 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
1164 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
1165 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
1169 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1171 /* Update vectorial force */
1172 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
1173 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
1174 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
1176 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
1177 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
1178 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
1180 /**************************
1181 * CALCULATE INTERACTIONS *
1182 **************************/
1184 r10 = _fjsp_mul_v2r8(rsq10,rinv10);
1186 /* Compute parameters for interactions between i and j atoms */
1187 qq10 = _fjsp_mul_v2r8(iq1,jq0);
1189 /* Calculate table index by multiplying r with table scale and truncate to integer */
1190 rt = _fjsp_mul_v2r8(r10,vftabscale);
1191 itab_tmp = _fjsp_dtox_v2r8(rt);
1192 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1193 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1194 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1199 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1200 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1201 F = _fjsp_setzero_v2r8();
1202 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1203 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1204 H = _fjsp_setzero_v2r8();
1205 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1206 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1207 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1208 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,FF),_fjsp_mul_v2r8(vftabscale,rinv10)));
1212 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1214 /* Update vectorial force */
1215 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
1216 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
1217 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
1219 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
1220 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
1221 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
1223 /**************************
1224 * CALCULATE INTERACTIONS *
1225 **************************/
1227 r20 = _fjsp_mul_v2r8(rsq20,rinv20);
1229 /* Compute parameters for interactions between i and j atoms */
1230 qq20 = _fjsp_mul_v2r8(iq2,jq0);
1232 /* Calculate table index by multiplying r with table scale and truncate to integer */
1233 rt = _fjsp_mul_v2r8(r20,vftabscale);
1234 itab_tmp = _fjsp_dtox_v2r8(rt);
1235 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1236 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1237 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1242 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1243 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1244 F = _fjsp_setzero_v2r8();
1245 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1246 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1247 H = _fjsp_setzero_v2r8();
1248 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1249 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1250 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1251 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,FF),_fjsp_mul_v2r8(vftabscale,rinv20)));
1255 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1257 /* Update vectorial force */
1258 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
1259 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
1260 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
1262 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
1263 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
1264 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
1266 /**************************
1267 * CALCULATE INTERACTIONS *
1268 **************************/
1270 r30 = _fjsp_mul_v2r8(rsq30,rinv30);
1272 /* Compute parameters for interactions between i and j atoms */
1273 qq30 = _fjsp_mul_v2r8(iq3,jq0);
1275 /* Calculate table index by multiplying r with table scale and truncate to integer */
1276 rt = _fjsp_mul_v2r8(r30,vftabscale);
1277 itab_tmp = _fjsp_dtox_v2r8(rt);
1278 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1279 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1280 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1285 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1286 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1287 F = _fjsp_setzero_v2r8();
1288 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1289 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1290 H = _fjsp_setzero_v2r8();
1291 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1292 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1293 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1294 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq30,FF),_fjsp_mul_v2r8(vftabscale,rinv30)));
1298 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1300 /* Update vectorial force */
1301 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
1302 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
1303 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
1305 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
1306 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
1307 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
1309 gmx_fjsp_decrement_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0);
1311 /* Inner loop uses 180 flops */
1314 /* End of innermost loop */
1316 gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
1317 f+i_coord_offset,fshift+i_shift_offset);
1319 /* Increment number of inner iterations */
1320 inneriter += j_index_end - j_index_start;
1322 /* Outer loop uses 24 flops */
1325 /* Increment number of outer iterations */
1328 /* Update outer/inner flops */
1330 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4_F,outeriter*24 + inneriter*180);