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 "types/simple.h"
44 #include "gromacs/math/vec.h"
47 #include "kernelutil_sparc64_hpc_ace_double.h"
50 * Gromacs nonbonded kernel: nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sparc64_hpc_ace_double
51 * Electrostatics interaction: CubicSplineTable
52 * VdW interaction: LennardJones
53 * Geometry: Water4-Water4
54 * Calculate force/pot: PotentialAndForce
57 nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_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;
82 _fjsp_v2r8 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
84 _fjsp_v2r8 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
86 _fjsp_v2r8 ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
87 int vdwjidx0A,vdwjidx0B;
88 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
89 int vdwjidx1A,vdwjidx1B;
90 _fjsp_v2r8 jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
91 int vdwjidx2A,vdwjidx2B;
92 _fjsp_v2r8 jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
93 int vdwjidx3A,vdwjidx3B;
94 _fjsp_v2r8 jx3,jy3,jz3,fjx3,fjy3,fjz3,jq3,isaj3;
95 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
96 _fjsp_v2r8 dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11;
97 _fjsp_v2r8 dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12;
98 _fjsp_v2r8 dx13,dy13,dz13,rsq13,rinv13,rinvsq13,r13,qq13,c6_13,c12_13;
99 _fjsp_v2r8 dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21;
100 _fjsp_v2r8 dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22;
101 _fjsp_v2r8 dx23,dy23,dz23,rsq23,rinv23,rinvsq23,r23,qq23,c6_23,c12_23;
102 _fjsp_v2r8 dx31,dy31,dz31,rsq31,rinv31,rinvsq31,r31,qq31,c6_31,c12_31;
103 _fjsp_v2r8 dx32,dy32,dz32,rsq32,rinv32,rinvsq32,r32,qq32,c6_32,c12_32;
104 _fjsp_v2r8 dx33,dy33,dz33,rsq33,rinv33,rinvsq33,r33,qq33,c6_33,c12_33;
105 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
108 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
111 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
112 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
113 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
116 _fjsp_v2r8 dummy_mask,cutoff_mask;
117 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
118 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
119 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
126 jindex = nlist->jindex;
128 shiftidx = nlist->shift;
130 shiftvec = fr->shift_vec[0];
131 fshift = fr->fshift[0];
132 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
133 charge = mdatoms->chargeA;
134 nvdwtype = fr->ntype;
136 vdwtype = mdatoms->typeA;
138 vftab = kernel_data->table_elec->data;
139 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_elec->scale);
141 /* Setup water-specific parameters */
142 inr = nlist->iinr[0];
143 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
144 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
145 iq3 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+3]));
146 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
148 jq1 = gmx_fjsp_set1_v2r8(charge[inr+1]);
149 jq2 = gmx_fjsp_set1_v2r8(charge[inr+2]);
150 jq3 = gmx_fjsp_set1_v2r8(charge[inr+3]);
151 vdwjidx0A = 2*vdwtype[inr+0];
152 c6_00 = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A]);
153 c12_00 = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A+1]);
154 qq11 = _fjsp_mul_v2r8(iq1,jq1);
155 qq12 = _fjsp_mul_v2r8(iq1,jq2);
156 qq13 = _fjsp_mul_v2r8(iq1,jq3);
157 qq21 = _fjsp_mul_v2r8(iq2,jq1);
158 qq22 = _fjsp_mul_v2r8(iq2,jq2);
159 qq23 = _fjsp_mul_v2r8(iq2,jq3);
160 qq31 = _fjsp_mul_v2r8(iq3,jq1);
161 qq32 = _fjsp_mul_v2r8(iq3,jq2);
162 qq33 = _fjsp_mul_v2r8(iq3,jq3);
164 /* Avoid stupid compiler warnings */
172 /* Start outer loop over neighborlists */
173 for(iidx=0; iidx<nri; iidx++)
175 /* Load shift vector for this list */
176 i_shift_offset = DIM*shiftidx[iidx];
178 /* Load limits for loop over neighbors */
179 j_index_start = jindex[iidx];
180 j_index_end = jindex[iidx+1];
182 /* Get outer coordinate index */
184 i_coord_offset = DIM*inr;
186 /* Load i particle coords and add shift vector */
187 gmx_fjsp_load_shift_and_4rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
188 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
190 fix0 = _fjsp_setzero_v2r8();
191 fiy0 = _fjsp_setzero_v2r8();
192 fiz0 = _fjsp_setzero_v2r8();
193 fix1 = _fjsp_setzero_v2r8();
194 fiy1 = _fjsp_setzero_v2r8();
195 fiz1 = _fjsp_setzero_v2r8();
196 fix2 = _fjsp_setzero_v2r8();
197 fiy2 = _fjsp_setzero_v2r8();
198 fiz2 = _fjsp_setzero_v2r8();
199 fix3 = _fjsp_setzero_v2r8();
200 fiy3 = _fjsp_setzero_v2r8();
201 fiz3 = _fjsp_setzero_v2r8();
203 /* Reset potential sums */
204 velecsum = _fjsp_setzero_v2r8();
205 vvdwsum = _fjsp_setzero_v2r8();
207 /* Start inner kernel loop */
208 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
211 /* Get j neighbor index, and coordinate index */
214 j_coord_offsetA = DIM*jnrA;
215 j_coord_offsetB = DIM*jnrB;
217 /* load j atom coordinates */
218 gmx_fjsp_load_4rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
219 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,
220 &jy2,&jz2,&jx3,&jy3,&jz3);
222 /* Calculate displacement vector */
223 dx00 = _fjsp_sub_v2r8(ix0,jx0);
224 dy00 = _fjsp_sub_v2r8(iy0,jy0);
225 dz00 = _fjsp_sub_v2r8(iz0,jz0);
226 dx11 = _fjsp_sub_v2r8(ix1,jx1);
227 dy11 = _fjsp_sub_v2r8(iy1,jy1);
228 dz11 = _fjsp_sub_v2r8(iz1,jz1);
229 dx12 = _fjsp_sub_v2r8(ix1,jx2);
230 dy12 = _fjsp_sub_v2r8(iy1,jy2);
231 dz12 = _fjsp_sub_v2r8(iz1,jz2);
232 dx13 = _fjsp_sub_v2r8(ix1,jx3);
233 dy13 = _fjsp_sub_v2r8(iy1,jy3);
234 dz13 = _fjsp_sub_v2r8(iz1,jz3);
235 dx21 = _fjsp_sub_v2r8(ix2,jx1);
236 dy21 = _fjsp_sub_v2r8(iy2,jy1);
237 dz21 = _fjsp_sub_v2r8(iz2,jz1);
238 dx22 = _fjsp_sub_v2r8(ix2,jx2);
239 dy22 = _fjsp_sub_v2r8(iy2,jy2);
240 dz22 = _fjsp_sub_v2r8(iz2,jz2);
241 dx23 = _fjsp_sub_v2r8(ix2,jx3);
242 dy23 = _fjsp_sub_v2r8(iy2,jy3);
243 dz23 = _fjsp_sub_v2r8(iz2,jz3);
244 dx31 = _fjsp_sub_v2r8(ix3,jx1);
245 dy31 = _fjsp_sub_v2r8(iy3,jy1);
246 dz31 = _fjsp_sub_v2r8(iz3,jz1);
247 dx32 = _fjsp_sub_v2r8(ix3,jx2);
248 dy32 = _fjsp_sub_v2r8(iy3,jy2);
249 dz32 = _fjsp_sub_v2r8(iz3,jz2);
250 dx33 = _fjsp_sub_v2r8(ix3,jx3);
251 dy33 = _fjsp_sub_v2r8(iy3,jy3);
252 dz33 = _fjsp_sub_v2r8(iz3,jz3);
254 /* Calculate squared distance and things based on it */
255 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
256 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
257 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
258 rsq13 = gmx_fjsp_calc_rsq_v2r8(dx13,dy13,dz13);
259 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
260 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
261 rsq23 = gmx_fjsp_calc_rsq_v2r8(dx23,dy23,dz23);
262 rsq31 = gmx_fjsp_calc_rsq_v2r8(dx31,dy31,dz31);
263 rsq32 = gmx_fjsp_calc_rsq_v2r8(dx32,dy32,dz32);
264 rsq33 = gmx_fjsp_calc_rsq_v2r8(dx33,dy33,dz33);
266 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
267 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
268 rinv13 = gmx_fjsp_invsqrt_v2r8(rsq13);
269 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
270 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
271 rinv23 = gmx_fjsp_invsqrt_v2r8(rsq23);
272 rinv31 = gmx_fjsp_invsqrt_v2r8(rsq31);
273 rinv32 = gmx_fjsp_invsqrt_v2r8(rsq32);
274 rinv33 = gmx_fjsp_invsqrt_v2r8(rsq33);
276 rinvsq00 = gmx_fjsp_inv_v2r8(rsq00);
278 fjx0 = _fjsp_setzero_v2r8();
279 fjy0 = _fjsp_setzero_v2r8();
280 fjz0 = _fjsp_setzero_v2r8();
281 fjx1 = _fjsp_setzero_v2r8();
282 fjy1 = _fjsp_setzero_v2r8();
283 fjz1 = _fjsp_setzero_v2r8();
284 fjx2 = _fjsp_setzero_v2r8();
285 fjy2 = _fjsp_setzero_v2r8();
286 fjz2 = _fjsp_setzero_v2r8();
287 fjx3 = _fjsp_setzero_v2r8();
288 fjy3 = _fjsp_setzero_v2r8();
289 fjz3 = _fjsp_setzero_v2r8();
291 /**************************
292 * CALCULATE INTERACTIONS *
293 **************************/
295 /* LENNARD-JONES DISPERSION/REPULSION */
297 rinvsix = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
298 vvdw6 = _fjsp_mul_v2r8(c6_00,rinvsix);
299 vvdw12 = _fjsp_mul_v2r8(c12_00,_fjsp_mul_v2r8(rinvsix,rinvsix));
300 vvdw = _fjsp_msub_v2r8( vvdw12,one_twelfth, _fjsp_mul_v2r8(vvdw6,one_sixth) );
301 fvdw = _fjsp_mul_v2r8(_fjsp_sub_v2r8(vvdw12,vvdw6),rinvsq00);
303 /* Update potential sum for this i atom from the interaction with this j atom. */
304 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
308 /* Update vectorial force */
309 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
310 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
311 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
313 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
314 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
315 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
317 /**************************
318 * CALCULATE INTERACTIONS *
319 **************************/
321 r11 = _fjsp_mul_v2r8(rsq11,rinv11);
323 /* Calculate table index by multiplying r with table scale and truncate to integer */
324 rt = _fjsp_mul_v2r8(r11,vftabscale);
325 itab_tmp = _fjsp_dtox_v2r8(rt);
326 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
327 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
328 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
333 /* CUBIC SPLINE TABLE ELECTROSTATICS */
334 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
335 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
336 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
337 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
338 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
339 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
340 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
341 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
342 velec = _fjsp_mul_v2r8(qq11,VV);
343 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
344 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq11,FF),_fjsp_mul_v2r8(vftabscale,rinv11)));
346 /* Update potential sum for this i atom from the interaction with this j atom. */
347 velecsum = _fjsp_add_v2r8(velecsum,velec);
351 /* Update vectorial force */
352 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
353 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
354 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
356 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
357 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
358 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
360 /**************************
361 * CALCULATE INTERACTIONS *
362 **************************/
364 r12 = _fjsp_mul_v2r8(rsq12,rinv12);
366 /* Calculate table index by multiplying r with table scale and truncate to integer */
367 rt = _fjsp_mul_v2r8(r12,vftabscale);
368 itab_tmp = _fjsp_dtox_v2r8(rt);
369 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
370 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
371 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
376 /* CUBIC SPLINE TABLE ELECTROSTATICS */
377 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
378 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
379 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
380 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
381 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
382 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
383 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
384 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
385 velec = _fjsp_mul_v2r8(qq12,VV);
386 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
387 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq12,FF),_fjsp_mul_v2r8(vftabscale,rinv12)));
389 /* Update potential sum for this i atom from the interaction with this j atom. */
390 velecsum = _fjsp_add_v2r8(velecsum,velec);
394 /* Update vectorial force */
395 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
396 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
397 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
399 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
400 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
401 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
403 /**************************
404 * CALCULATE INTERACTIONS *
405 **************************/
407 r13 = _fjsp_mul_v2r8(rsq13,rinv13);
409 /* Calculate table index by multiplying r with table scale and truncate to integer */
410 rt = _fjsp_mul_v2r8(r13,vftabscale);
411 itab_tmp = _fjsp_dtox_v2r8(rt);
412 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
413 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
414 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
419 /* CUBIC SPLINE TABLE ELECTROSTATICS */
420 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
421 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
422 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
423 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
424 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
425 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
426 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
427 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
428 velec = _fjsp_mul_v2r8(qq13,VV);
429 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
430 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq13,FF),_fjsp_mul_v2r8(vftabscale,rinv13)));
432 /* Update potential sum for this i atom from the interaction with this j atom. */
433 velecsum = _fjsp_add_v2r8(velecsum,velec);
437 /* Update vectorial force */
438 fix1 = _fjsp_madd_v2r8(dx13,fscal,fix1);
439 fiy1 = _fjsp_madd_v2r8(dy13,fscal,fiy1);
440 fiz1 = _fjsp_madd_v2r8(dz13,fscal,fiz1);
442 fjx3 = _fjsp_madd_v2r8(dx13,fscal,fjx3);
443 fjy3 = _fjsp_madd_v2r8(dy13,fscal,fjy3);
444 fjz3 = _fjsp_madd_v2r8(dz13,fscal,fjz3);
446 /**************************
447 * CALCULATE INTERACTIONS *
448 **************************/
450 r21 = _fjsp_mul_v2r8(rsq21,rinv21);
452 /* Calculate table index by multiplying r with table scale and truncate to integer */
453 rt = _fjsp_mul_v2r8(r21,vftabscale);
454 itab_tmp = _fjsp_dtox_v2r8(rt);
455 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
456 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
457 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
462 /* CUBIC SPLINE TABLE ELECTROSTATICS */
463 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
464 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
465 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
466 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
467 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
468 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
469 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
470 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
471 velec = _fjsp_mul_v2r8(qq21,VV);
472 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
473 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq21,FF),_fjsp_mul_v2r8(vftabscale,rinv21)));
475 /* Update potential sum for this i atom from the interaction with this j atom. */
476 velecsum = _fjsp_add_v2r8(velecsum,velec);
480 /* Update vectorial force */
481 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
482 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
483 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
485 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
486 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
487 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
489 /**************************
490 * CALCULATE INTERACTIONS *
491 **************************/
493 r22 = _fjsp_mul_v2r8(rsq22,rinv22);
495 /* Calculate table index by multiplying r with table scale and truncate to integer */
496 rt = _fjsp_mul_v2r8(r22,vftabscale);
497 itab_tmp = _fjsp_dtox_v2r8(rt);
498 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
499 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
500 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
505 /* CUBIC SPLINE TABLE ELECTROSTATICS */
506 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
507 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
508 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
509 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
510 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
511 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
512 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
513 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
514 velec = _fjsp_mul_v2r8(qq22,VV);
515 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
516 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq22,FF),_fjsp_mul_v2r8(vftabscale,rinv22)));
518 /* Update potential sum for this i atom from the interaction with this j atom. */
519 velecsum = _fjsp_add_v2r8(velecsum,velec);
523 /* Update vectorial force */
524 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
525 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
526 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
528 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
529 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
530 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
532 /**************************
533 * CALCULATE INTERACTIONS *
534 **************************/
536 r23 = _fjsp_mul_v2r8(rsq23,rinv23);
538 /* Calculate table index by multiplying r with table scale and truncate to integer */
539 rt = _fjsp_mul_v2r8(r23,vftabscale);
540 itab_tmp = _fjsp_dtox_v2r8(rt);
541 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
542 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
543 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
548 /* CUBIC SPLINE TABLE ELECTROSTATICS */
549 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
550 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
551 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
552 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
553 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
554 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
555 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
556 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
557 velec = _fjsp_mul_v2r8(qq23,VV);
558 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
559 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq23,FF),_fjsp_mul_v2r8(vftabscale,rinv23)));
561 /* Update potential sum for this i atom from the interaction with this j atom. */
562 velecsum = _fjsp_add_v2r8(velecsum,velec);
566 /* Update vectorial force */
567 fix2 = _fjsp_madd_v2r8(dx23,fscal,fix2);
568 fiy2 = _fjsp_madd_v2r8(dy23,fscal,fiy2);
569 fiz2 = _fjsp_madd_v2r8(dz23,fscal,fiz2);
571 fjx3 = _fjsp_madd_v2r8(dx23,fscal,fjx3);
572 fjy3 = _fjsp_madd_v2r8(dy23,fscal,fjy3);
573 fjz3 = _fjsp_madd_v2r8(dz23,fscal,fjz3);
575 /**************************
576 * CALCULATE INTERACTIONS *
577 **************************/
579 r31 = _fjsp_mul_v2r8(rsq31,rinv31);
581 /* Calculate table index by multiplying r with table scale and truncate to integer */
582 rt = _fjsp_mul_v2r8(r31,vftabscale);
583 itab_tmp = _fjsp_dtox_v2r8(rt);
584 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
585 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
586 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
591 /* CUBIC SPLINE TABLE ELECTROSTATICS */
592 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
593 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
594 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
595 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
596 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
597 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
598 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
599 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
600 velec = _fjsp_mul_v2r8(qq31,VV);
601 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
602 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq31,FF),_fjsp_mul_v2r8(vftabscale,rinv31)));
604 /* Update potential sum for this i atom from the interaction with this j atom. */
605 velecsum = _fjsp_add_v2r8(velecsum,velec);
609 /* Update vectorial force */
610 fix3 = _fjsp_madd_v2r8(dx31,fscal,fix3);
611 fiy3 = _fjsp_madd_v2r8(dy31,fscal,fiy3);
612 fiz3 = _fjsp_madd_v2r8(dz31,fscal,fiz3);
614 fjx1 = _fjsp_madd_v2r8(dx31,fscal,fjx1);
615 fjy1 = _fjsp_madd_v2r8(dy31,fscal,fjy1);
616 fjz1 = _fjsp_madd_v2r8(dz31,fscal,fjz1);
618 /**************************
619 * CALCULATE INTERACTIONS *
620 **************************/
622 r32 = _fjsp_mul_v2r8(rsq32,rinv32);
624 /* Calculate table index by multiplying r with table scale and truncate to integer */
625 rt = _fjsp_mul_v2r8(r32,vftabscale);
626 itab_tmp = _fjsp_dtox_v2r8(rt);
627 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
628 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
629 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
634 /* CUBIC SPLINE TABLE ELECTROSTATICS */
635 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
636 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
637 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
638 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
639 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
640 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
641 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
642 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
643 velec = _fjsp_mul_v2r8(qq32,VV);
644 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
645 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq32,FF),_fjsp_mul_v2r8(vftabscale,rinv32)));
647 /* Update potential sum for this i atom from the interaction with this j atom. */
648 velecsum = _fjsp_add_v2r8(velecsum,velec);
652 /* Update vectorial force */
653 fix3 = _fjsp_madd_v2r8(dx32,fscal,fix3);
654 fiy3 = _fjsp_madd_v2r8(dy32,fscal,fiy3);
655 fiz3 = _fjsp_madd_v2r8(dz32,fscal,fiz3);
657 fjx2 = _fjsp_madd_v2r8(dx32,fscal,fjx2);
658 fjy2 = _fjsp_madd_v2r8(dy32,fscal,fjy2);
659 fjz2 = _fjsp_madd_v2r8(dz32,fscal,fjz2);
661 /**************************
662 * CALCULATE INTERACTIONS *
663 **************************/
665 r33 = _fjsp_mul_v2r8(rsq33,rinv33);
667 /* Calculate table index by multiplying r with table scale and truncate to integer */
668 rt = _fjsp_mul_v2r8(r33,vftabscale);
669 itab_tmp = _fjsp_dtox_v2r8(rt);
670 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
671 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
672 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
677 /* CUBIC SPLINE TABLE ELECTROSTATICS */
678 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
679 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
680 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
681 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
682 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
683 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
684 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
685 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
686 velec = _fjsp_mul_v2r8(qq33,VV);
687 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
688 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq33,FF),_fjsp_mul_v2r8(vftabscale,rinv33)));
690 /* Update potential sum for this i atom from the interaction with this j atom. */
691 velecsum = _fjsp_add_v2r8(velecsum,velec);
695 /* Update vectorial force */
696 fix3 = _fjsp_madd_v2r8(dx33,fscal,fix3);
697 fiy3 = _fjsp_madd_v2r8(dy33,fscal,fiy3);
698 fiz3 = _fjsp_madd_v2r8(dz33,fscal,fiz3);
700 fjx3 = _fjsp_madd_v2r8(dx33,fscal,fjx3);
701 fjy3 = _fjsp_madd_v2r8(dy33,fscal,fjy3);
702 fjz3 = _fjsp_madd_v2r8(dz33,fscal,fjz3);
704 gmx_fjsp_decrement_4rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2,fjx3,fjy3,fjz3);
706 /* Inner loop uses 452 flops */
713 j_coord_offsetA = DIM*jnrA;
715 /* load j atom coordinates */
716 gmx_fjsp_load_4rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
717 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,
718 &jy2,&jz2,&jx3,&jy3,&jz3);
720 /* Calculate displacement vector */
721 dx00 = _fjsp_sub_v2r8(ix0,jx0);
722 dy00 = _fjsp_sub_v2r8(iy0,jy0);
723 dz00 = _fjsp_sub_v2r8(iz0,jz0);
724 dx11 = _fjsp_sub_v2r8(ix1,jx1);
725 dy11 = _fjsp_sub_v2r8(iy1,jy1);
726 dz11 = _fjsp_sub_v2r8(iz1,jz1);
727 dx12 = _fjsp_sub_v2r8(ix1,jx2);
728 dy12 = _fjsp_sub_v2r8(iy1,jy2);
729 dz12 = _fjsp_sub_v2r8(iz1,jz2);
730 dx13 = _fjsp_sub_v2r8(ix1,jx3);
731 dy13 = _fjsp_sub_v2r8(iy1,jy3);
732 dz13 = _fjsp_sub_v2r8(iz1,jz3);
733 dx21 = _fjsp_sub_v2r8(ix2,jx1);
734 dy21 = _fjsp_sub_v2r8(iy2,jy1);
735 dz21 = _fjsp_sub_v2r8(iz2,jz1);
736 dx22 = _fjsp_sub_v2r8(ix2,jx2);
737 dy22 = _fjsp_sub_v2r8(iy2,jy2);
738 dz22 = _fjsp_sub_v2r8(iz2,jz2);
739 dx23 = _fjsp_sub_v2r8(ix2,jx3);
740 dy23 = _fjsp_sub_v2r8(iy2,jy3);
741 dz23 = _fjsp_sub_v2r8(iz2,jz3);
742 dx31 = _fjsp_sub_v2r8(ix3,jx1);
743 dy31 = _fjsp_sub_v2r8(iy3,jy1);
744 dz31 = _fjsp_sub_v2r8(iz3,jz1);
745 dx32 = _fjsp_sub_v2r8(ix3,jx2);
746 dy32 = _fjsp_sub_v2r8(iy3,jy2);
747 dz32 = _fjsp_sub_v2r8(iz3,jz2);
748 dx33 = _fjsp_sub_v2r8(ix3,jx3);
749 dy33 = _fjsp_sub_v2r8(iy3,jy3);
750 dz33 = _fjsp_sub_v2r8(iz3,jz3);
752 /* Calculate squared distance and things based on it */
753 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
754 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
755 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
756 rsq13 = gmx_fjsp_calc_rsq_v2r8(dx13,dy13,dz13);
757 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
758 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
759 rsq23 = gmx_fjsp_calc_rsq_v2r8(dx23,dy23,dz23);
760 rsq31 = gmx_fjsp_calc_rsq_v2r8(dx31,dy31,dz31);
761 rsq32 = gmx_fjsp_calc_rsq_v2r8(dx32,dy32,dz32);
762 rsq33 = gmx_fjsp_calc_rsq_v2r8(dx33,dy33,dz33);
764 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
765 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
766 rinv13 = gmx_fjsp_invsqrt_v2r8(rsq13);
767 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
768 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
769 rinv23 = gmx_fjsp_invsqrt_v2r8(rsq23);
770 rinv31 = gmx_fjsp_invsqrt_v2r8(rsq31);
771 rinv32 = gmx_fjsp_invsqrt_v2r8(rsq32);
772 rinv33 = gmx_fjsp_invsqrt_v2r8(rsq33);
774 rinvsq00 = gmx_fjsp_inv_v2r8(rsq00);
776 fjx0 = _fjsp_setzero_v2r8();
777 fjy0 = _fjsp_setzero_v2r8();
778 fjz0 = _fjsp_setzero_v2r8();
779 fjx1 = _fjsp_setzero_v2r8();
780 fjy1 = _fjsp_setzero_v2r8();
781 fjz1 = _fjsp_setzero_v2r8();
782 fjx2 = _fjsp_setzero_v2r8();
783 fjy2 = _fjsp_setzero_v2r8();
784 fjz2 = _fjsp_setzero_v2r8();
785 fjx3 = _fjsp_setzero_v2r8();
786 fjy3 = _fjsp_setzero_v2r8();
787 fjz3 = _fjsp_setzero_v2r8();
789 /**************************
790 * CALCULATE INTERACTIONS *
791 **************************/
793 /* LENNARD-JONES DISPERSION/REPULSION */
795 rinvsix = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
796 vvdw6 = _fjsp_mul_v2r8(c6_00,rinvsix);
797 vvdw12 = _fjsp_mul_v2r8(c12_00,_fjsp_mul_v2r8(rinvsix,rinvsix));
798 vvdw = _fjsp_msub_v2r8( vvdw12,one_twelfth, _fjsp_mul_v2r8(vvdw6,one_sixth) );
799 fvdw = _fjsp_mul_v2r8(_fjsp_sub_v2r8(vvdw12,vvdw6),rinvsq00);
801 /* Update potential sum for this i atom from the interaction with this j atom. */
802 vvdw = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
803 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
807 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
809 /* Update vectorial force */
810 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
811 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
812 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
814 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
815 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
816 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
818 /**************************
819 * CALCULATE INTERACTIONS *
820 **************************/
822 r11 = _fjsp_mul_v2r8(rsq11,rinv11);
824 /* Calculate table index by multiplying r with table scale and truncate to integer */
825 rt = _fjsp_mul_v2r8(r11,vftabscale);
826 itab_tmp = _fjsp_dtox_v2r8(rt);
827 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
828 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
829 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
834 /* CUBIC SPLINE TABLE ELECTROSTATICS */
835 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
836 F = _fjsp_setzero_v2r8();
837 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
838 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
839 H = _fjsp_setzero_v2r8();
840 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
841 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
842 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
843 velec = _fjsp_mul_v2r8(qq11,VV);
844 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
845 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq11,FF),_fjsp_mul_v2r8(vftabscale,rinv11)));
847 /* Update potential sum for this i atom from the interaction with this j atom. */
848 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
849 velecsum = _fjsp_add_v2r8(velecsum,velec);
853 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
855 /* Update vectorial force */
856 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
857 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
858 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
860 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
861 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
862 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
864 /**************************
865 * CALCULATE INTERACTIONS *
866 **************************/
868 r12 = _fjsp_mul_v2r8(rsq12,rinv12);
870 /* Calculate table index by multiplying r with table scale and truncate to integer */
871 rt = _fjsp_mul_v2r8(r12,vftabscale);
872 itab_tmp = _fjsp_dtox_v2r8(rt);
873 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
874 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
875 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
880 /* CUBIC SPLINE TABLE ELECTROSTATICS */
881 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
882 F = _fjsp_setzero_v2r8();
883 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
884 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
885 H = _fjsp_setzero_v2r8();
886 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
887 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
888 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
889 velec = _fjsp_mul_v2r8(qq12,VV);
890 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
891 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq12,FF),_fjsp_mul_v2r8(vftabscale,rinv12)));
893 /* Update potential sum for this i atom from the interaction with this j atom. */
894 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
895 velecsum = _fjsp_add_v2r8(velecsum,velec);
899 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
901 /* Update vectorial force */
902 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
903 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
904 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
906 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
907 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
908 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
910 /**************************
911 * CALCULATE INTERACTIONS *
912 **************************/
914 r13 = _fjsp_mul_v2r8(rsq13,rinv13);
916 /* Calculate table index by multiplying r with table scale and truncate to integer */
917 rt = _fjsp_mul_v2r8(r13,vftabscale);
918 itab_tmp = _fjsp_dtox_v2r8(rt);
919 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
920 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
921 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
926 /* CUBIC SPLINE TABLE ELECTROSTATICS */
927 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
928 F = _fjsp_setzero_v2r8();
929 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
930 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
931 H = _fjsp_setzero_v2r8();
932 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
933 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
934 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
935 velec = _fjsp_mul_v2r8(qq13,VV);
936 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
937 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq13,FF),_fjsp_mul_v2r8(vftabscale,rinv13)));
939 /* Update potential sum for this i atom from the interaction with this j atom. */
940 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
941 velecsum = _fjsp_add_v2r8(velecsum,velec);
945 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
947 /* Update vectorial force */
948 fix1 = _fjsp_madd_v2r8(dx13,fscal,fix1);
949 fiy1 = _fjsp_madd_v2r8(dy13,fscal,fiy1);
950 fiz1 = _fjsp_madd_v2r8(dz13,fscal,fiz1);
952 fjx3 = _fjsp_madd_v2r8(dx13,fscal,fjx3);
953 fjy3 = _fjsp_madd_v2r8(dy13,fscal,fjy3);
954 fjz3 = _fjsp_madd_v2r8(dz13,fscal,fjz3);
956 /**************************
957 * CALCULATE INTERACTIONS *
958 **************************/
960 r21 = _fjsp_mul_v2r8(rsq21,rinv21);
962 /* Calculate table index by multiplying r with table scale and truncate to integer */
963 rt = _fjsp_mul_v2r8(r21,vftabscale);
964 itab_tmp = _fjsp_dtox_v2r8(rt);
965 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
966 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
967 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
972 /* CUBIC SPLINE TABLE ELECTROSTATICS */
973 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
974 F = _fjsp_setzero_v2r8();
975 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
976 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
977 H = _fjsp_setzero_v2r8();
978 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
979 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
980 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
981 velec = _fjsp_mul_v2r8(qq21,VV);
982 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
983 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq21,FF),_fjsp_mul_v2r8(vftabscale,rinv21)));
985 /* Update potential sum for this i atom from the interaction with this j atom. */
986 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
987 velecsum = _fjsp_add_v2r8(velecsum,velec);
991 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
993 /* Update vectorial force */
994 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
995 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
996 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
998 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
999 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
1000 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
1002 /**************************
1003 * CALCULATE INTERACTIONS *
1004 **************************/
1006 r22 = _fjsp_mul_v2r8(rsq22,rinv22);
1008 /* Calculate table index by multiplying r with table scale and truncate to integer */
1009 rt = _fjsp_mul_v2r8(r22,vftabscale);
1010 itab_tmp = _fjsp_dtox_v2r8(rt);
1011 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1012 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1013 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1018 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1019 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1020 F = _fjsp_setzero_v2r8();
1021 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1022 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1023 H = _fjsp_setzero_v2r8();
1024 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1025 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1026 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
1027 velec = _fjsp_mul_v2r8(qq22,VV);
1028 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1029 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq22,FF),_fjsp_mul_v2r8(vftabscale,rinv22)));
1031 /* Update potential sum for this i atom from the interaction with this j atom. */
1032 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1033 velecsum = _fjsp_add_v2r8(velecsum,velec);
1037 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1039 /* Update vectorial force */
1040 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
1041 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
1042 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
1044 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
1045 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
1046 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
1048 /**************************
1049 * CALCULATE INTERACTIONS *
1050 **************************/
1052 r23 = _fjsp_mul_v2r8(rsq23,rinv23);
1054 /* Calculate table index by multiplying r with table scale and truncate to integer */
1055 rt = _fjsp_mul_v2r8(r23,vftabscale);
1056 itab_tmp = _fjsp_dtox_v2r8(rt);
1057 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1058 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1059 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1064 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1065 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1066 F = _fjsp_setzero_v2r8();
1067 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1068 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1069 H = _fjsp_setzero_v2r8();
1070 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1071 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1072 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
1073 velec = _fjsp_mul_v2r8(qq23,VV);
1074 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1075 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq23,FF),_fjsp_mul_v2r8(vftabscale,rinv23)));
1077 /* Update potential sum for this i atom from the interaction with this j atom. */
1078 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1079 velecsum = _fjsp_add_v2r8(velecsum,velec);
1083 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1085 /* Update vectorial force */
1086 fix2 = _fjsp_madd_v2r8(dx23,fscal,fix2);
1087 fiy2 = _fjsp_madd_v2r8(dy23,fscal,fiy2);
1088 fiz2 = _fjsp_madd_v2r8(dz23,fscal,fiz2);
1090 fjx3 = _fjsp_madd_v2r8(dx23,fscal,fjx3);
1091 fjy3 = _fjsp_madd_v2r8(dy23,fscal,fjy3);
1092 fjz3 = _fjsp_madd_v2r8(dz23,fscal,fjz3);
1094 /**************************
1095 * CALCULATE INTERACTIONS *
1096 **************************/
1098 r31 = _fjsp_mul_v2r8(rsq31,rinv31);
1100 /* Calculate table index by multiplying r with table scale and truncate to integer */
1101 rt = _fjsp_mul_v2r8(r31,vftabscale);
1102 itab_tmp = _fjsp_dtox_v2r8(rt);
1103 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1104 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1105 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1110 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1111 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1112 F = _fjsp_setzero_v2r8();
1113 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1114 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1115 H = _fjsp_setzero_v2r8();
1116 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1117 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1118 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
1119 velec = _fjsp_mul_v2r8(qq31,VV);
1120 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1121 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq31,FF),_fjsp_mul_v2r8(vftabscale,rinv31)));
1123 /* Update potential sum for this i atom from the interaction with this j atom. */
1124 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1125 velecsum = _fjsp_add_v2r8(velecsum,velec);
1129 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1131 /* Update vectorial force */
1132 fix3 = _fjsp_madd_v2r8(dx31,fscal,fix3);
1133 fiy3 = _fjsp_madd_v2r8(dy31,fscal,fiy3);
1134 fiz3 = _fjsp_madd_v2r8(dz31,fscal,fiz3);
1136 fjx1 = _fjsp_madd_v2r8(dx31,fscal,fjx1);
1137 fjy1 = _fjsp_madd_v2r8(dy31,fscal,fjy1);
1138 fjz1 = _fjsp_madd_v2r8(dz31,fscal,fjz1);
1140 /**************************
1141 * CALCULATE INTERACTIONS *
1142 **************************/
1144 r32 = _fjsp_mul_v2r8(rsq32,rinv32);
1146 /* Calculate table index by multiplying r with table scale and truncate to integer */
1147 rt = _fjsp_mul_v2r8(r32,vftabscale);
1148 itab_tmp = _fjsp_dtox_v2r8(rt);
1149 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1150 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1151 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1156 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1157 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1158 F = _fjsp_setzero_v2r8();
1159 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1160 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1161 H = _fjsp_setzero_v2r8();
1162 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1163 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1164 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
1165 velec = _fjsp_mul_v2r8(qq32,VV);
1166 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1167 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq32,FF),_fjsp_mul_v2r8(vftabscale,rinv32)));
1169 /* Update potential sum for this i atom from the interaction with this j atom. */
1170 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1171 velecsum = _fjsp_add_v2r8(velecsum,velec);
1175 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1177 /* Update vectorial force */
1178 fix3 = _fjsp_madd_v2r8(dx32,fscal,fix3);
1179 fiy3 = _fjsp_madd_v2r8(dy32,fscal,fiy3);
1180 fiz3 = _fjsp_madd_v2r8(dz32,fscal,fiz3);
1182 fjx2 = _fjsp_madd_v2r8(dx32,fscal,fjx2);
1183 fjy2 = _fjsp_madd_v2r8(dy32,fscal,fjy2);
1184 fjz2 = _fjsp_madd_v2r8(dz32,fscal,fjz2);
1186 /**************************
1187 * CALCULATE INTERACTIONS *
1188 **************************/
1190 r33 = _fjsp_mul_v2r8(rsq33,rinv33);
1192 /* Calculate table index by multiplying r with table scale and truncate to integer */
1193 rt = _fjsp_mul_v2r8(r33,vftabscale);
1194 itab_tmp = _fjsp_dtox_v2r8(rt);
1195 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1196 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1197 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1202 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1203 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1204 F = _fjsp_setzero_v2r8();
1205 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1206 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1207 H = _fjsp_setzero_v2r8();
1208 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1209 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1210 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
1211 velec = _fjsp_mul_v2r8(qq33,VV);
1212 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1213 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq33,FF),_fjsp_mul_v2r8(vftabscale,rinv33)));
1215 /* Update potential sum for this i atom from the interaction with this j atom. */
1216 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1217 velecsum = _fjsp_add_v2r8(velecsum,velec);
1221 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1223 /* Update vectorial force */
1224 fix3 = _fjsp_madd_v2r8(dx33,fscal,fix3);
1225 fiy3 = _fjsp_madd_v2r8(dy33,fscal,fiy3);
1226 fiz3 = _fjsp_madd_v2r8(dz33,fscal,fiz3);
1228 fjx3 = _fjsp_madd_v2r8(dx33,fscal,fjx3);
1229 fjy3 = _fjsp_madd_v2r8(dy33,fscal,fjy3);
1230 fjz3 = _fjsp_madd_v2r8(dz33,fscal,fjz3);
1232 gmx_fjsp_decrement_4rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2,fjx3,fjy3,fjz3);
1234 /* Inner loop uses 452 flops */
1237 /* End of innermost loop */
1239 gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
1240 f+i_coord_offset,fshift+i_shift_offset);
1243 /* Update potential energies */
1244 gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
1245 gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
1247 /* Increment number of inner iterations */
1248 inneriter += j_index_end - j_index_start;
1250 /* Outer loop uses 26 flops */
1253 /* Increment number of outer iterations */
1256 /* Update outer/inner flops */
1258 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4W4_VF,outeriter*26 + inneriter*452);
1261 * Gromacs nonbonded kernel: nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sparc64_hpc_ace_double
1262 * Electrostatics interaction: CubicSplineTable
1263 * VdW interaction: LennardJones
1264 * Geometry: Water4-Water4
1265 * Calculate force/pot: Force
1268 nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sparc64_hpc_ace_double
1269 (t_nblist * gmx_restrict nlist,
1270 rvec * gmx_restrict xx,
1271 rvec * gmx_restrict ff,
1272 t_forcerec * gmx_restrict fr,
1273 t_mdatoms * gmx_restrict mdatoms,
1274 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
1275 t_nrnb * gmx_restrict nrnb)
1277 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
1278 * just 0 for non-waters.
1279 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
1280 * jnr indices corresponding to data put in the four positions in the SIMD register.
1282 int i_shift_offset,i_coord_offset,outeriter,inneriter;
1283 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
1285 int j_coord_offsetA,j_coord_offsetB;
1286 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
1287 real rcutoff_scalar;
1288 real *shiftvec,*fshift,*x,*f;
1289 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
1291 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
1293 _fjsp_v2r8 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
1295 _fjsp_v2r8 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
1297 _fjsp_v2r8 ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
1298 int vdwjidx0A,vdwjidx0B;
1299 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
1300 int vdwjidx1A,vdwjidx1B;
1301 _fjsp_v2r8 jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
1302 int vdwjidx2A,vdwjidx2B;
1303 _fjsp_v2r8 jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
1304 int vdwjidx3A,vdwjidx3B;
1305 _fjsp_v2r8 jx3,jy3,jz3,fjx3,fjy3,fjz3,jq3,isaj3;
1306 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
1307 _fjsp_v2r8 dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11;
1308 _fjsp_v2r8 dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12;
1309 _fjsp_v2r8 dx13,dy13,dz13,rsq13,rinv13,rinvsq13,r13,qq13,c6_13,c12_13;
1310 _fjsp_v2r8 dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21;
1311 _fjsp_v2r8 dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22;
1312 _fjsp_v2r8 dx23,dy23,dz23,rsq23,rinv23,rinvsq23,r23,qq23,c6_23,c12_23;
1313 _fjsp_v2r8 dx31,dy31,dz31,rsq31,rinv31,rinvsq31,r31,qq31,c6_31,c12_31;
1314 _fjsp_v2r8 dx32,dy32,dz32,rsq32,rinv32,rinvsq32,r32,qq32,c6_32,c12_32;
1315 _fjsp_v2r8 dx33,dy33,dz33,rsq33,rinv33,rinvsq33,r33,qq33,c6_33,c12_33;
1316 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
1319 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
1322 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
1323 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
1324 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
1326 _fjsp_v2r8 itab_tmp;
1327 _fjsp_v2r8 dummy_mask,cutoff_mask;
1328 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
1329 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
1330 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
1337 jindex = nlist->jindex;
1339 shiftidx = nlist->shift;
1341 shiftvec = fr->shift_vec[0];
1342 fshift = fr->fshift[0];
1343 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
1344 charge = mdatoms->chargeA;
1345 nvdwtype = fr->ntype;
1346 vdwparam = fr->nbfp;
1347 vdwtype = mdatoms->typeA;
1349 vftab = kernel_data->table_elec->data;
1350 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_elec->scale);
1352 /* Setup water-specific parameters */
1353 inr = nlist->iinr[0];
1354 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
1355 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
1356 iq3 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+3]));
1357 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
1359 jq1 = gmx_fjsp_set1_v2r8(charge[inr+1]);
1360 jq2 = gmx_fjsp_set1_v2r8(charge[inr+2]);
1361 jq3 = gmx_fjsp_set1_v2r8(charge[inr+3]);
1362 vdwjidx0A = 2*vdwtype[inr+0];
1363 c6_00 = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A]);
1364 c12_00 = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A+1]);
1365 qq11 = _fjsp_mul_v2r8(iq1,jq1);
1366 qq12 = _fjsp_mul_v2r8(iq1,jq2);
1367 qq13 = _fjsp_mul_v2r8(iq1,jq3);
1368 qq21 = _fjsp_mul_v2r8(iq2,jq1);
1369 qq22 = _fjsp_mul_v2r8(iq2,jq2);
1370 qq23 = _fjsp_mul_v2r8(iq2,jq3);
1371 qq31 = _fjsp_mul_v2r8(iq3,jq1);
1372 qq32 = _fjsp_mul_v2r8(iq3,jq2);
1373 qq33 = _fjsp_mul_v2r8(iq3,jq3);
1375 /* Avoid stupid compiler warnings */
1377 j_coord_offsetA = 0;
1378 j_coord_offsetB = 0;
1383 /* Start outer loop over neighborlists */
1384 for(iidx=0; iidx<nri; iidx++)
1386 /* Load shift vector for this list */
1387 i_shift_offset = DIM*shiftidx[iidx];
1389 /* Load limits for loop over neighbors */
1390 j_index_start = jindex[iidx];
1391 j_index_end = jindex[iidx+1];
1393 /* Get outer coordinate index */
1395 i_coord_offset = DIM*inr;
1397 /* Load i particle coords and add shift vector */
1398 gmx_fjsp_load_shift_and_4rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
1399 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
1401 fix0 = _fjsp_setzero_v2r8();
1402 fiy0 = _fjsp_setzero_v2r8();
1403 fiz0 = _fjsp_setzero_v2r8();
1404 fix1 = _fjsp_setzero_v2r8();
1405 fiy1 = _fjsp_setzero_v2r8();
1406 fiz1 = _fjsp_setzero_v2r8();
1407 fix2 = _fjsp_setzero_v2r8();
1408 fiy2 = _fjsp_setzero_v2r8();
1409 fiz2 = _fjsp_setzero_v2r8();
1410 fix3 = _fjsp_setzero_v2r8();
1411 fiy3 = _fjsp_setzero_v2r8();
1412 fiz3 = _fjsp_setzero_v2r8();
1414 /* Start inner kernel loop */
1415 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
1418 /* Get j neighbor index, and coordinate index */
1420 jnrB = jjnr[jidx+1];
1421 j_coord_offsetA = DIM*jnrA;
1422 j_coord_offsetB = DIM*jnrB;
1424 /* load j atom coordinates */
1425 gmx_fjsp_load_4rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
1426 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,
1427 &jy2,&jz2,&jx3,&jy3,&jz3);
1429 /* Calculate displacement vector */
1430 dx00 = _fjsp_sub_v2r8(ix0,jx0);
1431 dy00 = _fjsp_sub_v2r8(iy0,jy0);
1432 dz00 = _fjsp_sub_v2r8(iz0,jz0);
1433 dx11 = _fjsp_sub_v2r8(ix1,jx1);
1434 dy11 = _fjsp_sub_v2r8(iy1,jy1);
1435 dz11 = _fjsp_sub_v2r8(iz1,jz1);
1436 dx12 = _fjsp_sub_v2r8(ix1,jx2);
1437 dy12 = _fjsp_sub_v2r8(iy1,jy2);
1438 dz12 = _fjsp_sub_v2r8(iz1,jz2);
1439 dx13 = _fjsp_sub_v2r8(ix1,jx3);
1440 dy13 = _fjsp_sub_v2r8(iy1,jy3);
1441 dz13 = _fjsp_sub_v2r8(iz1,jz3);
1442 dx21 = _fjsp_sub_v2r8(ix2,jx1);
1443 dy21 = _fjsp_sub_v2r8(iy2,jy1);
1444 dz21 = _fjsp_sub_v2r8(iz2,jz1);
1445 dx22 = _fjsp_sub_v2r8(ix2,jx2);
1446 dy22 = _fjsp_sub_v2r8(iy2,jy2);
1447 dz22 = _fjsp_sub_v2r8(iz2,jz2);
1448 dx23 = _fjsp_sub_v2r8(ix2,jx3);
1449 dy23 = _fjsp_sub_v2r8(iy2,jy3);
1450 dz23 = _fjsp_sub_v2r8(iz2,jz3);
1451 dx31 = _fjsp_sub_v2r8(ix3,jx1);
1452 dy31 = _fjsp_sub_v2r8(iy3,jy1);
1453 dz31 = _fjsp_sub_v2r8(iz3,jz1);
1454 dx32 = _fjsp_sub_v2r8(ix3,jx2);
1455 dy32 = _fjsp_sub_v2r8(iy3,jy2);
1456 dz32 = _fjsp_sub_v2r8(iz3,jz2);
1457 dx33 = _fjsp_sub_v2r8(ix3,jx3);
1458 dy33 = _fjsp_sub_v2r8(iy3,jy3);
1459 dz33 = _fjsp_sub_v2r8(iz3,jz3);
1461 /* Calculate squared distance and things based on it */
1462 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
1463 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
1464 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
1465 rsq13 = gmx_fjsp_calc_rsq_v2r8(dx13,dy13,dz13);
1466 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
1467 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
1468 rsq23 = gmx_fjsp_calc_rsq_v2r8(dx23,dy23,dz23);
1469 rsq31 = gmx_fjsp_calc_rsq_v2r8(dx31,dy31,dz31);
1470 rsq32 = gmx_fjsp_calc_rsq_v2r8(dx32,dy32,dz32);
1471 rsq33 = gmx_fjsp_calc_rsq_v2r8(dx33,dy33,dz33);
1473 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
1474 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
1475 rinv13 = gmx_fjsp_invsqrt_v2r8(rsq13);
1476 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
1477 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
1478 rinv23 = gmx_fjsp_invsqrt_v2r8(rsq23);
1479 rinv31 = gmx_fjsp_invsqrt_v2r8(rsq31);
1480 rinv32 = gmx_fjsp_invsqrt_v2r8(rsq32);
1481 rinv33 = gmx_fjsp_invsqrt_v2r8(rsq33);
1483 rinvsq00 = gmx_fjsp_inv_v2r8(rsq00);
1485 fjx0 = _fjsp_setzero_v2r8();
1486 fjy0 = _fjsp_setzero_v2r8();
1487 fjz0 = _fjsp_setzero_v2r8();
1488 fjx1 = _fjsp_setzero_v2r8();
1489 fjy1 = _fjsp_setzero_v2r8();
1490 fjz1 = _fjsp_setzero_v2r8();
1491 fjx2 = _fjsp_setzero_v2r8();
1492 fjy2 = _fjsp_setzero_v2r8();
1493 fjz2 = _fjsp_setzero_v2r8();
1494 fjx3 = _fjsp_setzero_v2r8();
1495 fjy3 = _fjsp_setzero_v2r8();
1496 fjz3 = _fjsp_setzero_v2r8();
1498 /**************************
1499 * CALCULATE INTERACTIONS *
1500 **************************/
1502 /* LENNARD-JONES DISPERSION/REPULSION */
1504 rinvsix = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
1505 fvdw = _fjsp_mul_v2r8(_fjsp_msub_v2r8(c12_00,rinvsix,c6_00),_fjsp_mul_v2r8(rinvsix,rinvsq00));
1509 /* Update vectorial force */
1510 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
1511 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
1512 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
1514 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
1515 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
1516 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
1518 /**************************
1519 * CALCULATE INTERACTIONS *
1520 **************************/
1522 r11 = _fjsp_mul_v2r8(rsq11,rinv11);
1524 /* Calculate table index by multiplying r with table scale and truncate to integer */
1525 rt = _fjsp_mul_v2r8(r11,vftabscale);
1526 itab_tmp = _fjsp_dtox_v2r8(rt);
1527 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1528 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1529 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1534 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1535 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1536 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
1537 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1538 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1539 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
1540 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1541 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1542 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1543 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq11,FF),_fjsp_mul_v2r8(vftabscale,rinv11)));
1547 /* Update vectorial force */
1548 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
1549 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
1550 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
1552 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
1553 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
1554 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
1556 /**************************
1557 * CALCULATE INTERACTIONS *
1558 **************************/
1560 r12 = _fjsp_mul_v2r8(rsq12,rinv12);
1562 /* Calculate table index by multiplying r with table scale and truncate to integer */
1563 rt = _fjsp_mul_v2r8(r12,vftabscale);
1564 itab_tmp = _fjsp_dtox_v2r8(rt);
1565 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1566 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1567 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1572 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1573 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1574 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
1575 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1576 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1577 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
1578 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1579 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1580 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1581 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq12,FF),_fjsp_mul_v2r8(vftabscale,rinv12)));
1585 /* Update vectorial force */
1586 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
1587 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
1588 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
1590 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
1591 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
1592 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
1594 /**************************
1595 * CALCULATE INTERACTIONS *
1596 **************************/
1598 r13 = _fjsp_mul_v2r8(rsq13,rinv13);
1600 /* Calculate table index by multiplying r with table scale and truncate to integer */
1601 rt = _fjsp_mul_v2r8(r13,vftabscale);
1602 itab_tmp = _fjsp_dtox_v2r8(rt);
1603 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1604 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1605 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1610 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1611 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1612 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
1613 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1614 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1615 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
1616 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1617 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1618 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1619 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq13,FF),_fjsp_mul_v2r8(vftabscale,rinv13)));
1623 /* Update vectorial force */
1624 fix1 = _fjsp_madd_v2r8(dx13,fscal,fix1);
1625 fiy1 = _fjsp_madd_v2r8(dy13,fscal,fiy1);
1626 fiz1 = _fjsp_madd_v2r8(dz13,fscal,fiz1);
1628 fjx3 = _fjsp_madd_v2r8(dx13,fscal,fjx3);
1629 fjy3 = _fjsp_madd_v2r8(dy13,fscal,fjy3);
1630 fjz3 = _fjsp_madd_v2r8(dz13,fscal,fjz3);
1632 /**************************
1633 * CALCULATE INTERACTIONS *
1634 **************************/
1636 r21 = _fjsp_mul_v2r8(rsq21,rinv21);
1638 /* Calculate table index by multiplying r with table scale and truncate to integer */
1639 rt = _fjsp_mul_v2r8(r21,vftabscale);
1640 itab_tmp = _fjsp_dtox_v2r8(rt);
1641 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1642 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1643 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1648 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1649 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1650 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
1651 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1652 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1653 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
1654 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1655 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1656 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1657 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq21,FF),_fjsp_mul_v2r8(vftabscale,rinv21)));
1661 /* Update vectorial force */
1662 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
1663 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
1664 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
1666 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
1667 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
1668 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
1670 /**************************
1671 * CALCULATE INTERACTIONS *
1672 **************************/
1674 r22 = _fjsp_mul_v2r8(rsq22,rinv22);
1676 /* Calculate table index by multiplying r with table scale and truncate to integer */
1677 rt = _fjsp_mul_v2r8(r22,vftabscale);
1678 itab_tmp = _fjsp_dtox_v2r8(rt);
1679 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1680 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1681 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1686 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1687 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1688 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
1689 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1690 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1691 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
1692 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1693 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1694 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1695 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq22,FF),_fjsp_mul_v2r8(vftabscale,rinv22)));
1699 /* Update vectorial force */
1700 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
1701 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
1702 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
1704 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
1705 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
1706 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
1708 /**************************
1709 * CALCULATE INTERACTIONS *
1710 **************************/
1712 r23 = _fjsp_mul_v2r8(rsq23,rinv23);
1714 /* Calculate table index by multiplying r with table scale and truncate to integer */
1715 rt = _fjsp_mul_v2r8(r23,vftabscale);
1716 itab_tmp = _fjsp_dtox_v2r8(rt);
1717 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1718 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1719 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1724 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1725 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1726 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
1727 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1728 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1729 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
1730 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1731 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1732 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1733 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq23,FF),_fjsp_mul_v2r8(vftabscale,rinv23)));
1737 /* Update vectorial force */
1738 fix2 = _fjsp_madd_v2r8(dx23,fscal,fix2);
1739 fiy2 = _fjsp_madd_v2r8(dy23,fscal,fiy2);
1740 fiz2 = _fjsp_madd_v2r8(dz23,fscal,fiz2);
1742 fjx3 = _fjsp_madd_v2r8(dx23,fscal,fjx3);
1743 fjy3 = _fjsp_madd_v2r8(dy23,fscal,fjy3);
1744 fjz3 = _fjsp_madd_v2r8(dz23,fscal,fjz3);
1746 /**************************
1747 * CALCULATE INTERACTIONS *
1748 **************************/
1750 r31 = _fjsp_mul_v2r8(rsq31,rinv31);
1752 /* Calculate table index by multiplying r with table scale and truncate to integer */
1753 rt = _fjsp_mul_v2r8(r31,vftabscale);
1754 itab_tmp = _fjsp_dtox_v2r8(rt);
1755 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1756 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1757 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1762 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1763 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1764 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
1765 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1766 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1767 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
1768 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1769 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1770 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1771 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq31,FF),_fjsp_mul_v2r8(vftabscale,rinv31)));
1775 /* Update vectorial force */
1776 fix3 = _fjsp_madd_v2r8(dx31,fscal,fix3);
1777 fiy3 = _fjsp_madd_v2r8(dy31,fscal,fiy3);
1778 fiz3 = _fjsp_madd_v2r8(dz31,fscal,fiz3);
1780 fjx1 = _fjsp_madd_v2r8(dx31,fscal,fjx1);
1781 fjy1 = _fjsp_madd_v2r8(dy31,fscal,fjy1);
1782 fjz1 = _fjsp_madd_v2r8(dz31,fscal,fjz1);
1784 /**************************
1785 * CALCULATE INTERACTIONS *
1786 **************************/
1788 r32 = _fjsp_mul_v2r8(rsq32,rinv32);
1790 /* Calculate table index by multiplying r with table scale and truncate to integer */
1791 rt = _fjsp_mul_v2r8(r32,vftabscale);
1792 itab_tmp = _fjsp_dtox_v2r8(rt);
1793 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1794 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1795 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1800 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1801 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1802 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
1803 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1804 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1805 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
1806 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1807 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1808 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1809 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq32,FF),_fjsp_mul_v2r8(vftabscale,rinv32)));
1813 /* Update vectorial force */
1814 fix3 = _fjsp_madd_v2r8(dx32,fscal,fix3);
1815 fiy3 = _fjsp_madd_v2r8(dy32,fscal,fiy3);
1816 fiz3 = _fjsp_madd_v2r8(dz32,fscal,fiz3);
1818 fjx2 = _fjsp_madd_v2r8(dx32,fscal,fjx2);
1819 fjy2 = _fjsp_madd_v2r8(dy32,fscal,fjy2);
1820 fjz2 = _fjsp_madd_v2r8(dz32,fscal,fjz2);
1822 /**************************
1823 * CALCULATE INTERACTIONS *
1824 **************************/
1826 r33 = _fjsp_mul_v2r8(rsq33,rinv33);
1828 /* Calculate table index by multiplying r with table scale and truncate to integer */
1829 rt = _fjsp_mul_v2r8(r33,vftabscale);
1830 itab_tmp = _fjsp_dtox_v2r8(rt);
1831 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1832 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1833 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1838 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1839 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1840 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
1841 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1842 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1843 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
1844 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1845 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1846 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1847 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq33,FF),_fjsp_mul_v2r8(vftabscale,rinv33)));
1851 /* Update vectorial force */
1852 fix3 = _fjsp_madd_v2r8(dx33,fscal,fix3);
1853 fiy3 = _fjsp_madd_v2r8(dy33,fscal,fiy3);
1854 fiz3 = _fjsp_madd_v2r8(dz33,fscal,fiz3);
1856 fjx3 = _fjsp_madd_v2r8(dx33,fscal,fjx3);
1857 fjy3 = _fjsp_madd_v2r8(dy33,fscal,fjy3);
1858 fjz3 = _fjsp_madd_v2r8(dz33,fscal,fjz3);
1860 gmx_fjsp_decrement_4rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2,fjx3,fjy3,fjz3);
1862 /* Inner loop uses 411 flops */
1865 if(jidx<j_index_end)
1869 j_coord_offsetA = DIM*jnrA;
1871 /* load j atom coordinates */
1872 gmx_fjsp_load_4rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
1873 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,
1874 &jy2,&jz2,&jx3,&jy3,&jz3);
1876 /* Calculate displacement vector */
1877 dx00 = _fjsp_sub_v2r8(ix0,jx0);
1878 dy00 = _fjsp_sub_v2r8(iy0,jy0);
1879 dz00 = _fjsp_sub_v2r8(iz0,jz0);
1880 dx11 = _fjsp_sub_v2r8(ix1,jx1);
1881 dy11 = _fjsp_sub_v2r8(iy1,jy1);
1882 dz11 = _fjsp_sub_v2r8(iz1,jz1);
1883 dx12 = _fjsp_sub_v2r8(ix1,jx2);
1884 dy12 = _fjsp_sub_v2r8(iy1,jy2);
1885 dz12 = _fjsp_sub_v2r8(iz1,jz2);
1886 dx13 = _fjsp_sub_v2r8(ix1,jx3);
1887 dy13 = _fjsp_sub_v2r8(iy1,jy3);
1888 dz13 = _fjsp_sub_v2r8(iz1,jz3);
1889 dx21 = _fjsp_sub_v2r8(ix2,jx1);
1890 dy21 = _fjsp_sub_v2r8(iy2,jy1);
1891 dz21 = _fjsp_sub_v2r8(iz2,jz1);
1892 dx22 = _fjsp_sub_v2r8(ix2,jx2);
1893 dy22 = _fjsp_sub_v2r8(iy2,jy2);
1894 dz22 = _fjsp_sub_v2r8(iz2,jz2);
1895 dx23 = _fjsp_sub_v2r8(ix2,jx3);
1896 dy23 = _fjsp_sub_v2r8(iy2,jy3);
1897 dz23 = _fjsp_sub_v2r8(iz2,jz3);
1898 dx31 = _fjsp_sub_v2r8(ix3,jx1);
1899 dy31 = _fjsp_sub_v2r8(iy3,jy1);
1900 dz31 = _fjsp_sub_v2r8(iz3,jz1);
1901 dx32 = _fjsp_sub_v2r8(ix3,jx2);
1902 dy32 = _fjsp_sub_v2r8(iy3,jy2);
1903 dz32 = _fjsp_sub_v2r8(iz3,jz2);
1904 dx33 = _fjsp_sub_v2r8(ix3,jx3);
1905 dy33 = _fjsp_sub_v2r8(iy3,jy3);
1906 dz33 = _fjsp_sub_v2r8(iz3,jz3);
1908 /* Calculate squared distance and things based on it */
1909 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
1910 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
1911 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
1912 rsq13 = gmx_fjsp_calc_rsq_v2r8(dx13,dy13,dz13);
1913 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
1914 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
1915 rsq23 = gmx_fjsp_calc_rsq_v2r8(dx23,dy23,dz23);
1916 rsq31 = gmx_fjsp_calc_rsq_v2r8(dx31,dy31,dz31);
1917 rsq32 = gmx_fjsp_calc_rsq_v2r8(dx32,dy32,dz32);
1918 rsq33 = gmx_fjsp_calc_rsq_v2r8(dx33,dy33,dz33);
1920 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
1921 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
1922 rinv13 = gmx_fjsp_invsqrt_v2r8(rsq13);
1923 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
1924 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
1925 rinv23 = gmx_fjsp_invsqrt_v2r8(rsq23);
1926 rinv31 = gmx_fjsp_invsqrt_v2r8(rsq31);
1927 rinv32 = gmx_fjsp_invsqrt_v2r8(rsq32);
1928 rinv33 = gmx_fjsp_invsqrt_v2r8(rsq33);
1930 rinvsq00 = gmx_fjsp_inv_v2r8(rsq00);
1932 fjx0 = _fjsp_setzero_v2r8();
1933 fjy0 = _fjsp_setzero_v2r8();
1934 fjz0 = _fjsp_setzero_v2r8();
1935 fjx1 = _fjsp_setzero_v2r8();
1936 fjy1 = _fjsp_setzero_v2r8();
1937 fjz1 = _fjsp_setzero_v2r8();
1938 fjx2 = _fjsp_setzero_v2r8();
1939 fjy2 = _fjsp_setzero_v2r8();
1940 fjz2 = _fjsp_setzero_v2r8();
1941 fjx3 = _fjsp_setzero_v2r8();
1942 fjy3 = _fjsp_setzero_v2r8();
1943 fjz3 = _fjsp_setzero_v2r8();
1945 /**************************
1946 * CALCULATE INTERACTIONS *
1947 **************************/
1949 /* LENNARD-JONES DISPERSION/REPULSION */
1951 rinvsix = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
1952 fvdw = _fjsp_mul_v2r8(_fjsp_msub_v2r8(c12_00,rinvsix,c6_00),_fjsp_mul_v2r8(rinvsix,rinvsq00));
1956 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1958 /* Update vectorial force */
1959 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
1960 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
1961 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
1963 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
1964 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
1965 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
1967 /**************************
1968 * CALCULATE INTERACTIONS *
1969 **************************/
1971 r11 = _fjsp_mul_v2r8(rsq11,rinv11);
1973 /* Calculate table index by multiplying r with table scale and truncate to integer */
1974 rt = _fjsp_mul_v2r8(r11,vftabscale);
1975 itab_tmp = _fjsp_dtox_v2r8(rt);
1976 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1977 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1978 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1983 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1984 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1985 F = _fjsp_setzero_v2r8();
1986 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1987 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1988 H = _fjsp_setzero_v2r8();
1989 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1990 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1991 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1992 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq11,FF),_fjsp_mul_v2r8(vftabscale,rinv11)));
1996 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1998 /* Update vectorial force */
1999 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
2000 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
2001 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
2003 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
2004 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
2005 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
2007 /**************************
2008 * CALCULATE INTERACTIONS *
2009 **************************/
2011 r12 = _fjsp_mul_v2r8(rsq12,rinv12);
2013 /* Calculate table index by multiplying r with table scale and truncate to integer */
2014 rt = _fjsp_mul_v2r8(r12,vftabscale);
2015 itab_tmp = _fjsp_dtox_v2r8(rt);
2016 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
2017 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
2018 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
2023 /* CUBIC SPLINE TABLE ELECTROSTATICS */
2024 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
2025 F = _fjsp_setzero_v2r8();
2026 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
2027 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
2028 H = _fjsp_setzero_v2r8();
2029 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
2030 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
2031 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
2032 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq12,FF),_fjsp_mul_v2r8(vftabscale,rinv12)));
2036 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2038 /* Update vectorial force */
2039 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
2040 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
2041 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
2043 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
2044 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
2045 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
2047 /**************************
2048 * CALCULATE INTERACTIONS *
2049 **************************/
2051 r13 = _fjsp_mul_v2r8(rsq13,rinv13);
2053 /* Calculate table index by multiplying r with table scale and truncate to integer */
2054 rt = _fjsp_mul_v2r8(r13,vftabscale);
2055 itab_tmp = _fjsp_dtox_v2r8(rt);
2056 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
2057 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
2058 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
2063 /* CUBIC SPLINE TABLE ELECTROSTATICS */
2064 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
2065 F = _fjsp_setzero_v2r8();
2066 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
2067 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
2068 H = _fjsp_setzero_v2r8();
2069 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
2070 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
2071 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
2072 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq13,FF),_fjsp_mul_v2r8(vftabscale,rinv13)));
2076 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2078 /* Update vectorial force */
2079 fix1 = _fjsp_madd_v2r8(dx13,fscal,fix1);
2080 fiy1 = _fjsp_madd_v2r8(dy13,fscal,fiy1);
2081 fiz1 = _fjsp_madd_v2r8(dz13,fscal,fiz1);
2083 fjx3 = _fjsp_madd_v2r8(dx13,fscal,fjx3);
2084 fjy3 = _fjsp_madd_v2r8(dy13,fscal,fjy3);
2085 fjz3 = _fjsp_madd_v2r8(dz13,fscal,fjz3);
2087 /**************************
2088 * CALCULATE INTERACTIONS *
2089 **************************/
2091 r21 = _fjsp_mul_v2r8(rsq21,rinv21);
2093 /* Calculate table index by multiplying r with table scale and truncate to integer */
2094 rt = _fjsp_mul_v2r8(r21,vftabscale);
2095 itab_tmp = _fjsp_dtox_v2r8(rt);
2096 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
2097 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
2098 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
2103 /* CUBIC SPLINE TABLE ELECTROSTATICS */
2104 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
2105 F = _fjsp_setzero_v2r8();
2106 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
2107 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
2108 H = _fjsp_setzero_v2r8();
2109 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
2110 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
2111 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
2112 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq21,FF),_fjsp_mul_v2r8(vftabscale,rinv21)));
2116 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2118 /* Update vectorial force */
2119 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
2120 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
2121 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
2123 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
2124 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
2125 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
2127 /**************************
2128 * CALCULATE INTERACTIONS *
2129 **************************/
2131 r22 = _fjsp_mul_v2r8(rsq22,rinv22);
2133 /* Calculate table index by multiplying r with table scale and truncate to integer */
2134 rt = _fjsp_mul_v2r8(r22,vftabscale);
2135 itab_tmp = _fjsp_dtox_v2r8(rt);
2136 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
2137 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
2138 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
2143 /* CUBIC SPLINE TABLE ELECTROSTATICS */
2144 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
2145 F = _fjsp_setzero_v2r8();
2146 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
2147 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
2148 H = _fjsp_setzero_v2r8();
2149 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
2150 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
2151 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
2152 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq22,FF),_fjsp_mul_v2r8(vftabscale,rinv22)));
2156 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2158 /* Update vectorial force */
2159 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
2160 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
2161 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
2163 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
2164 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
2165 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
2167 /**************************
2168 * CALCULATE INTERACTIONS *
2169 **************************/
2171 r23 = _fjsp_mul_v2r8(rsq23,rinv23);
2173 /* Calculate table index by multiplying r with table scale and truncate to integer */
2174 rt = _fjsp_mul_v2r8(r23,vftabscale);
2175 itab_tmp = _fjsp_dtox_v2r8(rt);
2176 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
2177 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
2178 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
2183 /* CUBIC SPLINE TABLE ELECTROSTATICS */
2184 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
2185 F = _fjsp_setzero_v2r8();
2186 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
2187 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
2188 H = _fjsp_setzero_v2r8();
2189 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
2190 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
2191 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
2192 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq23,FF),_fjsp_mul_v2r8(vftabscale,rinv23)));
2196 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2198 /* Update vectorial force */
2199 fix2 = _fjsp_madd_v2r8(dx23,fscal,fix2);
2200 fiy2 = _fjsp_madd_v2r8(dy23,fscal,fiy2);
2201 fiz2 = _fjsp_madd_v2r8(dz23,fscal,fiz2);
2203 fjx3 = _fjsp_madd_v2r8(dx23,fscal,fjx3);
2204 fjy3 = _fjsp_madd_v2r8(dy23,fscal,fjy3);
2205 fjz3 = _fjsp_madd_v2r8(dz23,fscal,fjz3);
2207 /**************************
2208 * CALCULATE INTERACTIONS *
2209 **************************/
2211 r31 = _fjsp_mul_v2r8(rsq31,rinv31);
2213 /* Calculate table index by multiplying r with table scale and truncate to integer */
2214 rt = _fjsp_mul_v2r8(r31,vftabscale);
2215 itab_tmp = _fjsp_dtox_v2r8(rt);
2216 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
2217 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
2218 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
2223 /* CUBIC SPLINE TABLE ELECTROSTATICS */
2224 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
2225 F = _fjsp_setzero_v2r8();
2226 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
2227 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
2228 H = _fjsp_setzero_v2r8();
2229 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
2230 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
2231 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
2232 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq31,FF),_fjsp_mul_v2r8(vftabscale,rinv31)));
2236 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2238 /* Update vectorial force */
2239 fix3 = _fjsp_madd_v2r8(dx31,fscal,fix3);
2240 fiy3 = _fjsp_madd_v2r8(dy31,fscal,fiy3);
2241 fiz3 = _fjsp_madd_v2r8(dz31,fscal,fiz3);
2243 fjx1 = _fjsp_madd_v2r8(dx31,fscal,fjx1);
2244 fjy1 = _fjsp_madd_v2r8(dy31,fscal,fjy1);
2245 fjz1 = _fjsp_madd_v2r8(dz31,fscal,fjz1);
2247 /**************************
2248 * CALCULATE INTERACTIONS *
2249 **************************/
2251 r32 = _fjsp_mul_v2r8(rsq32,rinv32);
2253 /* Calculate table index by multiplying r with table scale and truncate to integer */
2254 rt = _fjsp_mul_v2r8(r32,vftabscale);
2255 itab_tmp = _fjsp_dtox_v2r8(rt);
2256 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
2257 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
2258 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
2263 /* CUBIC SPLINE TABLE ELECTROSTATICS */
2264 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
2265 F = _fjsp_setzero_v2r8();
2266 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
2267 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
2268 H = _fjsp_setzero_v2r8();
2269 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
2270 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
2271 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
2272 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq32,FF),_fjsp_mul_v2r8(vftabscale,rinv32)));
2276 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2278 /* Update vectorial force */
2279 fix3 = _fjsp_madd_v2r8(dx32,fscal,fix3);
2280 fiy3 = _fjsp_madd_v2r8(dy32,fscal,fiy3);
2281 fiz3 = _fjsp_madd_v2r8(dz32,fscal,fiz3);
2283 fjx2 = _fjsp_madd_v2r8(dx32,fscal,fjx2);
2284 fjy2 = _fjsp_madd_v2r8(dy32,fscal,fjy2);
2285 fjz2 = _fjsp_madd_v2r8(dz32,fscal,fjz2);
2287 /**************************
2288 * CALCULATE INTERACTIONS *
2289 **************************/
2291 r33 = _fjsp_mul_v2r8(rsq33,rinv33);
2293 /* Calculate table index by multiplying r with table scale and truncate to integer */
2294 rt = _fjsp_mul_v2r8(r33,vftabscale);
2295 itab_tmp = _fjsp_dtox_v2r8(rt);
2296 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
2297 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
2298 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
2303 /* CUBIC SPLINE TABLE ELECTROSTATICS */
2304 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
2305 F = _fjsp_setzero_v2r8();
2306 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
2307 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
2308 H = _fjsp_setzero_v2r8();
2309 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
2310 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
2311 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
2312 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq33,FF),_fjsp_mul_v2r8(vftabscale,rinv33)));
2316 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2318 /* Update vectorial force */
2319 fix3 = _fjsp_madd_v2r8(dx33,fscal,fix3);
2320 fiy3 = _fjsp_madd_v2r8(dy33,fscal,fiy3);
2321 fiz3 = _fjsp_madd_v2r8(dz33,fscal,fiz3);
2323 fjx3 = _fjsp_madd_v2r8(dx33,fscal,fjx3);
2324 fjy3 = _fjsp_madd_v2r8(dy33,fscal,fjy3);
2325 fjz3 = _fjsp_madd_v2r8(dz33,fscal,fjz3);
2327 gmx_fjsp_decrement_4rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2,fjx3,fjy3,fjz3);
2329 /* Inner loop uses 411 flops */
2332 /* End of innermost loop */
2334 gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
2335 f+i_coord_offset,fshift+i_shift_offset);
2337 /* Increment number of inner iterations */
2338 inneriter += j_index_end - j_index_start;
2340 /* Outer loop uses 24 flops */
2343 /* Increment number of outer iterations */
2346 /* Update outer/inner flops */
2348 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4W4_F,outeriter*24 + inneriter*411);