2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2012, by the GROMACS development team, led by
5 * David van der Spoel, Berk Hess, Erik Lindahl, and including many
6 * others, as listed in the AUTHORS file in the top-level source
7 * directory and at http://www.gromacs.org.
9 * GROMACS is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 2.1
12 * of the License, or (at your option) any later version.
14 * GROMACS is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with GROMACS; if not, see
21 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 * If you want to redistribute modifications to GROMACS, please
25 * consider that scientific software is very special. Version
26 * control is crucial - bugs must be traceable. We will be happy to
27 * consider code for inclusion in the official distribution, but
28 * derived work must not be called official GROMACS. Details are found
29 * in the README & COPYING files - if they are missing, get the
30 * official version at http://www.gromacs.org.
32 * To help us fund GROMACS development, we humbly ask that you cite
33 * the research papers on the package. Check out http://www.gromacs.org.
36 * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
44 #include "../nb_kernel.h"
45 #include "types/simple.h"
49 #include "kernelutil_sparc64_hpc_ace_double.h"
52 * Gromacs nonbonded kernel: nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sparc64_hpc_ace_double
53 * Electrostatics interaction: CubicSplineTable
54 * VdW interaction: LennardJones
55 * Geometry: Water4-Water4
56 * Calculate force/pot: PotentialAndForce
59 nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sparc64_hpc_ace_double
60 (t_nblist * gmx_restrict nlist,
61 rvec * gmx_restrict xx,
62 rvec * gmx_restrict ff,
63 t_forcerec * gmx_restrict fr,
64 t_mdatoms * gmx_restrict mdatoms,
65 nb_kernel_data_t * gmx_restrict kernel_data,
66 t_nrnb * gmx_restrict nrnb)
68 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
69 * just 0 for non-waters.
70 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
71 * jnr indices corresponding to data put in the four positions in the SIMD register.
73 int i_shift_offset,i_coord_offset,outeriter,inneriter;
74 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
76 int j_coord_offsetA,j_coord_offsetB;
77 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
79 real *shiftvec,*fshift,*x,*f;
80 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
82 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
84 _fjsp_v2r8 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
86 _fjsp_v2r8 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
88 _fjsp_v2r8 ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
89 int vdwjidx0A,vdwjidx0B;
90 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
91 int vdwjidx1A,vdwjidx1B;
92 _fjsp_v2r8 jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
93 int vdwjidx2A,vdwjidx2B;
94 _fjsp_v2r8 jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
95 int vdwjidx3A,vdwjidx3B;
96 _fjsp_v2r8 jx3,jy3,jz3,fjx3,fjy3,fjz3,jq3,isaj3;
97 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
98 _fjsp_v2r8 dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11;
99 _fjsp_v2r8 dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12;
100 _fjsp_v2r8 dx13,dy13,dz13,rsq13,rinv13,rinvsq13,r13,qq13,c6_13,c12_13;
101 _fjsp_v2r8 dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21;
102 _fjsp_v2r8 dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22;
103 _fjsp_v2r8 dx23,dy23,dz23,rsq23,rinv23,rinvsq23,r23,qq23,c6_23,c12_23;
104 _fjsp_v2r8 dx31,dy31,dz31,rsq31,rinv31,rinvsq31,r31,qq31,c6_31,c12_31;
105 _fjsp_v2r8 dx32,dy32,dz32,rsq32,rinv32,rinvsq32,r32,qq32,c6_32,c12_32;
106 _fjsp_v2r8 dx33,dy33,dz33,rsq33,rinv33,rinvsq33,r33,qq33,c6_33,c12_33;
107 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
110 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
113 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
114 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
115 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
118 _fjsp_v2r8 dummy_mask,cutoff_mask;
119 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
120 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
121 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
128 jindex = nlist->jindex;
130 shiftidx = nlist->shift;
132 shiftvec = fr->shift_vec[0];
133 fshift = fr->fshift[0];
134 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
135 charge = mdatoms->chargeA;
136 nvdwtype = fr->ntype;
138 vdwtype = mdatoms->typeA;
140 vftab = kernel_data->table_elec->data;
141 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_elec->scale);
143 /* Setup water-specific parameters */
144 inr = nlist->iinr[0];
145 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
146 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
147 iq3 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+3]));
148 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
150 jq1 = gmx_fjsp_set1_v2r8(charge[inr+1]);
151 jq2 = gmx_fjsp_set1_v2r8(charge[inr+2]);
152 jq3 = gmx_fjsp_set1_v2r8(charge[inr+3]);
153 vdwjidx0A = 2*vdwtype[inr+0];
154 c6_00 = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A]);
155 c12_00 = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A+1]);
156 qq11 = _fjsp_mul_v2r8(iq1,jq1);
157 qq12 = _fjsp_mul_v2r8(iq1,jq2);
158 qq13 = _fjsp_mul_v2r8(iq1,jq3);
159 qq21 = _fjsp_mul_v2r8(iq2,jq1);
160 qq22 = _fjsp_mul_v2r8(iq2,jq2);
161 qq23 = _fjsp_mul_v2r8(iq2,jq3);
162 qq31 = _fjsp_mul_v2r8(iq3,jq1);
163 qq32 = _fjsp_mul_v2r8(iq3,jq2);
164 qq33 = _fjsp_mul_v2r8(iq3,jq3);
166 /* Avoid stupid compiler warnings */
174 /* Start outer loop over neighborlists */
175 for(iidx=0; iidx<nri; iidx++)
177 /* Load shift vector for this list */
178 i_shift_offset = DIM*shiftidx[iidx];
180 /* Load limits for loop over neighbors */
181 j_index_start = jindex[iidx];
182 j_index_end = jindex[iidx+1];
184 /* Get outer coordinate index */
186 i_coord_offset = DIM*inr;
188 /* Load i particle coords and add shift vector */
189 gmx_fjsp_load_shift_and_4rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
190 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
192 fix0 = _fjsp_setzero_v2r8();
193 fiy0 = _fjsp_setzero_v2r8();
194 fiz0 = _fjsp_setzero_v2r8();
195 fix1 = _fjsp_setzero_v2r8();
196 fiy1 = _fjsp_setzero_v2r8();
197 fiz1 = _fjsp_setzero_v2r8();
198 fix2 = _fjsp_setzero_v2r8();
199 fiy2 = _fjsp_setzero_v2r8();
200 fiz2 = _fjsp_setzero_v2r8();
201 fix3 = _fjsp_setzero_v2r8();
202 fiy3 = _fjsp_setzero_v2r8();
203 fiz3 = _fjsp_setzero_v2r8();
205 /* Reset potential sums */
206 velecsum = _fjsp_setzero_v2r8();
207 vvdwsum = _fjsp_setzero_v2r8();
209 /* Start inner kernel loop */
210 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
213 /* Get j neighbor index, and coordinate index */
216 j_coord_offsetA = DIM*jnrA;
217 j_coord_offsetB = DIM*jnrB;
219 /* load j atom coordinates */
220 gmx_fjsp_load_4rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
221 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,
222 &jy2,&jz2,&jx3,&jy3,&jz3);
224 /* Calculate displacement vector */
225 dx00 = _fjsp_sub_v2r8(ix0,jx0);
226 dy00 = _fjsp_sub_v2r8(iy0,jy0);
227 dz00 = _fjsp_sub_v2r8(iz0,jz0);
228 dx11 = _fjsp_sub_v2r8(ix1,jx1);
229 dy11 = _fjsp_sub_v2r8(iy1,jy1);
230 dz11 = _fjsp_sub_v2r8(iz1,jz1);
231 dx12 = _fjsp_sub_v2r8(ix1,jx2);
232 dy12 = _fjsp_sub_v2r8(iy1,jy2);
233 dz12 = _fjsp_sub_v2r8(iz1,jz2);
234 dx13 = _fjsp_sub_v2r8(ix1,jx3);
235 dy13 = _fjsp_sub_v2r8(iy1,jy3);
236 dz13 = _fjsp_sub_v2r8(iz1,jz3);
237 dx21 = _fjsp_sub_v2r8(ix2,jx1);
238 dy21 = _fjsp_sub_v2r8(iy2,jy1);
239 dz21 = _fjsp_sub_v2r8(iz2,jz1);
240 dx22 = _fjsp_sub_v2r8(ix2,jx2);
241 dy22 = _fjsp_sub_v2r8(iy2,jy2);
242 dz22 = _fjsp_sub_v2r8(iz2,jz2);
243 dx23 = _fjsp_sub_v2r8(ix2,jx3);
244 dy23 = _fjsp_sub_v2r8(iy2,jy3);
245 dz23 = _fjsp_sub_v2r8(iz2,jz3);
246 dx31 = _fjsp_sub_v2r8(ix3,jx1);
247 dy31 = _fjsp_sub_v2r8(iy3,jy1);
248 dz31 = _fjsp_sub_v2r8(iz3,jz1);
249 dx32 = _fjsp_sub_v2r8(ix3,jx2);
250 dy32 = _fjsp_sub_v2r8(iy3,jy2);
251 dz32 = _fjsp_sub_v2r8(iz3,jz2);
252 dx33 = _fjsp_sub_v2r8(ix3,jx3);
253 dy33 = _fjsp_sub_v2r8(iy3,jy3);
254 dz33 = _fjsp_sub_v2r8(iz3,jz3);
256 /* Calculate squared distance and things based on it */
257 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
258 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
259 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
260 rsq13 = gmx_fjsp_calc_rsq_v2r8(dx13,dy13,dz13);
261 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
262 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
263 rsq23 = gmx_fjsp_calc_rsq_v2r8(dx23,dy23,dz23);
264 rsq31 = gmx_fjsp_calc_rsq_v2r8(dx31,dy31,dz31);
265 rsq32 = gmx_fjsp_calc_rsq_v2r8(dx32,dy32,dz32);
266 rsq33 = gmx_fjsp_calc_rsq_v2r8(dx33,dy33,dz33);
268 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
269 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
270 rinv13 = gmx_fjsp_invsqrt_v2r8(rsq13);
271 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
272 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
273 rinv23 = gmx_fjsp_invsqrt_v2r8(rsq23);
274 rinv31 = gmx_fjsp_invsqrt_v2r8(rsq31);
275 rinv32 = gmx_fjsp_invsqrt_v2r8(rsq32);
276 rinv33 = gmx_fjsp_invsqrt_v2r8(rsq33);
278 rinvsq00 = gmx_fjsp_inv_v2r8(rsq00);
280 fjx0 = _fjsp_setzero_v2r8();
281 fjy0 = _fjsp_setzero_v2r8();
282 fjz0 = _fjsp_setzero_v2r8();
283 fjx1 = _fjsp_setzero_v2r8();
284 fjy1 = _fjsp_setzero_v2r8();
285 fjz1 = _fjsp_setzero_v2r8();
286 fjx2 = _fjsp_setzero_v2r8();
287 fjy2 = _fjsp_setzero_v2r8();
288 fjz2 = _fjsp_setzero_v2r8();
289 fjx3 = _fjsp_setzero_v2r8();
290 fjy3 = _fjsp_setzero_v2r8();
291 fjz3 = _fjsp_setzero_v2r8();
293 /**************************
294 * CALCULATE INTERACTIONS *
295 **************************/
297 /* LENNARD-JONES DISPERSION/REPULSION */
299 rinvsix = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
300 vvdw6 = _fjsp_mul_v2r8(c6_00,rinvsix);
301 vvdw12 = _fjsp_mul_v2r8(c12_00,_fjsp_mul_v2r8(rinvsix,rinvsix));
302 vvdw = _fjsp_msub_v2r8( vvdw12,one_twelfth, _fjsp_mul_v2r8(vvdw6,one_sixth) );
303 fvdw = _fjsp_mul_v2r8(_fjsp_sub_v2r8(vvdw12,vvdw6),rinvsq00);
305 /* Update potential sum for this i atom from the interaction with this j atom. */
306 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
310 /* Update vectorial force */
311 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
312 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
313 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
315 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
316 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
317 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
319 /**************************
320 * CALCULATE INTERACTIONS *
321 **************************/
323 r11 = _fjsp_mul_v2r8(rsq11,rinv11);
325 /* Calculate table index by multiplying r with table scale and truncate to integer */
326 rt = _fjsp_mul_v2r8(r11,vftabscale);
327 itab_tmp = _fjsp_dtox_v2r8(rt);
328 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
329 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
330 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
335 /* CUBIC SPLINE TABLE ELECTROSTATICS */
336 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
337 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
338 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
339 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
340 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
341 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
342 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
343 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
344 velec = _fjsp_mul_v2r8(qq11,VV);
345 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
346 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq11,FF),_fjsp_mul_v2r8(vftabscale,rinv11)));
348 /* Update potential sum for this i atom from the interaction with this j atom. */
349 velecsum = _fjsp_add_v2r8(velecsum,velec);
353 /* Update vectorial force */
354 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
355 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
356 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
358 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
359 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
360 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
362 /**************************
363 * CALCULATE INTERACTIONS *
364 **************************/
366 r12 = _fjsp_mul_v2r8(rsq12,rinv12);
368 /* Calculate table index by multiplying r with table scale and truncate to integer */
369 rt = _fjsp_mul_v2r8(r12,vftabscale);
370 itab_tmp = _fjsp_dtox_v2r8(rt);
371 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
372 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
373 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
378 /* CUBIC SPLINE TABLE ELECTROSTATICS */
379 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
380 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
381 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
382 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
383 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
384 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
385 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
386 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
387 velec = _fjsp_mul_v2r8(qq12,VV);
388 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
389 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq12,FF),_fjsp_mul_v2r8(vftabscale,rinv12)));
391 /* Update potential sum for this i atom from the interaction with this j atom. */
392 velecsum = _fjsp_add_v2r8(velecsum,velec);
396 /* Update vectorial force */
397 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
398 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
399 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
401 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
402 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
403 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
405 /**************************
406 * CALCULATE INTERACTIONS *
407 **************************/
409 r13 = _fjsp_mul_v2r8(rsq13,rinv13);
411 /* Calculate table index by multiplying r with table scale and truncate to integer */
412 rt = _fjsp_mul_v2r8(r13,vftabscale);
413 itab_tmp = _fjsp_dtox_v2r8(rt);
414 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
415 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
416 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
421 /* CUBIC SPLINE TABLE ELECTROSTATICS */
422 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
423 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
424 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
425 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
426 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
427 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
428 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
429 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
430 velec = _fjsp_mul_v2r8(qq13,VV);
431 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
432 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq13,FF),_fjsp_mul_v2r8(vftabscale,rinv13)));
434 /* Update potential sum for this i atom from the interaction with this j atom. */
435 velecsum = _fjsp_add_v2r8(velecsum,velec);
439 /* Update vectorial force */
440 fix1 = _fjsp_madd_v2r8(dx13,fscal,fix1);
441 fiy1 = _fjsp_madd_v2r8(dy13,fscal,fiy1);
442 fiz1 = _fjsp_madd_v2r8(dz13,fscal,fiz1);
444 fjx3 = _fjsp_madd_v2r8(dx13,fscal,fjx3);
445 fjy3 = _fjsp_madd_v2r8(dy13,fscal,fjy3);
446 fjz3 = _fjsp_madd_v2r8(dz13,fscal,fjz3);
448 /**************************
449 * CALCULATE INTERACTIONS *
450 **************************/
452 r21 = _fjsp_mul_v2r8(rsq21,rinv21);
454 /* Calculate table index by multiplying r with table scale and truncate to integer */
455 rt = _fjsp_mul_v2r8(r21,vftabscale);
456 itab_tmp = _fjsp_dtox_v2r8(rt);
457 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
458 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
459 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
464 /* CUBIC SPLINE TABLE ELECTROSTATICS */
465 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
466 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
467 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
468 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
469 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
470 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
471 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
472 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
473 velec = _fjsp_mul_v2r8(qq21,VV);
474 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
475 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq21,FF),_fjsp_mul_v2r8(vftabscale,rinv21)));
477 /* Update potential sum for this i atom from the interaction with this j atom. */
478 velecsum = _fjsp_add_v2r8(velecsum,velec);
482 /* Update vectorial force */
483 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
484 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
485 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
487 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
488 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
489 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
491 /**************************
492 * CALCULATE INTERACTIONS *
493 **************************/
495 r22 = _fjsp_mul_v2r8(rsq22,rinv22);
497 /* Calculate table index by multiplying r with table scale and truncate to integer */
498 rt = _fjsp_mul_v2r8(r22,vftabscale);
499 itab_tmp = _fjsp_dtox_v2r8(rt);
500 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
501 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
502 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
507 /* CUBIC SPLINE TABLE ELECTROSTATICS */
508 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
509 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
510 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
511 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
512 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
513 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
514 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
515 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
516 velec = _fjsp_mul_v2r8(qq22,VV);
517 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
518 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq22,FF),_fjsp_mul_v2r8(vftabscale,rinv22)));
520 /* Update potential sum for this i atom from the interaction with this j atom. */
521 velecsum = _fjsp_add_v2r8(velecsum,velec);
525 /* Update vectorial force */
526 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
527 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
528 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
530 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
531 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
532 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
534 /**************************
535 * CALCULATE INTERACTIONS *
536 **************************/
538 r23 = _fjsp_mul_v2r8(rsq23,rinv23);
540 /* Calculate table index by multiplying r with table scale and truncate to integer */
541 rt = _fjsp_mul_v2r8(r23,vftabscale);
542 itab_tmp = _fjsp_dtox_v2r8(rt);
543 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
544 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
545 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
550 /* CUBIC SPLINE TABLE ELECTROSTATICS */
551 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
552 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
553 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
554 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
555 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
556 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
557 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
558 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
559 velec = _fjsp_mul_v2r8(qq23,VV);
560 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
561 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq23,FF),_fjsp_mul_v2r8(vftabscale,rinv23)));
563 /* Update potential sum for this i atom from the interaction with this j atom. */
564 velecsum = _fjsp_add_v2r8(velecsum,velec);
568 /* Update vectorial force */
569 fix2 = _fjsp_madd_v2r8(dx23,fscal,fix2);
570 fiy2 = _fjsp_madd_v2r8(dy23,fscal,fiy2);
571 fiz2 = _fjsp_madd_v2r8(dz23,fscal,fiz2);
573 fjx3 = _fjsp_madd_v2r8(dx23,fscal,fjx3);
574 fjy3 = _fjsp_madd_v2r8(dy23,fscal,fjy3);
575 fjz3 = _fjsp_madd_v2r8(dz23,fscal,fjz3);
577 /**************************
578 * CALCULATE INTERACTIONS *
579 **************************/
581 r31 = _fjsp_mul_v2r8(rsq31,rinv31);
583 /* Calculate table index by multiplying r with table scale and truncate to integer */
584 rt = _fjsp_mul_v2r8(r31,vftabscale);
585 itab_tmp = _fjsp_dtox_v2r8(rt);
586 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
587 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
588 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
593 /* CUBIC SPLINE TABLE ELECTROSTATICS */
594 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
595 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
596 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
597 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
598 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
599 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
600 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
601 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
602 velec = _fjsp_mul_v2r8(qq31,VV);
603 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
604 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq31,FF),_fjsp_mul_v2r8(vftabscale,rinv31)));
606 /* Update potential sum for this i atom from the interaction with this j atom. */
607 velecsum = _fjsp_add_v2r8(velecsum,velec);
611 /* Update vectorial force */
612 fix3 = _fjsp_madd_v2r8(dx31,fscal,fix3);
613 fiy3 = _fjsp_madd_v2r8(dy31,fscal,fiy3);
614 fiz3 = _fjsp_madd_v2r8(dz31,fscal,fiz3);
616 fjx1 = _fjsp_madd_v2r8(dx31,fscal,fjx1);
617 fjy1 = _fjsp_madd_v2r8(dy31,fscal,fjy1);
618 fjz1 = _fjsp_madd_v2r8(dz31,fscal,fjz1);
620 /**************************
621 * CALCULATE INTERACTIONS *
622 **************************/
624 r32 = _fjsp_mul_v2r8(rsq32,rinv32);
626 /* Calculate table index by multiplying r with table scale and truncate to integer */
627 rt = _fjsp_mul_v2r8(r32,vftabscale);
628 itab_tmp = _fjsp_dtox_v2r8(rt);
629 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
630 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
631 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
636 /* CUBIC SPLINE TABLE ELECTROSTATICS */
637 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
638 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
639 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
640 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
641 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
642 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
643 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
644 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
645 velec = _fjsp_mul_v2r8(qq32,VV);
646 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
647 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq32,FF),_fjsp_mul_v2r8(vftabscale,rinv32)));
649 /* Update potential sum for this i atom from the interaction with this j atom. */
650 velecsum = _fjsp_add_v2r8(velecsum,velec);
654 /* Update vectorial force */
655 fix3 = _fjsp_madd_v2r8(dx32,fscal,fix3);
656 fiy3 = _fjsp_madd_v2r8(dy32,fscal,fiy3);
657 fiz3 = _fjsp_madd_v2r8(dz32,fscal,fiz3);
659 fjx2 = _fjsp_madd_v2r8(dx32,fscal,fjx2);
660 fjy2 = _fjsp_madd_v2r8(dy32,fscal,fjy2);
661 fjz2 = _fjsp_madd_v2r8(dz32,fscal,fjz2);
663 /**************************
664 * CALCULATE INTERACTIONS *
665 **************************/
667 r33 = _fjsp_mul_v2r8(rsq33,rinv33);
669 /* Calculate table index by multiplying r with table scale and truncate to integer */
670 rt = _fjsp_mul_v2r8(r33,vftabscale);
671 itab_tmp = _fjsp_dtox_v2r8(rt);
672 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
673 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
674 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
679 /* CUBIC SPLINE TABLE ELECTROSTATICS */
680 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
681 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
682 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
683 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
684 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
685 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
686 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
687 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
688 velec = _fjsp_mul_v2r8(qq33,VV);
689 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
690 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq33,FF),_fjsp_mul_v2r8(vftabscale,rinv33)));
692 /* Update potential sum for this i atom from the interaction with this j atom. */
693 velecsum = _fjsp_add_v2r8(velecsum,velec);
697 /* Update vectorial force */
698 fix3 = _fjsp_madd_v2r8(dx33,fscal,fix3);
699 fiy3 = _fjsp_madd_v2r8(dy33,fscal,fiy3);
700 fiz3 = _fjsp_madd_v2r8(dz33,fscal,fiz3);
702 fjx3 = _fjsp_madd_v2r8(dx33,fscal,fjx3);
703 fjy3 = _fjsp_madd_v2r8(dy33,fscal,fjy3);
704 fjz3 = _fjsp_madd_v2r8(dz33,fscal,fjz3);
706 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);
708 /* Inner loop uses 452 flops */
715 j_coord_offsetA = DIM*jnrA;
717 /* load j atom coordinates */
718 gmx_fjsp_load_4rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
719 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,
720 &jy2,&jz2,&jx3,&jy3,&jz3);
722 /* Calculate displacement vector */
723 dx00 = _fjsp_sub_v2r8(ix0,jx0);
724 dy00 = _fjsp_sub_v2r8(iy0,jy0);
725 dz00 = _fjsp_sub_v2r8(iz0,jz0);
726 dx11 = _fjsp_sub_v2r8(ix1,jx1);
727 dy11 = _fjsp_sub_v2r8(iy1,jy1);
728 dz11 = _fjsp_sub_v2r8(iz1,jz1);
729 dx12 = _fjsp_sub_v2r8(ix1,jx2);
730 dy12 = _fjsp_sub_v2r8(iy1,jy2);
731 dz12 = _fjsp_sub_v2r8(iz1,jz2);
732 dx13 = _fjsp_sub_v2r8(ix1,jx3);
733 dy13 = _fjsp_sub_v2r8(iy1,jy3);
734 dz13 = _fjsp_sub_v2r8(iz1,jz3);
735 dx21 = _fjsp_sub_v2r8(ix2,jx1);
736 dy21 = _fjsp_sub_v2r8(iy2,jy1);
737 dz21 = _fjsp_sub_v2r8(iz2,jz1);
738 dx22 = _fjsp_sub_v2r8(ix2,jx2);
739 dy22 = _fjsp_sub_v2r8(iy2,jy2);
740 dz22 = _fjsp_sub_v2r8(iz2,jz2);
741 dx23 = _fjsp_sub_v2r8(ix2,jx3);
742 dy23 = _fjsp_sub_v2r8(iy2,jy3);
743 dz23 = _fjsp_sub_v2r8(iz2,jz3);
744 dx31 = _fjsp_sub_v2r8(ix3,jx1);
745 dy31 = _fjsp_sub_v2r8(iy3,jy1);
746 dz31 = _fjsp_sub_v2r8(iz3,jz1);
747 dx32 = _fjsp_sub_v2r8(ix3,jx2);
748 dy32 = _fjsp_sub_v2r8(iy3,jy2);
749 dz32 = _fjsp_sub_v2r8(iz3,jz2);
750 dx33 = _fjsp_sub_v2r8(ix3,jx3);
751 dy33 = _fjsp_sub_v2r8(iy3,jy3);
752 dz33 = _fjsp_sub_v2r8(iz3,jz3);
754 /* Calculate squared distance and things based on it */
755 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
756 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
757 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
758 rsq13 = gmx_fjsp_calc_rsq_v2r8(dx13,dy13,dz13);
759 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
760 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
761 rsq23 = gmx_fjsp_calc_rsq_v2r8(dx23,dy23,dz23);
762 rsq31 = gmx_fjsp_calc_rsq_v2r8(dx31,dy31,dz31);
763 rsq32 = gmx_fjsp_calc_rsq_v2r8(dx32,dy32,dz32);
764 rsq33 = gmx_fjsp_calc_rsq_v2r8(dx33,dy33,dz33);
766 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
767 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
768 rinv13 = gmx_fjsp_invsqrt_v2r8(rsq13);
769 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
770 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
771 rinv23 = gmx_fjsp_invsqrt_v2r8(rsq23);
772 rinv31 = gmx_fjsp_invsqrt_v2r8(rsq31);
773 rinv32 = gmx_fjsp_invsqrt_v2r8(rsq32);
774 rinv33 = gmx_fjsp_invsqrt_v2r8(rsq33);
776 rinvsq00 = gmx_fjsp_inv_v2r8(rsq00);
778 fjx0 = _fjsp_setzero_v2r8();
779 fjy0 = _fjsp_setzero_v2r8();
780 fjz0 = _fjsp_setzero_v2r8();
781 fjx1 = _fjsp_setzero_v2r8();
782 fjy1 = _fjsp_setzero_v2r8();
783 fjz1 = _fjsp_setzero_v2r8();
784 fjx2 = _fjsp_setzero_v2r8();
785 fjy2 = _fjsp_setzero_v2r8();
786 fjz2 = _fjsp_setzero_v2r8();
787 fjx3 = _fjsp_setzero_v2r8();
788 fjy3 = _fjsp_setzero_v2r8();
789 fjz3 = _fjsp_setzero_v2r8();
791 /**************************
792 * CALCULATE INTERACTIONS *
793 **************************/
795 /* LENNARD-JONES DISPERSION/REPULSION */
797 rinvsix = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
798 vvdw6 = _fjsp_mul_v2r8(c6_00,rinvsix);
799 vvdw12 = _fjsp_mul_v2r8(c12_00,_fjsp_mul_v2r8(rinvsix,rinvsix));
800 vvdw = _fjsp_msub_v2r8( vvdw12,one_twelfth, _fjsp_mul_v2r8(vvdw6,one_sixth) );
801 fvdw = _fjsp_mul_v2r8(_fjsp_sub_v2r8(vvdw12,vvdw6),rinvsq00);
803 /* Update potential sum for this i atom from the interaction with this j atom. */
804 vvdw = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
805 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
809 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
811 /* Update vectorial force */
812 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
813 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
814 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
816 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
817 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
818 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
820 /**************************
821 * CALCULATE INTERACTIONS *
822 **************************/
824 r11 = _fjsp_mul_v2r8(rsq11,rinv11);
826 /* Calculate table index by multiplying r with table scale and truncate to integer */
827 rt = _fjsp_mul_v2r8(r11,vftabscale);
828 itab_tmp = _fjsp_dtox_v2r8(rt);
829 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
830 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
831 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
836 /* CUBIC SPLINE TABLE ELECTROSTATICS */
837 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
838 F = _fjsp_setzero_v2r8();
839 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
840 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
841 H = _fjsp_setzero_v2r8();
842 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
843 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
844 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
845 velec = _fjsp_mul_v2r8(qq11,VV);
846 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
847 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq11,FF),_fjsp_mul_v2r8(vftabscale,rinv11)));
849 /* Update potential sum for this i atom from the interaction with this j atom. */
850 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
851 velecsum = _fjsp_add_v2r8(velecsum,velec);
855 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
857 /* Update vectorial force */
858 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
859 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
860 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
862 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
863 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
864 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
866 /**************************
867 * CALCULATE INTERACTIONS *
868 **************************/
870 r12 = _fjsp_mul_v2r8(rsq12,rinv12);
872 /* Calculate table index by multiplying r with table scale and truncate to integer */
873 rt = _fjsp_mul_v2r8(r12,vftabscale);
874 itab_tmp = _fjsp_dtox_v2r8(rt);
875 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
876 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
877 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
882 /* CUBIC SPLINE TABLE ELECTROSTATICS */
883 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
884 F = _fjsp_setzero_v2r8();
885 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
886 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
887 H = _fjsp_setzero_v2r8();
888 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
889 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
890 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
891 velec = _fjsp_mul_v2r8(qq12,VV);
892 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
893 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq12,FF),_fjsp_mul_v2r8(vftabscale,rinv12)));
895 /* Update potential sum for this i atom from the interaction with this j atom. */
896 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
897 velecsum = _fjsp_add_v2r8(velecsum,velec);
901 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
903 /* Update vectorial force */
904 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
905 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
906 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
908 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
909 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
910 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
912 /**************************
913 * CALCULATE INTERACTIONS *
914 **************************/
916 r13 = _fjsp_mul_v2r8(rsq13,rinv13);
918 /* Calculate table index by multiplying r with table scale and truncate to integer */
919 rt = _fjsp_mul_v2r8(r13,vftabscale);
920 itab_tmp = _fjsp_dtox_v2r8(rt);
921 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
922 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
923 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
928 /* CUBIC SPLINE TABLE ELECTROSTATICS */
929 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
930 F = _fjsp_setzero_v2r8();
931 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
932 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
933 H = _fjsp_setzero_v2r8();
934 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
935 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
936 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
937 velec = _fjsp_mul_v2r8(qq13,VV);
938 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
939 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq13,FF),_fjsp_mul_v2r8(vftabscale,rinv13)));
941 /* Update potential sum for this i atom from the interaction with this j atom. */
942 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
943 velecsum = _fjsp_add_v2r8(velecsum,velec);
947 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
949 /* Update vectorial force */
950 fix1 = _fjsp_madd_v2r8(dx13,fscal,fix1);
951 fiy1 = _fjsp_madd_v2r8(dy13,fscal,fiy1);
952 fiz1 = _fjsp_madd_v2r8(dz13,fscal,fiz1);
954 fjx3 = _fjsp_madd_v2r8(dx13,fscal,fjx3);
955 fjy3 = _fjsp_madd_v2r8(dy13,fscal,fjy3);
956 fjz3 = _fjsp_madd_v2r8(dz13,fscal,fjz3);
958 /**************************
959 * CALCULATE INTERACTIONS *
960 **************************/
962 r21 = _fjsp_mul_v2r8(rsq21,rinv21);
964 /* Calculate table index by multiplying r with table scale and truncate to integer */
965 rt = _fjsp_mul_v2r8(r21,vftabscale);
966 itab_tmp = _fjsp_dtox_v2r8(rt);
967 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
968 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
969 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
974 /* CUBIC SPLINE TABLE ELECTROSTATICS */
975 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
976 F = _fjsp_setzero_v2r8();
977 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
978 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
979 H = _fjsp_setzero_v2r8();
980 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
981 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
982 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
983 velec = _fjsp_mul_v2r8(qq21,VV);
984 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
985 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq21,FF),_fjsp_mul_v2r8(vftabscale,rinv21)));
987 /* Update potential sum for this i atom from the interaction with this j atom. */
988 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
989 velecsum = _fjsp_add_v2r8(velecsum,velec);
993 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
995 /* Update vectorial force */
996 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
997 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
998 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
1000 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
1001 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
1002 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
1004 /**************************
1005 * CALCULATE INTERACTIONS *
1006 **************************/
1008 r22 = _fjsp_mul_v2r8(rsq22,rinv22);
1010 /* Calculate table index by multiplying r with table scale and truncate to integer */
1011 rt = _fjsp_mul_v2r8(r22,vftabscale);
1012 itab_tmp = _fjsp_dtox_v2r8(rt);
1013 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1014 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1015 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1020 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1021 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1022 F = _fjsp_setzero_v2r8();
1023 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1024 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1025 H = _fjsp_setzero_v2r8();
1026 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1027 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1028 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
1029 velec = _fjsp_mul_v2r8(qq22,VV);
1030 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1031 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq22,FF),_fjsp_mul_v2r8(vftabscale,rinv22)));
1033 /* Update potential sum for this i atom from the interaction with this j atom. */
1034 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1035 velecsum = _fjsp_add_v2r8(velecsum,velec);
1039 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1041 /* Update vectorial force */
1042 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
1043 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
1044 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
1046 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
1047 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
1048 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
1050 /**************************
1051 * CALCULATE INTERACTIONS *
1052 **************************/
1054 r23 = _fjsp_mul_v2r8(rsq23,rinv23);
1056 /* Calculate table index by multiplying r with table scale and truncate to integer */
1057 rt = _fjsp_mul_v2r8(r23,vftabscale);
1058 itab_tmp = _fjsp_dtox_v2r8(rt);
1059 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1060 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1061 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1066 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1067 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1068 F = _fjsp_setzero_v2r8();
1069 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1070 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1071 H = _fjsp_setzero_v2r8();
1072 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1073 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1074 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
1075 velec = _fjsp_mul_v2r8(qq23,VV);
1076 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1077 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq23,FF),_fjsp_mul_v2r8(vftabscale,rinv23)));
1079 /* Update potential sum for this i atom from the interaction with this j atom. */
1080 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1081 velecsum = _fjsp_add_v2r8(velecsum,velec);
1085 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1087 /* Update vectorial force */
1088 fix2 = _fjsp_madd_v2r8(dx23,fscal,fix2);
1089 fiy2 = _fjsp_madd_v2r8(dy23,fscal,fiy2);
1090 fiz2 = _fjsp_madd_v2r8(dz23,fscal,fiz2);
1092 fjx3 = _fjsp_madd_v2r8(dx23,fscal,fjx3);
1093 fjy3 = _fjsp_madd_v2r8(dy23,fscal,fjy3);
1094 fjz3 = _fjsp_madd_v2r8(dz23,fscal,fjz3);
1096 /**************************
1097 * CALCULATE INTERACTIONS *
1098 **************************/
1100 r31 = _fjsp_mul_v2r8(rsq31,rinv31);
1102 /* Calculate table index by multiplying r with table scale and truncate to integer */
1103 rt = _fjsp_mul_v2r8(r31,vftabscale);
1104 itab_tmp = _fjsp_dtox_v2r8(rt);
1105 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1106 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1107 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1112 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1113 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1114 F = _fjsp_setzero_v2r8();
1115 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1116 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1117 H = _fjsp_setzero_v2r8();
1118 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1119 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1120 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
1121 velec = _fjsp_mul_v2r8(qq31,VV);
1122 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1123 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq31,FF),_fjsp_mul_v2r8(vftabscale,rinv31)));
1125 /* Update potential sum for this i atom from the interaction with this j atom. */
1126 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1127 velecsum = _fjsp_add_v2r8(velecsum,velec);
1131 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1133 /* Update vectorial force */
1134 fix3 = _fjsp_madd_v2r8(dx31,fscal,fix3);
1135 fiy3 = _fjsp_madd_v2r8(dy31,fscal,fiy3);
1136 fiz3 = _fjsp_madd_v2r8(dz31,fscal,fiz3);
1138 fjx1 = _fjsp_madd_v2r8(dx31,fscal,fjx1);
1139 fjy1 = _fjsp_madd_v2r8(dy31,fscal,fjy1);
1140 fjz1 = _fjsp_madd_v2r8(dz31,fscal,fjz1);
1142 /**************************
1143 * CALCULATE INTERACTIONS *
1144 **************************/
1146 r32 = _fjsp_mul_v2r8(rsq32,rinv32);
1148 /* Calculate table index by multiplying r with table scale and truncate to integer */
1149 rt = _fjsp_mul_v2r8(r32,vftabscale);
1150 itab_tmp = _fjsp_dtox_v2r8(rt);
1151 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1152 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1153 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1158 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1159 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1160 F = _fjsp_setzero_v2r8();
1161 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1162 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1163 H = _fjsp_setzero_v2r8();
1164 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1165 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1166 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
1167 velec = _fjsp_mul_v2r8(qq32,VV);
1168 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1169 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq32,FF),_fjsp_mul_v2r8(vftabscale,rinv32)));
1171 /* Update potential sum for this i atom from the interaction with this j atom. */
1172 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1173 velecsum = _fjsp_add_v2r8(velecsum,velec);
1177 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1179 /* Update vectorial force */
1180 fix3 = _fjsp_madd_v2r8(dx32,fscal,fix3);
1181 fiy3 = _fjsp_madd_v2r8(dy32,fscal,fiy3);
1182 fiz3 = _fjsp_madd_v2r8(dz32,fscal,fiz3);
1184 fjx2 = _fjsp_madd_v2r8(dx32,fscal,fjx2);
1185 fjy2 = _fjsp_madd_v2r8(dy32,fscal,fjy2);
1186 fjz2 = _fjsp_madd_v2r8(dz32,fscal,fjz2);
1188 /**************************
1189 * CALCULATE INTERACTIONS *
1190 **************************/
1192 r33 = _fjsp_mul_v2r8(rsq33,rinv33);
1194 /* Calculate table index by multiplying r with table scale and truncate to integer */
1195 rt = _fjsp_mul_v2r8(r33,vftabscale);
1196 itab_tmp = _fjsp_dtox_v2r8(rt);
1197 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1198 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1199 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1204 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1205 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1206 F = _fjsp_setzero_v2r8();
1207 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1208 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1209 H = _fjsp_setzero_v2r8();
1210 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1211 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1212 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
1213 velec = _fjsp_mul_v2r8(qq33,VV);
1214 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1215 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq33,FF),_fjsp_mul_v2r8(vftabscale,rinv33)));
1217 /* Update potential sum for this i atom from the interaction with this j atom. */
1218 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1219 velecsum = _fjsp_add_v2r8(velecsum,velec);
1223 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1225 /* Update vectorial force */
1226 fix3 = _fjsp_madd_v2r8(dx33,fscal,fix3);
1227 fiy3 = _fjsp_madd_v2r8(dy33,fscal,fiy3);
1228 fiz3 = _fjsp_madd_v2r8(dz33,fscal,fiz3);
1230 fjx3 = _fjsp_madd_v2r8(dx33,fscal,fjx3);
1231 fjy3 = _fjsp_madd_v2r8(dy33,fscal,fjy3);
1232 fjz3 = _fjsp_madd_v2r8(dz33,fscal,fjz3);
1234 gmx_fjsp_decrement_4rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2,fjx3,fjy3,fjz3);
1236 /* Inner loop uses 452 flops */
1239 /* End of innermost loop */
1241 gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
1242 f+i_coord_offset,fshift+i_shift_offset);
1245 /* Update potential energies */
1246 gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
1247 gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
1249 /* Increment number of inner iterations */
1250 inneriter += j_index_end - j_index_start;
1252 /* Outer loop uses 26 flops */
1255 /* Increment number of outer iterations */
1258 /* Update outer/inner flops */
1260 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4W4_VF,outeriter*26 + inneriter*452);
1263 * Gromacs nonbonded kernel: nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sparc64_hpc_ace_double
1264 * Electrostatics interaction: CubicSplineTable
1265 * VdW interaction: LennardJones
1266 * Geometry: Water4-Water4
1267 * Calculate force/pot: Force
1270 nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sparc64_hpc_ace_double
1271 (t_nblist * gmx_restrict nlist,
1272 rvec * gmx_restrict xx,
1273 rvec * gmx_restrict ff,
1274 t_forcerec * gmx_restrict fr,
1275 t_mdatoms * gmx_restrict mdatoms,
1276 nb_kernel_data_t * gmx_restrict kernel_data,
1277 t_nrnb * gmx_restrict nrnb)
1279 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
1280 * just 0 for non-waters.
1281 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
1282 * jnr indices corresponding to data put in the four positions in the SIMD register.
1284 int i_shift_offset,i_coord_offset,outeriter,inneriter;
1285 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
1287 int j_coord_offsetA,j_coord_offsetB;
1288 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
1289 real rcutoff_scalar;
1290 real *shiftvec,*fshift,*x,*f;
1291 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
1293 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
1295 _fjsp_v2r8 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
1297 _fjsp_v2r8 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
1299 _fjsp_v2r8 ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
1300 int vdwjidx0A,vdwjidx0B;
1301 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
1302 int vdwjidx1A,vdwjidx1B;
1303 _fjsp_v2r8 jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
1304 int vdwjidx2A,vdwjidx2B;
1305 _fjsp_v2r8 jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
1306 int vdwjidx3A,vdwjidx3B;
1307 _fjsp_v2r8 jx3,jy3,jz3,fjx3,fjy3,fjz3,jq3,isaj3;
1308 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
1309 _fjsp_v2r8 dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11;
1310 _fjsp_v2r8 dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12;
1311 _fjsp_v2r8 dx13,dy13,dz13,rsq13,rinv13,rinvsq13,r13,qq13,c6_13,c12_13;
1312 _fjsp_v2r8 dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21;
1313 _fjsp_v2r8 dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22;
1314 _fjsp_v2r8 dx23,dy23,dz23,rsq23,rinv23,rinvsq23,r23,qq23,c6_23,c12_23;
1315 _fjsp_v2r8 dx31,dy31,dz31,rsq31,rinv31,rinvsq31,r31,qq31,c6_31,c12_31;
1316 _fjsp_v2r8 dx32,dy32,dz32,rsq32,rinv32,rinvsq32,r32,qq32,c6_32,c12_32;
1317 _fjsp_v2r8 dx33,dy33,dz33,rsq33,rinv33,rinvsq33,r33,qq33,c6_33,c12_33;
1318 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
1321 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
1324 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
1325 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
1326 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
1328 _fjsp_v2r8 itab_tmp;
1329 _fjsp_v2r8 dummy_mask,cutoff_mask;
1330 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
1331 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
1332 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
1339 jindex = nlist->jindex;
1341 shiftidx = nlist->shift;
1343 shiftvec = fr->shift_vec[0];
1344 fshift = fr->fshift[0];
1345 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
1346 charge = mdatoms->chargeA;
1347 nvdwtype = fr->ntype;
1348 vdwparam = fr->nbfp;
1349 vdwtype = mdatoms->typeA;
1351 vftab = kernel_data->table_elec->data;
1352 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_elec->scale);
1354 /* Setup water-specific parameters */
1355 inr = nlist->iinr[0];
1356 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
1357 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
1358 iq3 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+3]));
1359 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
1361 jq1 = gmx_fjsp_set1_v2r8(charge[inr+1]);
1362 jq2 = gmx_fjsp_set1_v2r8(charge[inr+2]);
1363 jq3 = gmx_fjsp_set1_v2r8(charge[inr+3]);
1364 vdwjidx0A = 2*vdwtype[inr+0];
1365 c6_00 = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A]);
1366 c12_00 = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A+1]);
1367 qq11 = _fjsp_mul_v2r8(iq1,jq1);
1368 qq12 = _fjsp_mul_v2r8(iq1,jq2);
1369 qq13 = _fjsp_mul_v2r8(iq1,jq3);
1370 qq21 = _fjsp_mul_v2r8(iq2,jq1);
1371 qq22 = _fjsp_mul_v2r8(iq2,jq2);
1372 qq23 = _fjsp_mul_v2r8(iq2,jq3);
1373 qq31 = _fjsp_mul_v2r8(iq3,jq1);
1374 qq32 = _fjsp_mul_v2r8(iq3,jq2);
1375 qq33 = _fjsp_mul_v2r8(iq3,jq3);
1377 /* Avoid stupid compiler warnings */
1379 j_coord_offsetA = 0;
1380 j_coord_offsetB = 0;
1385 /* Start outer loop over neighborlists */
1386 for(iidx=0; iidx<nri; iidx++)
1388 /* Load shift vector for this list */
1389 i_shift_offset = DIM*shiftidx[iidx];
1391 /* Load limits for loop over neighbors */
1392 j_index_start = jindex[iidx];
1393 j_index_end = jindex[iidx+1];
1395 /* Get outer coordinate index */
1397 i_coord_offset = DIM*inr;
1399 /* Load i particle coords and add shift vector */
1400 gmx_fjsp_load_shift_and_4rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
1401 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
1403 fix0 = _fjsp_setzero_v2r8();
1404 fiy0 = _fjsp_setzero_v2r8();
1405 fiz0 = _fjsp_setzero_v2r8();
1406 fix1 = _fjsp_setzero_v2r8();
1407 fiy1 = _fjsp_setzero_v2r8();
1408 fiz1 = _fjsp_setzero_v2r8();
1409 fix2 = _fjsp_setzero_v2r8();
1410 fiy2 = _fjsp_setzero_v2r8();
1411 fiz2 = _fjsp_setzero_v2r8();
1412 fix3 = _fjsp_setzero_v2r8();
1413 fiy3 = _fjsp_setzero_v2r8();
1414 fiz3 = _fjsp_setzero_v2r8();
1416 /* Start inner kernel loop */
1417 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
1420 /* Get j neighbor index, and coordinate index */
1422 jnrB = jjnr[jidx+1];
1423 j_coord_offsetA = DIM*jnrA;
1424 j_coord_offsetB = DIM*jnrB;
1426 /* load j atom coordinates */
1427 gmx_fjsp_load_4rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
1428 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,
1429 &jy2,&jz2,&jx3,&jy3,&jz3);
1431 /* Calculate displacement vector */
1432 dx00 = _fjsp_sub_v2r8(ix0,jx0);
1433 dy00 = _fjsp_sub_v2r8(iy0,jy0);
1434 dz00 = _fjsp_sub_v2r8(iz0,jz0);
1435 dx11 = _fjsp_sub_v2r8(ix1,jx1);
1436 dy11 = _fjsp_sub_v2r8(iy1,jy1);
1437 dz11 = _fjsp_sub_v2r8(iz1,jz1);
1438 dx12 = _fjsp_sub_v2r8(ix1,jx2);
1439 dy12 = _fjsp_sub_v2r8(iy1,jy2);
1440 dz12 = _fjsp_sub_v2r8(iz1,jz2);
1441 dx13 = _fjsp_sub_v2r8(ix1,jx3);
1442 dy13 = _fjsp_sub_v2r8(iy1,jy3);
1443 dz13 = _fjsp_sub_v2r8(iz1,jz3);
1444 dx21 = _fjsp_sub_v2r8(ix2,jx1);
1445 dy21 = _fjsp_sub_v2r8(iy2,jy1);
1446 dz21 = _fjsp_sub_v2r8(iz2,jz1);
1447 dx22 = _fjsp_sub_v2r8(ix2,jx2);
1448 dy22 = _fjsp_sub_v2r8(iy2,jy2);
1449 dz22 = _fjsp_sub_v2r8(iz2,jz2);
1450 dx23 = _fjsp_sub_v2r8(ix2,jx3);
1451 dy23 = _fjsp_sub_v2r8(iy2,jy3);
1452 dz23 = _fjsp_sub_v2r8(iz2,jz3);
1453 dx31 = _fjsp_sub_v2r8(ix3,jx1);
1454 dy31 = _fjsp_sub_v2r8(iy3,jy1);
1455 dz31 = _fjsp_sub_v2r8(iz3,jz1);
1456 dx32 = _fjsp_sub_v2r8(ix3,jx2);
1457 dy32 = _fjsp_sub_v2r8(iy3,jy2);
1458 dz32 = _fjsp_sub_v2r8(iz3,jz2);
1459 dx33 = _fjsp_sub_v2r8(ix3,jx3);
1460 dy33 = _fjsp_sub_v2r8(iy3,jy3);
1461 dz33 = _fjsp_sub_v2r8(iz3,jz3);
1463 /* Calculate squared distance and things based on it */
1464 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
1465 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
1466 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
1467 rsq13 = gmx_fjsp_calc_rsq_v2r8(dx13,dy13,dz13);
1468 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
1469 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
1470 rsq23 = gmx_fjsp_calc_rsq_v2r8(dx23,dy23,dz23);
1471 rsq31 = gmx_fjsp_calc_rsq_v2r8(dx31,dy31,dz31);
1472 rsq32 = gmx_fjsp_calc_rsq_v2r8(dx32,dy32,dz32);
1473 rsq33 = gmx_fjsp_calc_rsq_v2r8(dx33,dy33,dz33);
1475 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
1476 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
1477 rinv13 = gmx_fjsp_invsqrt_v2r8(rsq13);
1478 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
1479 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
1480 rinv23 = gmx_fjsp_invsqrt_v2r8(rsq23);
1481 rinv31 = gmx_fjsp_invsqrt_v2r8(rsq31);
1482 rinv32 = gmx_fjsp_invsqrt_v2r8(rsq32);
1483 rinv33 = gmx_fjsp_invsqrt_v2r8(rsq33);
1485 rinvsq00 = gmx_fjsp_inv_v2r8(rsq00);
1487 fjx0 = _fjsp_setzero_v2r8();
1488 fjy0 = _fjsp_setzero_v2r8();
1489 fjz0 = _fjsp_setzero_v2r8();
1490 fjx1 = _fjsp_setzero_v2r8();
1491 fjy1 = _fjsp_setzero_v2r8();
1492 fjz1 = _fjsp_setzero_v2r8();
1493 fjx2 = _fjsp_setzero_v2r8();
1494 fjy2 = _fjsp_setzero_v2r8();
1495 fjz2 = _fjsp_setzero_v2r8();
1496 fjx3 = _fjsp_setzero_v2r8();
1497 fjy3 = _fjsp_setzero_v2r8();
1498 fjz3 = _fjsp_setzero_v2r8();
1500 /**************************
1501 * CALCULATE INTERACTIONS *
1502 **************************/
1504 /* LENNARD-JONES DISPERSION/REPULSION */
1506 rinvsix = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
1507 fvdw = _fjsp_mul_v2r8(_fjsp_msub_v2r8(c12_00,rinvsix,c6_00),_fjsp_mul_v2r8(rinvsix,rinvsq00));
1511 /* Update vectorial force */
1512 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
1513 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
1514 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
1516 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
1517 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
1518 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
1520 /**************************
1521 * CALCULATE INTERACTIONS *
1522 **************************/
1524 r11 = _fjsp_mul_v2r8(rsq11,rinv11);
1526 /* Calculate table index by multiplying r with table scale and truncate to integer */
1527 rt = _fjsp_mul_v2r8(r11,vftabscale);
1528 itab_tmp = _fjsp_dtox_v2r8(rt);
1529 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1530 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1531 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1536 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1537 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1538 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
1539 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1540 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1541 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
1542 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1543 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1544 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1545 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq11,FF),_fjsp_mul_v2r8(vftabscale,rinv11)));
1549 /* Update vectorial force */
1550 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
1551 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
1552 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
1554 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
1555 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
1556 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
1558 /**************************
1559 * CALCULATE INTERACTIONS *
1560 **************************/
1562 r12 = _fjsp_mul_v2r8(rsq12,rinv12);
1564 /* Calculate table index by multiplying r with table scale and truncate to integer */
1565 rt = _fjsp_mul_v2r8(r12,vftabscale);
1566 itab_tmp = _fjsp_dtox_v2r8(rt);
1567 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1568 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1569 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1574 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1575 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1576 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
1577 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1578 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1579 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
1580 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1581 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1582 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1583 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq12,FF),_fjsp_mul_v2r8(vftabscale,rinv12)));
1587 /* Update vectorial force */
1588 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
1589 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
1590 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
1592 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
1593 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
1594 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
1596 /**************************
1597 * CALCULATE INTERACTIONS *
1598 **************************/
1600 r13 = _fjsp_mul_v2r8(rsq13,rinv13);
1602 /* Calculate table index by multiplying r with table scale and truncate to integer */
1603 rt = _fjsp_mul_v2r8(r13,vftabscale);
1604 itab_tmp = _fjsp_dtox_v2r8(rt);
1605 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1606 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1607 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1612 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1613 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1614 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
1615 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1616 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1617 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
1618 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1619 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1620 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1621 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq13,FF),_fjsp_mul_v2r8(vftabscale,rinv13)));
1625 /* Update vectorial force */
1626 fix1 = _fjsp_madd_v2r8(dx13,fscal,fix1);
1627 fiy1 = _fjsp_madd_v2r8(dy13,fscal,fiy1);
1628 fiz1 = _fjsp_madd_v2r8(dz13,fscal,fiz1);
1630 fjx3 = _fjsp_madd_v2r8(dx13,fscal,fjx3);
1631 fjy3 = _fjsp_madd_v2r8(dy13,fscal,fjy3);
1632 fjz3 = _fjsp_madd_v2r8(dz13,fscal,fjz3);
1634 /**************************
1635 * CALCULATE INTERACTIONS *
1636 **************************/
1638 r21 = _fjsp_mul_v2r8(rsq21,rinv21);
1640 /* Calculate table index by multiplying r with table scale and truncate to integer */
1641 rt = _fjsp_mul_v2r8(r21,vftabscale);
1642 itab_tmp = _fjsp_dtox_v2r8(rt);
1643 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1644 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1645 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1650 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1651 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1652 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
1653 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1654 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1655 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
1656 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1657 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1658 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1659 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq21,FF),_fjsp_mul_v2r8(vftabscale,rinv21)));
1663 /* Update vectorial force */
1664 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
1665 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
1666 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
1668 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
1669 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
1670 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
1672 /**************************
1673 * CALCULATE INTERACTIONS *
1674 **************************/
1676 r22 = _fjsp_mul_v2r8(rsq22,rinv22);
1678 /* Calculate table index by multiplying r with table scale and truncate to integer */
1679 rt = _fjsp_mul_v2r8(r22,vftabscale);
1680 itab_tmp = _fjsp_dtox_v2r8(rt);
1681 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1682 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1683 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1688 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1689 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1690 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
1691 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1692 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1693 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
1694 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1695 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1696 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1697 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq22,FF),_fjsp_mul_v2r8(vftabscale,rinv22)));
1701 /* Update vectorial force */
1702 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
1703 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
1704 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
1706 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
1707 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
1708 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
1710 /**************************
1711 * CALCULATE INTERACTIONS *
1712 **************************/
1714 r23 = _fjsp_mul_v2r8(rsq23,rinv23);
1716 /* Calculate table index by multiplying r with table scale and truncate to integer */
1717 rt = _fjsp_mul_v2r8(r23,vftabscale);
1718 itab_tmp = _fjsp_dtox_v2r8(rt);
1719 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1720 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1721 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1726 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1727 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1728 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
1729 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1730 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1731 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
1732 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1733 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1734 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1735 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq23,FF),_fjsp_mul_v2r8(vftabscale,rinv23)));
1739 /* Update vectorial force */
1740 fix2 = _fjsp_madd_v2r8(dx23,fscal,fix2);
1741 fiy2 = _fjsp_madd_v2r8(dy23,fscal,fiy2);
1742 fiz2 = _fjsp_madd_v2r8(dz23,fscal,fiz2);
1744 fjx3 = _fjsp_madd_v2r8(dx23,fscal,fjx3);
1745 fjy3 = _fjsp_madd_v2r8(dy23,fscal,fjy3);
1746 fjz3 = _fjsp_madd_v2r8(dz23,fscal,fjz3);
1748 /**************************
1749 * CALCULATE INTERACTIONS *
1750 **************************/
1752 r31 = _fjsp_mul_v2r8(rsq31,rinv31);
1754 /* Calculate table index by multiplying r with table scale and truncate to integer */
1755 rt = _fjsp_mul_v2r8(r31,vftabscale);
1756 itab_tmp = _fjsp_dtox_v2r8(rt);
1757 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1758 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1759 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1764 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1765 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1766 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
1767 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1768 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1769 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
1770 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1771 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1772 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1773 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq31,FF),_fjsp_mul_v2r8(vftabscale,rinv31)));
1777 /* Update vectorial force */
1778 fix3 = _fjsp_madd_v2r8(dx31,fscal,fix3);
1779 fiy3 = _fjsp_madd_v2r8(dy31,fscal,fiy3);
1780 fiz3 = _fjsp_madd_v2r8(dz31,fscal,fiz3);
1782 fjx1 = _fjsp_madd_v2r8(dx31,fscal,fjx1);
1783 fjy1 = _fjsp_madd_v2r8(dy31,fscal,fjy1);
1784 fjz1 = _fjsp_madd_v2r8(dz31,fscal,fjz1);
1786 /**************************
1787 * CALCULATE INTERACTIONS *
1788 **************************/
1790 r32 = _fjsp_mul_v2r8(rsq32,rinv32);
1792 /* Calculate table index by multiplying r with table scale and truncate to integer */
1793 rt = _fjsp_mul_v2r8(r32,vftabscale);
1794 itab_tmp = _fjsp_dtox_v2r8(rt);
1795 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1796 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1797 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1802 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1803 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1804 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
1805 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1806 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1807 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
1808 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1809 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1810 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1811 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq32,FF),_fjsp_mul_v2r8(vftabscale,rinv32)));
1815 /* Update vectorial force */
1816 fix3 = _fjsp_madd_v2r8(dx32,fscal,fix3);
1817 fiy3 = _fjsp_madd_v2r8(dy32,fscal,fiy3);
1818 fiz3 = _fjsp_madd_v2r8(dz32,fscal,fiz3);
1820 fjx2 = _fjsp_madd_v2r8(dx32,fscal,fjx2);
1821 fjy2 = _fjsp_madd_v2r8(dy32,fscal,fjy2);
1822 fjz2 = _fjsp_madd_v2r8(dz32,fscal,fjz2);
1824 /**************************
1825 * CALCULATE INTERACTIONS *
1826 **************************/
1828 r33 = _fjsp_mul_v2r8(rsq33,rinv33);
1830 /* Calculate table index by multiplying r with table scale and truncate to integer */
1831 rt = _fjsp_mul_v2r8(r33,vftabscale);
1832 itab_tmp = _fjsp_dtox_v2r8(rt);
1833 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1834 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1835 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1840 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1841 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1842 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
1843 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1844 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1845 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
1846 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1847 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1848 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1849 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq33,FF),_fjsp_mul_v2r8(vftabscale,rinv33)));
1853 /* Update vectorial force */
1854 fix3 = _fjsp_madd_v2r8(dx33,fscal,fix3);
1855 fiy3 = _fjsp_madd_v2r8(dy33,fscal,fiy3);
1856 fiz3 = _fjsp_madd_v2r8(dz33,fscal,fiz3);
1858 fjx3 = _fjsp_madd_v2r8(dx33,fscal,fjx3);
1859 fjy3 = _fjsp_madd_v2r8(dy33,fscal,fjy3);
1860 fjz3 = _fjsp_madd_v2r8(dz33,fscal,fjz3);
1862 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);
1864 /* Inner loop uses 411 flops */
1867 if(jidx<j_index_end)
1871 j_coord_offsetA = DIM*jnrA;
1873 /* load j atom coordinates */
1874 gmx_fjsp_load_4rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
1875 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,
1876 &jy2,&jz2,&jx3,&jy3,&jz3);
1878 /* Calculate displacement vector */
1879 dx00 = _fjsp_sub_v2r8(ix0,jx0);
1880 dy00 = _fjsp_sub_v2r8(iy0,jy0);
1881 dz00 = _fjsp_sub_v2r8(iz0,jz0);
1882 dx11 = _fjsp_sub_v2r8(ix1,jx1);
1883 dy11 = _fjsp_sub_v2r8(iy1,jy1);
1884 dz11 = _fjsp_sub_v2r8(iz1,jz1);
1885 dx12 = _fjsp_sub_v2r8(ix1,jx2);
1886 dy12 = _fjsp_sub_v2r8(iy1,jy2);
1887 dz12 = _fjsp_sub_v2r8(iz1,jz2);
1888 dx13 = _fjsp_sub_v2r8(ix1,jx3);
1889 dy13 = _fjsp_sub_v2r8(iy1,jy3);
1890 dz13 = _fjsp_sub_v2r8(iz1,jz3);
1891 dx21 = _fjsp_sub_v2r8(ix2,jx1);
1892 dy21 = _fjsp_sub_v2r8(iy2,jy1);
1893 dz21 = _fjsp_sub_v2r8(iz2,jz1);
1894 dx22 = _fjsp_sub_v2r8(ix2,jx2);
1895 dy22 = _fjsp_sub_v2r8(iy2,jy2);
1896 dz22 = _fjsp_sub_v2r8(iz2,jz2);
1897 dx23 = _fjsp_sub_v2r8(ix2,jx3);
1898 dy23 = _fjsp_sub_v2r8(iy2,jy3);
1899 dz23 = _fjsp_sub_v2r8(iz2,jz3);
1900 dx31 = _fjsp_sub_v2r8(ix3,jx1);
1901 dy31 = _fjsp_sub_v2r8(iy3,jy1);
1902 dz31 = _fjsp_sub_v2r8(iz3,jz1);
1903 dx32 = _fjsp_sub_v2r8(ix3,jx2);
1904 dy32 = _fjsp_sub_v2r8(iy3,jy2);
1905 dz32 = _fjsp_sub_v2r8(iz3,jz2);
1906 dx33 = _fjsp_sub_v2r8(ix3,jx3);
1907 dy33 = _fjsp_sub_v2r8(iy3,jy3);
1908 dz33 = _fjsp_sub_v2r8(iz3,jz3);
1910 /* Calculate squared distance and things based on it */
1911 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
1912 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
1913 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
1914 rsq13 = gmx_fjsp_calc_rsq_v2r8(dx13,dy13,dz13);
1915 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
1916 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
1917 rsq23 = gmx_fjsp_calc_rsq_v2r8(dx23,dy23,dz23);
1918 rsq31 = gmx_fjsp_calc_rsq_v2r8(dx31,dy31,dz31);
1919 rsq32 = gmx_fjsp_calc_rsq_v2r8(dx32,dy32,dz32);
1920 rsq33 = gmx_fjsp_calc_rsq_v2r8(dx33,dy33,dz33);
1922 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
1923 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
1924 rinv13 = gmx_fjsp_invsqrt_v2r8(rsq13);
1925 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
1926 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
1927 rinv23 = gmx_fjsp_invsqrt_v2r8(rsq23);
1928 rinv31 = gmx_fjsp_invsqrt_v2r8(rsq31);
1929 rinv32 = gmx_fjsp_invsqrt_v2r8(rsq32);
1930 rinv33 = gmx_fjsp_invsqrt_v2r8(rsq33);
1932 rinvsq00 = gmx_fjsp_inv_v2r8(rsq00);
1934 fjx0 = _fjsp_setzero_v2r8();
1935 fjy0 = _fjsp_setzero_v2r8();
1936 fjz0 = _fjsp_setzero_v2r8();
1937 fjx1 = _fjsp_setzero_v2r8();
1938 fjy1 = _fjsp_setzero_v2r8();
1939 fjz1 = _fjsp_setzero_v2r8();
1940 fjx2 = _fjsp_setzero_v2r8();
1941 fjy2 = _fjsp_setzero_v2r8();
1942 fjz2 = _fjsp_setzero_v2r8();
1943 fjx3 = _fjsp_setzero_v2r8();
1944 fjy3 = _fjsp_setzero_v2r8();
1945 fjz3 = _fjsp_setzero_v2r8();
1947 /**************************
1948 * CALCULATE INTERACTIONS *
1949 **************************/
1951 /* LENNARD-JONES DISPERSION/REPULSION */
1953 rinvsix = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
1954 fvdw = _fjsp_mul_v2r8(_fjsp_msub_v2r8(c12_00,rinvsix,c6_00),_fjsp_mul_v2r8(rinvsix,rinvsq00));
1958 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1960 /* Update vectorial force */
1961 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
1962 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
1963 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
1965 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
1966 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
1967 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
1969 /**************************
1970 * CALCULATE INTERACTIONS *
1971 **************************/
1973 r11 = _fjsp_mul_v2r8(rsq11,rinv11);
1975 /* Calculate table index by multiplying r with table scale and truncate to integer */
1976 rt = _fjsp_mul_v2r8(r11,vftabscale);
1977 itab_tmp = _fjsp_dtox_v2r8(rt);
1978 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1979 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1980 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1985 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1986 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1987 F = _fjsp_setzero_v2r8();
1988 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1989 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
1990 H = _fjsp_setzero_v2r8();
1991 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1992 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
1993 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
1994 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq11,FF),_fjsp_mul_v2r8(vftabscale,rinv11)));
1998 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2000 /* Update vectorial force */
2001 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
2002 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
2003 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
2005 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
2006 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
2007 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
2009 /**************************
2010 * CALCULATE INTERACTIONS *
2011 **************************/
2013 r12 = _fjsp_mul_v2r8(rsq12,rinv12);
2015 /* Calculate table index by multiplying r with table scale and truncate to integer */
2016 rt = _fjsp_mul_v2r8(r12,vftabscale);
2017 itab_tmp = _fjsp_dtox_v2r8(rt);
2018 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
2019 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
2020 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
2025 /* CUBIC SPLINE TABLE ELECTROSTATICS */
2026 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
2027 F = _fjsp_setzero_v2r8();
2028 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
2029 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
2030 H = _fjsp_setzero_v2r8();
2031 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
2032 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
2033 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
2034 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq12,FF),_fjsp_mul_v2r8(vftabscale,rinv12)));
2038 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2040 /* Update vectorial force */
2041 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
2042 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
2043 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
2045 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
2046 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
2047 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
2049 /**************************
2050 * CALCULATE INTERACTIONS *
2051 **************************/
2053 r13 = _fjsp_mul_v2r8(rsq13,rinv13);
2055 /* Calculate table index by multiplying r with table scale and truncate to integer */
2056 rt = _fjsp_mul_v2r8(r13,vftabscale);
2057 itab_tmp = _fjsp_dtox_v2r8(rt);
2058 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
2059 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
2060 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
2065 /* CUBIC SPLINE TABLE ELECTROSTATICS */
2066 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
2067 F = _fjsp_setzero_v2r8();
2068 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
2069 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
2070 H = _fjsp_setzero_v2r8();
2071 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
2072 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
2073 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
2074 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq13,FF),_fjsp_mul_v2r8(vftabscale,rinv13)));
2078 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2080 /* Update vectorial force */
2081 fix1 = _fjsp_madd_v2r8(dx13,fscal,fix1);
2082 fiy1 = _fjsp_madd_v2r8(dy13,fscal,fiy1);
2083 fiz1 = _fjsp_madd_v2r8(dz13,fscal,fiz1);
2085 fjx3 = _fjsp_madd_v2r8(dx13,fscal,fjx3);
2086 fjy3 = _fjsp_madd_v2r8(dy13,fscal,fjy3);
2087 fjz3 = _fjsp_madd_v2r8(dz13,fscal,fjz3);
2089 /**************************
2090 * CALCULATE INTERACTIONS *
2091 **************************/
2093 r21 = _fjsp_mul_v2r8(rsq21,rinv21);
2095 /* Calculate table index by multiplying r with table scale and truncate to integer */
2096 rt = _fjsp_mul_v2r8(r21,vftabscale);
2097 itab_tmp = _fjsp_dtox_v2r8(rt);
2098 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
2099 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
2100 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
2105 /* CUBIC SPLINE TABLE ELECTROSTATICS */
2106 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
2107 F = _fjsp_setzero_v2r8();
2108 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
2109 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
2110 H = _fjsp_setzero_v2r8();
2111 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
2112 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
2113 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
2114 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq21,FF),_fjsp_mul_v2r8(vftabscale,rinv21)));
2118 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2120 /* Update vectorial force */
2121 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
2122 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
2123 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
2125 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
2126 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
2127 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
2129 /**************************
2130 * CALCULATE INTERACTIONS *
2131 **************************/
2133 r22 = _fjsp_mul_v2r8(rsq22,rinv22);
2135 /* Calculate table index by multiplying r with table scale and truncate to integer */
2136 rt = _fjsp_mul_v2r8(r22,vftabscale);
2137 itab_tmp = _fjsp_dtox_v2r8(rt);
2138 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
2139 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
2140 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
2145 /* CUBIC SPLINE TABLE ELECTROSTATICS */
2146 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
2147 F = _fjsp_setzero_v2r8();
2148 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
2149 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
2150 H = _fjsp_setzero_v2r8();
2151 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
2152 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
2153 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
2154 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq22,FF),_fjsp_mul_v2r8(vftabscale,rinv22)));
2158 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2160 /* Update vectorial force */
2161 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
2162 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
2163 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
2165 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
2166 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
2167 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
2169 /**************************
2170 * CALCULATE INTERACTIONS *
2171 **************************/
2173 r23 = _fjsp_mul_v2r8(rsq23,rinv23);
2175 /* Calculate table index by multiplying r with table scale and truncate to integer */
2176 rt = _fjsp_mul_v2r8(r23,vftabscale);
2177 itab_tmp = _fjsp_dtox_v2r8(rt);
2178 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
2179 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
2180 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
2185 /* CUBIC SPLINE TABLE ELECTROSTATICS */
2186 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
2187 F = _fjsp_setzero_v2r8();
2188 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
2189 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
2190 H = _fjsp_setzero_v2r8();
2191 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
2192 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
2193 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
2194 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq23,FF),_fjsp_mul_v2r8(vftabscale,rinv23)));
2198 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2200 /* Update vectorial force */
2201 fix2 = _fjsp_madd_v2r8(dx23,fscal,fix2);
2202 fiy2 = _fjsp_madd_v2r8(dy23,fscal,fiy2);
2203 fiz2 = _fjsp_madd_v2r8(dz23,fscal,fiz2);
2205 fjx3 = _fjsp_madd_v2r8(dx23,fscal,fjx3);
2206 fjy3 = _fjsp_madd_v2r8(dy23,fscal,fjy3);
2207 fjz3 = _fjsp_madd_v2r8(dz23,fscal,fjz3);
2209 /**************************
2210 * CALCULATE INTERACTIONS *
2211 **************************/
2213 r31 = _fjsp_mul_v2r8(rsq31,rinv31);
2215 /* Calculate table index by multiplying r with table scale and truncate to integer */
2216 rt = _fjsp_mul_v2r8(r31,vftabscale);
2217 itab_tmp = _fjsp_dtox_v2r8(rt);
2218 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
2219 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
2220 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
2225 /* CUBIC SPLINE TABLE ELECTROSTATICS */
2226 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
2227 F = _fjsp_setzero_v2r8();
2228 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
2229 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
2230 H = _fjsp_setzero_v2r8();
2231 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
2232 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
2233 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
2234 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq31,FF),_fjsp_mul_v2r8(vftabscale,rinv31)));
2238 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2240 /* Update vectorial force */
2241 fix3 = _fjsp_madd_v2r8(dx31,fscal,fix3);
2242 fiy3 = _fjsp_madd_v2r8(dy31,fscal,fiy3);
2243 fiz3 = _fjsp_madd_v2r8(dz31,fscal,fiz3);
2245 fjx1 = _fjsp_madd_v2r8(dx31,fscal,fjx1);
2246 fjy1 = _fjsp_madd_v2r8(dy31,fscal,fjy1);
2247 fjz1 = _fjsp_madd_v2r8(dz31,fscal,fjz1);
2249 /**************************
2250 * CALCULATE INTERACTIONS *
2251 **************************/
2253 r32 = _fjsp_mul_v2r8(rsq32,rinv32);
2255 /* Calculate table index by multiplying r with table scale and truncate to integer */
2256 rt = _fjsp_mul_v2r8(r32,vftabscale);
2257 itab_tmp = _fjsp_dtox_v2r8(rt);
2258 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
2259 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
2260 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
2265 /* CUBIC SPLINE TABLE ELECTROSTATICS */
2266 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
2267 F = _fjsp_setzero_v2r8();
2268 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
2269 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
2270 H = _fjsp_setzero_v2r8();
2271 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
2272 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
2273 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
2274 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq32,FF),_fjsp_mul_v2r8(vftabscale,rinv32)));
2278 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2280 /* Update vectorial force */
2281 fix3 = _fjsp_madd_v2r8(dx32,fscal,fix3);
2282 fiy3 = _fjsp_madd_v2r8(dy32,fscal,fiy3);
2283 fiz3 = _fjsp_madd_v2r8(dz32,fscal,fiz3);
2285 fjx2 = _fjsp_madd_v2r8(dx32,fscal,fjx2);
2286 fjy2 = _fjsp_madd_v2r8(dy32,fscal,fjy2);
2287 fjz2 = _fjsp_madd_v2r8(dz32,fscal,fjz2);
2289 /**************************
2290 * CALCULATE INTERACTIONS *
2291 **************************/
2293 r33 = _fjsp_mul_v2r8(rsq33,rinv33);
2295 /* Calculate table index by multiplying r with table scale and truncate to integer */
2296 rt = _fjsp_mul_v2r8(r33,vftabscale);
2297 itab_tmp = _fjsp_dtox_v2r8(rt);
2298 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
2299 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
2300 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
2305 /* CUBIC SPLINE TABLE ELECTROSTATICS */
2306 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
2307 F = _fjsp_setzero_v2r8();
2308 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
2309 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
2310 H = _fjsp_setzero_v2r8();
2311 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
2312 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
2313 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
2314 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq33,FF),_fjsp_mul_v2r8(vftabscale,rinv33)));
2318 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2320 /* Update vectorial force */
2321 fix3 = _fjsp_madd_v2r8(dx33,fscal,fix3);
2322 fiy3 = _fjsp_madd_v2r8(dy33,fscal,fiy3);
2323 fiz3 = _fjsp_madd_v2r8(dz33,fscal,fiz3);
2325 fjx3 = _fjsp_madd_v2r8(dx33,fscal,fjx3);
2326 fjy3 = _fjsp_madd_v2r8(dy33,fscal,fjy3);
2327 fjz3 = _fjsp_madd_v2r8(dz33,fscal,fjz3);
2329 gmx_fjsp_decrement_4rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2,fjx3,fjy3,fjz3);
2331 /* Inner loop uses 411 flops */
2334 /* End of innermost loop */
2336 gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
2337 f+i_coord_offset,fshift+i_shift_offset);
2339 /* Increment number of inner iterations */
2340 inneriter += j_index_end - j_index_start;
2342 /* Outer loop uses 24 flops */
2345 /* Increment number of outer iterations */
2348 /* Update outer/inner flops */
2350 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4W4_F,outeriter*24 + inneriter*411);