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_VdwCSTab_GeomP1P1_VF_sparc64_hpc_ace_double
53 * Electrostatics interaction: CubicSplineTable
54 * VdW interaction: CubicSplineTable
55 * Geometry: Particle-Particle
56 * Calculate force/pot: PotentialAndForce
59 nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_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;
83 int vdwjidx0A,vdwjidx0B;
84 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
85 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
86 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
89 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
92 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
93 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
94 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
97 _fjsp_v2r8 dummy_mask,cutoff_mask;
98 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
99 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
100 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
107 jindex = nlist->jindex;
109 shiftidx = nlist->shift;
111 shiftvec = fr->shift_vec[0];
112 fshift = fr->fshift[0];
113 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
114 charge = mdatoms->chargeA;
115 nvdwtype = fr->ntype;
117 vdwtype = mdatoms->typeA;
119 vftab = kernel_data->table_elec_vdw->data;
120 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_elec_vdw->scale);
122 /* Avoid stupid compiler warnings */
130 /* Start outer loop over neighborlists */
131 for(iidx=0; iidx<nri; iidx++)
133 /* Load shift vector for this list */
134 i_shift_offset = DIM*shiftidx[iidx];
136 /* Load limits for loop over neighbors */
137 j_index_start = jindex[iidx];
138 j_index_end = jindex[iidx+1];
140 /* Get outer coordinate index */
142 i_coord_offset = DIM*inr;
144 /* Load i particle coords and add shift vector */
145 gmx_fjsp_load_shift_and_1rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
147 fix0 = _fjsp_setzero_v2r8();
148 fiy0 = _fjsp_setzero_v2r8();
149 fiz0 = _fjsp_setzero_v2r8();
151 /* Load parameters for i particles */
152 iq0 = _fjsp_mul_v2r8(facel,gmx_fjsp_load1_v2r8(charge+inr+0));
153 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
155 /* Reset potential sums */
156 velecsum = _fjsp_setzero_v2r8();
157 vvdwsum = _fjsp_setzero_v2r8();
159 /* Start inner kernel loop */
160 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
163 /* Get j neighbor index, and coordinate index */
166 j_coord_offsetA = DIM*jnrA;
167 j_coord_offsetB = DIM*jnrB;
169 /* load j atom coordinates */
170 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
173 /* Calculate displacement vector */
174 dx00 = _fjsp_sub_v2r8(ix0,jx0);
175 dy00 = _fjsp_sub_v2r8(iy0,jy0);
176 dz00 = _fjsp_sub_v2r8(iz0,jz0);
178 /* Calculate squared distance and things based on it */
179 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
181 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
183 /* Load parameters for j particles */
184 jq0 = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
185 vdwjidx0A = 2*vdwtype[jnrA+0];
186 vdwjidx0B = 2*vdwtype[jnrB+0];
188 /**************************
189 * CALCULATE INTERACTIONS *
190 **************************/
192 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
194 /* Compute parameters for interactions between i and j atoms */
195 qq00 = _fjsp_mul_v2r8(iq0,jq0);
196 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
197 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
199 /* Calculate table index by multiplying r with table scale and truncate to integer */
200 rt = _fjsp_mul_v2r8(r00,vftabscale);
201 itab_tmp = _fjsp_dtox_v2r8(rt);
202 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
203 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
204 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
209 /* CUBIC SPLINE TABLE ELECTROSTATICS */
210 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
211 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
212 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
213 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
214 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
215 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
216 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
217 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
218 velec = _fjsp_mul_v2r8(qq00,VV);
219 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
220 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq00,FF),_fjsp_mul_v2r8(vftabscale,rinv00)));
222 /* CUBIC SPLINE TABLE DISPERSION */
225 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
226 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
227 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
228 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
229 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
230 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
231 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
232 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
233 vvdw6 = _fjsp_mul_v2r8(c6_00,VV);
234 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
235 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
237 /* CUBIC SPLINE TABLE REPULSION */
238 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
239 F = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
240 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
241 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
242 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
243 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
244 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
245 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
246 vvdw12 = _fjsp_mul_v2r8(c12_00,VV);
247 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
248 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
249 vvdw = _fjsp_add_v2r8(vvdw12,vvdw6);
250 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
252 /* Update potential sum for this i atom from the interaction with this j atom. */
253 velecsum = _fjsp_add_v2r8(velecsum,velec);
254 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
256 fscal = _fjsp_add_v2r8(felec,fvdw);
258 /* Update vectorial force */
259 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
260 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
261 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
263 gmx_fjsp_decrement_fma_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fscal,dx00,dy00,dz00);
265 /* Inner loop uses 76 flops */
272 j_coord_offsetA = DIM*jnrA;
274 /* load j atom coordinates */
275 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
278 /* Calculate displacement vector */
279 dx00 = _fjsp_sub_v2r8(ix0,jx0);
280 dy00 = _fjsp_sub_v2r8(iy0,jy0);
281 dz00 = _fjsp_sub_v2r8(iz0,jz0);
283 /* Calculate squared distance and things based on it */
284 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
286 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
288 /* Load parameters for j particles */
289 jq0 = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
290 vdwjidx0A = 2*vdwtype[jnrA+0];
292 /**************************
293 * CALCULATE INTERACTIONS *
294 **************************/
296 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
298 /* Compute parameters for interactions between i and j atoms */
299 qq00 = _fjsp_mul_v2r8(iq0,jq0);
300 gmx_fjsp_load_1pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
302 /* Calculate table index by multiplying r with table scale and truncate to integer */
303 rt = _fjsp_mul_v2r8(r00,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_setzero_v2r8();
315 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
316 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
317 H = _fjsp_setzero_v2r8();
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(qq00,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(qq00,FF),_fjsp_mul_v2r8(vftabscale,rinv00)));
325 /* CUBIC SPLINE TABLE DISPERSION */
328 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
329 F = _fjsp_setzero_v2r8();
330 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
331 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
332 H = _fjsp_setzero_v2r8();
333 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
334 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
335 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
336 vvdw6 = _fjsp_mul_v2r8(c6_00,VV);
337 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
338 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
340 /* CUBIC SPLINE TABLE REPULSION */
341 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
342 F = _fjsp_setzero_v2r8();
343 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
344 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
345 H = _fjsp_setzero_v2r8();
346 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
347 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
348 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
349 vvdw12 = _fjsp_mul_v2r8(c12_00,VV);
350 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
351 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
352 vvdw = _fjsp_add_v2r8(vvdw12,vvdw6);
353 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
355 /* Update potential sum for this i atom from the interaction with this j atom. */
356 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
357 velecsum = _fjsp_add_v2r8(velecsum,velec);
358 vvdw = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
359 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
361 fscal = _fjsp_add_v2r8(felec,fvdw);
363 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
365 /* Update vectorial force */
366 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
367 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
368 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
370 gmx_fjsp_decrement_fma_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fscal,dx00,dy00,dz00);
372 /* Inner loop uses 76 flops */
375 /* End of innermost loop */
377 gmx_fjsp_update_iforce_1atom_swizzle_v2r8(fix0,fiy0,fiz0,
378 f+i_coord_offset,fshift+i_shift_offset);
381 /* Update potential energies */
382 gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
383 gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
385 /* Increment number of inner iterations */
386 inneriter += j_index_end - j_index_start;
388 /* Outer loop uses 9 flops */
391 /* Increment number of outer iterations */
394 /* Update outer/inner flops */
396 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_VF,outeriter*9 + inneriter*76);
399 * Gromacs nonbonded kernel: nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double
400 * Electrostatics interaction: CubicSplineTable
401 * VdW interaction: CubicSplineTable
402 * Geometry: Particle-Particle
403 * Calculate force/pot: Force
406 nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double
407 (t_nblist * gmx_restrict nlist,
408 rvec * gmx_restrict xx,
409 rvec * gmx_restrict ff,
410 t_forcerec * gmx_restrict fr,
411 t_mdatoms * gmx_restrict mdatoms,
412 nb_kernel_data_t * gmx_restrict kernel_data,
413 t_nrnb * gmx_restrict nrnb)
415 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
416 * just 0 for non-waters.
417 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
418 * jnr indices corresponding to data put in the four positions in the SIMD register.
420 int i_shift_offset,i_coord_offset,outeriter,inneriter;
421 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
423 int j_coord_offsetA,j_coord_offsetB;
424 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
426 real *shiftvec,*fshift,*x,*f;
427 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
429 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
430 int vdwjidx0A,vdwjidx0B;
431 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
432 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
433 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
436 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
439 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
440 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
441 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
444 _fjsp_v2r8 dummy_mask,cutoff_mask;
445 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
446 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
447 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
454 jindex = nlist->jindex;
456 shiftidx = nlist->shift;
458 shiftvec = fr->shift_vec[0];
459 fshift = fr->fshift[0];
460 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
461 charge = mdatoms->chargeA;
462 nvdwtype = fr->ntype;
464 vdwtype = mdatoms->typeA;
466 vftab = kernel_data->table_elec_vdw->data;
467 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_elec_vdw->scale);
469 /* Avoid stupid compiler warnings */
477 /* Start outer loop over neighborlists */
478 for(iidx=0; iidx<nri; iidx++)
480 /* Load shift vector for this list */
481 i_shift_offset = DIM*shiftidx[iidx];
483 /* Load limits for loop over neighbors */
484 j_index_start = jindex[iidx];
485 j_index_end = jindex[iidx+1];
487 /* Get outer coordinate index */
489 i_coord_offset = DIM*inr;
491 /* Load i particle coords and add shift vector */
492 gmx_fjsp_load_shift_and_1rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
494 fix0 = _fjsp_setzero_v2r8();
495 fiy0 = _fjsp_setzero_v2r8();
496 fiz0 = _fjsp_setzero_v2r8();
498 /* Load parameters for i particles */
499 iq0 = _fjsp_mul_v2r8(facel,gmx_fjsp_load1_v2r8(charge+inr+0));
500 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
502 /* Start inner kernel loop */
503 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
506 /* Get j neighbor index, and coordinate index */
509 j_coord_offsetA = DIM*jnrA;
510 j_coord_offsetB = DIM*jnrB;
512 /* load j atom coordinates */
513 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
516 /* Calculate displacement vector */
517 dx00 = _fjsp_sub_v2r8(ix0,jx0);
518 dy00 = _fjsp_sub_v2r8(iy0,jy0);
519 dz00 = _fjsp_sub_v2r8(iz0,jz0);
521 /* Calculate squared distance and things based on it */
522 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
524 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
526 /* Load parameters for j particles */
527 jq0 = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
528 vdwjidx0A = 2*vdwtype[jnrA+0];
529 vdwjidx0B = 2*vdwtype[jnrB+0];
531 /**************************
532 * CALCULATE INTERACTIONS *
533 **************************/
535 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
537 /* Compute parameters for interactions between i and j atoms */
538 qq00 = _fjsp_mul_v2r8(iq0,jq0);
539 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
540 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
542 /* Calculate table index by multiplying r with table scale and truncate to integer */
543 rt = _fjsp_mul_v2r8(r00,vftabscale);
544 itab_tmp = _fjsp_dtox_v2r8(rt);
545 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
546 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
547 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
552 /* CUBIC SPLINE TABLE ELECTROSTATICS */
553 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
554 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
555 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
556 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
557 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
558 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
559 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
560 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
561 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq00,FF),_fjsp_mul_v2r8(vftabscale,rinv00)));
563 /* CUBIC SPLINE TABLE DISPERSION */
566 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
567 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
568 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
569 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
570 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
571 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
572 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
573 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
574 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
576 /* CUBIC SPLINE TABLE REPULSION */
577 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
578 F = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
579 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
580 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
581 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
582 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
583 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
584 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
585 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
586 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
588 fscal = _fjsp_add_v2r8(felec,fvdw);
590 /* Update vectorial force */
591 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
592 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
593 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
595 gmx_fjsp_decrement_fma_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fscal,dx00,dy00,dz00);
597 /* Inner loop uses 64 flops */
604 j_coord_offsetA = DIM*jnrA;
606 /* load j atom coordinates */
607 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
610 /* Calculate displacement vector */
611 dx00 = _fjsp_sub_v2r8(ix0,jx0);
612 dy00 = _fjsp_sub_v2r8(iy0,jy0);
613 dz00 = _fjsp_sub_v2r8(iz0,jz0);
615 /* Calculate squared distance and things based on it */
616 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
618 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
620 /* Load parameters for j particles */
621 jq0 = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
622 vdwjidx0A = 2*vdwtype[jnrA+0];
624 /**************************
625 * CALCULATE INTERACTIONS *
626 **************************/
628 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
630 /* Compute parameters for interactions between i and j atoms */
631 qq00 = _fjsp_mul_v2r8(iq0,jq0);
632 gmx_fjsp_load_1pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
634 /* Calculate table index by multiplying r with table scale and truncate to integer */
635 rt = _fjsp_mul_v2r8(r00,vftabscale);
636 itab_tmp = _fjsp_dtox_v2r8(rt);
637 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
638 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
639 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
644 /* CUBIC SPLINE TABLE ELECTROSTATICS */
645 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
646 F = _fjsp_setzero_v2r8();
647 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
648 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
649 H = _fjsp_setzero_v2r8();
650 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
651 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
652 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
653 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq00,FF),_fjsp_mul_v2r8(vftabscale,rinv00)));
655 /* CUBIC SPLINE TABLE DISPERSION */
658 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
659 F = _fjsp_setzero_v2r8();
660 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
661 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
662 H = _fjsp_setzero_v2r8();
663 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
664 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
665 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
666 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
668 /* CUBIC SPLINE TABLE REPULSION */
669 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
670 F = _fjsp_setzero_v2r8();
671 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
672 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
673 H = _fjsp_setzero_v2r8();
674 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
675 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
676 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
677 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
678 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
680 fscal = _fjsp_add_v2r8(felec,fvdw);
682 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
684 /* Update vectorial force */
685 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
686 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
687 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
689 gmx_fjsp_decrement_fma_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fscal,dx00,dy00,dz00);
691 /* Inner loop uses 64 flops */
694 /* End of innermost loop */
696 gmx_fjsp_update_iforce_1atom_swizzle_v2r8(fix0,fiy0,fiz0,
697 f+i_coord_offset,fshift+i_shift_offset);
699 /* Increment number of inner iterations */
700 inneriter += j_index_end - j_index_start;
702 /* Outer loop uses 7 flops */
705 /* Increment number of outer iterations */
708 /* Update outer/inner flops */
710 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_F,outeriter*7 + inneriter*64);