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.
42 #include "../nb_kernel.h"
43 #include "gromacs/legacyheaders/types/simple.h"
44 #include "gromacs/math/vec.h"
45 #include "gromacs/legacyheaders/nrnb.h"
47 #include "kernelutil_sparc64_hpc_ace_double.h"
50 * Gromacs nonbonded kernel: nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sparc64_hpc_ace_double
51 * Electrostatics interaction: Coulomb
52 * VdW interaction: CubicSplineTable
53 * Geometry: Particle-Particle
54 * Calculate force/pot: PotentialAndForce
57 nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sparc64_hpc_ace_double
58 (t_nblist * gmx_restrict nlist,
59 rvec * gmx_restrict xx,
60 rvec * gmx_restrict ff,
61 t_forcerec * gmx_restrict fr,
62 t_mdatoms * gmx_restrict mdatoms,
63 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
64 t_nrnb * gmx_restrict nrnb)
66 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
67 * just 0 for non-waters.
68 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
69 * jnr indices corresponding to data put in the four positions in the SIMD register.
71 int i_shift_offset,i_coord_offset,outeriter,inneriter;
72 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
74 int j_coord_offsetA,j_coord_offsetB;
75 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
77 real *shiftvec,*fshift,*x,*f;
78 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
80 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
81 int vdwjidx0A,vdwjidx0B;
82 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
83 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
84 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
87 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
90 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
91 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
92 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
95 _fjsp_v2r8 dummy_mask,cutoff_mask;
96 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
97 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
98 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
105 jindex = nlist->jindex;
107 shiftidx = nlist->shift;
109 shiftvec = fr->shift_vec[0];
110 fshift = fr->fshift[0];
111 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
112 charge = mdatoms->chargeA;
113 nvdwtype = fr->ntype;
115 vdwtype = mdatoms->typeA;
117 vftab = kernel_data->table_vdw->data;
118 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
120 /* Avoid stupid compiler warnings */
128 /* Start outer loop over neighborlists */
129 for(iidx=0; iidx<nri; iidx++)
131 /* Load shift vector for this list */
132 i_shift_offset = DIM*shiftidx[iidx];
134 /* Load limits for loop over neighbors */
135 j_index_start = jindex[iidx];
136 j_index_end = jindex[iidx+1];
138 /* Get outer coordinate index */
140 i_coord_offset = DIM*inr;
142 /* Load i particle coords and add shift vector */
143 gmx_fjsp_load_shift_and_1rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
145 fix0 = _fjsp_setzero_v2r8();
146 fiy0 = _fjsp_setzero_v2r8();
147 fiz0 = _fjsp_setzero_v2r8();
149 /* Load parameters for i particles */
150 iq0 = _fjsp_mul_v2r8(facel,gmx_fjsp_load1_v2r8(charge+inr+0));
151 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
153 /* Reset potential sums */
154 velecsum = _fjsp_setzero_v2r8();
155 vvdwsum = _fjsp_setzero_v2r8();
157 /* Start inner kernel loop */
158 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
161 /* Get j neighbor index, and coordinate index */
164 j_coord_offsetA = DIM*jnrA;
165 j_coord_offsetB = DIM*jnrB;
167 /* load j atom coordinates */
168 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
171 /* Calculate displacement vector */
172 dx00 = _fjsp_sub_v2r8(ix0,jx0);
173 dy00 = _fjsp_sub_v2r8(iy0,jy0);
174 dz00 = _fjsp_sub_v2r8(iz0,jz0);
176 /* Calculate squared distance and things based on it */
177 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
179 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
181 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
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 /* COULOMB ELECTROSTATICS */
210 velec = _fjsp_mul_v2r8(qq00,rinv00);
211 felec = _fjsp_mul_v2r8(velec,rinvsq00);
213 /* CUBIC SPLINE TABLE DISPERSION */
214 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
215 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
216 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
217 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
218 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
219 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
220 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
221 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
222 vvdw6 = _fjsp_mul_v2r8(c6_00,VV);
223 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
224 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
226 /* CUBIC SPLINE TABLE REPULSION */
227 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
228 F = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
229 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
230 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
231 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
232 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
233 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
234 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
235 vvdw12 = _fjsp_mul_v2r8(c12_00,VV);
236 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
237 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
238 vvdw = _fjsp_add_v2r8(vvdw12,vvdw6);
239 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
241 /* Update potential sum for this i atom from the interaction with this j atom. */
242 velecsum = _fjsp_add_v2r8(velecsum,velec);
243 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
245 fscal = _fjsp_add_v2r8(felec,fvdw);
247 /* Update vectorial force */
248 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
249 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
250 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
252 gmx_fjsp_decrement_fma_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fscal,dx00,dy00,dz00);
254 /* Inner loop uses 66 flops */
261 j_coord_offsetA = DIM*jnrA;
263 /* load j atom coordinates */
264 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
267 /* Calculate displacement vector */
268 dx00 = _fjsp_sub_v2r8(ix0,jx0);
269 dy00 = _fjsp_sub_v2r8(iy0,jy0);
270 dz00 = _fjsp_sub_v2r8(iz0,jz0);
272 /* Calculate squared distance and things based on it */
273 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
275 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
277 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
279 /* Load parameters for j particles */
280 jq0 = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
281 vdwjidx0A = 2*vdwtype[jnrA+0];
283 /**************************
284 * CALCULATE INTERACTIONS *
285 **************************/
287 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
289 /* Compute parameters for interactions between i and j atoms */
290 qq00 = _fjsp_mul_v2r8(iq0,jq0);
291 gmx_fjsp_load_1pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
293 /* Calculate table index by multiplying r with table scale and truncate to integer */
294 rt = _fjsp_mul_v2r8(r00,vftabscale);
295 itab_tmp = _fjsp_dtox_v2r8(rt);
296 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
297 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
298 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
303 /* COULOMB ELECTROSTATICS */
304 velec = _fjsp_mul_v2r8(qq00,rinv00);
305 felec = _fjsp_mul_v2r8(velec,rinvsq00);
307 /* CUBIC SPLINE TABLE DISPERSION */
308 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
309 F = _fjsp_setzero_v2r8();
310 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
311 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
312 H = _fjsp_setzero_v2r8();
313 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
314 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
315 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
316 vvdw6 = _fjsp_mul_v2r8(c6_00,VV);
317 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
318 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
320 /* CUBIC SPLINE TABLE REPULSION */
321 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
322 F = _fjsp_setzero_v2r8();
323 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
324 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
325 H = _fjsp_setzero_v2r8();
326 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
327 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
328 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
329 vvdw12 = _fjsp_mul_v2r8(c12_00,VV);
330 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
331 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
332 vvdw = _fjsp_add_v2r8(vvdw12,vvdw6);
333 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
335 /* Update potential sum for this i atom from the interaction with this j atom. */
336 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
337 velecsum = _fjsp_add_v2r8(velecsum,velec);
338 vvdw = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
339 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
341 fscal = _fjsp_add_v2r8(felec,fvdw);
343 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
345 /* Update vectorial force */
346 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
347 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
348 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
350 gmx_fjsp_decrement_fma_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fscal,dx00,dy00,dz00);
352 /* Inner loop uses 66 flops */
355 /* End of innermost loop */
357 gmx_fjsp_update_iforce_1atom_swizzle_v2r8(fix0,fiy0,fiz0,
358 f+i_coord_offset,fshift+i_shift_offset);
361 /* Update potential energies */
362 gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
363 gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
365 /* Increment number of inner iterations */
366 inneriter += j_index_end - j_index_start;
368 /* Outer loop uses 9 flops */
371 /* Increment number of outer iterations */
374 /* Update outer/inner flops */
376 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_VF,outeriter*9 + inneriter*66);
379 * Gromacs nonbonded kernel: nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double
380 * Electrostatics interaction: Coulomb
381 * VdW interaction: CubicSplineTable
382 * Geometry: Particle-Particle
383 * Calculate force/pot: Force
386 nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double
387 (t_nblist * gmx_restrict nlist,
388 rvec * gmx_restrict xx,
389 rvec * gmx_restrict ff,
390 t_forcerec * gmx_restrict fr,
391 t_mdatoms * gmx_restrict mdatoms,
392 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
393 t_nrnb * gmx_restrict nrnb)
395 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
396 * just 0 for non-waters.
397 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
398 * jnr indices corresponding to data put in the four positions in the SIMD register.
400 int i_shift_offset,i_coord_offset,outeriter,inneriter;
401 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
403 int j_coord_offsetA,j_coord_offsetB;
404 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
406 real *shiftvec,*fshift,*x,*f;
407 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
409 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
410 int vdwjidx0A,vdwjidx0B;
411 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
412 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
413 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
416 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
419 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
420 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
421 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
424 _fjsp_v2r8 dummy_mask,cutoff_mask;
425 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
426 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
427 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
434 jindex = nlist->jindex;
436 shiftidx = nlist->shift;
438 shiftvec = fr->shift_vec[0];
439 fshift = fr->fshift[0];
440 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
441 charge = mdatoms->chargeA;
442 nvdwtype = fr->ntype;
444 vdwtype = mdatoms->typeA;
446 vftab = kernel_data->table_vdw->data;
447 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
449 /* Avoid stupid compiler warnings */
457 /* Start outer loop over neighborlists */
458 for(iidx=0; iidx<nri; iidx++)
460 /* Load shift vector for this list */
461 i_shift_offset = DIM*shiftidx[iidx];
463 /* Load limits for loop over neighbors */
464 j_index_start = jindex[iidx];
465 j_index_end = jindex[iidx+1];
467 /* Get outer coordinate index */
469 i_coord_offset = DIM*inr;
471 /* Load i particle coords and add shift vector */
472 gmx_fjsp_load_shift_and_1rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
474 fix0 = _fjsp_setzero_v2r8();
475 fiy0 = _fjsp_setzero_v2r8();
476 fiz0 = _fjsp_setzero_v2r8();
478 /* Load parameters for i particles */
479 iq0 = _fjsp_mul_v2r8(facel,gmx_fjsp_load1_v2r8(charge+inr+0));
480 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
482 /* Start inner kernel loop */
483 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
486 /* Get j neighbor index, and coordinate index */
489 j_coord_offsetA = DIM*jnrA;
490 j_coord_offsetB = DIM*jnrB;
492 /* load j atom coordinates */
493 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
496 /* Calculate displacement vector */
497 dx00 = _fjsp_sub_v2r8(ix0,jx0);
498 dy00 = _fjsp_sub_v2r8(iy0,jy0);
499 dz00 = _fjsp_sub_v2r8(iz0,jz0);
501 /* Calculate squared distance and things based on it */
502 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
504 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
506 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
508 /* Load parameters for j particles */
509 jq0 = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
510 vdwjidx0A = 2*vdwtype[jnrA+0];
511 vdwjidx0B = 2*vdwtype[jnrB+0];
513 /**************************
514 * CALCULATE INTERACTIONS *
515 **************************/
517 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
519 /* Compute parameters for interactions between i and j atoms */
520 qq00 = _fjsp_mul_v2r8(iq0,jq0);
521 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
522 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
524 /* Calculate table index by multiplying r with table scale and truncate to integer */
525 rt = _fjsp_mul_v2r8(r00,vftabscale);
526 itab_tmp = _fjsp_dtox_v2r8(rt);
527 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
528 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
529 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
534 /* COULOMB ELECTROSTATICS */
535 velec = _fjsp_mul_v2r8(qq00,rinv00);
536 felec = _fjsp_mul_v2r8(velec,rinvsq00);
538 /* CUBIC SPLINE TABLE DISPERSION */
539 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
540 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
541 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
542 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
543 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
544 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
545 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
546 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
547 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
549 /* CUBIC SPLINE TABLE REPULSION */
550 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
551 F = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
552 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
553 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
554 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
555 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
556 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
557 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
558 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
559 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
561 fscal = _fjsp_add_v2r8(felec,fvdw);
563 /* Update vectorial force */
564 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
565 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
566 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
568 gmx_fjsp_decrement_fma_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fscal,dx00,dy00,dz00);
570 /* Inner loop uses 57 flops */
577 j_coord_offsetA = DIM*jnrA;
579 /* load j atom coordinates */
580 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
583 /* Calculate displacement vector */
584 dx00 = _fjsp_sub_v2r8(ix0,jx0);
585 dy00 = _fjsp_sub_v2r8(iy0,jy0);
586 dz00 = _fjsp_sub_v2r8(iz0,jz0);
588 /* Calculate squared distance and things based on it */
589 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
591 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
593 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
595 /* Load parameters for j particles */
596 jq0 = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
597 vdwjidx0A = 2*vdwtype[jnrA+0];
599 /**************************
600 * CALCULATE INTERACTIONS *
601 **************************/
603 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
605 /* Compute parameters for interactions between i and j atoms */
606 qq00 = _fjsp_mul_v2r8(iq0,jq0);
607 gmx_fjsp_load_1pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
609 /* Calculate table index by multiplying r with table scale and truncate to integer */
610 rt = _fjsp_mul_v2r8(r00,vftabscale);
611 itab_tmp = _fjsp_dtox_v2r8(rt);
612 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
613 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
614 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
619 /* COULOMB ELECTROSTATICS */
620 velec = _fjsp_mul_v2r8(qq00,rinv00);
621 felec = _fjsp_mul_v2r8(velec,rinvsq00);
623 /* CUBIC SPLINE TABLE DISPERSION */
624 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
625 F = _fjsp_setzero_v2r8();
626 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
627 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
628 H = _fjsp_setzero_v2r8();
629 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
630 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
631 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
632 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
634 /* CUBIC SPLINE TABLE REPULSION */
635 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
636 F = _fjsp_setzero_v2r8();
637 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
638 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
639 H = _fjsp_setzero_v2r8();
640 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
641 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
642 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
643 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
644 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
646 fscal = _fjsp_add_v2r8(felec,fvdw);
648 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
650 /* Update vectorial force */
651 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
652 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
653 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
655 gmx_fjsp_decrement_fma_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fscal,dx00,dy00,dz00);
657 /* Inner loop uses 57 flops */
660 /* End of innermost loop */
662 gmx_fjsp_update_iforce_1atom_swizzle_v2r8(fix0,fiy0,fiz0,
663 f+i_coord_offset,fshift+i_shift_offset);
665 /* Increment number of inner iterations */
666 inneriter += j_index_end - j_index_start;
668 /* Outer loop uses 7 flops */
671 /* Increment number of outer iterations */
674 /* Update outer/inner flops */
676 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_F,outeriter*7 + inneriter*57);