2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
5 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6 * and including many others, as listed in the AUTHORS file in the
7 * top-level source directory and at http://www.gromacs.org.
9 * GROMACS is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 2.1
12 * of the License, or (at your option) any later version.
14 * GROMACS is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with GROMACS; if not, see
21 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 * If you want to redistribute modifications to GROMACS, please
25 * consider that scientific software is very special. Version
26 * control is crucial - bugs must be traceable. We will be happy to
27 * consider code for inclusion in the official distribution, but
28 * derived work must not be called official GROMACS. Details are found
29 * in the README & COPYING files - if they are missing, get the
30 * official version at http://www.gromacs.org.
32 * To help us fund GROMACS development, we humbly ask that you cite
33 * the research papers on the package. Check out http://www.gromacs.org.
36 * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
42 #include "../nb_kernel.h"
43 #include "gromacs/legacyheaders/types/simple.h"
44 #include "gromacs/math/vec.h"
45 #include "gromacs/legacyheaders/nrnb.h"
47 #include "kernelutil_sparc64_hpc_ace_double.h"
50 * Gromacs nonbonded kernel: nb_kernel_ElecEw_VdwCSTab_GeomW4W4_VF_sparc64_hpc_ace_double
51 * Electrostatics interaction: Ewald
52 * VdW interaction: CubicSplineTable
53 * Geometry: Water4-Water4
54 * Calculate force/pot: PotentialAndForce
57 nb_kernel_ElecEw_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;
115 _fjsp_v2r8 ewtabscale,eweps,sh_ewald,ewrt,ewtabhalfspace,ewtabF,ewtabFn,ewtabD,ewtabV;
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_vdw->data;
141 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
143 sh_ewald = gmx_fjsp_set1_v2r8(fr->ic->sh_ewald);
144 ewtab = fr->ic->tabq_coul_FDV0;
145 ewtabscale = gmx_fjsp_set1_v2r8(fr->ic->tabq_scale);
146 ewtabhalfspace = gmx_fjsp_set1_v2r8(0.5/fr->ic->tabq_scale);
148 /* Setup water-specific parameters */
149 inr = nlist->iinr[0];
150 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
151 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
152 iq3 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+3]));
153 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
155 jq1 = gmx_fjsp_set1_v2r8(charge[inr+1]);
156 jq2 = gmx_fjsp_set1_v2r8(charge[inr+2]);
157 jq3 = gmx_fjsp_set1_v2r8(charge[inr+3]);
158 vdwjidx0A = 2*vdwtype[inr+0];
159 c6_00 = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A]);
160 c12_00 = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A+1]);
161 qq11 = _fjsp_mul_v2r8(iq1,jq1);
162 qq12 = _fjsp_mul_v2r8(iq1,jq2);
163 qq13 = _fjsp_mul_v2r8(iq1,jq3);
164 qq21 = _fjsp_mul_v2r8(iq2,jq1);
165 qq22 = _fjsp_mul_v2r8(iq2,jq2);
166 qq23 = _fjsp_mul_v2r8(iq2,jq3);
167 qq31 = _fjsp_mul_v2r8(iq3,jq1);
168 qq32 = _fjsp_mul_v2r8(iq3,jq2);
169 qq33 = _fjsp_mul_v2r8(iq3,jq3);
171 /* Avoid stupid compiler warnings */
179 /* Start outer loop over neighborlists */
180 for(iidx=0; iidx<nri; iidx++)
182 /* Load shift vector for this list */
183 i_shift_offset = DIM*shiftidx[iidx];
185 /* Load limits for loop over neighbors */
186 j_index_start = jindex[iidx];
187 j_index_end = jindex[iidx+1];
189 /* Get outer coordinate index */
191 i_coord_offset = DIM*inr;
193 /* Load i particle coords and add shift vector */
194 gmx_fjsp_load_shift_and_4rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
195 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
197 fix0 = _fjsp_setzero_v2r8();
198 fiy0 = _fjsp_setzero_v2r8();
199 fiz0 = _fjsp_setzero_v2r8();
200 fix1 = _fjsp_setzero_v2r8();
201 fiy1 = _fjsp_setzero_v2r8();
202 fiz1 = _fjsp_setzero_v2r8();
203 fix2 = _fjsp_setzero_v2r8();
204 fiy2 = _fjsp_setzero_v2r8();
205 fiz2 = _fjsp_setzero_v2r8();
206 fix3 = _fjsp_setzero_v2r8();
207 fiy3 = _fjsp_setzero_v2r8();
208 fiz3 = _fjsp_setzero_v2r8();
210 /* Reset potential sums */
211 velecsum = _fjsp_setzero_v2r8();
212 vvdwsum = _fjsp_setzero_v2r8();
214 /* Start inner kernel loop */
215 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
218 /* Get j neighbor index, and coordinate index */
221 j_coord_offsetA = DIM*jnrA;
222 j_coord_offsetB = DIM*jnrB;
224 /* load j atom coordinates */
225 gmx_fjsp_load_4rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
226 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,
227 &jy2,&jz2,&jx3,&jy3,&jz3);
229 /* Calculate displacement vector */
230 dx00 = _fjsp_sub_v2r8(ix0,jx0);
231 dy00 = _fjsp_sub_v2r8(iy0,jy0);
232 dz00 = _fjsp_sub_v2r8(iz0,jz0);
233 dx11 = _fjsp_sub_v2r8(ix1,jx1);
234 dy11 = _fjsp_sub_v2r8(iy1,jy1);
235 dz11 = _fjsp_sub_v2r8(iz1,jz1);
236 dx12 = _fjsp_sub_v2r8(ix1,jx2);
237 dy12 = _fjsp_sub_v2r8(iy1,jy2);
238 dz12 = _fjsp_sub_v2r8(iz1,jz2);
239 dx13 = _fjsp_sub_v2r8(ix1,jx3);
240 dy13 = _fjsp_sub_v2r8(iy1,jy3);
241 dz13 = _fjsp_sub_v2r8(iz1,jz3);
242 dx21 = _fjsp_sub_v2r8(ix2,jx1);
243 dy21 = _fjsp_sub_v2r8(iy2,jy1);
244 dz21 = _fjsp_sub_v2r8(iz2,jz1);
245 dx22 = _fjsp_sub_v2r8(ix2,jx2);
246 dy22 = _fjsp_sub_v2r8(iy2,jy2);
247 dz22 = _fjsp_sub_v2r8(iz2,jz2);
248 dx23 = _fjsp_sub_v2r8(ix2,jx3);
249 dy23 = _fjsp_sub_v2r8(iy2,jy3);
250 dz23 = _fjsp_sub_v2r8(iz2,jz3);
251 dx31 = _fjsp_sub_v2r8(ix3,jx1);
252 dy31 = _fjsp_sub_v2r8(iy3,jy1);
253 dz31 = _fjsp_sub_v2r8(iz3,jz1);
254 dx32 = _fjsp_sub_v2r8(ix3,jx2);
255 dy32 = _fjsp_sub_v2r8(iy3,jy2);
256 dz32 = _fjsp_sub_v2r8(iz3,jz2);
257 dx33 = _fjsp_sub_v2r8(ix3,jx3);
258 dy33 = _fjsp_sub_v2r8(iy3,jy3);
259 dz33 = _fjsp_sub_v2r8(iz3,jz3);
261 /* Calculate squared distance and things based on it */
262 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
263 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
264 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
265 rsq13 = gmx_fjsp_calc_rsq_v2r8(dx13,dy13,dz13);
266 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
267 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
268 rsq23 = gmx_fjsp_calc_rsq_v2r8(dx23,dy23,dz23);
269 rsq31 = gmx_fjsp_calc_rsq_v2r8(dx31,dy31,dz31);
270 rsq32 = gmx_fjsp_calc_rsq_v2r8(dx32,dy32,dz32);
271 rsq33 = gmx_fjsp_calc_rsq_v2r8(dx33,dy33,dz33);
273 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
274 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
275 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
276 rinv13 = gmx_fjsp_invsqrt_v2r8(rsq13);
277 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
278 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
279 rinv23 = gmx_fjsp_invsqrt_v2r8(rsq23);
280 rinv31 = gmx_fjsp_invsqrt_v2r8(rsq31);
281 rinv32 = gmx_fjsp_invsqrt_v2r8(rsq32);
282 rinv33 = gmx_fjsp_invsqrt_v2r8(rsq33);
284 rinvsq11 = _fjsp_mul_v2r8(rinv11,rinv11);
285 rinvsq12 = _fjsp_mul_v2r8(rinv12,rinv12);
286 rinvsq13 = _fjsp_mul_v2r8(rinv13,rinv13);
287 rinvsq21 = _fjsp_mul_v2r8(rinv21,rinv21);
288 rinvsq22 = _fjsp_mul_v2r8(rinv22,rinv22);
289 rinvsq23 = _fjsp_mul_v2r8(rinv23,rinv23);
290 rinvsq31 = _fjsp_mul_v2r8(rinv31,rinv31);
291 rinvsq32 = _fjsp_mul_v2r8(rinv32,rinv32);
292 rinvsq33 = _fjsp_mul_v2r8(rinv33,rinv33);
294 fjx0 = _fjsp_setzero_v2r8();
295 fjy0 = _fjsp_setzero_v2r8();
296 fjz0 = _fjsp_setzero_v2r8();
297 fjx1 = _fjsp_setzero_v2r8();
298 fjy1 = _fjsp_setzero_v2r8();
299 fjz1 = _fjsp_setzero_v2r8();
300 fjx2 = _fjsp_setzero_v2r8();
301 fjy2 = _fjsp_setzero_v2r8();
302 fjz2 = _fjsp_setzero_v2r8();
303 fjx3 = _fjsp_setzero_v2r8();
304 fjy3 = _fjsp_setzero_v2r8();
305 fjz3 = _fjsp_setzero_v2r8();
307 /**************************
308 * CALCULATE INTERACTIONS *
309 **************************/
311 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
313 /* Calculate table index by multiplying r with table scale and truncate to integer */
314 rt = _fjsp_mul_v2r8(r00,vftabscale);
315 itab_tmp = _fjsp_dtox_v2r8(rt);
316 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
317 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
318 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
323 /* CUBIC SPLINE TABLE DISPERSION */
324 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
325 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
326 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
327 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
328 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
329 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
330 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
331 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
332 vvdw6 = _fjsp_mul_v2r8(c6_00,VV);
333 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
334 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
336 /* CUBIC SPLINE TABLE REPULSION */
337 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
338 F = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
339 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
340 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
341 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
342 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
343 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
344 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
345 vvdw12 = _fjsp_mul_v2r8(c12_00,VV);
346 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
347 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
348 vvdw = _fjsp_add_v2r8(vvdw12,vvdw6);
349 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
351 /* Update potential sum for this i atom from the interaction with this j atom. */
352 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
356 /* Update vectorial force */
357 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
358 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
359 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
361 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
362 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
363 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
365 /**************************
366 * CALCULATE INTERACTIONS *
367 **************************/
369 r11 = _fjsp_mul_v2r8(rsq11,rinv11);
371 /* EWALD ELECTROSTATICS */
373 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
374 ewrt = _fjsp_mul_v2r8(r11,ewtabscale);
375 itab_tmp = _fjsp_dtox_v2r8(ewrt);
376 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
377 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
379 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
380 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
381 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
382 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
383 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
384 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
385 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
386 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
387 velec = _fjsp_mul_v2r8(qq11,_fjsp_sub_v2r8(rinv11,velec));
388 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq11,rinv11),_fjsp_sub_v2r8(rinvsq11,felec));
390 /* Update potential sum for this i atom from the interaction with this j atom. */
391 velecsum = _fjsp_add_v2r8(velecsum,velec);
395 /* Update vectorial force */
396 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
397 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
398 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
400 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
401 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
402 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
404 /**************************
405 * CALCULATE INTERACTIONS *
406 **************************/
408 r12 = _fjsp_mul_v2r8(rsq12,rinv12);
410 /* EWALD ELECTROSTATICS */
412 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
413 ewrt = _fjsp_mul_v2r8(r12,ewtabscale);
414 itab_tmp = _fjsp_dtox_v2r8(ewrt);
415 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
416 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
418 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
419 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
420 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
421 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
422 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
423 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
424 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
425 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
426 velec = _fjsp_mul_v2r8(qq12,_fjsp_sub_v2r8(rinv12,velec));
427 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq12,rinv12),_fjsp_sub_v2r8(rinvsq12,felec));
429 /* Update potential sum for this i atom from the interaction with this j atom. */
430 velecsum = _fjsp_add_v2r8(velecsum,velec);
434 /* Update vectorial force */
435 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
436 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
437 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
439 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
440 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
441 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
443 /**************************
444 * CALCULATE INTERACTIONS *
445 **************************/
447 r13 = _fjsp_mul_v2r8(rsq13,rinv13);
449 /* EWALD ELECTROSTATICS */
451 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
452 ewrt = _fjsp_mul_v2r8(r13,ewtabscale);
453 itab_tmp = _fjsp_dtox_v2r8(ewrt);
454 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
455 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
457 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
458 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
459 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
460 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
461 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
462 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
463 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
464 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
465 velec = _fjsp_mul_v2r8(qq13,_fjsp_sub_v2r8(rinv13,velec));
466 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq13,rinv13),_fjsp_sub_v2r8(rinvsq13,felec));
468 /* Update potential sum for this i atom from the interaction with this j atom. */
469 velecsum = _fjsp_add_v2r8(velecsum,velec);
473 /* Update vectorial force */
474 fix1 = _fjsp_madd_v2r8(dx13,fscal,fix1);
475 fiy1 = _fjsp_madd_v2r8(dy13,fscal,fiy1);
476 fiz1 = _fjsp_madd_v2r8(dz13,fscal,fiz1);
478 fjx3 = _fjsp_madd_v2r8(dx13,fscal,fjx3);
479 fjy3 = _fjsp_madd_v2r8(dy13,fscal,fjy3);
480 fjz3 = _fjsp_madd_v2r8(dz13,fscal,fjz3);
482 /**************************
483 * CALCULATE INTERACTIONS *
484 **************************/
486 r21 = _fjsp_mul_v2r8(rsq21,rinv21);
488 /* EWALD ELECTROSTATICS */
490 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
491 ewrt = _fjsp_mul_v2r8(r21,ewtabscale);
492 itab_tmp = _fjsp_dtox_v2r8(ewrt);
493 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
494 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
496 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
497 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
498 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
499 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
500 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
501 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
502 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
503 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
504 velec = _fjsp_mul_v2r8(qq21,_fjsp_sub_v2r8(rinv21,velec));
505 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq21,rinv21),_fjsp_sub_v2r8(rinvsq21,felec));
507 /* Update potential sum for this i atom from the interaction with this j atom. */
508 velecsum = _fjsp_add_v2r8(velecsum,velec);
512 /* Update vectorial force */
513 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
514 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
515 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
517 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
518 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
519 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
521 /**************************
522 * CALCULATE INTERACTIONS *
523 **************************/
525 r22 = _fjsp_mul_v2r8(rsq22,rinv22);
527 /* EWALD ELECTROSTATICS */
529 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
530 ewrt = _fjsp_mul_v2r8(r22,ewtabscale);
531 itab_tmp = _fjsp_dtox_v2r8(ewrt);
532 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
533 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
535 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
536 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
537 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
538 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
539 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
540 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
541 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
542 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
543 velec = _fjsp_mul_v2r8(qq22,_fjsp_sub_v2r8(rinv22,velec));
544 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq22,rinv22),_fjsp_sub_v2r8(rinvsq22,felec));
546 /* Update potential sum for this i atom from the interaction with this j atom. */
547 velecsum = _fjsp_add_v2r8(velecsum,velec);
551 /* Update vectorial force */
552 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
553 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
554 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
556 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
557 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
558 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
560 /**************************
561 * CALCULATE INTERACTIONS *
562 **************************/
564 r23 = _fjsp_mul_v2r8(rsq23,rinv23);
566 /* EWALD ELECTROSTATICS */
568 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
569 ewrt = _fjsp_mul_v2r8(r23,ewtabscale);
570 itab_tmp = _fjsp_dtox_v2r8(ewrt);
571 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
572 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
574 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
575 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
576 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
577 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
578 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
579 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
580 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
581 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
582 velec = _fjsp_mul_v2r8(qq23,_fjsp_sub_v2r8(rinv23,velec));
583 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq23,rinv23),_fjsp_sub_v2r8(rinvsq23,felec));
585 /* Update potential sum for this i atom from the interaction with this j atom. */
586 velecsum = _fjsp_add_v2r8(velecsum,velec);
590 /* Update vectorial force */
591 fix2 = _fjsp_madd_v2r8(dx23,fscal,fix2);
592 fiy2 = _fjsp_madd_v2r8(dy23,fscal,fiy2);
593 fiz2 = _fjsp_madd_v2r8(dz23,fscal,fiz2);
595 fjx3 = _fjsp_madd_v2r8(dx23,fscal,fjx3);
596 fjy3 = _fjsp_madd_v2r8(dy23,fscal,fjy3);
597 fjz3 = _fjsp_madd_v2r8(dz23,fscal,fjz3);
599 /**************************
600 * CALCULATE INTERACTIONS *
601 **************************/
603 r31 = _fjsp_mul_v2r8(rsq31,rinv31);
605 /* EWALD ELECTROSTATICS */
607 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
608 ewrt = _fjsp_mul_v2r8(r31,ewtabscale);
609 itab_tmp = _fjsp_dtox_v2r8(ewrt);
610 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
611 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
613 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
614 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
615 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
616 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
617 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
618 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
619 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
620 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
621 velec = _fjsp_mul_v2r8(qq31,_fjsp_sub_v2r8(rinv31,velec));
622 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq31,rinv31),_fjsp_sub_v2r8(rinvsq31,felec));
624 /* Update potential sum for this i atom from the interaction with this j atom. */
625 velecsum = _fjsp_add_v2r8(velecsum,velec);
629 /* Update vectorial force */
630 fix3 = _fjsp_madd_v2r8(dx31,fscal,fix3);
631 fiy3 = _fjsp_madd_v2r8(dy31,fscal,fiy3);
632 fiz3 = _fjsp_madd_v2r8(dz31,fscal,fiz3);
634 fjx1 = _fjsp_madd_v2r8(dx31,fscal,fjx1);
635 fjy1 = _fjsp_madd_v2r8(dy31,fscal,fjy1);
636 fjz1 = _fjsp_madd_v2r8(dz31,fscal,fjz1);
638 /**************************
639 * CALCULATE INTERACTIONS *
640 **************************/
642 r32 = _fjsp_mul_v2r8(rsq32,rinv32);
644 /* EWALD ELECTROSTATICS */
646 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
647 ewrt = _fjsp_mul_v2r8(r32,ewtabscale);
648 itab_tmp = _fjsp_dtox_v2r8(ewrt);
649 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
650 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
652 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
653 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
654 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
655 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
656 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
657 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
658 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
659 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
660 velec = _fjsp_mul_v2r8(qq32,_fjsp_sub_v2r8(rinv32,velec));
661 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq32,rinv32),_fjsp_sub_v2r8(rinvsq32,felec));
663 /* Update potential sum for this i atom from the interaction with this j atom. */
664 velecsum = _fjsp_add_v2r8(velecsum,velec);
668 /* Update vectorial force */
669 fix3 = _fjsp_madd_v2r8(dx32,fscal,fix3);
670 fiy3 = _fjsp_madd_v2r8(dy32,fscal,fiy3);
671 fiz3 = _fjsp_madd_v2r8(dz32,fscal,fiz3);
673 fjx2 = _fjsp_madd_v2r8(dx32,fscal,fjx2);
674 fjy2 = _fjsp_madd_v2r8(dy32,fscal,fjy2);
675 fjz2 = _fjsp_madd_v2r8(dz32,fscal,fjz2);
677 /**************************
678 * CALCULATE INTERACTIONS *
679 **************************/
681 r33 = _fjsp_mul_v2r8(rsq33,rinv33);
683 /* EWALD ELECTROSTATICS */
685 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
686 ewrt = _fjsp_mul_v2r8(r33,ewtabscale);
687 itab_tmp = _fjsp_dtox_v2r8(ewrt);
688 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
689 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
691 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
692 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
693 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
694 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
695 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
696 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
697 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
698 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
699 velec = _fjsp_mul_v2r8(qq33,_fjsp_sub_v2r8(rinv33,velec));
700 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq33,rinv33),_fjsp_sub_v2r8(rinvsq33,felec));
702 /* Update potential sum for this i atom from the interaction with this j atom. */
703 velecsum = _fjsp_add_v2r8(velecsum,velec);
707 /* Update vectorial force */
708 fix3 = _fjsp_madd_v2r8(dx33,fscal,fix3);
709 fiy3 = _fjsp_madd_v2r8(dy33,fscal,fiy3);
710 fiz3 = _fjsp_madd_v2r8(dz33,fscal,fiz3);
712 fjx3 = _fjsp_madd_v2r8(dx33,fscal,fjx3);
713 fjy3 = _fjsp_madd_v2r8(dy33,fscal,fjy3);
714 fjz3 = _fjsp_madd_v2r8(dz33,fscal,fjz3);
716 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);
718 /* Inner loop uses 458 flops */
725 j_coord_offsetA = DIM*jnrA;
727 /* load j atom coordinates */
728 gmx_fjsp_load_4rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
729 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,
730 &jy2,&jz2,&jx3,&jy3,&jz3);
732 /* Calculate displacement vector */
733 dx00 = _fjsp_sub_v2r8(ix0,jx0);
734 dy00 = _fjsp_sub_v2r8(iy0,jy0);
735 dz00 = _fjsp_sub_v2r8(iz0,jz0);
736 dx11 = _fjsp_sub_v2r8(ix1,jx1);
737 dy11 = _fjsp_sub_v2r8(iy1,jy1);
738 dz11 = _fjsp_sub_v2r8(iz1,jz1);
739 dx12 = _fjsp_sub_v2r8(ix1,jx2);
740 dy12 = _fjsp_sub_v2r8(iy1,jy2);
741 dz12 = _fjsp_sub_v2r8(iz1,jz2);
742 dx13 = _fjsp_sub_v2r8(ix1,jx3);
743 dy13 = _fjsp_sub_v2r8(iy1,jy3);
744 dz13 = _fjsp_sub_v2r8(iz1,jz3);
745 dx21 = _fjsp_sub_v2r8(ix2,jx1);
746 dy21 = _fjsp_sub_v2r8(iy2,jy1);
747 dz21 = _fjsp_sub_v2r8(iz2,jz1);
748 dx22 = _fjsp_sub_v2r8(ix2,jx2);
749 dy22 = _fjsp_sub_v2r8(iy2,jy2);
750 dz22 = _fjsp_sub_v2r8(iz2,jz2);
751 dx23 = _fjsp_sub_v2r8(ix2,jx3);
752 dy23 = _fjsp_sub_v2r8(iy2,jy3);
753 dz23 = _fjsp_sub_v2r8(iz2,jz3);
754 dx31 = _fjsp_sub_v2r8(ix3,jx1);
755 dy31 = _fjsp_sub_v2r8(iy3,jy1);
756 dz31 = _fjsp_sub_v2r8(iz3,jz1);
757 dx32 = _fjsp_sub_v2r8(ix3,jx2);
758 dy32 = _fjsp_sub_v2r8(iy3,jy2);
759 dz32 = _fjsp_sub_v2r8(iz3,jz2);
760 dx33 = _fjsp_sub_v2r8(ix3,jx3);
761 dy33 = _fjsp_sub_v2r8(iy3,jy3);
762 dz33 = _fjsp_sub_v2r8(iz3,jz3);
764 /* Calculate squared distance and things based on it */
765 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
766 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
767 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
768 rsq13 = gmx_fjsp_calc_rsq_v2r8(dx13,dy13,dz13);
769 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
770 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
771 rsq23 = gmx_fjsp_calc_rsq_v2r8(dx23,dy23,dz23);
772 rsq31 = gmx_fjsp_calc_rsq_v2r8(dx31,dy31,dz31);
773 rsq32 = gmx_fjsp_calc_rsq_v2r8(dx32,dy32,dz32);
774 rsq33 = gmx_fjsp_calc_rsq_v2r8(dx33,dy33,dz33);
776 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
777 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
778 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
779 rinv13 = gmx_fjsp_invsqrt_v2r8(rsq13);
780 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
781 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
782 rinv23 = gmx_fjsp_invsqrt_v2r8(rsq23);
783 rinv31 = gmx_fjsp_invsqrt_v2r8(rsq31);
784 rinv32 = gmx_fjsp_invsqrt_v2r8(rsq32);
785 rinv33 = gmx_fjsp_invsqrt_v2r8(rsq33);
787 rinvsq11 = _fjsp_mul_v2r8(rinv11,rinv11);
788 rinvsq12 = _fjsp_mul_v2r8(rinv12,rinv12);
789 rinvsq13 = _fjsp_mul_v2r8(rinv13,rinv13);
790 rinvsq21 = _fjsp_mul_v2r8(rinv21,rinv21);
791 rinvsq22 = _fjsp_mul_v2r8(rinv22,rinv22);
792 rinvsq23 = _fjsp_mul_v2r8(rinv23,rinv23);
793 rinvsq31 = _fjsp_mul_v2r8(rinv31,rinv31);
794 rinvsq32 = _fjsp_mul_v2r8(rinv32,rinv32);
795 rinvsq33 = _fjsp_mul_v2r8(rinv33,rinv33);
797 fjx0 = _fjsp_setzero_v2r8();
798 fjy0 = _fjsp_setzero_v2r8();
799 fjz0 = _fjsp_setzero_v2r8();
800 fjx1 = _fjsp_setzero_v2r8();
801 fjy1 = _fjsp_setzero_v2r8();
802 fjz1 = _fjsp_setzero_v2r8();
803 fjx2 = _fjsp_setzero_v2r8();
804 fjy2 = _fjsp_setzero_v2r8();
805 fjz2 = _fjsp_setzero_v2r8();
806 fjx3 = _fjsp_setzero_v2r8();
807 fjy3 = _fjsp_setzero_v2r8();
808 fjz3 = _fjsp_setzero_v2r8();
810 /**************************
811 * CALCULATE INTERACTIONS *
812 **************************/
814 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
816 /* Calculate table index by multiplying r with table scale and truncate to integer */
817 rt = _fjsp_mul_v2r8(r00,vftabscale);
818 itab_tmp = _fjsp_dtox_v2r8(rt);
819 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
820 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
821 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
826 /* CUBIC SPLINE TABLE DISPERSION */
827 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
828 F = _fjsp_setzero_v2r8();
829 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
830 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
831 H = _fjsp_setzero_v2r8();
832 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
833 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
834 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
835 vvdw6 = _fjsp_mul_v2r8(c6_00,VV);
836 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
837 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
839 /* CUBIC SPLINE TABLE REPULSION */
840 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
841 F = _fjsp_setzero_v2r8();
842 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
843 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
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 vvdw12 = _fjsp_mul_v2r8(c12_00,VV);
849 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
850 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
851 vvdw = _fjsp_add_v2r8(vvdw12,vvdw6);
852 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
854 /* Update potential sum for this i atom from the interaction with this j atom. */
855 vvdw = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
856 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
860 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
862 /* Update vectorial force */
863 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
864 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
865 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
867 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
868 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
869 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
871 /**************************
872 * CALCULATE INTERACTIONS *
873 **************************/
875 r11 = _fjsp_mul_v2r8(rsq11,rinv11);
877 /* EWALD ELECTROSTATICS */
879 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
880 ewrt = _fjsp_mul_v2r8(r11,ewtabscale);
881 itab_tmp = _fjsp_dtox_v2r8(ewrt);
882 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
883 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
885 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
886 ewtabD = _fjsp_setzero_v2r8();
887 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
888 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
889 ewtabFn = _fjsp_setzero_v2r8();
890 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
891 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
892 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
893 velec = _fjsp_mul_v2r8(qq11,_fjsp_sub_v2r8(rinv11,velec));
894 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq11,rinv11),_fjsp_sub_v2r8(rinvsq11,felec));
896 /* Update potential sum for this i atom from the interaction with this j atom. */
897 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
898 velecsum = _fjsp_add_v2r8(velecsum,velec);
902 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
904 /* Update vectorial force */
905 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
906 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
907 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
909 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
910 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
911 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
913 /**************************
914 * CALCULATE INTERACTIONS *
915 **************************/
917 r12 = _fjsp_mul_v2r8(rsq12,rinv12);
919 /* EWALD ELECTROSTATICS */
921 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
922 ewrt = _fjsp_mul_v2r8(r12,ewtabscale);
923 itab_tmp = _fjsp_dtox_v2r8(ewrt);
924 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
925 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
927 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
928 ewtabD = _fjsp_setzero_v2r8();
929 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
930 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
931 ewtabFn = _fjsp_setzero_v2r8();
932 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
933 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
934 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
935 velec = _fjsp_mul_v2r8(qq12,_fjsp_sub_v2r8(rinv12,velec));
936 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq12,rinv12),_fjsp_sub_v2r8(rinvsq12,felec));
938 /* Update potential sum for this i atom from the interaction with this j atom. */
939 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
940 velecsum = _fjsp_add_v2r8(velecsum,velec);
944 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
946 /* Update vectorial force */
947 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
948 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
949 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
951 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
952 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
953 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
955 /**************************
956 * CALCULATE INTERACTIONS *
957 **************************/
959 r13 = _fjsp_mul_v2r8(rsq13,rinv13);
961 /* EWALD ELECTROSTATICS */
963 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
964 ewrt = _fjsp_mul_v2r8(r13,ewtabscale);
965 itab_tmp = _fjsp_dtox_v2r8(ewrt);
966 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
967 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
969 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
970 ewtabD = _fjsp_setzero_v2r8();
971 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
972 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
973 ewtabFn = _fjsp_setzero_v2r8();
974 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
975 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
976 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
977 velec = _fjsp_mul_v2r8(qq13,_fjsp_sub_v2r8(rinv13,velec));
978 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq13,rinv13),_fjsp_sub_v2r8(rinvsq13,felec));
980 /* Update potential sum for this i atom from the interaction with this j atom. */
981 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
982 velecsum = _fjsp_add_v2r8(velecsum,velec);
986 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
988 /* Update vectorial force */
989 fix1 = _fjsp_madd_v2r8(dx13,fscal,fix1);
990 fiy1 = _fjsp_madd_v2r8(dy13,fscal,fiy1);
991 fiz1 = _fjsp_madd_v2r8(dz13,fscal,fiz1);
993 fjx3 = _fjsp_madd_v2r8(dx13,fscal,fjx3);
994 fjy3 = _fjsp_madd_v2r8(dy13,fscal,fjy3);
995 fjz3 = _fjsp_madd_v2r8(dz13,fscal,fjz3);
997 /**************************
998 * CALCULATE INTERACTIONS *
999 **************************/
1001 r21 = _fjsp_mul_v2r8(rsq21,rinv21);
1003 /* EWALD ELECTROSTATICS */
1005 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1006 ewrt = _fjsp_mul_v2r8(r21,ewtabscale);
1007 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1008 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1009 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1011 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
1012 ewtabD = _fjsp_setzero_v2r8();
1013 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
1014 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
1015 ewtabFn = _fjsp_setzero_v2r8();
1016 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
1017 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
1018 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
1019 velec = _fjsp_mul_v2r8(qq21,_fjsp_sub_v2r8(rinv21,velec));
1020 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq21,rinv21),_fjsp_sub_v2r8(rinvsq21,felec));
1022 /* Update potential sum for this i atom from the interaction with this j atom. */
1023 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1024 velecsum = _fjsp_add_v2r8(velecsum,velec);
1028 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1030 /* Update vectorial force */
1031 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
1032 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
1033 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
1035 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
1036 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
1037 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
1039 /**************************
1040 * CALCULATE INTERACTIONS *
1041 **************************/
1043 r22 = _fjsp_mul_v2r8(rsq22,rinv22);
1045 /* EWALD ELECTROSTATICS */
1047 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1048 ewrt = _fjsp_mul_v2r8(r22,ewtabscale);
1049 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1050 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1051 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1053 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
1054 ewtabD = _fjsp_setzero_v2r8();
1055 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
1056 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
1057 ewtabFn = _fjsp_setzero_v2r8();
1058 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
1059 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
1060 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
1061 velec = _fjsp_mul_v2r8(qq22,_fjsp_sub_v2r8(rinv22,velec));
1062 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq22,rinv22),_fjsp_sub_v2r8(rinvsq22,felec));
1064 /* Update potential sum for this i atom from the interaction with this j atom. */
1065 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1066 velecsum = _fjsp_add_v2r8(velecsum,velec);
1070 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1072 /* Update vectorial force */
1073 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
1074 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
1075 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
1077 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
1078 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
1079 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
1081 /**************************
1082 * CALCULATE INTERACTIONS *
1083 **************************/
1085 r23 = _fjsp_mul_v2r8(rsq23,rinv23);
1087 /* EWALD ELECTROSTATICS */
1089 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1090 ewrt = _fjsp_mul_v2r8(r23,ewtabscale);
1091 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1092 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1093 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1095 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
1096 ewtabD = _fjsp_setzero_v2r8();
1097 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
1098 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
1099 ewtabFn = _fjsp_setzero_v2r8();
1100 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
1101 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
1102 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
1103 velec = _fjsp_mul_v2r8(qq23,_fjsp_sub_v2r8(rinv23,velec));
1104 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq23,rinv23),_fjsp_sub_v2r8(rinvsq23,felec));
1106 /* Update potential sum for this i atom from the interaction with this j atom. */
1107 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1108 velecsum = _fjsp_add_v2r8(velecsum,velec);
1112 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1114 /* Update vectorial force */
1115 fix2 = _fjsp_madd_v2r8(dx23,fscal,fix2);
1116 fiy2 = _fjsp_madd_v2r8(dy23,fscal,fiy2);
1117 fiz2 = _fjsp_madd_v2r8(dz23,fscal,fiz2);
1119 fjx3 = _fjsp_madd_v2r8(dx23,fscal,fjx3);
1120 fjy3 = _fjsp_madd_v2r8(dy23,fscal,fjy3);
1121 fjz3 = _fjsp_madd_v2r8(dz23,fscal,fjz3);
1123 /**************************
1124 * CALCULATE INTERACTIONS *
1125 **************************/
1127 r31 = _fjsp_mul_v2r8(rsq31,rinv31);
1129 /* EWALD ELECTROSTATICS */
1131 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1132 ewrt = _fjsp_mul_v2r8(r31,ewtabscale);
1133 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1134 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1135 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1137 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
1138 ewtabD = _fjsp_setzero_v2r8();
1139 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
1140 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
1141 ewtabFn = _fjsp_setzero_v2r8();
1142 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
1143 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
1144 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
1145 velec = _fjsp_mul_v2r8(qq31,_fjsp_sub_v2r8(rinv31,velec));
1146 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq31,rinv31),_fjsp_sub_v2r8(rinvsq31,felec));
1148 /* Update potential sum for this i atom from the interaction with this j atom. */
1149 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1150 velecsum = _fjsp_add_v2r8(velecsum,velec);
1154 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1156 /* Update vectorial force */
1157 fix3 = _fjsp_madd_v2r8(dx31,fscal,fix3);
1158 fiy3 = _fjsp_madd_v2r8(dy31,fscal,fiy3);
1159 fiz3 = _fjsp_madd_v2r8(dz31,fscal,fiz3);
1161 fjx1 = _fjsp_madd_v2r8(dx31,fscal,fjx1);
1162 fjy1 = _fjsp_madd_v2r8(dy31,fscal,fjy1);
1163 fjz1 = _fjsp_madd_v2r8(dz31,fscal,fjz1);
1165 /**************************
1166 * CALCULATE INTERACTIONS *
1167 **************************/
1169 r32 = _fjsp_mul_v2r8(rsq32,rinv32);
1171 /* EWALD ELECTROSTATICS */
1173 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1174 ewrt = _fjsp_mul_v2r8(r32,ewtabscale);
1175 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1176 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1177 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1179 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
1180 ewtabD = _fjsp_setzero_v2r8();
1181 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
1182 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
1183 ewtabFn = _fjsp_setzero_v2r8();
1184 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
1185 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
1186 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
1187 velec = _fjsp_mul_v2r8(qq32,_fjsp_sub_v2r8(rinv32,velec));
1188 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq32,rinv32),_fjsp_sub_v2r8(rinvsq32,felec));
1190 /* Update potential sum for this i atom from the interaction with this j atom. */
1191 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1192 velecsum = _fjsp_add_v2r8(velecsum,velec);
1196 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1198 /* Update vectorial force */
1199 fix3 = _fjsp_madd_v2r8(dx32,fscal,fix3);
1200 fiy3 = _fjsp_madd_v2r8(dy32,fscal,fiy3);
1201 fiz3 = _fjsp_madd_v2r8(dz32,fscal,fiz3);
1203 fjx2 = _fjsp_madd_v2r8(dx32,fscal,fjx2);
1204 fjy2 = _fjsp_madd_v2r8(dy32,fscal,fjy2);
1205 fjz2 = _fjsp_madd_v2r8(dz32,fscal,fjz2);
1207 /**************************
1208 * CALCULATE INTERACTIONS *
1209 **************************/
1211 r33 = _fjsp_mul_v2r8(rsq33,rinv33);
1213 /* EWALD ELECTROSTATICS */
1215 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1216 ewrt = _fjsp_mul_v2r8(r33,ewtabscale);
1217 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1218 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1219 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1221 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
1222 ewtabD = _fjsp_setzero_v2r8();
1223 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
1224 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
1225 ewtabFn = _fjsp_setzero_v2r8();
1226 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
1227 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
1228 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
1229 velec = _fjsp_mul_v2r8(qq33,_fjsp_sub_v2r8(rinv33,velec));
1230 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq33,rinv33),_fjsp_sub_v2r8(rinvsq33,felec));
1232 /* Update potential sum for this i atom from the interaction with this j atom. */
1233 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1234 velecsum = _fjsp_add_v2r8(velecsum,velec);
1238 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1240 /* Update vectorial force */
1241 fix3 = _fjsp_madd_v2r8(dx33,fscal,fix3);
1242 fiy3 = _fjsp_madd_v2r8(dy33,fscal,fiy3);
1243 fiz3 = _fjsp_madd_v2r8(dz33,fscal,fiz3);
1245 fjx3 = _fjsp_madd_v2r8(dx33,fscal,fjx3);
1246 fjy3 = _fjsp_madd_v2r8(dy33,fscal,fjy3);
1247 fjz3 = _fjsp_madd_v2r8(dz33,fscal,fjz3);
1249 gmx_fjsp_decrement_4rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2,fjx3,fjy3,fjz3);
1251 /* Inner loop uses 458 flops */
1254 /* End of innermost loop */
1256 gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
1257 f+i_coord_offset,fshift+i_shift_offset);
1260 /* Update potential energies */
1261 gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
1262 gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
1264 /* Increment number of inner iterations */
1265 inneriter += j_index_end - j_index_start;
1267 /* Outer loop uses 26 flops */
1270 /* Increment number of outer iterations */
1273 /* Update outer/inner flops */
1275 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4W4_VF,outeriter*26 + inneriter*458);
1278 * Gromacs nonbonded kernel: nb_kernel_ElecEw_VdwCSTab_GeomW4W4_F_sparc64_hpc_ace_double
1279 * Electrostatics interaction: Ewald
1280 * VdW interaction: CubicSplineTable
1281 * Geometry: Water4-Water4
1282 * Calculate force/pot: Force
1285 nb_kernel_ElecEw_VdwCSTab_GeomW4W4_F_sparc64_hpc_ace_double
1286 (t_nblist * gmx_restrict nlist,
1287 rvec * gmx_restrict xx,
1288 rvec * gmx_restrict ff,
1289 t_forcerec * gmx_restrict fr,
1290 t_mdatoms * gmx_restrict mdatoms,
1291 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
1292 t_nrnb * gmx_restrict nrnb)
1294 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
1295 * just 0 for non-waters.
1296 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
1297 * jnr indices corresponding to data put in the four positions in the SIMD register.
1299 int i_shift_offset,i_coord_offset,outeriter,inneriter;
1300 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
1302 int j_coord_offsetA,j_coord_offsetB;
1303 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
1304 real rcutoff_scalar;
1305 real *shiftvec,*fshift,*x,*f;
1306 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
1308 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
1310 _fjsp_v2r8 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
1312 _fjsp_v2r8 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
1314 _fjsp_v2r8 ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
1315 int vdwjidx0A,vdwjidx0B;
1316 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
1317 int vdwjidx1A,vdwjidx1B;
1318 _fjsp_v2r8 jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
1319 int vdwjidx2A,vdwjidx2B;
1320 _fjsp_v2r8 jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
1321 int vdwjidx3A,vdwjidx3B;
1322 _fjsp_v2r8 jx3,jy3,jz3,fjx3,fjy3,fjz3,jq3,isaj3;
1323 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
1324 _fjsp_v2r8 dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11;
1325 _fjsp_v2r8 dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12;
1326 _fjsp_v2r8 dx13,dy13,dz13,rsq13,rinv13,rinvsq13,r13,qq13,c6_13,c12_13;
1327 _fjsp_v2r8 dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21;
1328 _fjsp_v2r8 dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22;
1329 _fjsp_v2r8 dx23,dy23,dz23,rsq23,rinv23,rinvsq23,r23,qq23,c6_23,c12_23;
1330 _fjsp_v2r8 dx31,dy31,dz31,rsq31,rinv31,rinvsq31,r31,qq31,c6_31,c12_31;
1331 _fjsp_v2r8 dx32,dy32,dz32,rsq32,rinv32,rinvsq32,r32,qq32,c6_32,c12_32;
1332 _fjsp_v2r8 dx33,dy33,dz33,rsq33,rinv33,rinvsq33,r33,qq33,c6_33,c12_33;
1333 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
1336 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
1339 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
1340 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
1341 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
1343 _fjsp_v2r8 ewtabscale,eweps,sh_ewald,ewrt,ewtabhalfspace,ewtabF,ewtabFn,ewtabD,ewtabV;
1345 _fjsp_v2r8 itab_tmp;
1346 _fjsp_v2r8 dummy_mask,cutoff_mask;
1347 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
1348 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
1349 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
1356 jindex = nlist->jindex;
1358 shiftidx = nlist->shift;
1360 shiftvec = fr->shift_vec[0];
1361 fshift = fr->fshift[0];
1362 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
1363 charge = mdatoms->chargeA;
1364 nvdwtype = fr->ntype;
1365 vdwparam = fr->nbfp;
1366 vdwtype = mdatoms->typeA;
1368 vftab = kernel_data->table_vdw->data;
1369 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
1371 sh_ewald = gmx_fjsp_set1_v2r8(fr->ic->sh_ewald);
1372 ewtab = fr->ic->tabq_coul_F;
1373 ewtabscale = gmx_fjsp_set1_v2r8(fr->ic->tabq_scale);
1374 ewtabhalfspace = gmx_fjsp_set1_v2r8(0.5/fr->ic->tabq_scale);
1376 /* Setup water-specific parameters */
1377 inr = nlist->iinr[0];
1378 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
1379 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
1380 iq3 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+3]));
1381 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
1383 jq1 = gmx_fjsp_set1_v2r8(charge[inr+1]);
1384 jq2 = gmx_fjsp_set1_v2r8(charge[inr+2]);
1385 jq3 = gmx_fjsp_set1_v2r8(charge[inr+3]);
1386 vdwjidx0A = 2*vdwtype[inr+0];
1387 c6_00 = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A]);
1388 c12_00 = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A+1]);
1389 qq11 = _fjsp_mul_v2r8(iq1,jq1);
1390 qq12 = _fjsp_mul_v2r8(iq1,jq2);
1391 qq13 = _fjsp_mul_v2r8(iq1,jq3);
1392 qq21 = _fjsp_mul_v2r8(iq2,jq1);
1393 qq22 = _fjsp_mul_v2r8(iq2,jq2);
1394 qq23 = _fjsp_mul_v2r8(iq2,jq3);
1395 qq31 = _fjsp_mul_v2r8(iq3,jq1);
1396 qq32 = _fjsp_mul_v2r8(iq3,jq2);
1397 qq33 = _fjsp_mul_v2r8(iq3,jq3);
1399 /* Avoid stupid compiler warnings */
1401 j_coord_offsetA = 0;
1402 j_coord_offsetB = 0;
1407 /* Start outer loop over neighborlists */
1408 for(iidx=0; iidx<nri; iidx++)
1410 /* Load shift vector for this list */
1411 i_shift_offset = DIM*shiftidx[iidx];
1413 /* Load limits for loop over neighbors */
1414 j_index_start = jindex[iidx];
1415 j_index_end = jindex[iidx+1];
1417 /* Get outer coordinate index */
1419 i_coord_offset = DIM*inr;
1421 /* Load i particle coords and add shift vector */
1422 gmx_fjsp_load_shift_and_4rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
1423 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
1425 fix0 = _fjsp_setzero_v2r8();
1426 fiy0 = _fjsp_setzero_v2r8();
1427 fiz0 = _fjsp_setzero_v2r8();
1428 fix1 = _fjsp_setzero_v2r8();
1429 fiy1 = _fjsp_setzero_v2r8();
1430 fiz1 = _fjsp_setzero_v2r8();
1431 fix2 = _fjsp_setzero_v2r8();
1432 fiy2 = _fjsp_setzero_v2r8();
1433 fiz2 = _fjsp_setzero_v2r8();
1434 fix3 = _fjsp_setzero_v2r8();
1435 fiy3 = _fjsp_setzero_v2r8();
1436 fiz3 = _fjsp_setzero_v2r8();
1438 /* Start inner kernel loop */
1439 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
1442 /* Get j neighbor index, and coordinate index */
1444 jnrB = jjnr[jidx+1];
1445 j_coord_offsetA = DIM*jnrA;
1446 j_coord_offsetB = DIM*jnrB;
1448 /* load j atom coordinates */
1449 gmx_fjsp_load_4rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
1450 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,
1451 &jy2,&jz2,&jx3,&jy3,&jz3);
1453 /* Calculate displacement vector */
1454 dx00 = _fjsp_sub_v2r8(ix0,jx0);
1455 dy00 = _fjsp_sub_v2r8(iy0,jy0);
1456 dz00 = _fjsp_sub_v2r8(iz0,jz0);
1457 dx11 = _fjsp_sub_v2r8(ix1,jx1);
1458 dy11 = _fjsp_sub_v2r8(iy1,jy1);
1459 dz11 = _fjsp_sub_v2r8(iz1,jz1);
1460 dx12 = _fjsp_sub_v2r8(ix1,jx2);
1461 dy12 = _fjsp_sub_v2r8(iy1,jy2);
1462 dz12 = _fjsp_sub_v2r8(iz1,jz2);
1463 dx13 = _fjsp_sub_v2r8(ix1,jx3);
1464 dy13 = _fjsp_sub_v2r8(iy1,jy3);
1465 dz13 = _fjsp_sub_v2r8(iz1,jz3);
1466 dx21 = _fjsp_sub_v2r8(ix2,jx1);
1467 dy21 = _fjsp_sub_v2r8(iy2,jy1);
1468 dz21 = _fjsp_sub_v2r8(iz2,jz1);
1469 dx22 = _fjsp_sub_v2r8(ix2,jx2);
1470 dy22 = _fjsp_sub_v2r8(iy2,jy2);
1471 dz22 = _fjsp_sub_v2r8(iz2,jz2);
1472 dx23 = _fjsp_sub_v2r8(ix2,jx3);
1473 dy23 = _fjsp_sub_v2r8(iy2,jy3);
1474 dz23 = _fjsp_sub_v2r8(iz2,jz3);
1475 dx31 = _fjsp_sub_v2r8(ix3,jx1);
1476 dy31 = _fjsp_sub_v2r8(iy3,jy1);
1477 dz31 = _fjsp_sub_v2r8(iz3,jz1);
1478 dx32 = _fjsp_sub_v2r8(ix3,jx2);
1479 dy32 = _fjsp_sub_v2r8(iy3,jy2);
1480 dz32 = _fjsp_sub_v2r8(iz3,jz2);
1481 dx33 = _fjsp_sub_v2r8(ix3,jx3);
1482 dy33 = _fjsp_sub_v2r8(iy3,jy3);
1483 dz33 = _fjsp_sub_v2r8(iz3,jz3);
1485 /* Calculate squared distance and things based on it */
1486 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
1487 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
1488 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
1489 rsq13 = gmx_fjsp_calc_rsq_v2r8(dx13,dy13,dz13);
1490 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
1491 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
1492 rsq23 = gmx_fjsp_calc_rsq_v2r8(dx23,dy23,dz23);
1493 rsq31 = gmx_fjsp_calc_rsq_v2r8(dx31,dy31,dz31);
1494 rsq32 = gmx_fjsp_calc_rsq_v2r8(dx32,dy32,dz32);
1495 rsq33 = gmx_fjsp_calc_rsq_v2r8(dx33,dy33,dz33);
1497 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
1498 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
1499 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
1500 rinv13 = gmx_fjsp_invsqrt_v2r8(rsq13);
1501 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
1502 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
1503 rinv23 = gmx_fjsp_invsqrt_v2r8(rsq23);
1504 rinv31 = gmx_fjsp_invsqrt_v2r8(rsq31);
1505 rinv32 = gmx_fjsp_invsqrt_v2r8(rsq32);
1506 rinv33 = gmx_fjsp_invsqrt_v2r8(rsq33);
1508 rinvsq11 = _fjsp_mul_v2r8(rinv11,rinv11);
1509 rinvsq12 = _fjsp_mul_v2r8(rinv12,rinv12);
1510 rinvsq13 = _fjsp_mul_v2r8(rinv13,rinv13);
1511 rinvsq21 = _fjsp_mul_v2r8(rinv21,rinv21);
1512 rinvsq22 = _fjsp_mul_v2r8(rinv22,rinv22);
1513 rinvsq23 = _fjsp_mul_v2r8(rinv23,rinv23);
1514 rinvsq31 = _fjsp_mul_v2r8(rinv31,rinv31);
1515 rinvsq32 = _fjsp_mul_v2r8(rinv32,rinv32);
1516 rinvsq33 = _fjsp_mul_v2r8(rinv33,rinv33);
1518 fjx0 = _fjsp_setzero_v2r8();
1519 fjy0 = _fjsp_setzero_v2r8();
1520 fjz0 = _fjsp_setzero_v2r8();
1521 fjx1 = _fjsp_setzero_v2r8();
1522 fjy1 = _fjsp_setzero_v2r8();
1523 fjz1 = _fjsp_setzero_v2r8();
1524 fjx2 = _fjsp_setzero_v2r8();
1525 fjy2 = _fjsp_setzero_v2r8();
1526 fjz2 = _fjsp_setzero_v2r8();
1527 fjx3 = _fjsp_setzero_v2r8();
1528 fjy3 = _fjsp_setzero_v2r8();
1529 fjz3 = _fjsp_setzero_v2r8();
1531 /**************************
1532 * CALCULATE INTERACTIONS *
1533 **************************/
1535 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
1537 /* Calculate table index by multiplying r with table scale and truncate to integer */
1538 rt = _fjsp_mul_v2r8(r00,vftabscale);
1539 itab_tmp = _fjsp_dtox_v2r8(rt);
1540 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1541 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1542 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1547 /* CUBIC SPLINE TABLE DISPERSION */
1548 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1549 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
1550 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1551 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
1552 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
1553 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1554 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
1555 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
1556 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
1558 /* CUBIC SPLINE TABLE REPULSION */
1559 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
1560 F = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
1561 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1562 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
1563 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
1564 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1565 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
1566 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
1567 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
1568 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
1572 /* Update vectorial force */
1573 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
1574 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
1575 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
1577 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
1578 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
1579 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
1581 /**************************
1582 * CALCULATE INTERACTIONS *
1583 **************************/
1585 r11 = _fjsp_mul_v2r8(rsq11,rinv11);
1587 /* EWALD ELECTROSTATICS */
1589 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1590 ewrt = _fjsp_mul_v2r8(r11,ewtabscale);
1591 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1592 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1593 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1595 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1597 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1598 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq11,rinv11),_fjsp_sub_v2r8(rinvsq11,felec));
1602 /* Update vectorial force */
1603 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
1604 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
1605 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
1607 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
1608 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
1609 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
1611 /**************************
1612 * CALCULATE INTERACTIONS *
1613 **************************/
1615 r12 = _fjsp_mul_v2r8(rsq12,rinv12);
1617 /* EWALD ELECTROSTATICS */
1619 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1620 ewrt = _fjsp_mul_v2r8(r12,ewtabscale);
1621 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1622 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1623 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1625 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1627 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1628 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq12,rinv12),_fjsp_sub_v2r8(rinvsq12,felec));
1632 /* Update vectorial force */
1633 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
1634 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
1635 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
1637 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
1638 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
1639 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
1641 /**************************
1642 * CALCULATE INTERACTIONS *
1643 **************************/
1645 r13 = _fjsp_mul_v2r8(rsq13,rinv13);
1647 /* EWALD ELECTROSTATICS */
1649 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1650 ewrt = _fjsp_mul_v2r8(r13,ewtabscale);
1651 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1652 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1653 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1655 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1657 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1658 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq13,rinv13),_fjsp_sub_v2r8(rinvsq13,felec));
1662 /* Update vectorial force */
1663 fix1 = _fjsp_madd_v2r8(dx13,fscal,fix1);
1664 fiy1 = _fjsp_madd_v2r8(dy13,fscal,fiy1);
1665 fiz1 = _fjsp_madd_v2r8(dz13,fscal,fiz1);
1667 fjx3 = _fjsp_madd_v2r8(dx13,fscal,fjx3);
1668 fjy3 = _fjsp_madd_v2r8(dy13,fscal,fjy3);
1669 fjz3 = _fjsp_madd_v2r8(dz13,fscal,fjz3);
1671 /**************************
1672 * CALCULATE INTERACTIONS *
1673 **************************/
1675 r21 = _fjsp_mul_v2r8(rsq21,rinv21);
1677 /* EWALD ELECTROSTATICS */
1679 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1680 ewrt = _fjsp_mul_v2r8(r21,ewtabscale);
1681 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1682 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1683 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1685 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1687 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1688 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq21,rinv21),_fjsp_sub_v2r8(rinvsq21,felec));
1692 /* Update vectorial force */
1693 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
1694 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
1695 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
1697 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
1698 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
1699 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
1701 /**************************
1702 * CALCULATE INTERACTIONS *
1703 **************************/
1705 r22 = _fjsp_mul_v2r8(rsq22,rinv22);
1707 /* EWALD ELECTROSTATICS */
1709 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1710 ewrt = _fjsp_mul_v2r8(r22,ewtabscale);
1711 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1712 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1713 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1715 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1717 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1718 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq22,rinv22),_fjsp_sub_v2r8(rinvsq22,felec));
1722 /* Update vectorial force */
1723 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
1724 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
1725 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
1727 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
1728 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
1729 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
1731 /**************************
1732 * CALCULATE INTERACTIONS *
1733 **************************/
1735 r23 = _fjsp_mul_v2r8(rsq23,rinv23);
1737 /* EWALD ELECTROSTATICS */
1739 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1740 ewrt = _fjsp_mul_v2r8(r23,ewtabscale);
1741 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1742 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1743 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1745 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1747 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1748 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq23,rinv23),_fjsp_sub_v2r8(rinvsq23,felec));
1752 /* Update vectorial force */
1753 fix2 = _fjsp_madd_v2r8(dx23,fscal,fix2);
1754 fiy2 = _fjsp_madd_v2r8(dy23,fscal,fiy2);
1755 fiz2 = _fjsp_madd_v2r8(dz23,fscal,fiz2);
1757 fjx3 = _fjsp_madd_v2r8(dx23,fscal,fjx3);
1758 fjy3 = _fjsp_madd_v2r8(dy23,fscal,fjy3);
1759 fjz3 = _fjsp_madd_v2r8(dz23,fscal,fjz3);
1761 /**************************
1762 * CALCULATE INTERACTIONS *
1763 **************************/
1765 r31 = _fjsp_mul_v2r8(rsq31,rinv31);
1767 /* EWALD ELECTROSTATICS */
1769 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1770 ewrt = _fjsp_mul_v2r8(r31,ewtabscale);
1771 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1772 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1773 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1775 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1777 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1778 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq31,rinv31),_fjsp_sub_v2r8(rinvsq31,felec));
1782 /* Update vectorial force */
1783 fix3 = _fjsp_madd_v2r8(dx31,fscal,fix3);
1784 fiy3 = _fjsp_madd_v2r8(dy31,fscal,fiy3);
1785 fiz3 = _fjsp_madd_v2r8(dz31,fscal,fiz3);
1787 fjx1 = _fjsp_madd_v2r8(dx31,fscal,fjx1);
1788 fjy1 = _fjsp_madd_v2r8(dy31,fscal,fjy1);
1789 fjz1 = _fjsp_madd_v2r8(dz31,fscal,fjz1);
1791 /**************************
1792 * CALCULATE INTERACTIONS *
1793 **************************/
1795 r32 = _fjsp_mul_v2r8(rsq32,rinv32);
1797 /* EWALD ELECTROSTATICS */
1799 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1800 ewrt = _fjsp_mul_v2r8(r32,ewtabscale);
1801 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1802 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1803 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1805 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1807 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1808 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq32,rinv32),_fjsp_sub_v2r8(rinvsq32,felec));
1812 /* Update vectorial force */
1813 fix3 = _fjsp_madd_v2r8(dx32,fscal,fix3);
1814 fiy3 = _fjsp_madd_v2r8(dy32,fscal,fiy3);
1815 fiz3 = _fjsp_madd_v2r8(dz32,fscal,fiz3);
1817 fjx2 = _fjsp_madd_v2r8(dx32,fscal,fjx2);
1818 fjy2 = _fjsp_madd_v2r8(dy32,fscal,fjy2);
1819 fjz2 = _fjsp_madd_v2r8(dz32,fscal,fjz2);
1821 /**************************
1822 * CALCULATE INTERACTIONS *
1823 **************************/
1825 r33 = _fjsp_mul_v2r8(rsq33,rinv33);
1827 /* EWALD ELECTROSTATICS */
1829 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1830 ewrt = _fjsp_mul_v2r8(r33,ewtabscale);
1831 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1832 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1833 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1835 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1837 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1838 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq33,rinv33),_fjsp_sub_v2r8(rinvsq33,felec));
1842 /* Update vectorial force */
1843 fix3 = _fjsp_madd_v2r8(dx33,fscal,fix3);
1844 fiy3 = _fjsp_madd_v2r8(dy33,fscal,fiy3);
1845 fiz3 = _fjsp_madd_v2r8(dz33,fscal,fiz3);
1847 fjx3 = _fjsp_madd_v2r8(dx33,fscal,fjx3);
1848 fjy3 = _fjsp_madd_v2r8(dy33,fscal,fjy3);
1849 fjz3 = _fjsp_madd_v2r8(dz33,fscal,fjz3);
1851 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);
1853 /* Inner loop uses 405 flops */
1856 if(jidx<j_index_end)
1860 j_coord_offsetA = DIM*jnrA;
1862 /* load j atom coordinates */
1863 gmx_fjsp_load_4rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
1864 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,
1865 &jy2,&jz2,&jx3,&jy3,&jz3);
1867 /* Calculate displacement vector */
1868 dx00 = _fjsp_sub_v2r8(ix0,jx0);
1869 dy00 = _fjsp_sub_v2r8(iy0,jy0);
1870 dz00 = _fjsp_sub_v2r8(iz0,jz0);
1871 dx11 = _fjsp_sub_v2r8(ix1,jx1);
1872 dy11 = _fjsp_sub_v2r8(iy1,jy1);
1873 dz11 = _fjsp_sub_v2r8(iz1,jz1);
1874 dx12 = _fjsp_sub_v2r8(ix1,jx2);
1875 dy12 = _fjsp_sub_v2r8(iy1,jy2);
1876 dz12 = _fjsp_sub_v2r8(iz1,jz2);
1877 dx13 = _fjsp_sub_v2r8(ix1,jx3);
1878 dy13 = _fjsp_sub_v2r8(iy1,jy3);
1879 dz13 = _fjsp_sub_v2r8(iz1,jz3);
1880 dx21 = _fjsp_sub_v2r8(ix2,jx1);
1881 dy21 = _fjsp_sub_v2r8(iy2,jy1);
1882 dz21 = _fjsp_sub_v2r8(iz2,jz1);
1883 dx22 = _fjsp_sub_v2r8(ix2,jx2);
1884 dy22 = _fjsp_sub_v2r8(iy2,jy2);
1885 dz22 = _fjsp_sub_v2r8(iz2,jz2);
1886 dx23 = _fjsp_sub_v2r8(ix2,jx3);
1887 dy23 = _fjsp_sub_v2r8(iy2,jy3);
1888 dz23 = _fjsp_sub_v2r8(iz2,jz3);
1889 dx31 = _fjsp_sub_v2r8(ix3,jx1);
1890 dy31 = _fjsp_sub_v2r8(iy3,jy1);
1891 dz31 = _fjsp_sub_v2r8(iz3,jz1);
1892 dx32 = _fjsp_sub_v2r8(ix3,jx2);
1893 dy32 = _fjsp_sub_v2r8(iy3,jy2);
1894 dz32 = _fjsp_sub_v2r8(iz3,jz2);
1895 dx33 = _fjsp_sub_v2r8(ix3,jx3);
1896 dy33 = _fjsp_sub_v2r8(iy3,jy3);
1897 dz33 = _fjsp_sub_v2r8(iz3,jz3);
1899 /* Calculate squared distance and things based on it */
1900 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
1901 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
1902 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
1903 rsq13 = gmx_fjsp_calc_rsq_v2r8(dx13,dy13,dz13);
1904 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
1905 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
1906 rsq23 = gmx_fjsp_calc_rsq_v2r8(dx23,dy23,dz23);
1907 rsq31 = gmx_fjsp_calc_rsq_v2r8(dx31,dy31,dz31);
1908 rsq32 = gmx_fjsp_calc_rsq_v2r8(dx32,dy32,dz32);
1909 rsq33 = gmx_fjsp_calc_rsq_v2r8(dx33,dy33,dz33);
1911 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
1912 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
1913 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
1914 rinv13 = gmx_fjsp_invsqrt_v2r8(rsq13);
1915 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
1916 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
1917 rinv23 = gmx_fjsp_invsqrt_v2r8(rsq23);
1918 rinv31 = gmx_fjsp_invsqrt_v2r8(rsq31);
1919 rinv32 = gmx_fjsp_invsqrt_v2r8(rsq32);
1920 rinv33 = gmx_fjsp_invsqrt_v2r8(rsq33);
1922 rinvsq11 = _fjsp_mul_v2r8(rinv11,rinv11);
1923 rinvsq12 = _fjsp_mul_v2r8(rinv12,rinv12);
1924 rinvsq13 = _fjsp_mul_v2r8(rinv13,rinv13);
1925 rinvsq21 = _fjsp_mul_v2r8(rinv21,rinv21);
1926 rinvsq22 = _fjsp_mul_v2r8(rinv22,rinv22);
1927 rinvsq23 = _fjsp_mul_v2r8(rinv23,rinv23);
1928 rinvsq31 = _fjsp_mul_v2r8(rinv31,rinv31);
1929 rinvsq32 = _fjsp_mul_v2r8(rinv32,rinv32);
1930 rinvsq33 = _fjsp_mul_v2r8(rinv33,rinv33);
1932 fjx0 = _fjsp_setzero_v2r8();
1933 fjy0 = _fjsp_setzero_v2r8();
1934 fjz0 = _fjsp_setzero_v2r8();
1935 fjx1 = _fjsp_setzero_v2r8();
1936 fjy1 = _fjsp_setzero_v2r8();
1937 fjz1 = _fjsp_setzero_v2r8();
1938 fjx2 = _fjsp_setzero_v2r8();
1939 fjy2 = _fjsp_setzero_v2r8();
1940 fjz2 = _fjsp_setzero_v2r8();
1941 fjx3 = _fjsp_setzero_v2r8();
1942 fjy3 = _fjsp_setzero_v2r8();
1943 fjz3 = _fjsp_setzero_v2r8();
1945 /**************************
1946 * CALCULATE INTERACTIONS *
1947 **************************/
1949 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
1951 /* Calculate table index by multiplying r with table scale and truncate to integer */
1952 rt = _fjsp_mul_v2r8(r00,vftabscale);
1953 itab_tmp = _fjsp_dtox_v2r8(rt);
1954 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1955 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1956 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1961 /* CUBIC SPLINE TABLE DISPERSION */
1962 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1963 F = _fjsp_setzero_v2r8();
1964 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1965 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
1966 H = _fjsp_setzero_v2r8();
1967 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1968 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
1969 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
1970 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
1972 /* CUBIC SPLINE TABLE REPULSION */
1973 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
1974 F = _fjsp_setzero_v2r8();
1975 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1976 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
1977 H = _fjsp_setzero_v2r8();
1978 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1979 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
1980 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
1981 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
1982 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
1986 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1988 /* Update vectorial force */
1989 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
1990 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
1991 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
1993 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
1994 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
1995 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
1997 /**************************
1998 * CALCULATE INTERACTIONS *
1999 **************************/
2001 r11 = _fjsp_mul_v2r8(rsq11,rinv11);
2003 /* EWALD ELECTROSTATICS */
2005 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
2006 ewrt = _fjsp_mul_v2r8(r11,ewtabscale);
2007 itab_tmp = _fjsp_dtox_v2r8(ewrt);
2008 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
2009 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
2011 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
2012 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
2013 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq11,rinv11),_fjsp_sub_v2r8(rinvsq11,felec));
2017 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2019 /* Update vectorial force */
2020 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
2021 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
2022 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
2024 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
2025 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
2026 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
2028 /**************************
2029 * CALCULATE INTERACTIONS *
2030 **************************/
2032 r12 = _fjsp_mul_v2r8(rsq12,rinv12);
2034 /* EWALD ELECTROSTATICS */
2036 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
2037 ewrt = _fjsp_mul_v2r8(r12,ewtabscale);
2038 itab_tmp = _fjsp_dtox_v2r8(ewrt);
2039 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
2040 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
2042 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
2043 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
2044 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq12,rinv12),_fjsp_sub_v2r8(rinvsq12,felec));
2048 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2050 /* Update vectorial force */
2051 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
2052 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
2053 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
2055 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
2056 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
2057 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
2059 /**************************
2060 * CALCULATE INTERACTIONS *
2061 **************************/
2063 r13 = _fjsp_mul_v2r8(rsq13,rinv13);
2065 /* EWALD ELECTROSTATICS */
2067 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
2068 ewrt = _fjsp_mul_v2r8(r13,ewtabscale);
2069 itab_tmp = _fjsp_dtox_v2r8(ewrt);
2070 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
2071 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
2073 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
2074 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
2075 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq13,rinv13),_fjsp_sub_v2r8(rinvsq13,felec));
2079 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2081 /* Update vectorial force */
2082 fix1 = _fjsp_madd_v2r8(dx13,fscal,fix1);
2083 fiy1 = _fjsp_madd_v2r8(dy13,fscal,fiy1);
2084 fiz1 = _fjsp_madd_v2r8(dz13,fscal,fiz1);
2086 fjx3 = _fjsp_madd_v2r8(dx13,fscal,fjx3);
2087 fjy3 = _fjsp_madd_v2r8(dy13,fscal,fjy3);
2088 fjz3 = _fjsp_madd_v2r8(dz13,fscal,fjz3);
2090 /**************************
2091 * CALCULATE INTERACTIONS *
2092 **************************/
2094 r21 = _fjsp_mul_v2r8(rsq21,rinv21);
2096 /* EWALD ELECTROSTATICS */
2098 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
2099 ewrt = _fjsp_mul_v2r8(r21,ewtabscale);
2100 itab_tmp = _fjsp_dtox_v2r8(ewrt);
2101 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
2102 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
2104 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
2105 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
2106 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq21,rinv21),_fjsp_sub_v2r8(rinvsq21,felec));
2110 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2112 /* Update vectorial force */
2113 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
2114 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
2115 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
2117 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
2118 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
2119 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
2121 /**************************
2122 * CALCULATE INTERACTIONS *
2123 **************************/
2125 r22 = _fjsp_mul_v2r8(rsq22,rinv22);
2127 /* EWALD ELECTROSTATICS */
2129 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
2130 ewrt = _fjsp_mul_v2r8(r22,ewtabscale);
2131 itab_tmp = _fjsp_dtox_v2r8(ewrt);
2132 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
2133 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
2135 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
2136 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
2137 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq22,rinv22),_fjsp_sub_v2r8(rinvsq22,felec));
2141 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2143 /* Update vectorial force */
2144 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
2145 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
2146 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
2148 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
2149 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
2150 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
2152 /**************************
2153 * CALCULATE INTERACTIONS *
2154 **************************/
2156 r23 = _fjsp_mul_v2r8(rsq23,rinv23);
2158 /* EWALD ELECTROSTATICS */
2160 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
2161 ewrt = _fjsp_mul_v2r8(r23,ewtabscale);
2162 itab_tmp = _fjsp_dtox_v2r8(ewrt);
2163 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
2164 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
2166 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
2167 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
2168 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq23,rinv23),_fjsp_sub_v2r8(rinvsq23,felec));
2172 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2174 /* Update vectorial force */
2175 fix2 = _fjsp_madd_v2r8(dx23,fscal,fix2);
2176 fiy2 = _fjsp_madd_v2r8(dy23,fscal,fiy2);
2177 fiz2 = _fjsp_madd_v2r8(dz23,fscal,fiz2);
2179 fjx3 = _fjsp_madd_v2r8(dx23,fscal,fjx3);
2180 fjy3 = _fjsp_madd_v2r8(dy23,fscal,fjy3);
2181 fjz3 = _fjsp_madd_v2r8(dz23,fscal,fjz3);
2183 /**************************
2184 * CALCULATE INTERACTIONS *
2185 **************************/
2187 r31 = _fjsp_mul_v2r8(rsq31,rinv31);
2189 /* EWALD ELECTROSTATICS */
2191 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
2192 ewrt = _fjsp_mul_v2r8(r31,ewtabscale);
2193 itab_tmp = _fjsp_dtox_v2r8(ewrt);
2194 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
2195 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
2197 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
2198 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
2199 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq31,rinv31),_fjsp_sub_v2r8(rinvsq31,felec));
2203 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2205 /* Update vectorial force */
2206 fix3 = _fjsp_madd_v2r8(dx31,fscal,fix3);
2207 fiy3 = _fjsp_madd_v2r8(dy31,fscal,fiy3);
2208 fiz3 = _fjsp_madd_v2r8(dz31,fscal,fiz3);
2210 fjx1 = _fjsp_madd_v2r8(dx31,fscal,fjx1);
2211 fjy1 = _fjsp_madd_v2r8(dy31,fscal,fjy1);
2212 fjz1 = _fjsp_madd_v2r8(dz31,fscal,fjz1);
2214 /**************************
2215 * CALCULATE INTERACTIONS *
2216 **************************/
2218 r32 = _fjsp_mul_v2r8(rsq32,rinv32);
2220 /* EWALD ELECTROSTATICS */
2222 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
2223 ewrt = _fjsp_mul_v2r8(r32,ewtabscale);
2224 itab_tmp = _fjsp_dtox_v2r8(ewrt);
2225 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
2226 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
2228 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
2229 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
2230 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq32,rinv32),_fjsp_sub_v2r8(rinvsq32,felec));
2234 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2236 /* Update vectorial force */
2237 fix3 = _fjsp_madd_v2r8(dx32,fscal,fix3);
2238 fiy3 = _fjsp_madd_v2r8(dy32,fscal,fiy3);
2239 fiz3 = _fjsp_madd_v2r8(dz32,fscal,fiz3);
2241 fjx2 = _fjsp_madd_v2r8(dx32,fscal,fjx2);
2242 fjy2 = _fjsp_madd_v2r8(dy32,fscal,fjy2);
2243 fjz2 = _fjsp_madd_v2r8(dz32,fscal,fjz2);
2245 /**************************
2246 * CALCULATE INTERACTIONS *
2247 **************************/
2249 r33 = _fjsp_mul_v2r8(rsq33,rinv33);
2251 /* EWALD ELECTROSTATICS */
2253 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
2254 ewrt = _fjsp_mul_v2r8(r33,ewtabscale);
2255 itab_tmp = _fjsp_dtox_v2r8(ewrt);
2256 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
2257 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
2259 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
2260 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
2261 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq33,rinv33),_fjsp_sub_v2r8(rinvsq33,felec));
2265 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2267 /* Update vectorial force */
2268 fix3 = _fjsp_madd_v2r8(dx33,fscal,fix3);
2269 fiy3 = _fjsp_madd_v2r8(dy33,fscal,fiy3);
2270 fiz3 = _fjsp_madd_v2r8(dz33,fscal,fiz3);
2272 fjx3 = _fjsp_madd_v2r8(dx33,fscal,fjx3);
2273 fjy3 = _fjsp_madd_v2r8(dy33,fscal,fjy3);
2274 fjz3 = _fjsp_madd_v2r8(dz33,fscal,fjz3);
2276 gmx_fjsp_decrement_4rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2,fjx3,fjy3,fjz3);
2278 /* Inner loop uses 405 flops */
2281 /* End of innermost loop */
2283 gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
2284 f+i_coord_offset,fshift+i_shift_offset);
2286 /* Increment number of inner iterations */
2287 inneriter += j_index_end - j_index_start;
2289 /* Outer loop uses 24 flops */
2292 /* Increment number of outer iterations */
2295 /* Update outer/inner flops */
2297 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4W4_F,outeriter*24 + inneriter*405);