2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2012,2013, 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"
49 #include "kernelutil_sparc64_hpc_ace_double.h"
52 * Gromacs nonbonded kernel: nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sparc64_hpc_ace_double
53 * Electrostatics interaction: Coulomb
54 * VdW interaction: CubicSplineTable
55 * Geometry: Particle-Particle
56 * Calculate force/pot: PotentialAndForce
59 nb_kernel_ElecCoul_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_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;
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_vdw->data;
120 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_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 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
185 /* Load parameters for j particles */
186 jq0 = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
187 vdwjidx0A = 2*vdwtype[jnrA+0];
188 vdwjidx0B = 2*vdwtype[jnrB+0];
190 /**************************
191 * CALCULATE INTERACTIONS *
192 **************************/
194 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
196 /* Compute parameters for interactions between i and j atoms */
197 qq00 = _fjsp_mul_v2r8(iq0,jq0);
198 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
199 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
201 /* Calculate table index by multiplying r with table scale and truncate to integer */
202 rt = _fjsp_mul_v2r8(r00,vftabscale);
203 itab_tmp = _fjsp_dtox_v2r8(rt);
204 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
205 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
206 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
211 /* COULOMB ELECTROSTATICS */
212 velec = _fjsp_mul_v2r8(qq00,rinv00);
213 felec = _fjsp_mul_v2r8(velec,rinvsq00);
215 /* CUBIC SPLINE TABLE DISPERSION */
216 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
217 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
218 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
219 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
220 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
221 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
222 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
223 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
224 vvdw6 = _fjsp_mul_v2r8(c6_00,VV);
225 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
226 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
228 /* CUBIC SPLINE TABLE REPULSION */
229 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
230 F = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
231 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
232 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
233 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
234 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
235 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
236 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
237 vvdw12 = _fjsp_mul_v2r8(c12_00,VV);
238 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
239 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
240 vvdw = _fjsp_add_v2r8(vvdw12,vvdw6);
241 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
243 /* Update potential sum for this i atom from the interaction with this j atom. */
244 velecsum = _fjsp_add_v2r8(velecsum,velec);
245 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
247 fscal = _fjsp_add_v2r8(felec,fvdw);
249 /* Update vectorial force */
250 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
251 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
252 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
254 gmx_fjsp_decrement_fma_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fscal,dx00,dy00,dz00);
256 /* Inner loop uses 66 flops */
263 j_coord_offsetA = DIM*jnrA;
265 /* load j atom coordinates */
266 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
269 /* Calculate displacement vector */
270 dx00 = _fjsp_sub_v2r8(ix0,jx0);
271 dy00 = _fjsp_sub_v2r8(iy0,jy0);
272 dz00 = _fjsp_sub_v2r8(iz0,jz0);
274 /* Calculate squared distance and things based on it */
275 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
277 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
279 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
281 /* Load parameters for j particles */
282 jq0 = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
283 vdwjidx0A = 2*vdwtype[jnrA+0];
285 /**************************
286 * CALCULATE INTERACTIONS *
287 **************************/
289 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
291 /* Compute parameters for interactions between i and j atoms */
292 qq00 = _fjsp_mul_v2r8(iq0,jq0);
293 gmx_fjsp_load_1pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
295 /* Calculate table index by multiplying r with table scale and truncate to integer */
296 rt = _fjsp_mul_v2r8(r00,vftabscale);
297 itab_tmp = _fjsp_dtox_v2r8(rt);
298 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
299 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
300 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
305 /* COULOMB ELECTROSTATICS */
306 velec = _fjsp_mul_v2r8(qq00,rinv00);
307 felec = _fjsp_mul_v2r8(velec,rinvsq00);
309 /* CUBIC SPLINE TABLE DISPERSION */
310 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
311 F = _fjsp_setzero_v2r8();
312 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
313 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
314 H = _fjsp_setzero_v2r8();
315 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
316 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
317 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
318 vvdw6 = _fjsp_mul_v2r8(c6_00,VV);
319 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
320 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
322 /* CUBIC SPLINE TABLE REPULSION */
323 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
324 F = _fjsp_setzero_v2r8();
325 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
326 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
327 H = _fjsp_setzero_v2r8();
328 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
329 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
330 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
331 vvdw12 = _fjsp_mul_v2r8(c12_00,VV);
332 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
333 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
334 vvdw = _fjsp_add_v2r8(vvdw12,vvdw6);
335 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
337 /* Update potential sum for this i atom from the interaction with this j atom. */
338 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
339 velecsum = _fjsp_add_v2r8(velecsum,velec);
340 vvdw = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
341 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
343 fscal = _fjsp_add_v2r8(felec,fvdw);
345 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
347 /* Update vectorial force */
348 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
349 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
350 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
352 gmx_fjsp_decrement_fma_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fscal,dx00,dy00,dz00);
354 /* Inner loop uses 66 flops */
357 /* End of innermost loop */
359 gmx_fjsp_update_iforce_1atom_swizzle_v2r8(fix0,fiy0,fiz0,
360 f+i_coord_offset,fshift+i_shift_offset);
363 /* Update potential energies */
364 gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
365 gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
367 /* Increment number of inner iterations */
368 inneriter += j_index_end - j_index_start;
370 /* Outer loop uses 9 flops */
373 /* Increment number of outer iterations */
376 /* Update outer/inner flops */
378 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_VF,outeriter*9 + inneriter*66);
381 * Gromacs nonbonded kernel: nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double
382 * Electrostatics interaction: Coulomb
383 * VdW interaction: CubicSplineTable
384 * Geometry: Particle-Particle
385 * Calculate force/pot: Force
388 nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double
389 (t_nblist * gmx_restrict nlist,
390 rvec * gmx_restrict xx,
391 rvec * gmx_restrict ff,
392 t_forcerec * gmx_restrict fr,
393 t_mdatoms * gmx_restrict mdatoms,
394 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
395 t_nrnb * gmx_restrict nrnb)
397 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
398 * just 0 for non-waters.
399 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
400 * jnr indices corresponding to data put in the four positions in the SIMD register.
402 int i_shift_offset,i_coord_offset,outeriter,inneriter;
403 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
405 int j_coord_offsetA,j_coord_offsetB;
406 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
408 real *shiftvec,*fshift,*x,*f;
409 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
411 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
412 int vdwjidx0A,vdwjidx0B;
413 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
414 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
415 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
418 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
421 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
422 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
423 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
426 _fjsp_v2r8 dummy_mask,cutoff_mask;
427 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
428 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
429 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
436 jindex = nlist->jindex;
438 shiftidx = nlist->shift;
440 shiftvec = fr->shift_vec[0];
441 fshift = fr->fshift[0];
442 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
443 charge = mdatoms->chargeA;
444 nvdwtype = fr->ntype;
446 vdwtype = mdatoms->typeA;
448 vftab = kernel_data->table_vdw->data;
449 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
451 /* Avoid stupid compiler warnings */
459 /* Start outer loop over neighborlists */
460 for(iidx=0; iidx<nri; iidx++)
462 /* Load shift vector for this list */
463 i_shift_offset = DIM*shiftidx[iidx];
465 /* Load limits for loop over neighbors */
466 j_index_start = jindex[iidx];
467 j_index_end = jindex[iidx+1];
469 /* Get outer coordinate index */
471 i_coord_offset = DIM*inr;
473 /* Load i particle coords and add shift vector */
474 gmx_fjsp_load_shift_and_1rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
476 fix0 = _fjsp_setzero_v2r8();
477 fiy0 = _fjsp_setzero_v2r8();
478 fiz0 = _fjsp_setzero_v2r8();
480 /* Load parameters for i particles */
481 iq0 = _fjsp_mul_v2r8(facel,gmx_fjsp_load1_v2r8(charge+inr+0));
482 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
484 /* Start inner kernel loop */
485 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
488 /* Get j neighbor index, and coordinate index */
491 j_coord_offsetA = DIM*jnrA;
492 j_coord_offsetB = DIM*jnrB;
494 /* load j atom coordinates */
495 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
498 /* Calculate displacement vector */
499 dx00 = _fjsp_sub_v2r8(ix0,jx0);
500 dy00 = _fjsp_sub_v2r8(iy0,jy0);
501 dz00 = _fjsp_sub_v2r8(iz0,jz0);
503 /* Calculate squared distance and things based on it */
504 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
506 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
508 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
510 /* Load parameters for j particles */
511 jq0 = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
512 vdwjidx0A = 2*vdwtype[jnrA+0];
513 vdwjidx0B = 2*vdwtype[jnrB+0];
515 /**************************
516 * CALCULATE INTERACTIONS *
517 **************************/
519 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
521 /* Compute parameters for interactions between i and j atoms */
522 qq00 = _fjsp_mul_v2r8(iq0,jq0);
523 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
524 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
526 /* Calculate table index by multiplying r with table scale and truncate to integer */
527 rt = _fjsp_mul_v2r8(r00,vftabscale);
528 itab_tmp = _fjsp_dtox_v2r8(rt);
529 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
530 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
531 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
536 /* COULOMB ELECTROSTATICS */
537 velec = _fjsp_mul_v2r8(qq00,rinv00);
538 felec = _fjsp_mul_v2r8(velec,rinvsq00);
540 /* CUBIC SPLINE TABLE DISPERSION */
541 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
542 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
543 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
544 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
545 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
546 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
547 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
548 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
549 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
551 /* CUBIC SPLINE TABLE REPULSION */
552 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
553 F = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
554 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
555 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
556 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
557 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
558 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
559 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
560 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
561 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
563 fscal = _fjsp_add_v2r8(felec,fvdw);
565 /* Update vectorial force */
566 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
567 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
568 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
570 gmx_fjsp_decrement_fma_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fscal,dx00,dy00,dz00);
572 /* Inner loop uses 57 flops */
579 j_coord_offsetA = DIM*jnrA;
581 /* load j atom coordinates */
582 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
585 /* Calculate displacement vector */
586 dx00 = _fjsp_sub_v2r8(ix0,jx0);
587 dy00 = _fjsp_sub_v2r8(iy0,jy0);
588 dz00 = _fjsp_sub_v2r8(iz0,jz0);
590 /* Calculate squared distance and things based on it */
591 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
593 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
595 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
597 /* Load parameters for j particles */
598 jq0 = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
599 vdwjidx0A = 2*vdwtype[jnrA+0];
601 /**************************
602 * CALCULATE INTERACTIONS *
603 **************************/
605 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
607 /* Compute parameters for interactions between i and j atoms */
608 qq00 = _fjsp_mul_v2r8(iq0,jq0);
609 gmx_fjsp_load_1pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
611 /* Calculate table index by multiplying r with table scale and truncate to integer */
612 rt = _fjsp_mul_v2r8(r00,vftabscale);
613 itab_tmp = _fjsp_dtox_v2r8(rt);
614 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
615 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
616 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
621 /* COULOMB ELECTROSTATICS */
622 velec = _fjsp_mul_v2r8(qq00,rinv00);
623 felec = _fjsp_mul_v2r8(velec,rinvsq00);
625 /* CUBIC SPLINE TABLE DISPERSION */
626 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
627 F = _fjsp_setzero_v2r8();
628 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
629 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
630 H = _fjsp_setzero_v2r8();
631 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
632 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
633 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
634 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
636 /* CUBIC SPLINE TABLE REPULSION */
637 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
638 F = _fjsp_setzero_v2r8();
639 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
640 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
641 H = _fjsp_setzero_v2r8();
642 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
643 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
644 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
645 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
646 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
648 fscal = _fjsp_add_v2r8(felec,fvdw);
650 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
652 /* Update vectorial force */
653 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
654 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
655 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
657 gmx_fjsp_decrement_fma_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fscal,dx00,dy00,dz00);
659 /* Inner loop uses 57 flops */
662 /* End of innermost loop */
664 gmx_fjsp_update_iforce_1atom_swizzle_v2r8(fix0,fiy0,fiz0,
665 f+i_coord_offset,fshift+i_shift_offset);
667 /* Increment number of inner iterations */
668 inneriter += j_index_end - j_index_start;
670 /* Outer loop uses 7 flops */
673 /* Increment number of outer iterations */
676 /* Update outer/inner flops */
678 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_F,outeriter*7 + inneriter*57);