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_VdwCSTab_GeomW4W4_VF_sparc64_hpc_ace_double
51 * Electrostatics interaction: CubicSplineTable
52 * VdW interaction: CubicSplineTable
53 * Geometry: Water4-Water4
54 * Calculate force/pot: PotentialAndForce
57 nb_kernel_ElecCSTab_VdwCSTab_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_vdw->data;
139 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_elec_vdw->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 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
267 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
268 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
269 rinv13 = gmx_fjsp_invsqrt_v2r8(rsq13);
270 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
271 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
272 rinv23 = gmx_fjsp_invsqrt_v2r8(rsq23);
273 rinv31 = gmx_fjsp_invsqrt_v2r8(rsq31);
274 rinv32 = gmx_fjsp_invsqrt_v2r8(rsq32);
275 rinv33 = gmx_fjsp_invsqrt_v2r8(rsq33);
277 fjx0 = _fjsp_setzero_v2r8();
278 fjy0 = _fjsp_setzero_v2r8();
279 fjz0 = _fjsp_setzero_v2r8();
280 fjx1 = _fjsp_setzero_v2r8();
281 fjy1 = _fjsp_setzero_v2r8();
282 fjz1 = _fjsp_setzero_v2r8();
283 fjx2 = _fjsp_setzero_v2r8();
284 fjy2 = _fjsp_setzero_v2r8();
285 fjz2 = _fjsp_setzero_v2r8();
286 fjx3 = _fjsp_setzero_v2r8();
287 fjy3 = _fjsp_setzero_v2r8();
288 fjz3 = _fjsp_setzero_v2r8();
290 /**************************
291 * CALCULATE INTERACTIONS *
292 **************************/
294 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
296 /* Calculate table index by multiplying r with table scale and truncate to integer */
297 rt = _fjsp_mul_v2r8(r00,vftabscale);
298 itab_tmp = _fjsp_dtox_v2r8(rt);
299 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
300 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
301 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
306 /* CUBIC SPLINE TABLE DISPERSION */
309 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
310 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
311 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
312 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
313 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
314 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
315 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
316 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
317 vvdw6 = _fjsp_mul_v2r8(c6_00,VV);
318 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
319 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
321 /* CUBIC SPLINE TABLE REPULSION */
322 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
323 F = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
324 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
325 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
326 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
327 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
328 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
329 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
330 vvdw12 = _fjsp_mul_v2r8(c12_00,VV);
331 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
332 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
333 vvdw = _fjsp_add_v2r8(vvdw12,vvdw6);
334 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
336 /* Update potential sum for this i atom from the interaction with this j atom. */
337 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
341 /* Update vectorial force */
342 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
343 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
344 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
346 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
347 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
348 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
350 /**************************
351 * CALCULATE INTERACTIONS *
352 **************************/
354 r11 = _fjsp_mul_v2r8(rsq11,rinv11);
356 /* Calculate table index by multiplying r with table scale and truncate to integer */
357 rt = _fjsp_mul_v2r8(r11,vftabscale);
358 itab_tmp = _fjsp_dtox_v2r8(rt);
359 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
360 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
361 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
366 /* CUBIC SPLINE TABLE ELECTROSTATICS */
367 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
368 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
369 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
370 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
371 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
372 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
373 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
374 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
375 velec = _fjsp_mul_v2r8(qq11,VV);
376 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
377 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq11,FF),_fjsp_mul_v2r8(vftabscale,rinv11)));
379 /* Update potential sum for this i atom from the interaction with this j atom. */
380 velecsum = _fjsp_add_v2r8(velecsum,velec);
384 /* Update vectorial force */
385 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
386 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
387 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
389 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
390 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
391 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
393 /**************************
394 * CALCULATE INTERACTIONS *
395 **************************/
397 r12 = _fjsp_mul_v2r8(rsq12,rinv12);
399 /* Calculate table index by multiplying r with table scale and truncate to integer */
400 rt = _fjsp_mul_v2r8(r12,vftabscale);
401 itab_tmp = _fjsp_dtox_v2r8(rt);
402 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
403 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
404 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
409 /* CUBIC SPLINE TABLE ELECTROSTATICS */
410 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
411 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
412 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
413 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
414 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
415 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
416 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
417 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
418 velec = _fjsp_mul_v2r8(qq12,VV);
419 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
420 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq12,FF),_fjsp_mul_v2r8(vftabscale,rinv12)));
422 /* Update potential sum for this i atom from the interaction with this j atom. */
423 velecsum = _fjsp_add_v2r8(velecsum,velec);
427 /* Update vectorial force */
428 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
429 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
430 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
432 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
433 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
434 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
436 /**************************
437 * CALCULATE INTERACTIONS *
438 **************************/
440 r13 = _fjsp_mul_v2r8(rsq13,rinv13);
442 /* Calculate table index by multiplying r with table scale and truncate to integer */
443 rt = _fjsp_mul_v2r8(r13,vftabscale);
444 itab_tmp = _fjsp_dtox_v2r8(rt);
445 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
446 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
447 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
452 /* CUBIC SPLINE TABLE ELECTROSTATICS */
453 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
454 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
455 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
456 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
457 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
458 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
459 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
460 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
461 velec = _fjsp_mul_v2r8(qq13,VV);
462 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
463 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq13,FF),_fjsp_mul_v2r8(vftabscale,rinv13)));
465 /* Update potential sum for this i atom from the interaction with this j atom. */
466 velecsum = _fjsp_add_v2r8(velecsum,velec);
470 /* Update vectorial force */
471 fix1 = _fjsp_madd_v2r8(dx13,fscal,fix1);
472 fiy1 = _fjsp_madd_v2r8(dy13,fscal,fiy1);
473 fiz1 = _fjsp_madd_v2r8(dz13,fscal,fiz1);
475 fjx3 = _fjsp_madd_v2r8(dx13,fscal,fjx3);
476 fjy3 = _fjsp_madd_v2r8(dy13,fscal,fjy3);
477 fjz3 = _fjsp_madd_v2r8(dz13,fscal,fjz3);
479 /**************************
480 * CALCULATE INTERACTIONS *
481 **************************/
483 r21 = _fjsp_mul_v2r8(rsq21,rinv21);
485 /* Calculate table index by multiplying r with table scale and truncate to integer */
486 rt = _fjsp_mul_v2r8(r21,vftabscale);
487 itab_tmp = _fjsp_dtox_v2r8(rt);
488 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
489 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
490 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
495 /* CUBIC SPLINE TABLE ELECTROSTATICS */
496 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
497 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
498 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
499 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
500 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
501 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
502 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
503 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
504 velec = _fjsp_mul_v2r8(qq21,VV);
505 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
506 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq21,FF),_fjsp_mul_v2r8(vftabscale,rinv21)));
508 /* Update potential sum for this i atom from the interaction with this j atom. */
509 velecsum = _fjsp_add_v2r8(velecsum,velec);
513 /* Update vectorial force */
514 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
515 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
516 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
518 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
519 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
520 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
522 /**************************
523 * CALCULATE INTERACTIONS *
524 **************************/
526 r22 = _fjsp_mul_v2r8(rsq22,rinv22);
528 /* Calculate table index by multiplying r with table scale and truncate to integer */
529 rt = _fjsp_mul_v2r8(r22,vftabscale);
530 itab_tmp = _fjsp_dtox_v2r8(rt);
531 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
532 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
533 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
538 /* CUBIC SPLINE TABLE ELECTROSTATICS */
539 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
540 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
541 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
542 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
543 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
544 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
545 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
546 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
547 velec = _fjsp_mul_v2r8(qq22,VV);
548 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
549 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq22,FF),_fjsp_mul_v2r8(vftabscale,rinv22)));
551 /* Update potential sum for this i atom from the interaction with this j atom. */
552 velecsum = _fjsp_add_v2r8(velecsum,velec);
556 /* Update vectorial force */
557 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
558 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
559 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
561 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
562 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
563 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
565 /**************************
566 * CALCULATE INTERACTIONS *
567 **************************/
569 r23 = _fjsp_mul_v2r8(rsq23,rinv23);
571 /* Calculate table index by multiplying r with table scale and truncate to integer */
572 rt = _fjsp_mul_v2r8(r23,vftabscale);
573 itab_tmp = _fjsp_dtox_v2r8(rt);
574 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
575 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
576 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
581 /* CUBIC SPLINE TABLE ELECTROSTATICS */
582 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
583 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
584 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
585 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
586 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
587 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
588 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
589 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
590 velec = _fjsp_mul_v2r8(qq23,VV);
591 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
592 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq23,FF),_fjsp_mul_v2r8(vftabscale,rinv23)));
594 /* Update potential sum for this i atom from the interaction with this j atom. */
595 velecsum = _fjsp_add_v2r8(velecsum,velec);
599 /* Update vectorial force */
600 fix2 = _fjsp_madd_v2r8(dx23,fscal,fix2);
601 fiy2 = _fjsp_madd_v2r8(dy23,fscal,fiy2);
602 fiz2 = _fjsp_madd_v2r8(dz23,fscal,fiz2);
604 fjx3 = _fjsp_madd_v2r8(dx23,fscal,fjx3);
605 fjy3 = _fjsp_madd_v2r8(dy23,fscal,fjy3);
606 fjz3 = _fjsp_madd_v2r8(dz23,fscal,fjz3);
608 /**************************
609 * CALCULATE INTERACTIONS *
610 **************************/
612 r31 = _fjsp_mul_v2r8(rsq31,rinv31);
614 /* Calculate table index by multiplying r with table scale and truncate to integer */
615 rt = _fjsp_mul_v2r8(r31,vftabscale);
616 itab_tmp = _fjsp_dtox_v2r8(rt);
617 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
618 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
619 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
624 /* CUBIC SPLINE TABLE ELECTROSTATICS */
625 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
626 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
627 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
628 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
629 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
630 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
631 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
632 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
633 velec = _fjsp_mul_v2r8(qq31,VV);
634 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
635 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq31,FF),_fjsp_mul_v2r8(vftabscale,rinv31)));
637 /* Update potential sum for this i atom from the interaction with this j atom. */
638 velecsum = _fjsp_add_v2r8(velecsum,velec);
642 /* Update vectorial force */
643 fix3 = _fjsp_madd_v2r8(dx31,fscal,fix3);
644 fiy3 = _fjsp_madd_v2r8(dy31,fscal,fiy3);
645 fiz3 = _fjsp_madd_v2r8(dz31,fscal,fiz3);
647 fjx1 = _fjsp_madd_v2r8(dx31,fscal,fjx1);
648 fjy1 = _fjsp_madd_v2r8(dy31,fscal,fjy1);
649 fjz1 = _fjsp_madd_v2r8(dz31,fscal,fjz1);
651 /**************************
652 * CALCULATE INTERACTIONS *
653 **************************/
655 r32 = _fjsp_mul_v2r8(rsq32,rinv32);
657 /* Calculate table index by multiplying r with table scale and truncate to integer */
658 rt = _fjsp_mul_v2r8(r32,vftabscale);
659 itab_tmp = _fjsp_dtox_v2r8(rt);
660 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
661 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
662 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
667 /* CUBIC SPLINE TABLE ELECTROSTATICS */
668 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
669 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
670 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
671 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
672 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
673 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
674 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
675 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
676 velec = _fjsp_mul_v2r8(qq32,VV);
677 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
678 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq32,FF),_fjsp_mul_v2r8(vftabscale,rinv32)));
680 /* Update potential sum for this i atom from the interaction with this j atom. */
681 velecsum = _fjsp_add_v2r8(velecsum,velec);
685 /* Update vectorial force */
686 fix3 = _fjsp_madd_v2r8(dx32,fscal,fix3);
687 fiy3 = _fjsp_madd_v2r8(dy32,fscal,fiy3);
688 fiz3 = _fjsp_madd_v2r8(dz32,fscal,fiz3);
690 fjx2 = _fjsp_madd_v2r8(dx32,fscal,fjx2);
691 fjy2 = _fjsp_madd_v2r8(dy32,fscal,fjy2);
692 fjz2 = _fjsp_madd_v2r8(dz32,fscal,fjz2);
694 /**************************
695 * CALCULATE INTERACTIONS *
696 **************************/
698 r33 = _fjsp_mul_v2r8(rsq33,rinv33);
700 /* Calculate table index by multiplying r with table scale and truncate to integer */
701 rt = _fjsp_mul_v2r8(r33,vftabscale);
702 itab_tmp = _fjsp_dtox_v2r8(rt);
703 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
704 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
705 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
710 /* CUBIC SPLINE TABLE ELECTROSTATICS */
711 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
712 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
713 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
714 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
715 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
716 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
717 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
718 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
719 velec = _fjsp_mul_v2r8(qq33,VV);
720 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
721 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq33,FF),_fjsp_mul_v2r8(vftabscale,rinv33)));
723 /* Update potential sum for this i atom from the interaction with this j atom. */
724 velecsum = _fjsp_add_v2r8(velecsum,velec);
728 /* Update vectorial force */
729 fix3 = _fjsp_madd_v2r8(dx33,fscal,fix3);
730 fiy3 = _fjsp_madd_v2r8(dy33,fscal,fiy3);
731 fiz3 = _fjsp_madd_v2r8(dz33,fscal,fiz3);
733 fjx3 = _fjsp_madd_v2r8(dx33,fscal,fjx3);
734 fjy3 = _fjsp_madd_v2r8(dy33,fscal,fjy3);
735 fjz3 = _fjsp_madd_v2r8(dz33,fscal,fjz3);
737 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);
739 /* Inner loop uses 476 flops */
746 j_coord_offsetA = DIM*jnrA;
748 /* load j atom coordinates */
749 gmx_fjsp_load_4rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
750 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,
751 &jy2,&jz2,&jx3,&jy3,&jz3);
753 /* Calculate displacement vector */
754 dx00 = _fjsp_sub_v2r8(ix0,jx0);
755 dy00 = _fjsp_sub_v2r8(iy0,jy0);
756 dz00 = _fjsp_sub_v2r8(iz0,jz0);
757 dx11 = _fjsp_sub_v2r8(ix1,jx1);
758 dy11 = _fjsp_sub_v2r8(iy1,jy1);
759 dz11 = _fjsp_sub_v2r8(iz1,jz1);
760 dx12 = _fjsp_sub_v2r8(ix1,jx2);
761 dy12 = _fjsp_sub_v2r8(iy1,jy2);
762 dz12 = _fjsp_sub_v2r8(iz1,jz2);
763 dx13 = _fjsp_sub_v2r8(ix1,jx3);
764 dy13 = _fjsp_sub_v2r8(iy1,jy3);
765 dz13 = _fjsp_sub_v2r8(iz1,jz3);
766 dx21 = _fjsp_sub_v2r8(ix2,jx1);
767 dy21 = _fjsp_sub_v2r8(iy2,jy1);
768 dz21 = _fjsp_sub_v2r8(iz2,jz1);
769 dx22 = _fjsp_sub_v2r8(ix2,jx2);
770 dy22 = _fjsp_sub_v2r8(iy2,jy2);
771 dz22 = _fjsp_sub_v2r8(iz2,jz2);
772 dx23 = _fjsp_sub_v2r8(ix2,jx3);
773 dy23 = _fjsp_sub_v2r8(iy2,jy3);
774 dz23 = _fjsp_sub_v2r8(iz2,jz3);
775 dx31 = _fjsp_sub_v2r8(ix3,jx1);
776 dy31 = _fjsp_sub_v2r8(iy3,jy1);
777 dz31 = _fjsp_sub_v2r8(iz3,jz1);
778 dx32 = _fjsp_sub_v2r8(ix3,jx2);
779 dy32 = _fjsp_sub_v2r8(iy3,jy2);
780 dz32 = _fjsp_sub_v2r8(iz3,jz2);
781 dx33 = _fjsp_sub_v2r8(ix3,jx3);
782 dy33 = _fjsp_sub_v2r8(iy3,jy3);
783 dz33 = _fjsp_sub_v2r8(iz3,jz3);
785 /* Calculate squared distance and things based on it */
786 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
787 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
788 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
789 rsq13 = gmx_fjsp_calc_rsq_v2r8(dx13,dy13,dz13);
790 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
791 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
792 rsq23 = gmx_fjsp_calc_rsq_v2r8(dx23,dy23,dz23);
793 rsq31 = gmx_fjsp_calc_rsq_v2r8(dx31,dy31,dz31);
794 rsq32 = gmx_fjsp_calc_rsq_v2r8(dx32,dy32,dz32);
795 rsq33 = gmx_fjsp_calc_rsq_v2r8(dx33,dy33,dz33);
797 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
798 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
799 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
800 rinv13 = gmx_fjsp_invsqrt_v2r8(rsq13);
801 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
802 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
803 rinv23 = gmx_fjsp_invsqrt_v2r8(rsq23);
804 rinv31 = gmx_fjsp_invsqrt_v2r8(rsq31);
805 rinv32 = gmx_fjsp_invsqrt_v2r8(rsq32);
806 rinv33 = gmx_fjsp_invsqrt_v2r8(rsq33);
808 fjx0 = _fjsp_setzero_v2r8();
809 fjy0 = _fjsp_setzero_v2r8();
810 fjz0 = _fjsp_setzero_v2r8();
811 fjx1 = _fjsp_setzero_v2r8();
812 fjy1 = _fjsp_setzero_v2r8();
813 fjz1 = _fjsp_setzero_v2r8();
814 fjx2 = _fjsp_setzero_v2r8();
815 fjy2 = _fjsp_setzero_v2r8();
816 fjz2 = _fjsp_setzero_v2r8();
817 fjx3 = _fjsp_setzero_v2r8();
818 fjy3 = _fjsp_setzero_v2r8();
819 fjz3 = _fjsp_setzero_v2r8();
821 /**************************
822 * CALCULATE INTERACTIONS *
823 **************************/
825 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
827 /* Calculate table index by multiplying r with table scale and truncate to integer */
828 rt = _fjsp_mul_v2r8(r00,vftabscale);
829 itab_tmp = _fjsp_dtox_v2r8(rt);
830 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
831 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
832 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
837 /* CUBIC SPLINE TABLE DISPERSION */
840 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
841 F = _fjsp_setzero_v2r8();
842 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
843 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
844 H = _fjsp_setzero_v2r8();
845 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
846 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
847 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
848 vvdw6 = _fjsp_mul_v2r8(c6_00,VV);
849 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
850 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
852 /* CUBIC SPLINE TABLE REPULSION */
853 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
854 F = _fjsp_setzero_v2r8();
855 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
856 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
857 H = _fjsp_setzero_v2r8();
858 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
859 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
860 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
861 vvdw12 = _fjsp_mul_v2r8(c12_00,VV);
862 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
863 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
864 vvdw = _fjsp_add_v2r8(vvdw12,vvdw6);
865 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
867 /* Update potential sum for this i atom from the interaction with this j atom. */
868 vvdw = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
869 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
873 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
875 /* Update vectorial force */
876 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
877 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
878 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
880 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
881 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
882 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
884 /**************************
885 * CALCULATE INTERACTIONS *
886 **************************/
888 r11 = _fjsp_mul_v2r8(rsq11,rinv11);
890 /* Calculate table index by multiplying r with table scale and truncate to integer */
891 rt = _fjsp_mul_v2r8(r11,vftabscale);
892 itab_tmp = _fjsp_dtox_v2r8(rt);
893 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
894 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
895 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
900 /* CUBIC SPLINE TABLE ELECTROSTATICS */
901 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
902 F = _fjsp_setzero_v2r8();
903 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
904 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
905 H = _fjsp_setzero_v2r8();
906 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
907 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
908 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
909 velec = _fjsp_mul_v2r8(qq11,VV);
910 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
911 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq11,FF),_fjsp_mul_v2r8(vftabscale,rinv11)));
913 /* Update potential sum for this i atom from the interaction with this j atom. */
914 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
915 velecsum = _fjsp_add_v2r8(velecsum,velec);
919 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
921 /* Update vectorial force */
922 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
923 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
924 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
926 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
927 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
928 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
930 /**************************
931 * CALCULATE INTERACTIONS *
932 **************************/
934 r12 = _fjsp_mul_v2r8(rsq12,rinv12);
936 /* Calculate table index by multiplying r with table scale and truncate to integer */
937 rt = _fjsp_mul_v2r8(r12,vftabscale);
938 itab_tmp = _fjsp_dtox_v2r8(rt);
939 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
940 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
941 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
946 /* CUBIC SPLINE TABLE ELECTROSTATICS */
947 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
948 F = _fjsp_setzero_v2r8();
949 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
950 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
951 H = _fjsp_setzero_v2r8();
952 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
953 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
954 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
955 velec = _fjsp_mul_v2r8(qq12,VV);
956 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
957 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq12,FF),_fjsp_mul_v2r8(vftabscale,rinv12)));
959 /* Update potential sum for this i atom from the interaction with this j atom. */
960 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
961 velecsum = _fjsp_add_v2r8(velecsum,velec);
965 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
967 /* Update vectorial force */
968 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
969 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
970 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
972 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
973 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
974 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
976 /**************************
977 * CALCULATE INTERACTIONS *
978 **************************/
980 r13 = _fjsp_mul_v2r8(rsq13,rinv13);
982 /* Calculate table index by multiplying r with table scale and truncate to integer */
983 rt = _fjsp_mul_v2r8(r13,vftabscale);
984 itab_tmp = _fjsp_dtox_v2r8(rt);
985 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
986 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
987 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
992 /* CUBIC SPLINE TABLE ELECTROSTATICS */
993 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
994 F = _fjsp_setzero_v2r8();
995 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
996 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
997 H = _fjsp_setzero_v2r8();
998 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
999 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1000 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
1001 velec = _fjsp_mul_v2r8(qq13,VV);
1002 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1003 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq13,FF),_fjsp_mul_v2r8(vftabscale,rinv13)));
1005 /* Update potential sum for this i atom from the interaction with this j atom. */
1006 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1007 velecsum = _fjsp_add_v2r8(velecsum,velec);
1011 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1013 /* Update vectorial force */
1014 fix1 = _fjsp_madd_v2r8(dx13,fscal,fix1);
1015 fiy1 = _fjsp_madd_v2r8(dy13,fscal,fiy1);
1016 fiz1 = _fjsp_madd_v2r8(dz13,fscal,fiz1);
1018 fjx3 = _fjsp_madd_v2r8(dx13,fscal,fjx3);
1019 fjy3 = _fjsp_madd_v2r8(dy13,fscal,fjy3);
1020 fjz3 = _fjsp_madd_v2r8(dz13,fscal,fjz3);
1022 /**************************
1023 * CALCULATE INTERACTIONS *
1024 **************************/
1026 r21 = _fjsp_mul_v2r8(rsq21,rinv21);
1028 /* Calculate table index by multiplying r with table scale and truncate to integer */
1029 rt = _fjsp_mul_v2r8(r21,vftabscale);
1030 itab_tmp = _fjsp_dtox_v2r8(rt);
1031 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1032 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1033 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1038 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1039 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1040 F = _fjsp_setzero_v2r8();
1041 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1042 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1043 H = _fjsp_setzero_v2r8();
1044 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1045 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1046 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
1047 velec = _fjsp_mul_v2r8(qq21,VV);
1048 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1049 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq21,FF),_fjsp_mul_v2r8(vftabscale,rinv21)));
1051 /* Update potential sum for this i atom from the interaction with this j atom. */
1052 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1053 velecsum = _fjsp_add_v2r8(velecsum,velec);
1057 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1059 /* Update vectorial force */
1060 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
1061 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
1062 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
1064 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
1065 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
1066 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
1068 /**************************
1069 * CALCULATE INTERACTIONS *
1070 **************************/
1072 r22 = _fjsp_mul_v2r8(rsq22,rinv22);
1074 /* Calculate table index by multiplying r with table scale and truncate to integer */
1075 rt = _fjsp_mul_v2r8(r22,vftabscale);
1076 itab_tmp = _fjsp_dtox_v2r8(rt);
1077 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1078 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1079 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1084 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1085 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1086 F = _fjsp_setzero_v2r8();
1087 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1088 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1089 H = _fjsp_setzero_v2r8();
1090 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1091 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1092 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
1093 velec = _fjsp_mul_v2r8(qq22,VV);
1094 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1095 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq22,FF),_fjsp_mul_v2r8(vftabscale,rinv22)));
1097 /* Update potential sum for this i atom from the interaction with this j atom. */
1098 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1099 velecsum = _fjsp_add_v2r8(velecsum,velec);
1103 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1105 /* Update vectorial force */
1106 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
1107 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
1108 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
1110 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
1111 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
1112 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
1114 /**************************
1115 * CALCULATE INTERACTIONS *
1116 **************************/
1118 r23 = _fjsp_mul_v2r8(rsq23,rinv23);
1120 /* Calculate table index by multiplying r with table scale and truncate to integer */
1121 rt = _fjsp_mul_v2r8(r23,vftabscale);
1122 itab_tmp = _fjsp_dtox_v2r8(rt);
1123 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1124 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1125 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1130 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1131 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1132 F = _fjsp_setzero_v2r8();
1133 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1134 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1135 H = _fjsp_setzero_v2r8();
1136 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1137 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1138 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
1139 velec = _fjsp_mul_v2r8(qq23,VV);
1140 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1141 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq23,FF),_fjsp_mul_v2r8(vftabscale,rinv23)));
1143 /* Update potential sum for this i atom from the interaction with this j atom. */
1144 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1145 velecsum = _fjsp_add_v2r8(velecsum,velec);
1149 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1151 /* Update vectorial force */
1152 fix2 = _fjsp_madd_v2r8(dx23,fscal,fix2);
1153 fiy2 = _fjsp_madd_v2r8(dy23,fscal,fiy2);
1154 fiz2 = _fjsp_madd_v2r8(dz23,fscal,fiz2);
1156 fjx3 = _fjsp_madd_v2r8(dx23,fscal,fjx3);
1157 fjy3 = _fjsp_madd_v2r8(dy23,fscal,fjy3);
1158 fjz3 = _fjsp_madd_v2r8(dz23,fscal,fjz3);
1160 /**************************
1161 * CALCULATE INTERACTIONS *
1162 **************************/
1164 r31 = _fjsp_mul_v2r8(rsq31,rinv31);
1166 /* Calculate table index by multiplying r with table scale and truncate to integer */
1167 rt = _fjsp_mul_v2r8(r31,vftabscale);
1168 itab_tmp = _fjsp_dtox_v2r8(rt);
1169 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1170 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1171 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1176 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1177 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1178 F = _fjsp_setzero_v2r8();
1179 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1180 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1181 H = _fjsp_setzero_v2r8();
1182 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1183 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1184 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
1185 velec = _fjsp_mul_v2r8(qq31,VV);
1186 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1187 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq31,FF),_fjsp_mul_v2r8(vftabscale,rinv31)));
1189 /* Update potential sum for this i atom from the interaction with this j atom. */
1190 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1191 velecsum = _fjsp_add_v2r8(velecsum,velec);
1195 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1197 /* Update vectorial force */
1198 fix3 = _fjsp_madd_v2r8(dx31,fscal,fix3);
1199 fiy3 = _fjsp_madd_v2r8(dy31,fscal,fiy3);
1200 fiz3 = _fjsp_madd_v2r8(dz31,fscal,fiz3);
1202 fjx1 = _fjsp_madd_v2r8(dx31,fscal,fjx1);
1203 fjy1 = _fjsp_madd_v2r8(dy31,fscal,fjy1);
1204 fjz1 = _fjsp_madd_v2r8(dz31,fscal,fjz1);
1206 /**************************
1207 * CALCULATE INTERACTIONS *
1208 **************************/
1210 r32 = _fjsp_mul_v2r8(rsq32,rinv32);
1212 /* Calculate table index by multiplying r with table scale and truncate to integer */
1213 rt = _fjsp_mul_v2r8(r32,vftabscale);
1214 itab_tmp = _fjsp_dtox_v2r8(rt);
1215 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1216 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1217 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1222 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1223 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1224 F = _fjsp_setzero_v2r8();
1225 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1226 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1227 H = _fjsp_setzero_v2r8();
1228 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1229 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1230 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
1231 velec = _fjsp_mul_v2r8(qq32,VV);
1232 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1233 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq32,FF),_fjsp_mul_v2r8(vftabscale,rinv32)));
1235 /* Update potential sum for this i atom from the interaction with this j atom. */
1236 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1237 velecsum = _fjsp_add_v2r8(velecsum,velec);
1241 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1243 /* Update vectorial force */
1244 fix3 = _fjsp_madd_v2r8(dx32,fscal,fix3);
1245 fiy3 = _fjsp_madd_v2r8(dy32,fscal,fiy3);
1246 fiz3 = _fjsp_madd_v2r8(dz32,fscal,fiz3);
1248 fjx2 = _fjsp_madd_v2r8(dx32,fscal,fjx2);
1249 fjy2 = _fjsp_madd_v2r8(dy32,fscal,fjy2);
1250 fjz2 = _fjsp_madd_v2r8(dz32,fscal,fjz2);
1252 /**************************
1253 * CALCULATE INTERACTIONS *
1254 **************************/
1256 r33 = _fjsp_mul_v2r8(rsq33,rinv33);
1258 /* Calculate table index by multiplying r with table scale and truncate to integer */
1259 rt = _fjsp_mul_v2r8(r33,vftabscale);
1260 itab_tmp = _fjsp_dtox_v2r8(rt);
1261 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1262 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1263 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1268 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1269 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1270 F = _fjsp_setzero_v2r8();
1271 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1272 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1273 H = _fjsp_setzero_v2r8();
1274 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1275 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1276 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
1277 velec = _fjsp_mul_v2r8(qq33,VV);
1278 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1279 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq33,FF),_fjsp_mul_v2r8(vftabscale,rinv33)));
1281 /* Update potential sum for this i atom from the interaction with this j atom. */
1282 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1283 velecsum = _fjsp_add_v2r8(velecsum,velec);
1287 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1289 /* Update vectorial force */
1290 fix3 = _fjsp_madd_v2r8(dx33,fscal,fix3);
1291 fiy3 = _fjsp_madd_v2r8(dy33,fscal,fiy3);
1292 fiz3 = _fjsp_madd_v2r8(dz33,fscal,fiz3);
1294 fjx3 = _fjsp_madd_v2r8(dx33,fscal,fjx3);
1295 fjy3 = _fjsp_madd_v2r8(dy33,fscal,fjy3);
1296 fjz3 = _fjsp_madd_v2r8(dz33,fscal,fjz3);
1298 gmx_fjsp_decrement_4rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2,fjx3,fjy3,fjz3);
1300 /* Inner loop uses 476 flops */
1303 /* End of innermost loop */
1305 gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
1306 f+i_coord_offset,fshift+i_shift_offset);
1309 /* Update potential energies */
1310 gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
1311 gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
1313 /* Increment number of inner iterations */
1314 inneriter += j_index_end - j_index_start;
1316 /* Outer loop uses 26 flops */
1319 /* Increment number of outer iterations */
1322 /* Update outer/inner flops */
1324 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4W4_VF,outeriter*26 + inneriter*476);
1327 * Gromacs nonbonded kernel: nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sparc64_hpc_ace_double
1328 * Electrostatics interaction: CubicSplineTable
1329 * VdW interaction: CubicSplineTable
1330 * Geometry: Water4-Water4
1331 * Calculate force/pot: Force
1334 nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sparc64_hpc_ace_double
1335 (t_nblist * gmx_restrict nlist,
1336 rvec * gmx_restrict xx,
1337 rvec * gmx_restrict ff,
1338 t_forcerec * gmx_restrict fr,
1339 t_mdatoms * gmx_restrict mdatoms,
1340 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
1341 t_nrnb * gmx_restrict nrnb)
1343 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
1344 * just 0 for non-waters.
1345 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
1346 * jnr indices corresponding to data put in the four positions in the SIMD register.
1348 int i_shift_offset,i_coord_offset,outeriter,inneriter;
1349 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
1351 int j_coord_offsetA,j_coord_offsetB;
1352 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
1353 real rcutoff_scalar;
1354 real *shiftvec,*fshift,*x,*f;
1355 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
1357 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
1359 _fjsp_v2r8 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
1361 _fjsp_v2r8 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
1363 _fjsp_v2r8 ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
1364 int vdwjidx0A,vdwjidx0B;
1365 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
1366 int vdwjidx1A,vdwjidx1B;
1367 _fjsp_v2r8 jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
1368 int vdwjidx2A,vdwjidx2B;
1369 _fjsp_v2r8 jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
1370 int vdwjidx3A,vdwjidx3B;
1371 _fjsp_v2r8 jx3,jy3,jz3,fjx3,fjy3,fjz3,jq3,isaj3;
1372 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
1373 _fjsp_v2r8 dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11;
1374 _fjsp_v2r8 dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12;
1375 _fjsp_v2r8 dx13,dy13,dz13,rsq13,rinv13,rinvsq13,r13,qq13,c6_13,c12_13;
1376 _fjsp_v2r8 dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21;
1377 _fjsp_v2r8 dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22;
1378 _fjsp_v2r8 dx23,dy23,dz23,rsq23,rinv23,rinvsq23,r23,qq23,c6_23,c12_23;
1379 _fjsp_v2r8 dx31,dy31,dz31,rsq31,rinv31,rinvsq31,r31,qq31,c6_31,c12_31;
1380 _fjsp_v2r8 dx32,dy32,dz32,rsq32,rinv32,rinvsq32,r32,qq32,c6_32,c12_32;
1381 _fjsp_v2r8 dx33,dy33,dz33,rsq33,rinv33,rinvsq33,r33,qq33,c6_33,c12_33;
1382 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
1385 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
1388 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
1389 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
1390 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
1392 _fjsp_v2r8 itab_tmp;
1393 _fjsp_v2r8 dummy_mask,cutoff_mask;
1394 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
1395 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
1396 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
1403 jindex = nlist->jindex;
1405 shiftidx = nlist->shift;
1407 shiftvec = fr->shift_vec[0];
1408 fshift = fr->fshift[0];
1409 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
1410 charge = mdatoms->chargeA;
1411 nvdwtype = fr->ntype;
1412 vdwparam = fr->nbfp;
1413 vdwtype = mdatoms->typeA;
1415 vftab = kernel_data->table_elec_vdw->data;
1416 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_elec_vdw->scale);
1418 /* Setup water-specific parameters */
1419 inr = nlist->iinr[0];
1420 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
1421 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
1422 iq3 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+3]));
1423 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
1425 jq1 = gmx_fjsp_set1_v2r8(charge[inr+1]);
1426 jq2 = gmx_fjsp_set1_v2r8(charge[inr+2]);
1427 jq3 = gmx_fjsp_set1_v2r8(charge[inr+3]);
1428 vdwjidx0A = 2*vdwtype[inr+0];
1429 c6_00 = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A]);
1430 c12_00 = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A+1]);
1431 qq11 = _fjsp_mul_v2r8(iq1,jq1);
1432 qq12 = _fjsp_mul_v2r8(iq1,jq2);
1433 qq13 = _fjsp_mul_v2r8(iq1,jq3);
1434 qq21 = _fjsp_mul_v2r8(iq2,jq1);
1435 qq22 = _fjsp_mul_v2r8(iq2,jq2);
1436 qq23 = _fjsp_mul_v2r8(iq2,jq3);
1437 qq31 = _fjsp_mul_v2r8(iq3,jq1);
1438 qq32 = _fjsp_mul_v2r8(iq3,jq2);
1439 qq33 = _fjsp_mul_v2r8(iq3,jq3);
1441 /* Avoid stupid compiler warnings */
1443 j_coord_offsetA = 0;
1444 j_coord_offsetB = 0;
1449 /* Start outer loop over neighborlists */
1450 for(iidx=0; iidx<nri; iidx++)
1452 /* Load shift vector for this list */
1453 i_shift_offset = DIM*shiftidx[iidx];
1455 /* Load limits for loop over neighbors */
1456 j_index_start = jindex[iidx];
1457 j_index_end = jindex[iidx+1];
1459 /* Get outer coordinate index */
1461 i_coord_offset = DIM*inr;
1463 /* Load i particle coords and add shift vector */
1464 gmx_fjsp_load_shift_and_4rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
1465 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
1467 fix0 = _fjsp_setzero_v2r8();
1468 fiy0 = _fjsp_setzero_v2r8();
1469 fiz0 = _fjsp_setzero_v2r8();
1470 fix1 = _fjsp_setzero_v2r8();
1471 fiy1 = _fjsp_setzero_v2r8();
1472 fiz1 = _fjsp_setzero_v2r8();
1473 fix2 = _fjsp_setzero_v2r8();
1474 fiy2 = _fjsp_setzero_v2r8();
1475 fiz2 = _fjsp_setzero_v2r8();
1476 fix3 = _fjsp_setzero_v2r8();
1477 fiy3 = _fjsp_setzero_v2r8();
1478 fiz3 = _fjsp_setzero_v2r8();
1480 /* Start inner kernel loop */
1481 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
1484 /* Get j neighbor index, and coordinate index */
1486 jnrB = jjnr[jidx+1];
1487 j_coord_offsetA = DIM*jnrA;
1488 j_coord_offsetB = DIM*jnrB;
1490 /* load j atom coordinates */
1491 gmx_fjsp_load_4rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
1492 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,
1493 &jy2,&jz2,&jx3,&jy3,&jz3);
1495 /* Calculate displacement vector */
1496 dx00 = _fjsp_sub_v2r8(ix0,jx0);
1497 dy00 = _fjsp_sub_v2r8(iy0,jy0);
1498 dz00 = _fjsp_sub_v2r8(iz0,jz0);
1499 dx11 = _fjsp_sub_v2r8(ix1,jx1);
1500 dy11 = _fjsp_sub_v2r8(iy1,jy1);
1501 dz11 = _fjsp_sub_v2r8(iz1,jz1);
1502 dx12 = _fjsp_sub_v2r8(ix1,jx2);
1503 dy12 = _fjsp_sub_v2r8(iy1,jy2);
1504 dz12 = _fjsp_sub_v2r8(iz1,jz2);
1505 dx13 = _fjsp_sub_v2r8(ix1,jx3);
1506 dy13 = _fjsp_sub_v2r8(iy1,jy3);
1507 dz13 = _fjsp_sub_v2r8(iz1,jz3);
1508 dx21 = _fjsp_sub_v2r8(ix2,jx1);
1509 dy21 = _fjsp_sub_v2r8(iy2,jy1);
1510 dz21 = _fjsp_sub_v2r8(iz2,jz1);
1511 dx22 = _fjsp_sub_v2r8(ix2,jx2);
1512 dy22 = _fjsp_sub_v2r8(iy2,jy2);
1513 dz22 = _fjsp_sub_v2r8(iz2,jz2);
1514 dx23 = _fjsp_sub_v2r8(ix2,jx3);
1515 dy23 = _fjsp_sub_v2r8(iy2,jy3);
1516 dz23 = _fjsp_sub_v2r8(iz2,jz3);
1517 dx31 = _fjsp_sub_v2r8(ix3,jx1);
1518 dy31 = _fjsp_sub_v2r8(iy3,jy1);
1519 dz31 = _fjsp_sub_v2r8(iz3,jz1);
1520 dx32 = _fjsp_sub_v2r8(ix3,jx2);
1521 dy32 = _fjsp_sub_v2r8(iy3,jy2);
1522 dz32 = _fjsp_sub_v2r8(iz3,jz2);
1523 dx33 = _fjsp_sub_v2r8(ix3,jx3);
1524 dy33 = _fjsp_sub_v2r8(iy3,jy3);
1525 dz33 = _fjsp_sub_v2r8(iz3,jz3);
1527 /* Calculate squared distance and things based on it */
1528 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
1529 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
1530 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
1531 rsq13 = gmx_fjsp_calc_rsq_v2r8(dx13,dy13,dz13);
1532 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
1533 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
1534 rsq23 = gmx_fjsp_calc_rsq_v2r8(dx23,dy23,dz23);
1535 rsq31 = gmx_fjsp_calc_rsq_v2r8(dx31,dy31,dz31);
1536 rsq32 = gmx_fjsp_calc_rsq_v2r8(dx32,dy32,dz32);
1537 rsq33 = gmx_fjsp_calc_rsq_v2r8(dx33,dy33,dz33);
1539 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
1540 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
1541 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
1542 rinv13 = gmx_fjsp_invsqrt_v2r8(rsq13);
1543 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
1544 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
1545 rinv23 = gmx_fjsp_invsqrt_v2r8(rsq23);
1546 rinv31 = gmx_fjsp_invsqrt_v2r8(rsq31);
1547 rinv32 = gmx_fjsp_invsqrt_v2r8(rsq32);
1548 rinv33 = gmx_fjsp_invsqrt_v2r8(rsq33);
1550 fjx0 = _fjsp_setzero_v2r8();
1551 fjy0 = _fjsp_setzero_v2r8();
1552 fjz0 = _fjsp_setzero_v2r8();
1553 fjx1 = _fjsp_setzero_v2r8();
1554 fjy1 = _fjsp_setzero_v2r8();
1555 fjz1 = _fjsp_setzero_v2r8();
1556 fjx2 = _fjsp_setzero_v2r8();
1557 fjy2 = _fjsp_setzero_v2r8();
1558 fjz2 = _fjsp_setzero_v2r8();
1559 fjx3 = _fjsp_setzero_v2r8();
1560 fjy3 = _fjsp_setzero_v2r8();
1561 fjz3 = _fjsp_setzero_v2r8();
1563 /**************************
1564 * CALCULATE INTERACTIONS *
1565 **************************/
1567 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
1569 /* Calculate table index by multiplying r with table scale and truncate to integer */
1570 rt = _fjsp_mul_v2r8(r00,vftabscale);
1571 itab_tmp = _fjsp_dtox_v2r8(rt);
1572 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1573 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1574 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1579 /* CUBIC SPLINE TABLE DISPERSION */
1582 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1583 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
1584 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1585 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
1586 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
1587 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1588 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
1589 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
1590 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
1592 /* CUBIC SPLINE TABLE REPULSION */
1593 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
1594 F = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
1595 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1596 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
1597 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
1598 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1599 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
1600 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
1601 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
1602 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
1606 /* Update vectorial force */
1607 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
1608 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
1609 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
1611 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
1612 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
1613 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
1615 /**************************
1616 * CALCULATE INTERACTIONS *
1617 **************************/
1619 r11 = _fjsp_mul_v2r8(rsq11,rinv11);
1621 /* Calculate table index by multiplying r with table scale and truncate to integer */
1622 rt = _fjsp_mul_v2r8(r11,vftabscale);
1623 itab_tmp = _fjsp_dtox_v2r8(rt);
1624 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1625 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1626 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1631 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1632 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1633 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
1634 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1635 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1636 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
1637 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1638 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1639 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1640 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq11,FF),_fjsp_mul_v2r8(vftabscale,rinv11)));
1644 /* Update vectorial force */
1645 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
1646 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
1647 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
1649 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
1650 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
1651 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
1653 /**************************
1654 * CALCULATE INTERACTIONS *
1655 **************************/
1657 r12 = _fjsp_mul_v2r8(rsq12,rinv12);
1659 /* Calculate table index by multiplying r with table scale and truncate to integer */
1660 rt = _fjsp_mul_v2r8(r12,vftabscale);
1661 itab_tmp = _fjsp_dtox_v2r8(rt);
1662 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1663 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1664 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1669 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1670 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1671 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
1672 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1673 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1674 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
1675 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1676 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1677 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1678 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq12,FF),_fjsp_mul_v2r8(vftabscale,rinv12)));
1682 /* Update vectorial force */
1683 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
1684 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
1685 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
1687 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
1688 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
1689 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
1691 /**************************
1692 * CALCULATE INTERACTIONS *
1693 **************************/
1695 r13 = _fjsp_mul_v2r8(rsq13,rinv13);
1697 /* Calculate table index by multiplying r with table scale and truncate to integer */
1698 rt = _fjsp_mul_v2r8(r13,vftabscale);
1699 itab_tmp = _fjsp_dtox_v2r8(rt);
1700 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1701 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1702 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1707 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1708 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1709 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
1710 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1711 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1712 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
1713 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1714 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1715 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1716 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq13,FF),_fjsp_mul_v2r8(vftabscale,rinv13)));
1720 /* Update vectorial force */
1721 fix1 = _fjsp_madd_v2r8(dx13,fscal,fix1);
1722 fiy1 = _fjsp_madd_v2r8(dy13,fscal,fiy1);
1723 fiz1 = _fjsp_madd_v2r8(dz13,fscal,fiz1);
1725 fjx3 = _fjsp_madd_v2r8(dx13,fscal,fjx3);
1726 fjy3 = _fjsp_madd_v2r8(dy13,fscal,fjy3);
1727 fjz3 = _fjsp_madd_v2r8(dz13,fscal,fjz3);
1729 /**************************
1730 * CALCULATE INTERACTIONS *
1731 **************************/
1733 r21 = _fjsp_mul_v2r8(rsq21,rinv21);
1735 /* Calculate table index by multiplying r with table scale and truncate to integer */
1736 rt = _fjsp_mul_v2r8(r21,vftabscale);
1737 itab_tmp = _fjsp_dtox_v2r8(rt);
1738 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1739 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1740 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1745 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1746 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1747 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
1748 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1749 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1750 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
1751 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1752 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1753 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1754 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq21,FF),_fjsp_mul_v2r8(vftabscale,rinv21)));
1758 /* Update vectorial force */
1759 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
1760 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
1761 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
1763 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
1764 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
1765 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
1767 /**************************
1768 * CALCULATE INTERACTIONS *
1769 **************************/
1771 r22 = _fjsp_mul_v2r8(rsq22,rinv22);
1773 /* Calculate table index by multiplying r with table scale and truncate to integer */
1774 rt = _fjsp_mul_v2r8(r22,vftabscale);
1775 itab_tmp = _fjsp_dtox_v2r8(rt);
1776 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1777 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1778 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1783 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1784 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1785 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
1786 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1787 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1788 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
1789 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1790 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1791 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1792 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq22,FF),_fjsp_mul_v2r8(vftabscale,rinv22)));
1796 /* Update vectorial force */
1797 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
1798 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
1799 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
1801 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
1802 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
1803 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
1805 /**************************
1806 * CALCULATE INTERACTIONS *
1807 **************************/
1809 r23 = _fjsp_mul_v2r8(rsq23,rinv23);
1811 /* Calculate table index by multiplying r with table scale and truncate to integer */
1812 rt = _fjsp_mul_v2r8(r23,vftabscale);
1813 itab_tmp = _fjsp_dtox_v2r8(rt);
1814 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1815 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1816 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1821 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1822 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1823 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
1824 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1825 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1826 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
1827 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1828 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1829 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1830 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq23,FF),_fjsp_mul_v2r8(vftabscale,rinv23)));
1834 /* Update vectorial force */
1835 fix2 = _fjsp_madd_v2r8(dx23,fscal,fix2);
1836 fiy2 = _fjsp_madd_v2r8(dy23,fscal,fiy2);
1837 fiz2 = _fjsp_madd_v2r8(dz23,fscal,fiz2);
1839 fjx3 = _fjsp_madd_v2r8(dx23,fscal,fjx3);
1840 fjy3 = _fjsp_madd_v2r8(dy23,fscal,fjy3);
1841 fjz3 = _fjsp_madd_v2r8(dz23,fscal,fjz3);
1843 /**************************
1844 * CALCULATE INTERACTIONS *
1845 **************************/
1847 r31 = _fjsp_mul_v2r8(rsq31,rinv31);
1849 /* Calculate table index by multiplying r with table scale and truncate to integer */
1850 rt = _fjsp_mul_v2r8(r31,vftabscale);
1851 itab_tmp = _fjsp_dtox_v2r8(rt);
1852 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1853 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1854 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1859 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1860 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1861 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
1862 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1863 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1864 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
1865 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1866 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1867 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1868 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq31,FF),_fjsp_mul_v2r8(vftabscale,rinv31)));
1872 /* Update vectorial force */
1873 fix3 = _fjsp_madd_v2r8(dx31,fscal,fix3);
1874 fiy3 = _fjsp_madd_v2r8(dy31,fscal,fiy3);
1875 fiz3 = _fjsp_madd_v2r8(dz31,fscal,fiz3);
1877 fjx1 = _fjsp_madd_v2r8(dx31,fscal,fjx1);
1878 fjy1 = _fjsp_madd_v2r8(dy31,fscal,fjy1);
1879 fjz1 = _fjsp_madd_v2r8(dz31,fscal,fjz1);
1881 /**************************
1882 * CALCULATE INTERACTIONS *
1883 **************************/
1885 r32 = _fjsp_mul_v2r8(rsq32,rinv32);
1887 /* Calculate table index by multiplying r with table scale and truncate to integer */
1888 rt = _fjsp_mul_v2r8(r32,vftabscale);
1889 itab_tmp = _fjsp_dtox_v2r8(rt);
1890 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1891 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1892 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1897 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1898 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1899 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
1900 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1901 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1902 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
1903 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1904 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1905 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1906 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq32,FF),_fjsp_mul_v2r8(vftabscale,rinv32)));
1910 /* Update vectorial force */
1911 fix3 = _fjsp_madd_v2r8(dx32,fscal,fix3);
1912 fiy3 = _fjsp_madd_v2r8(dy32,fscal,fiy3);
1913 fiz3 = _fjsp_madd_v2r8(dz32,fscal,fiz3);
1915 fjx2 = _fjsp_madd_v2r8(dx32,fscal,fjx2);
1916 fjy2 = _fjsp_madd_v2r8(dy32,fscal,fjy2);
1917 fjz2 = _fjsp_madd_v2r8(dz32,fscal,fjz2);
1919 /**************************
1920 * CALCULATE INTERACTIONS *
1921 **************************/
1923 r33 = _fjsp_mul_v2r8(rsq33,rinv33);
1925 /* Calculate table index by multiplying r with table scale and truncate to integer */
1926 rt = _fjsp_mul_v2r8(r33,vftabscale);
1927 itab_tmp = _fjsp_dtox_v2r8(rt);
1928 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1929 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1930 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1935 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1936 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1937 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
1938 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1939 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1940 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
1941 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1942 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1943 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1944 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq33,FF),_fjsp_mul_v2r8(vftabscale,rinv33)));
1948 /* Update vectorial force */
1949 fix3 = _fjsp_madd_v2r8(dx33,fscal,fix3);
1950 fiy3 = _fjsp_madd_v2r8(dy33,fscal,fiy3);
1951 fiz3 = _fjsp_madd_v2r8(dz33,fscal,fiz3);
1953 fjx3 = _fjsp_madd_v2r8(dx33,fscal,fjx3);
1954 fjy3 = _fjsp_madd_v2r8(dy33,fscal,fjy3);
1955 fjz3 = _fjsp_madd_v2r8(dz33,fscal,fjz3);
1957 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);
1959 /* Inner loop uses 432 flops */
1962 if(jidx<j_index_end)
1966 j_coord_offsetA = DIM*jnrA;
1968 /* load j atom coordinates */
1969 gmx_fjsp_load_4rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
1970 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,
1971 &jy2,&jz2,&jx3,&jy3,&jz3);
1973 /* Calculate displacement vector */
1974 dx00 = _fjsp_sub_v2r8(ix0,jx0);
1975 dy00 = _fjsp_sub_v2r8(iy0,jy0);
1976 dz00 = _fjsp_sub_v2r8(iz0,jz0);
1977 dx11 = _fjsp_sub_v2r8(ix1,jx1);
1978 dy11 = _fjsp_sub_v2r8(iy1,jy1);
1979 dz11 = _fjsp_sub_v2r8(iz1,jz1);
1980 dx12 = _fjsp_sub_v2r8(ix1,jx2);
1981 dy12 = _fjsp_sub_v2r8(iy1,jy2);
1982 dz12 = _fjsp_sub_v2r8(iz1,jz2);
1983 dx13 = _fjsp_sub_v2r8(ix1,jx3);
1984 dy13 = _fjsp_sub_v2r8(iy1,jy3);
1985 dz13 = _fjsp_sub_v2r8(iz1,jz3);
1986 dx21 = _fjsp_sub_v2r8(ix2,jx1);
1987 dy21 = _fjsp_sub_v2r8(iy2,jy1);
1988 dz21 = _fjsp_sub_v2r8(iz2,jz1);
1989 dx22 = _fjsp_sub_v2r8(ix2,jx2);
1990 dy22 = _fjsp_sub_v2r8(iy2,jy2);
1991 dz22 = _fjsp_sub_v2r8(iz2,jz2);
1992 dx23 = _fjsp_sub_v2r8(ix2,jx3);
1993 dy23 = _fjsp_sub_v2r8(iy2,jy3);
1994 dz23 = _fjsp_sub_v2r8(iz2,jz3);
1995 dx31 = _fjsp_sub_v2r8(ix3,jx1);
1996 dy31 = _fjsp_sub_v2r8(iy3,jy1);
1997 dz31 = _fjsp_sub_v2r8(iz3,jz1);
1998 dx32 = _fjsp_sub_v2r8(ix3,jx2);
1999 dy32 = _fjsp_sub_v2r8(iy3,jy2);
2000 dz32 = _fjsp_sub_v2r8(iz3,jz2);
2001 dx33 = _fjsp_sub_v2r8(ix3,jx3);
2002 dy33 = _fjsp_sub_v2r8(iy3,jy3);
2003 dz33 = _fjsp_sub_v2r8(iz3,jz3);
2005 /* Calculate squared distance and things based on it */
2006 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
2007 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
2008 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
2009 rsq13 = gmx_fjsp_calc_rsq_v2r8(dx13,dy13,dz13);
2010 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
2011 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
2012 rsq23 = gmx_fjsp_calc_rsq_v2r8(dx23,dy23,dz23);
2013 rsq31 = gmx_fjsp_calc_rsq_v2r8(dx31,dy31,dz31);
2014 rsq32 = gmx_fjsp_calc_rsq_v2r8(dx32,dy32,dz32);
2015 rsq33 = gmx_fjsp_calc_rsq_v2r8(dx33,dy33,dz33);
2017 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
2018 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
2019 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
2020 rinv13 = gmx_fjsp_invsqrt_v2r8(rsq13);
2021 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
2022 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
2023 rinv23 = gmx_fjsp_invsqrt_v2r8(rsq23);
2024 rinv31 = gmx_fjsp_invsqrt_v2r8(rsq31);
2025 rinv32 = gmx_fjsp_invsqrt_v2r8(rsq32);
2026 rinv33 = gmx_fjsp_invsqrt_v2r8(rsq33);
2028 fjx0 = _fjsp_setzero_v2r8();
2029 fjy0 = _fjsp_setzero_v2r8();
2030 fjz0 = _fjsp_setzero_v2r8();
2031 fjx1 = _fjsp_setzero_v2r8();
2032 fjy1 = _fjsp_setzero_v2r8();
2033 fjz1 = _fjsp_setzero_v2r8();
2034 fjx2 = _fjsp_setzero_v2r8();
2035 fjy2 = _fjsp_setzero_v2r8();
2036 fjz2 = _fjsp_setzero_v2r8();
2037 fjx3 = _fjsp_setzero_v2r8();
2038 fjy3 = _fjsp_setzero_v2r8();
2039 fjz3 = _fjsp_setzero_v2r8();
2041 /**************************
2042 * CALCULATE INTERACTIONS *
2043 **************************/
2045 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
2047 /* Calculate table index by multiplying r with table scale and truncate to integer */
2048 rt = _fjsp_mul_v2r8(r00,vftabscale);
2049 itab_tmp = _fjsp_dtox_v2r8(rt);
2050 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
2051 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
2052 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
2057 /* CUBIC SPLINE TABLE DISPERSION */
2060 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
2061 F = _fjsp_setzero_v2r8();
2062 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
2063 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
2064 H = _fjsp_setzero_v2r8();
2065 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
2066 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
2067 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
2068 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
2070 /* CUBIC SPLINE TABLE REPULSION */
2071 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
2072 F = _fjsp_setzero_v2r8();
2073 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
2074 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
2075 H = _fjsp_setzero_v2r8();
2076 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
2077 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
2078 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
2079 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
2080 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
2084 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2086 /* Update vectorial force */
2087 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
2088 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
2089 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
2091 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
2092 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
2093 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
2095 /**************************
2096 * CALCULATE INTERACTIONS *
2097 **************************/
2099 r11 = _fjsp_mul_v2r8(rsq11,rinv11);
2101 /* Calculate table index by multiplying r with table scale and truncate to integer */
2102 rt = _fjsp_mul_v2r8(r11,vftabscale);
2103 itab_tmp = _fjsp_dtox_v2r8(rt);
2104 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
2105 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
2106 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
2111 /* CUBIC SPLINE TABLE ELECTROSTATICS */
2112 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
2113 F = _fjsp_setzero_v2r8();
2114 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
2115 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
2116 H = _fjsp_setzero_v2r8();
2117 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
2118 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
2119 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
2120 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq11,FF),_fjsp_mul_v2r8(vftabscale,rinv11)));
2124 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2126 /* Update vectorial force */
2127 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
2128 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
2129 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
2131 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
2132 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
2133 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
2135 /**************************
2136 * CALCULATE INTERACTIONS *
2137 **************************/
2139 r12 = _fjsp_mul_v2r8(rsq12,rinv12);
2141 /* Calculate table index by multiplying r with table scale and truncate to integer */
2142 rt = _fjsp_mul_v2r8(r12,vftabscale);
2143 itab_tmp = _fjsp_dtox_v2r8(rt);
2144 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
2145 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
2146 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
2151 /* CUBIC SPLINE TABLE ELECTROSTATICS */
2152 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
2153 F = _fjsp_setzero_v2r8();
2154 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
2155 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
2156 H = _fjsp_setzero_v2r8();
2157 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
2158 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
2159 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
2160 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq12,FF),_fjsp_mul_v2r8(vftabscale,rinv12)));
2164 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2166 /* Update vectorial force */
2167 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
2168 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
2169 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
2171 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
2172 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
2173 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
2175 /**************************
2176 * CALCULATE INTERACTIONS *
2177 **************************/
2179 r13 = _fjsp_mul_v2r8(rsq13,rinv13);
2181 /* Calculate table index by multiplying r with table scale and truncate to integer */
2182 rt = _fjsp_mul_v2r8(r13,vftabscale);
2183 itab_tmp = _fjsp_dtox_v2r8(rt);
2184 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
2185 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
2186 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
2191 /* CUBIC SPLINE TABLE ELECTROSTATICS */
2192 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
2193 F = _fjsp_setzero_v2r8();
2194 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
2195 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
2196 H = _fjsp_setzero_v2r8();
2197 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
2198 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
2199 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
2200 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq13,FF),_fjsp_mul_v2r8(vftabscale,rinv13)));
2204 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2206 /* Update vectorial force */
2207 fix1 = _fjsp_madd_v2r8(dx13,fscal,fix1);
2208 fiy1 = _fjsp_madd_v2r8(dy13,fscal,fiy1);
2209 fiz1 = _fjsp_madd_v2r8(dz13,fscal,fiz1);
2211 fjx3 = _fjsp_madd_v2r8(dx13,fscal,fjx3);
2212 fjy3 = _fjsp_madd_v2r8(dy13,fscal,fjy3);
2213 fjz3 = _fjsp_madd_v2r8(dz13,fscal,fjz3);
2215 /**************************
2216 * CALCULATE INTERACTIONS *
2217 **************************/
2219 r21 = _fjsp_mul_v2r8(rsq21,rinv21);
2221 /* Calculate table index by multiplying r with table scale and truncate to integer */
2222 rt = _fjsp_mul_v2r8(r21,vftabscale);
2223 itab_tmp = _fjsp_dtox_v2r8(rt);
2224 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
2225 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
2226 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
2231 /* CUBIC SPLINE TABLE ELECTROSTATICS */
2232 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
2233 F = _fjsp_setzero_v2r8();
2234 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
2235 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
2236 H = _fjsp_setzero_v2r8();
2237 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
2238 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
2239 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
2240 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq21,FF),_fjsp_mul_v2r8(vftabscale,rinv21)));
2244 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2246 /* Update vectorial force */
2247 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
2248 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
2249 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
2251 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
2252 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
2253 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
2255 /**************************
2256 * CALCULATE INTERACTIONS *
2257 **************************/
2259 r22 = _fjsp_mul_v2r8(rsq22,rinv22);
2261 /* Calculate table index by multiplying r with table scale and truncate to integer */
2262 rt = _fjsp_mul_v2r8(r22,vftabscale);
2263 itab_tmp = _fjsp_dtox_v2r8(rt);
2264 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
2265 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
2266 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
2271 /* CUBIC SPLINE TABLE ELECTROSTATICS */
2272 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
2273 F = _fjsp_setzero_v2r8();
2274 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
2275 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
2276 H = _fjsp_setzero_v2r8();
2277 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
2278 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
2279 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
2280 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq22,FF),_fjsp_mul_v2r8(vftabscale,rinv22)));
2284 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2286 /* Update vectorial force */
2287 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
2288 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
2289 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
2291 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
2292 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
2293 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
2295 /**************************
2296 * CALCULATE INTERACTIONS *
2297 **************************/
2299 r23 = _fjsp_mul_v2r8(rsq23,rinv23);
2301 /* Calculate table index by multiplying r with table scale and truncate to integer */
2302 rt = _fjsp_mul_v2r8(r23,vftabscale);
2303 itab_tmp = _fjsp_dtox_v2r8(rt);
2304 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
2305 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
2306 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
2311 /* CUBIC SPLINE TABLE ELECTROSTATICS */
2312 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
2313 F = _fjsp_setzero_v2r8();
2314 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
2315 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
2316 H = _fjsp_setzero_v2r8();
2317 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
2318 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
2319 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
2320 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq23,FF),_fjsp_mul_v2r8(vftabscale,rinv23)));
2324 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2326 /* Update vectorial force */
2327 fix2 = _fjsp_madd_v2r8(dx23,fscal,fix2);
2328 fiy2 = _fjsp_madd_v2r8(dy23,fscal,fiy2);
2329 fiz2 = _fjsp_madd_v2r8(dz23,fscal,fiz2);
2331 fjx3 = _fjsp_madd_v2r8(dx23,fscal,fjx3);
2332 fjy3 = _fjsp_madd_v2r8(dy23,fscal,fjy3);
2333 fjz3 = _fjsp_madd_v2r8(dz23,fscal,fjz3);
2335 /**************************
2336 * CALCULATE INTERACTIONS *
2337 **************************/
2339 r31 = _fjsp_mul_v2r8(rsq31,rinv31);
2341 /* Calculate table index by multiplying r with table scale and truncate to integer */
2342 rt = _fjsp_mul_v2r8(r31,vftabscale);
2343 itab_tmp = _fjsp_dtox_v2r8(rt);
2344 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
2345 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
2346 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
2351 /* CUBIC SPLINE TABLE ELECTROSTATICS */
2352 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
2353 F = _fjsp_setzero_v2r8();
2354 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
2355 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
2356 H = _fjsp_setzero_v2r8();
2357 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
2358 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
2359 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
2360 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq31,FF),_fjsp_mul_v2r8(vftabscale,rinv31)));
2364 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2366 /* Update vectorial force */
2367 fix3 = _fjsp_madd_v2r8(dx31,fscal,fix3);
2368 fiy3 = _fjsp_madd_v2r8(dy31,fscal,fiy3);
2369 fiz3 = _fjsp_madd_v2r8(dz31,fscal,fiz3);
2371 fjx1 = _fjsp_madd_v2r8(dx31,fscal,fjx1);
2372 fjy1 = _fjsp_madd_v2r8(dy31,fscal,fjy1);
2373 fjz1 = _fjsp_madd_v2r8(dz31,fscal,fjz1);
2375 /**************************
2376 * CALCULATE INTERACTIONS *
2377 **************************/
2379 r32 = _fjsp_mul_v2r8(rsq32,rinv32);
2381 /* Calculate table index by multiplying r with table scale and truncate to integer */
2382 rt = _fjsp_mul_v2r8(r32,vftabscale);
2383 itab_tmp = _fjsp_dtox_v2r8(rt);
2384 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
2385 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
2386 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
2391 /* CUBIC SPLINE TABLE ELECTROSTATICS */
2392 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
2393 F = _fjsp_setzero_v2r8();
2394 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
2395 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
2396 H = _fjsp_setzero_v2r8();
2397 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
2398 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
2399 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
2400 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq32,FF),_fjsp_mul_v2r8(vftabscale,rinv32)));
2404 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2406 /* Update vectorial force */
2407 fix3 = _fjsp_madd_v2r8(dx32,fscal,fix3);
2408 fiy3 = _fjsp_madd_v2r8(dy32,fscal,fiy3);
2409 fiz3 = _fjsp_madd_v2r8(dz32,fscal,fiz3);
2411 fjx2 = _fjsp_madd_v2r8(dx32,fscal,fjx2);
2412 fjy2 = _fjsp_madd_v2r8(dy32,fscal,fjy2);
2413 fjz2 = _fjsp_madd_v2r8(dz32,fscal,fjz2);
2415 /**************************
2416 * CALCULATE INTERACTIONS *
2417 **************************/
2419 r33 = _fjsp_mul_v2r8(rsq33,rinv33);
2421 /* Calculate table index by multiplying r with table scale and truncate to integer */
2422 rt = _fjsp_mul_v2r8(r33,vftabscale);
2423 itab_tmp = _fjsp_dtox_v2r8(rt);
2424 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
2425 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
2426 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
2431 /* CUBIC SPLINE TABLE ELECTROSTATICS */
2432 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
2433 F = _fjsp_setzero_v2r8();
2434 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
2435 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
2436 H = _fjsp_setzero_v2r8();
2437 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
2438 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
2439 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
2440 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq33,FF),_fjsp_mul_v2r8(vftabscale,rinv33)));
2444 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2446 /* Update vectorial force */
2447 fix3 = _fjsp_madd_v2r8(dx33,fscal,fix3);
2448 fiy3 = _fjsp_madd_v2r8(dy33,fscal,fiy3);
2449 fiz3 = _fjsp_madd_v2r8(dz33,fscal,fiz3);
2451 fjx3 = _fjsp_madd_v2r8(dx33,fscal,fjx3);
2452 fjy3 = _fjsp_madd_v2r8(dy33,fscal,fjy3);
2453 fjz3 = _fjsp_madd_v2r8(dz33,fscal,fjz3);
2455 gmx_fjsp_decrement_4rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2,fjx3,fjy3,fjz3);
2457 /* Inner loop uses 432 flops */
2460 /* End of innermost loop */
2462 gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
2463 f+i_coord_offset,fshift+i_shift_offset);
2465 /* Increment number of inner iterations */
2466 inneriter += j_index_end - j_index_start;
2468 /* Outer loop uses 24 flops */
2471 /* Increment number of outer iterations */
2474 /* Update outer/inner flops */
2476 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4W4_F,outeriter*24 + inneriter*432);