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_ElecEw_VdwCSTab_GeomW3W3_VF_sparc64_hpc_ace_double
53 * Electrostatics interaction: Ewald
54 * VdW interaction: CubicSplineTable
55 * Geometry: Water3-Water3
56 * Calculate force/pot: PotentialAndForce
59 nb_kernel_ElecEw_VdwCSTab_GeomW3W3_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;
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 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
94 _fjsp_v2r8 dx01,dy01,dz01,rsq01,rinv01,rinvsq01,r01,qq01,c6_01,c12_01;
95 _fjsp_v2r8 dx02,dy02,dz02,rsq02,rinv02,rinvsq02,r02,qq02,c6_02,c12_02;
96 _fjsp_v2r8 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
97 _fjsp_v2r8 dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11;
98 _fjsp_v2r8 dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12;
99 _fjsp_v2r8 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
100 _fjsp_v2r8 dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21;
101 _fjsp_v2r8 dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22;
102 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
105 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
108 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
109 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
110 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
112 _fjsp_v2r8 ewtabscale,eweps,sh_ewald,ewrt,ewtabhalfspace,ewtabF,ewtabFn,ewtabD,ewtabV;
115 _fjsp_v2r8 dummy_mask,cutoff_mask;
116 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
117 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
118 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
125 jindex = nlist->jindex;
127 shiftidx = nlist->shift;
129 shiftvec = fr->shift_vec[0];
130 fshift = fr->fshift[0];
131 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
132 charge = mdatoms->chargeA;
133 nvdwtype = fr->ntype;
135 vdwtype = mdatoms->typeA;
137 vftab = kernel_data->table_vdw->data;
138 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
140 sh_ewald = gmx_fjsp_set1_v2r8(fr->ic->sh_ewald);
141 ewtab = fr->ic->tabq_coul_FDV0;
142 ewtabscale = gmx_fjsp_set1_v2r8(fr->ic->tabq_scale);
143 ewtabhalfspace = gmx_fjsp_set1_v2r8(0.5/fr->ic->tabq_scale);
145 /* Setup water-specific parameters */
146 inr = nlist->iinr[0];
147 iq0 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+0]));
148 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
149 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
150 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
152 jq0 = gmx_fjsp_set1_v2r8(charge[inr+0]);
153 jq1 = gmx_fjsp_set1_v2r8(charge[inr+1]);
154 jq2 = gmx_fjsp_set1_v2r8(charge[inr+2]);
155 vdwjidx0A = 2*vdwtype[inr+0];
156 qq00 = _fjsp_mul_v2r8(iq0,jq0);
157 c6_00 = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A]);
158 c12_00 = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A+1]);
159 qq01 = _fjsp_mul_v2r8(iq0,jq1);
160 qq02 = _fjsp_mul_v2r8(iq0,jq2);
161 qq10 = _fjsp_mul_v2r8(iq1,jq0);
162 qq11 = _fjsp_mul_v2r8(iq1,jq1);
163 qq12 = _fjsp_mul_v2r8(iq1,jq2);
164 qq20 = _fjsp_mul_v2r8(iq2,jq0);
165 qq21 = _fjsp_mul_v2r8(iq2,jq1);
166 qq22 = _fjsp_mul_v2r8(iq2,jq2);
168 /* Avoid stupid compiler warnings */
176 /* Start outer loop over neighborlists */
177 for(iidx=0; iidx<nri; iidx++)
179 /* Load shift vector for this list */
180 i_shift_offset = DIM*shiftidx[iidx];
182 /* Load limits for loop over neighbors */
183 j_index_start = jindex[iidx];
184 j_index_end = jindex[iidx+1];
186 /* Get outer coordinate index */
188 i_coord_offset = DIM*inr;
190 /* Load i particle coords and add shift vector */
191 gmx_fjsp_load_shift_and_3rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
192 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2);
194 fix0 = _fjsp_setzero_v2r8();
195 fiy0 = _fjsp_setzero_v2r8();
196 fiz0 = _fjsp_setzero_v2r8();
197 fix1 = _fjsp_setzero_v2r8();
198 fiy1 = _fjsp_setzero_v2r8();
199 fiz1 = _fjsp_setzero_v2r8();
200 fix2 = _fjsp_setzero_v2r8();
201 fiy2 = _fjsp_setzero_v2r8();
202 fiz2 = _fjsp_setzero_v2r8();
204 /* Reset potential sums */
205 velecsum = _fjsp_setzero_v2r8();
206 vvdwsum = _fjsp_setzero_v2r8();
208 /* Start inner kernel loop */
209 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
212 /* Get j neighbor index, and coordinate index */
215 j_coord_offsetA = DIM*jnrA;
216 j_coord_offsetB = DIM*jnrB;
218 /* load j atom coordinates */
219 gmx_fjsp_load_3rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
220 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,&jy2,&jz2);
222 /* Calculate displacement vector */
223 dx00 = _fjsp_sub_v2r8(ix0,jx0);
224 dy00 = _fjsp_sub_v2r8(iy0,jy0);
225 dz00 = _fjsp_sub_v2r8(iz0,jz0);
226 dx01 = _fjsp_sub_v2r8(ix0,jx1);
227 dy01 = _fjsp_sub_v2r8(iy0,jy1);
228 dz01 = _fjsp_sub_v2r8(iz0,jz1);
229 dx02 = _fjsp_sub_v2r8(ix0,jx2);
230 dy02 = _fjsp_sub_v2r8(iy0,jy2);
231 dz02 = _fjsp_sub_v2r8(iz0,jz2);
232 dx10 = _fjsp_sub_v2r8(ix1,jx0);
233 dy10 = _fjsp_sub_v2r8(iy1,jy0);
234 dz10 = _fjsp_sub_v2r8(iz1,jz0);
235 dx11 = _fjsp_sub_v2r8(ix1,jx1);
236 dy11 = _fjsp_sub_v2r8(iy1,jy1);
237 dz11 = _fjsp_sub_v2r8(iz1,jz1);
238 dx12 = _fjsp_sub_v2r8(ix1,jx2);
239 dy12 = _fjsp_sub_v2r8(iy1,jy2);
240 dz12 = _fjsp_sub_v2r8(iz1,jz2);
241 dx20 = _fjsp_sub_v2r8(ix2,jx0);
242 dy20 = _fjsp_sub_v2r8(iy2,jy0);
243 dz20 = _fjsp_sub_v2r8(iz2,jz0);
244 dx21 = _fjsp_sub_v2r8(ix2,jx1);
245 dy21 = _fjsp_sub_v2r8(iy2,jy1);
246 dz21 = _fjsp_sub_v2r8(iz2,jz1);
247 dx22 = _fjsp_sub_v2r8(ix2,jx2);
248 dy22 = _fjsp_sub_v2r8(iy2,jy2);
249 dz22 = _fjsp_sub_v2r8(iz2,jz2);
251 /* Calculate squared distance and things based on it */
252 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
253 rsq01 = gmx_fjsp_calc_rsq_v2r8(dx01,dy01,dz01);
254 rsq02 = gmx_fjsp_calc_rsq_v2r8(dx02,dy02,dz02);
255 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
256 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
257 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
258 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
259 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
260 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
262 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
263 rinv01 = gmx_fjsp_invsqrt_v2r8(rsq01);
264 rinv02 = gmx_fjsp_invsqrt_v2r8(rsq02);
265 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
266 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
267 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
268 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
269 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
270 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
272 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
273 rinvsq01 = _fjsp_mul_v2r8(rinv01,rinv01);
274 rinvsq02 = _fjsp_mul_v2r8(rinv02,rinv02);
275 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
276 rinvsq11 = _fjsp_mul_v2r8(rinv11,rinv11);
277 rinvsq12 = _fjsp_mul_v2r8(rinv12,rinv12);
278 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
279 rinvsq21 = _fjsp_mul_v2r8(rinv21,rinv21);
280 rinvsq22 = _fjsp_mul_v2r8(rinv22,rinv22);
282 fjx0 = _fjsp_setzero_v2r8();
283 fjy0 = _fjsp_setzero_v2r8();
284 fjz0 = _fjsp_setzero_v2r8();
285 fjx1 = _fjsp_setzero_v2r8();
286 fjy1 = _fjsp_setzero_v2r8();
287 fjz1 = _fjsp_setzero_v2r8();
288 fjx2 = _fjsp_setzero_v2r8();
289 fjy2 = _fjsp_setzero_v2r8();
290 fjz2 = _fjsp_setzero_v2r8();
292 /**************************
293 * CALCULATE INTERACTIONS *
294 **************************/
296 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
298 /* Calculate table index by multiplying r with table scale and truncate to integer */
299 rt = _fjsp_mul_v2r8(r00,vftabscale);
300 itab_tmp = _fjsp_dtox_v2r8(rt);
301 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
302 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
303 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
308 /* EWALD ELECTROSTATICS */
310 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
311 ewrt = _fjsp_mul_v2r8(r00,ewtabscale);
312 itab_tmp = _fjsp_dtox_v2r8(ewrt);
313 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
314 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
316 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
317 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
318 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
319 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
320 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
321 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
322 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
323 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
324 velec = _fjsp_mul_v2r8(qq00,_fjsp_sub_v2r8(rinv00,velec));
325 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq00,rinv00),_fjsp_sub_v2r8(rinvsq00,felec));
327 /* CUBIC SPLINE TABLE DISPERSION */
328 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
329 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
330 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
331 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
332 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
333 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
334 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
335 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
336 vvdw6 = _fjsp_mul_v2r8(c6_00,VV);
337 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
338 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
340 /* CUBIC SPLINE TABLE REPULSION */
341 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
342 F = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
343 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
344 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
345 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
346 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
347 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
348 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
349 vvdw12 = _fjsp_mul_v2r8(c12_00,VV);
350 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
351 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
352 vvdw = _fjsp_add_v2r8(vvdw12,vvdw6);
353 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
355 /* Update potential sum for this i atom from the interaction with this j atom. */
356 velecsum = _fjsp_add_v2r8(velecsum,velec);
357 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
359 fscal = _fjsp_add_v2r8(felec,fvdw);
361 /* Update vectorial force */
362 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
363 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
364 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
366 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
367 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
368 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
370 /**************************
371 * CALCULATE INTERACTIONS *
372 **************************/
374 r01 = _fjsp_mul_v2r8(rsq01,rinv01);
376 /* EWALD ELECTROSTATICS */
378 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
379 ewrt = _fjsp_mul_v2r8(r01,ewtabscale);
380 itab_tmp = _fjsp_dtox_v2r8(ewrt);
381 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
382 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
384 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
385 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
386 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
387 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
388 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
389 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
390 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
391 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
392 velec = _fjsp_mul_v2r8(qq01,_fjsp_sub_v2r8(rinv01,velec));
393 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq01,rinv01),_fjsp_sub_v2r8(rinvsq01,felec));
395 /* Update potential sum for this i atom from the interaction with this j atom. */
396 velecsum = _fjsp_add_v2r8(velecsum,velec);
400 /* Update vectorial force */
401 fix0 = _fjsp_madd_v2r8(dx01,fscal,fix0);
402 fiy0 = _fjsp_madd_v2r8(dy01,fscal,fiy0);
403 fiz0 = _fjsp_madd_v2r8(dz01,fscal,fiz0);
405 fjx1 = _fjsp_madd_v2r8(dx01,fscal,fjx1);
406 fjy1 = _fjsp_madd_v2r8(dy01,fscal,fjy1);
407 fjz1 = _fjsp_madd_v2r8(dz01,fscal,fjz1);
409 /**************************
410 * CALCULATE INTERACTIONS *
411 **************************/
413 r02 = _fjsp_mul_v2r8(rsq02,rinv02);
415 /* EWALD ELECTROSTATICS */
417 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
418 ewrt = _fjsp_mul_v2r8(r02,ewtabscale);
419 itab_tmp = _fjsp_dtox_v2r8(ewrt);
420 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
421 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
423 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
424 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
425 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
426 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
427 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
428 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
429 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
430 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
431 velec = _fjsp_mul_v2r8(qq02,_fjsp_sub_v2r8(rinv02,velec));
432 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq02,rinv02),_fjsp_sub_v2r8(rinvsq02,felec));
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 fix0 = _fjsp_madd_v2r8(dx02,fscal,fix0);
441 fiy0 = _fjsp_madd_v2r8(dy02,fscal,fiy0);
442 fiz0 = _fjsp_madd_v2r8(dz02,fscal,fiz0);
444 fjx2 = _fjsp_madd_v2r8(dx02,fscal,fjx2);
445 fjy2 = _fjsp_madd_v2r8(dy02,fscal,fjy2);
446 fjz2 = _fjsp_madd_v2r8(dz02,fscal,fjz2);
448 /**************************
449 * CALCULATE INTERACTIONS *
450 **************************/
452 r10 = _fjsp_mul_v2r8(rsq10,rinv10);
454 /* EWALD ELECTROSTATICS */
456 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
457 ewrt = _fjsp_mul_v2r8(r10,ewtabscale);
458 itab_tmp = _fjsp_dtox_v2r8(ewrt);
459 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
460 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
462 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
463 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
464 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
465 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
466 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
467 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
468 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
469 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
470 velec = _fjsp_mul_v2r8(qq10,_fjsp_sub_v2r8(rinv10,velec));
471 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,rinv10),_fjsp_sub_v2r8(rinvsq10,felec));
473 /* Update potential sum for this i atom from the interaction with this j atom. */
474 velecsum = _fjsp_add_v2r8(velecsum,velec);
478 /* Update vectorial force */
479 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
480 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
481 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
483 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
484 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
485 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
487 /**************************
488 * CALCULATE INTERACTIONS *
489 **************************/
491 r11 = _fjsp_mul_v2r8(rsq11,rinv11);
493 /* EWALD ELECTROSTATICS */
495 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
496 ewrt = _fjsp_mul_v2r8(r11,ewtabscale);
497 itab_tmp = _fjsp_dtox_v2r8(ewrt);
498 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
499 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
501 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
502 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
503 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
504 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
505 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
506 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
507 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
508 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
509 velec = _fjsp_mul_v2r8(qq11,_fjsp_sub_v2r8(rinv11,velec));
510 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq11,rinv11),_fjsp_sub_v2r8(rinvsq11,felec));
512 /* Update potential sum for this i atom from the interaction with this j atom. */
513 velecsum = _fjsp_add_v2r8(velecsum,velec);
517 /* Update vectorial force */
518 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
519 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
520 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
522 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
523 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
524 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
526 /**************************
527 * CALCULATE INTERACTIONS *
528 **************************/
530 r12 = _fjsp_mul_v2r8(rsq12,rinv12);
532 /* EWALD ELECTROSTATICS */
534 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
535 ewrt = _fjsp_mul_v2r8(r12,ewtabscale);
536 itab_tmp = _fjsp_dtox_v2r8(ewrt);
537 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
538 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
540 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
541 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
542 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
543 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
544 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
545 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
546 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
547 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
548 velec = _fjsp_mul_v2r8(qq12,_fjsp_sub_v2r8(rinv12,velec));
549 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq12,rinv12),_fjsp_sub_v2r8(rinvsq12,felec));
551 /* Update potential sum for this i atom from the interaction with this j atom. */
552 velecsum = _fjsp_add_v2r8(velecsum,velec);
556 /* Update vectorial force */
557 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
558 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
559 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
561 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
562 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
563 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
565 /**************************
566 * CALCULATE INTERACTIONS *
567 **************************/
569 r20 = _fjsp_mul_v2r8(rsq20,rinv20);
571 /* EWALD ELECTROSTATICS */
573 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
574 ewrt = _fjsp_mul_v2r8(r20,ewtabscale);
575 itab_tmp = _fjsp_dtox_v2r8(ewrt);
576 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
577 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
579 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
580 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
581 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
582 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
583 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
584 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
585 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
586 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
587 velec = _fjsp_mul_v2r8(qq20,_fjsp_sub_v2r8(rinv20,velec));
588 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,rinv20),_fjsp_sub_v2r8(rinvsq20,felec));
590 /* Update potential sum for this i atom from the interaction with this j atom. */
591 velecsum = _fjsp_add_v2r8(velecsum,velec);
595 /* Update vectorial force */
596 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
597 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
598 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
600 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
601 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
602 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
604 /**************************
605 * CALCULATE INTERACTIONS *
606 **************************/
608 r21 = _fjsp_mul_v2r8(rsq21,rinv21);
610 /* EWALD ELECTROSTATICS */
612 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
613 ewrt = _fjsp_mul_v2r8(r21,ewtabscale);
614 itab_tmp = _fjsp_dtox_v2r8(ewrt);
615 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
616 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
618 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
619 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
620 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
621 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
622 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
623 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
624 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
625 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
626 velec = _fjsp_mul_v2r8(qq21,_fjsp_sub_v2r8(rinv21,velec));
627 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq21,rinv21),_fjsp_sub_v2r8(rinvsq21,felec));
629 /* Update potential sum for this i atom from the interaction with this j atom. */
630 velecsum = _fjsp_add_v2r8(velecsum,velec);
634 /* Update vectorial force */
635 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
636 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
637 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
639 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
640 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
641 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
643 /**************************
644 * CALCULATE INTERACTIONS *
645 **************************/
647 r22 = _fjsp_mul_v2r8(rsq22,rinv22);
649 /* EWALD ELECTROSTATICS */
651 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
652 ewrt = _fjsp_mul_v2r8(r22,ewtabscale);
653 itab_tmp = _fjsp_dtox_v2r8(ewrt);
654 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
655 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
657 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
658 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
659 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
660 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
661 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
662 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
663 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
664 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
665 velec = _fjsp_mul_v2r8(qq22,_fjsp_sub_v2r8(rinv22,velec));
666 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq22,rinv22),_fjsp_sub_v2r8(rinvsq22,felec));
668 /* Update potential sum for this i atom from the interaction with this j atom. */
669 velecsum = _fjsp_add_v2r8(velecsum,velec);
673 /* Update vectorial force */
674 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
675 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
676 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
678 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
679 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
680 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
682 gmx_fjsp_decrement_3rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2);
684 /* Inner loop uses 430 flops */
691 j_coord_offsetA = DIM*jnrA;
693 /* load j atom coordinates */
694 gmx_fjsp_load_3rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
695 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,&jy2,&jz2);
697 /* Calculate displacement vector */
698 dx00 = _fjsp_sub_v2r8(ix0,jx0);
699 dy00 = _fjsp_sub_v2r8(iy0,jy0);
700 dz00 = _fjsp_sub_v2r8(iz0,jz0);
701 dx01 = _fjsp_sub_v2r8(ix0,jx1);
702 dy01 = _fjsp_sub_v2r8(iy0,jy1);
703 dz01 = _fjsp_sub_v2r8(iz0,jz1);
704 dx02 = _fjsp_sub_v2r8(ix0,jx2);
705 dy02 = _fjsp_sub_v2r8(iy0,jy2);
706 dz02 = _fjsp_sub_v2r8(iz0,jz2);
707 dx10 = _fjsp_sub_v2r8(ix1,jx0);
708 dy10 = _fjsp_sub_v2r8(iy1,jy0);
709 dz10 = _fjsp_sub_v2r8(iz1,jz0);
710 dx11 = _fjsp_sub_v2r8(ix1,jx1);
711 dy11 = _fjsp_sub_v2r8(iy1,jy1);
712 dz11 = _fjsp_sub_v2r8(iz1,jz1);
713 dx12 = _fjsp_sub_v2r8(ix1,jx2);
714 dy12 = _fjsp_sub_v2r8(iy1,jy2);
715 dz12 = _fjsp_sub_v2r8(iz1,jz2);
716 dx20 = _fjsp_sub_v2r8(ix2,jx0);
717 dy20 = _fjsp_sub_v2r8(iy2,jy0);
718 dz20 = _fjsp_sub_v2r8(iz2,jz0);
719 dx21 = _fjsp_sub_v2r8(ix2,jx1);
720 dy21 = _fjsp_sub_v2r8(iy2,jy1);
721 dz21 = _fjsp_sub_v2r8(iz2,jz1);
722 dx22 = _fjsp_sub_v2r8(ix2,jx2);
723 dy22 = _fjsp_sub_v2r8(iy2,jy2);
724 dz22 = _fjsp_sub_v2r8(iz2,jz2);
726 /* Calculate squared distance and things based on it */
727 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
728 rsq01 = gmx_fjsp_calc_rsq_v2r8(dx01,dy01,dz01);
729 rsq02 = gmx_fjsp_calc_rsq_v2r8(dx02,dy02,dz02);
730 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
731 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
732 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
733 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
734 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
735 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
737 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
738 rinv01 = gmx_fjsp_invsqrt_v2r8(rsq01);
739 rinv02 = gmx_fjsp_invsqrt_v2r8(rsq02);
740 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
741 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
742 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
743 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
744 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
745 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
747 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
748 rinvsq01 = _fjsp_mul_v2r8(rinv01,rinv01);
749 rinvsq02 = _fjsp_mul_v2r8(rinv02,rinv02);
750 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
751 rinvsq11 = _fjsp_mul_v2r8(rinv11,rinv11);
752 rinvsq12 = _fjsp_mul_v2r8(rinv12,rinv12);
753 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
754 rinvsq21 = _fjsp_mul_v2r8(rinv21,rinv21);
755 rinvsq22 = _fjsp_mul_v2r8(rinv22,rinv22);
757 fjx0 = _fjsp_setzero_v2r8();
758 fjy0 = _fjsp_setzero_v2r8();
759 fjz0 = _fjsp_setzero_v2r8();
760 fjx1 = _fjsp_setzero_v2r8();
761 fjy1 = _fjsp_setzero_v2r8();
762 fjz1 = _fjsp_setzero_v2r8();
763 fjx2 = _fjsp_setzero_v2r8();
764 fjy2 = _fjsp_setzero_v2r8();
765 fjz2 = _fjsp_setzero_v2r8();
767 /**************************
768 * CALCULATE INTERACTIONS *
769 **************************/
771 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
773 /* Calculate table index by multiplying r with table scale and truncate to integer */
774 rt = _fjsp_mul_v2r8(r00,vftabscale);
775 itab_tmp = _fjsp_dtox_v2r8(rt);
776 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
777 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
778 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
783 /* EWALD ELECTROSTATICS */
785 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
786 ewrt = _fjsp_mul_v2r8(r00,ewtabscale);
787 itab_tmp = _fjsp_dtox_v2r8(ewrt);
788 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
789 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
791 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
792 ewtabD = _fjsp_setzero_v2r8();
793 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
794 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
795 ewtabFn = _fjsp_setzero_v2r8();
796 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
797 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
798 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
799 velec = _fjsp_mul_v2r8(qq00,_fjsp_sub_v2r8(rinv00,velec));
800 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq00,rinv00),_fjsp_sub_v2r8(rinvsq00,felec));
802 /* CUBIC SPLINE TABLE DISPERSION */
803 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
804 F = _fjsp_setzero_v2r8();
805 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
806 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
807 H = _fjsp_setzero_v2r8();
808 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
809 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
810 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
811 vvdw6 = _fjsp_mul_v2r8(c6_00,VV);
812 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
813 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
815 /* CUBIC SPLINE TABLE REPULSION */
816 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
817 F = _fjsp_setzero_v2r8();
818 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
819 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
820 H = _fjsp_setzero_v2r8();
821 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
822 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
823 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
824 vvdw12 = _fjsp_mul_v2r8(c12_00,VV);
825 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
826 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
827 vvdw = _fjsp_add_v2r8(vvdw12,vvdw6);
828 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
830 /* Update potential sum for this i atom from the interaction with this j atom. */
831 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
832 velecsum = _fjsp_add_v2r8(velecsum,velec);
833 vvdw = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
834 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
836 fscal = _fjsp_add_v2r8(felec,fvdw);
838 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
840 /* Update vectorial force */
841 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
842 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
843 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
845 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
846 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
847 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
849 /**************************
850 * CALCULATE INTERACTIONS *
851 **************************/
853 r01 = _fjsp_mul_v2r8(rsq01,rinv01);
855 /* EWALD ELECTROSTATICS */
857 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
858 ewrt = _fjsp_mul_v2r8(r01,ewtabscale);
859 itab_tmp = _fjsp_dtox_v2r8(ewrt);
860 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
861 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
863 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
864 ewtabD = _fjsp_setzero_v2r8();
865 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
866 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
867 ewtabFn = _fjsp_setzero_v2r8();
868 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
869 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
870 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
871 velec = _fjsp_mul_v2r8(qq01,_fjsp_sub_v2r8(rinv01,velec));
872 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq01,rinv01),_fjsp_sub_v2r8(rinvsq01,felec));
874 /* Update potential sum for this i atom from the interaction with this j atom. */
875 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
876 velecsum = _fjsp_add_v2r8(velecsum,velec);
880 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
882 /* Update vectorial force */
883 fix0 = _fjsp_madd_v2r8(dx01,fscal,fix0);
884 fiy0 = _fjsp_madd_v2r8(dy01,fscal,fiy0);
885 fiz0 = _fjsp_madd_v2r8(dz01,fscal,fiz0);
887 fjx1 = _fjsp_madd_v2r8(dx01,fscal,fjx1);
888 fjy1 = _fjsp_madd_v2r8(dy01,fscal,fjy1);
889 fjz1 = _fjsp_madd_v2r8(dz01,fscal,fjz1);
891 /**************************
892 * CALCULATE INTERACTIONS *
893 **************************/
895 r02 = _fjsp_mul_v2r8(rsq02,rinv02);
897 /* EWALD ELECTROSTATICS */
899 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
900 ewrt = _fjsp_mul_v2r8(r02,ewtabscale);
901 itab_tmp = _fjsp_dtox_v2r8(ewrt);
902 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
903 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
905 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
906 ewtabD = _fjsp_setzero_v2r8();
907 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
908 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
909 ewtabFn = _fjsp_setzero_v2r8();
910 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
911 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
912 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
913 velec = _fjsp_mul_v2r8(qq02,_fjsp_sub_v2r8(rinv02,velec));
914 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq02,rinv02),_fjsp_sub_v2r8(rinvsq02,felec));
916 /* Update potential sum for this i atom from the interaction with this j atom. */
917 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
918 velecsum = _fjsp_add_v2r8(velecsum,velec);
922 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
924 /* Update vectorial force */
925 fix0 = _fjsp_madd_v2r8(dx02,fscal,fix0);
926 fiy0 = _fjsp_madd_v2r8(dy02,fscal,fiy0);
927 fiz0 = _fjsp_madd_v2r8(dz02,fscal,fiz0);
929 fjx2 = _fjsp_madd_v2r8(dx02,fscal,fjx2);
930 fjy2 = _fjsp_madd_v2r8(dy02,fscal,fjy2);
931 fjz2 = _fjsp_madd_v2r8(dz02,fscal,fjz2);
933 /**************************
934 * CALCULATE INTERACTIONS *
935 **************************/
937 r10 = _fjsp_mul_v2r8(rsq10,rinv10);
939 /* EWALD ELECTROSTATICS */
941 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
942 ewrt = _fjsp_mul_v2r8(r10,ewtabscale);
943 itab_tmp = _fjsp_dtox_v2r8(ewrt);
944 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
945 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
947 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
948 ewtabD = _fjsp_setzero_v2r8();
949 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
950 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
951 ewtabFn = _fjsp_setzero_v2r8();
952 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
953 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
954 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
955 velec = _fjsp_mul_v2r8(qq10,_fjsp_sub_v2r8(rinv10,velec));
956 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,rinv10),_fjsp_sub_v2r8(rinvsq10,felec));
958 /* Update potential sum for this i atom from the interaction with this j atom. */
959 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
960 velecsum = _fjsp_add_v2r8(velecsum,velec);
964 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
966 /* Update vectorial force */
967 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
968 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
969 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
971 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
972 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
973 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
975 /**************************
976 * CALCULATE INTERACTIONS *
977 **************************/
979 r11 = _fjsp_mul_v2r8(rsq11,rinv11);
981 /* EWALD ELECTROSTATICS */
983 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
984 ewrt = _fjsp_mul_v2r8(r11,ewtabscale);
985 itab_tmp = _fjsp_dtox_v2r8(ewrt);
986 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
987 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
989 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
990 ewtabD = _fjsp_setzero_v2r8();
991 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
992 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
993 ewtabFn = _fjsp_setzero_v2r8();
994 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
995 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
996 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
997 velec = _fjsp_mul_v2r8(qq11,_fjsp_sub_v2r8(rinv11,velec));
998 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq11,rinv11),_fjsp_sub_v2r8(rinvsq11,felec));
1000 /* Update potential sum for this i atom from the interaction with this j atom. */
1001 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1002 velecsum = _fjsp_add_v2r8(velecsum,velec);
1006 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1008 /* Update vectorial force */
1009 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
1010 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
1011 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
1013 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
1014 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
1015 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
1017 /**************************
1018 * CALCULATE INTERACTIONS *
1019 **************************/
1021 r12 = _fjsp_mul_v2r8(rsq12,rinv12);
1023 /* EWALD ELECTROSTATICS */
1025 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1026 ewrt = _fjsp_mul_v2r8(r12,ewtabscale);
1027 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1028 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1029 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1031 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
1032 ewtabD = _fjsp_setzero_v2r8();
1033 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
1034 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
1035 ewtabFn = _fjsp_setzero_v2r8();
1036 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
1037 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
1038 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
1039 velec = _fjsp_mul_v2r8(qq12,_fjsp_sub_v2r8(rinv12,velec));
1040 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq12,rinv12),_fjsp_sub_v2r8(rinvsq12,felec));
1042 /* Update potential sum for this i atom from the interaction with this j atom. */
1043 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1044 velecsum = _fjsp_add_v2r8(velecsum,velec);
1048 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1050 /* Update vectorial force */
1051 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
1052 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
1053 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
1055 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
1056 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
1057 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
1059 /**************************
1060 * CALCULATE INTERACTIONS *
1061 **************************/
1063 r20 = _fjsp_mul_v2r8(rsq20,rinv20);
1065 /* EWALD ELECTROSTATICS */
1067 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1068 ewrt = _fjsp_mul_v2r8(r20,ewtabscale);
1069 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1070 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1071 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1073 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
1074 ewtabD = _fjsp_setzero_v2r8();
1075 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
1076 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
1077 ewtabFn = _fjsp_setzero_v2r8();
1078 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
1079 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
1080 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
1081 velec = _fjsp_mul_v2r8(qq20,_fjsp_sub_v2r8(rinv20,velec));
1082 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,rinv20),_fjsp_sub_v2r8(rinvsq20,felec));
1084 /* Update potential sum for this i atom from the interaction with this j atom. */
1085 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1086 velecsum = _fjsp_add_v2r8(velecsum,velec);
1090 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1092 /* Update vectorial force */
1093 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
1094 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
1095 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
1097 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
1098 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
1099 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
1101 /**************************
1102 * CALCULATE INTERACTIONS *
1103 **************************/
1105 r21 = _fjsp_mul_v2r8(rsq21,rinv21);
1107 /* EWALD ELECTROSTATICS */
1109 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1110 ewrt = _fjsp_mul_v2r8(r21,ewtabscale);
1111 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1112 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1113 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1115 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
1116 ewtabD = _fjsp_setzero_v2r8();
1117 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
1118 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
1119 ewtabFn = _fjsp_setzero_v2r8();
1120 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
1121 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
1122 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
1123 velec = _fjsp_mul_v2r8(qq21,_fjsp_sub_v2r8(rinv21,velec));
1124 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq21,rinv21),_fjsp_sub_v2r8(rinvsq21,felec));
1126 /* Update potential sum for this i atom from the interaction with this j atom. */
1127 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1128 velecsum = _fjsp_add_v2r8(velecsum,velec);
1132 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1134 /* Update vectorial force */
1135 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
1136 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
1137 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
1139 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
1140 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
1141 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
1143 /**************************
1144 * CALCULATE INTERACTIONS *
1145 **************************/
1147 r22 = _fjsp_mul_v2r8(rsq22,rinv22);
1149 /* EWALD ELECTROSTATICS */
1151 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1152 ewrt = _fjsp_mul_v2r8(r22,ewtabscale);
1153 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1154 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1155 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1157 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
1158 ewtabD = _fjsp_setzero_v2r8();
1159 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
1160 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
1161 ewtabFn = _fjsp_setzero_v2r8();
1162 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
1163 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
1164 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
1165 velec = _fjsp_mul_v2r8(qq22,_fjsp_sub_v2r8(rinv22,velec));
1166 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq22,rinv22),_fjsp_sub_v2r8(rinvsq22,felec));
1168 /* Update potential sum for this i atom from the interaction with this j atom. */
1169 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1170 velecsum = _fjsp_add_v2r8(velecsum,velec);
1174 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1176 /* Update vectorial force */
1177 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
1178 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
1179 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
1181 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
1182 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
1183 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
1185 gmx_fjsp_decrement_3rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2);
1187 /* Inner loop uses 430 flops */
1190 /* End of innermost loop */
1192 gmx_fjsp_update_iforce_3atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,
1193 f+i_coord_offset,fshift+i_shift_offset);
1196 /* Update potential energies */
1197 gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
1198 gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
1200 /* Increment number of inner iterations */
1201 inneriter += j_index_end - j_index_start;
1203 /* Outer loop uses 20 flops */
1206 /* Increment number of outer iterations */
1209 /* Update outer/inner flops */
1211 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3W3_VF,outeriter*20 + inneriter*430);
1214 * Gromacs nonbonded kernel: nb_kernel_ElecEw_VdwCSTab_GeomW3W3_F_sparc64_hpc_ace_double
1215 * Electrostatics interaction: Ewald
1216 * VdW interaction: CubicSplineTable
1217 * Geometry: Water3-Water3
1218 * Calculate force/pot: Force
1221 nb_kernel_ElecEw_VdwCSTab_GeomW3W3_F_sparc64_hpc_ace_double
1222 (t_nblist * gmx_restrict nlist,
1223 rvec * gmx_restrict xx,
1224 rvec * gmx_restrict ff,
1225 t_forcerec * gmx_restrict fr,
1226 t_mdatoms * gmx_restrict mdatoms,
1227 nb_kernel_data_t * gmx_restrict kernel_data,
1228 t_nrnb * gmx_restrict nrnb)
1230 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
1231 * just 0 for non-waters.
1232 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
1233 * jnr indices corresponding to data put in the four positions in the SIMD register.
1235 int i_shift_offset,i_coord_offset,outeriter,inneriter;
1236 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
1238 int j_coord_offsetA,j_coord_offsetB;
1239 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
1240 real rcutoff_scalar;
1241 real *shiftvec,*fshift,*x,*f;
1242 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
1244 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
1246 _fjsp_v2r8 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
1248 _fjsp_v2r8 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
1249 int vdwjidx0A,vdwjidx0B;
1250 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
1251 int vdwjidx1A,vdwjidx1B;
1252 _fjsp_v2r8 jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
1253 int vdwjidx2A,vdwjidx2B;
1254 _fjsp_v2r8 jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
1255 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
1256 _fjsp_v2r8 dx01,dy01,dz01,rsq01,rinv01,rinvsq01,r01,qq01,c6_01,c12_01;
1257 _fjsp_v2r8 dx02,dy02,dz02,rsq02,rinv02,rinvsq02,r02,qq02,c6_02,c12_02;
1258 _fjsp_v2r8 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
1259 _fjsp_v2r8 dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11;
1260 _fjsp_v2r8 dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12;
1261 _fjsp_v2r8 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
1262 _fjsp_v2r8 dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21;
1263 _fjsp_v2r8 dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22;
1264 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
1267 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
1270 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
1271 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
1272 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
1274 _fjsp_v2r8 ewtabscale,eweps,sh_ewald,ewrt,ewtabhalfspace,ewtabF,ewtabFn,ewtabD,ewtabV;
1276 _fjsp_v2r8 itab_tmp;
1277 _fjsp_v2r8 dummy_mask,cutoff_mask;
1278 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
1279 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
1280 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
1287 jindex = nlist->jindex;
1289 shiftidx = nlist->shift;
1291 shiftvec = fr->shift_vec[0];
1292 fshift = fr->fshift[0];
1293 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
1294 charge = mdatoms->chargeA;
1295 nvdwtype = fr->ntype;
1296 vdwparam = fr->nbfp;
1297 vdwtype = mdatoms->typeA;
1299 vftab = kernel_data->table_vdw->data;
1300 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
1302 sh_ewald = gmx_fjsp_set1_v2r8(fr->ic->sh_ewald);
1303 ewtab = fr->ic->tabq_coul_F;
1304 ewtabscale = gmx_fjsp_set1_v2r8(fr->ic->tabq_scale);
1305 ewtabhalfspace = gmx_fjsp_set1_v2r8(0.5/fr->ic->tabq_scale);
1307 /* Setup water-specific parameters */
1308 inr = nlist->iinr[0];
1309 iq0 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+0]));
1310 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
1311 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
1312 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
1314 jq0 = gmx_fjsp_set1_v2r8(charge[inr+0]);
1315 jq1 = gmx_fjsp_set1_v2r8(charge[inr+1]);
1316 jq2 = gmx_fjsp_set1_v2r8(charge[inr+2]);
1317 vdwjidx0A = 2*vdwtype[inr+0];
1318 qq00 = _fjsp_mul_v2r8(iq0,jq0);
1319 c6_00 = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A]);
1320 c12_00 = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A+1]);
1321 qq01 = _fjsp_mul_v2r8(iq0,jq1);
1322 qq02 = _fjsp_mul_v2r8(iq0,jq2);
1323 qq10 = _fjsp_mul_v2r8(iq1,jq0);
1324 qq11 = _fjsp_mul_v2r8(iq1,jq1);
1325 qq12 = _fjsp_mul_v2r8(iq1,jq2);
1326 qq20 = _fjsp_mul_v2r8(iq2,jq0);
1327 qq21 = _fjsp_mul_v2r8(iq2,jq1);
1328 qq22 = _fjsp_mul_v2r8(iq2,jq2);
1330 /* Avoid stupid compiler warnings */
1332 j_coord_offsetA = 0;
1333 j_coord_offsetB = 0;
1338 /* Start outer loop over neighborlists */
1339 for(iidx=0; iidx<nri; iidx++)
1341 /* Load shift vector for this list */
1342 i_shift_offset = DIM*shiftidx[iidx];
1344 /* Load limits for loop over neighbors */
1345 j_index_start = jindex[iidx];
1346 j_index_end = jindex[iidx+1];
1348 /* Get outer coordinate index */
1350 i_coord_offset = DIM*inr;
1352 /* Load i particle coords and add shift vector */
1353 gmx_fjsp_load_shift_and_3rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
1354 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2);
1356 fix0 = _fjsp_setzero_v2r8();
1357 fiy0 = _fjsp_setzero_v2r8();
1358 fiz0 = _fjsp_setzero_v2r8();
1359 fix1 = _fjsp_setzero_v2r8();
1360 fiy1 = _fjsp_setzero_v2r8();
1361 fiz1 = _fjsp_setzero_v2r8();
1362 fix2 = _fjsp_setzero_v2r8();
1363 fiy2 = _fjsp_setzero_v2r8();
1364 fiz2 = _fjsp_setzero_v2r8();
1366 /* Start inner kernel loop */
1367 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
1370 /* Get j neighbor index, and coordinate index */
1372 jnrB = jjnr[jidx+1];
1373 j_coord_offsetA = DIM*jnrA;
1374 j_coord_offsetB = DIM*jnrB;
1376 /* load j atom coordinates */
1377 gmx_fjsp_load_3rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
1378 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,&jy2,&jz2);
1380 /* Calculate displacement vector */
1381 dx00 = _fjsp_sub_v2r8(ix0,jx0);
1382 dy00 = _fjsp_sub_v2r8(iy0,jy0);
1383 dz00 = _fjsp_sub_v2r8(iz0,jz0);
1384 dx01 = _fjsp_sub_v2r8(ix0,jx1);
1385 dy01 = _fjsp_sub_v2r8(iy0,jy1);
1386 dz01 = _fjsp_sub_v2r8(iz0,jz1);
1387 dx02 = _fjsp_sub_v2r8(ix0,jx2);
1388 dy02 = _fjsp_sub_v2r8(iy0,jy2);
1389 dz02 = _fjsp_sub_v2r8(iz0,jz2);
1390 dx10 = _fjsp_sub_v2r8(ix1,jx0);
1391 dy10 = _fjsp_sub_v2r8(iy1,jy0);
1392 dz10 = _fjsp_sub_v2r8(iz1,jz0);
1393 dx11 = _fjsp_sub_v2r8(ix1,jx1);
1394 dy11 = _fjsp_sub_v2r8(iy1,jy1);
1395 dz11 = _fjsp_sub_v2r8(iz1,jz1);
1396 dx12 = _fjsp_sub_v2r8(ix1,jx2);
1397 dy12 = _fjsp_sub_v2r8(iy1,jy2);
1398 dz12 = _fjsp_sub_v2r8(iz1,jz2);
1399 dx20 = _fjsp_sub_v2r8(ix2,jx0);
1400 dy20 = _fjsp_sub_v2r8(iy2,jy0);
1401 dz20 = _fjsp_sub_v2r8(iz2,jz0);
1402 dx21 = _fjsp_sub_v2r8(ix2,jx1);
1403 dy21 = _fjsp_sub_v2r8(iy2,jy1);
1404 dz21 = _fjsp_sub_v2r8(iz2,jz1);
1405 dx22 = _fjsp_sub_v2r8(ix2,jx2);
1406 dy22 = _fjsp_sub_v2r8(iy2,jy2);
1407 dz22 = _fjsp_sub_v2r8(iz2,jz2);
1409 /* Calculate squared distance and things based on it */
1410 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
1411 rsq01 = gmx_fjsp_calc_rsq_v2r8(dx01,dy01,dz01);
1412 rsq02 = gmx_fjsp_calc_rsq_v2r8(dx02,dy02,dz02);
1413 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
1414 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
1415 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
1416 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
1417 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
1418 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
1420 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
1421 rinv01 = gmx_fjsp_invsqrt_v2r8(rsq01);
1422 rinv02 = gmx_fjsp_invsqrt_v2r8(rsq02);
1423 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
1424 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
1425 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
1426 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
1427 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
1428 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
1430 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
1431 rinvsq01 = _fjsp_mul_v2r8(rinv01,rinv01);
1432 rinvsq02 = _fjsp_mul_v2r8(rinv02,rinv02);
1433 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
1434 rinvsq11 = _fjsp_mul_v2r8(rinv11,rinv11);
1435 rinvsq12 = _fjsp_mul_v2r8(rinv12,rinv12);
1436 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
1437 rinvsq21 = _fjsp_mul_v2r8(rinv21,rinv21);
1438 rinvsq22 = _fjsp_mul_v2r8(rinv22,rinv22);
1440 fjx0 = _fjsp_setzero_v2r8();
1441 fjy0 = _fjsp_setzero_v2r8();
1442 fjz0 = _fjsp_setzero_v2r8();
1443 fjx1 = _fjsp_setzero_v2r8();
1444 fjy1 = _fjsp_setzero_v2r8();
1445 fjz1 = _fjsp_setzero_v2r8();
1446 fjx2 = _fjsp_setzero_v2r8();
1447 fjy2 = _fjsp_setzero_v2r8();
1448 fjz2 = _fjsp_setzero_v2r8();
1450 /**************************
1451 * CALCULATE INTERACTIONS *
1452 **************************/
1454 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
1456 /* Calculate table index by multiplying r with table scale and truncate to integer */
1457 rt = _fjsp_mul_v2r8(r00,vftabscale);
1458 itab_tmp = _fjsp_dtox_v2r8(rt);
1459 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1460 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1461 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1466 /* EWALD ELECTROSTATICS */
1468 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1469 ewrt = _fjsp_mul_v2r8(r00,ewtabscale);
1470 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1471 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1472 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1474 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1476 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1477 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq00,rinv00),_fjsp_sub_v2r8(rinvsq00,felec));
1479 /* CUBIC SPLINE TABLE DISPERSION */
1480 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1481 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
1482 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1483 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
1484 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
1485 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1486 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
1487 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
1488 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
1490 /* CUBIC SPLINE TABLE REPULSION */
1491 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
1492 F = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
1493 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1494 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
1495 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
1496 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1497 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
1498 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
1499 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
1500 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
1502 fscal = _fjsp_add_v2r8(felec,fvdw);
1504 /* Update vectorial force */
1505 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
1506 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
1507 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
1509 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
1510 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
1511 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
1513 /**************************
1514 * CALCULATE INTERACTIONS *
1515 **************************/
1517 r01 = _fjsp_mul_v2r8(rsq01,rinv01);
1519 /* EWALD ELECTROSTATICS */
1521 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1522 ewrt = _fjsp_mul_v2r8(r01,ewtabscale);
1523 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1524 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1525 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1527 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1529 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1530 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq01,rinv01),_fjsp_sub_v2r8(rinvsq01,felec));
1534 /* Update vectorial force */
1535 fix0 = _fjsp_madd_v2r8(dx01,fscal,fix0);
1536 fiy0 = _fjsp_madd_v2r8(dy01,fscal,fiy0);
1537 fiz0 = _fjsp_madd_v2r8(dz01,fscal,fiz0);
1539 fjx1 = _fjsp_madd_v2r8(dx01,fscal,fjx1);
1540 fjy1 = _fjsp_madd_v2r8(dy01,fscal,fjy1);
1541 fjz1 = _fjsp_madd_v2r8(dz01,fscal,fjz1);
1543 /**************************
1544 * CALCULATE INTERACTIONS *
1545 **************************/
1547 r02 = _fjsp_mul_v2r8(rsq02,rinv02);
1549 /* EWALD ELECTROSTATICS */
1551 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1552 ewrt = _fjsp_mul_v2r8(r02,ewtabscale);
1553 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1554 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1555 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1557 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1559 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1560 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq02,rinv02),_fjsp_sub_v2r8(rinvsq02,felec));
1564 /* Update vectorial force */
1565 fix0 = _fjsp_madd_v2r8(dx02,fscal,fix0);
1566 fiy0 = _fjsp_madd_v2r8(dy02,fscal,fiy0);
1567 fiz0 = _fjsp_madd_v2r8(dz02,fscal,fiz0);
1569 fjx2 = _fjsp_madd_v2r8(dx02,fscal,fjx2);
1570 fjy2 = _fjsp_madd_v2r8(dy02,fscal,fjy2);
1571 fjz2 = _fjsp_madd_v2r8(dz02,fscal,fjz2);
1573 /**************************
1574 * CALCULATE INTERACTIONS *
1575 **************************/
1577 r10 = _fjsp_mul_v2r8(rsq10,rinv10);
1579 /* EWALD ELECTROSTATICS */
1581 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1582 ewrt = _fjsp_mul_v2r8(r10,ewtabscale);
1583 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1584 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1585 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1587 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1589 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1590 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,rinv10),_fjsp_sub_v2r8(rinvsq10,felec));
1594 /* Update vectorial force */
1595 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
1596 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
1597 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
1599 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
1600 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
1601 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
1603 /**************************
1604 * CALCULATE INTERACTIONS *
1605 **************************/
1607 r11 = _fjsp_mul_v2r8(rsq11,rinv11);
1609 /* EWALD ELECTROSTATICS */
1611 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1612 ewrt = _fjsp_mul_v2r8(r11,ewtabscale);
1613 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1614 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1615 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1617 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1619 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1620 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq11,rinv11),_fjsp_sub_v2r8(rinvsq11,felec));
1624 /* Update vectorial force */
1625 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
1626 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
1627 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
1629 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
1630 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
1631 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
1633 /**************************
1634 * CALCULATE INTERACTIONS *
1635 **************************/
1637 r12 = _fjsp_mul_v2r8(rsq12,rinv12);
1639 /* EWALD ELECTROSTATICS */
1641 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1642 ewrt = _fjsp_mul_v2r8(r12,ewtabscale);
1643 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1644 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1645 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1647 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1649 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1650 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq12,rinv12),_fjsp_sub_v2r8(rinvsq12,felec));
1654 /* Update vectorial force */
1655 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
1656 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
1657 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
1659 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
1660 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
1661 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
1663 /**************************
1664 * CALCULATE INTERACTIONS *
1665 **************************/
1667 r20 = _fjsp_mul_v2r8(rsq20,rinv20);
1669 /* EWALD ELECTROSTATICS */
1671 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1672 ewrt = _fjsp_mul_v2r8(r20,ewtabscale);
1673 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1674 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1675 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1677 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1679 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1680 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,rinv20),_fjsp_sub_v2r8(rinvsq20,felec));
1684 /* Update vectorial force */
1685 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
1686 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
1687 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
1689 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
1690 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
1691 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
1693 /**************************
1694 * CALCULATE INTERACTIONS *
1695 **************************/
1697 r21 = _fjsp_mul_v2r8(rsq21,rinv21);
1699 /* EWALD ELECTROSTATICS */
1701 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1702 ewrt = _fjsp_mul_v2r8(r21,ewtabscale);
1703 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1704 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1705 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1707 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1709 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1710 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq21,rinv21),_fjsp_sub_v2r8(rinvsq21,felec));
1714 /* Update vectorial force */
1715 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
1716 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
1717 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
1719 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
1720 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
1721 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
1723 /**************************
1724 * CALCULATE INTERACTIONS *
1725 **************************/
1727 r22 = _fjsp_mul_v2r8(rsq22,rinv22);
1729 /* EWALD ELECTROSTATICS */
1731 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1732 ewrt = _fjsp_mul_v2r8(r22,ewtabscale);
1733 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1734 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1735 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1737 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1739 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1740 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq22,rinv22),_fjsp_sub_v2r8(rinvsq22,felec));
1744 /* Update vectorial force */
1745 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
1746 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
1747 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
1749 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
1750 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
1751 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
1753 gmx_fjsp_decrement_3rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2);
1755 /* Inner loop uses 377 flops */
1758 if(jidx<j_index_end)
1762 j_coord_offsetA = DIM*jnrA;
1764 /* load j atom coordinates */
1765 gmx_fjsp_load_3rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
1766 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,&jy2,&jz2);
1768 /* Calculate displacement vector */
1769 dx00 = _fjsp_sub_v2r8(ix0,jx0);
1770 dy00 = _fjsp_sub_v2r8(iy0,jy0);
1771 dz00 = _fjsp_sub_v2r8(iz0,jz0);
1772 dx01 = _fjsp_sub_v2r8(ix0,jx1);
1773 dy01 = _fjsp_sub_v2r8(iy0,jy1);
1774 dz01 = _fjsp_sub_v2r8(iz0,jz1);
1775 dx02 = _fjsp_sub_v2r8(ix0,jx2);
1776 dy02 = _fjsp_sub_v2r8(iy0,jy2);
1777 dz02 = _fjsp_sub_v2r8(iz0,jz2);
1778 dx10 = _fjsp_sub_v2r8(ix1,jx0);
1779 dy10 = _fjsp_sub_v2r8(iy1,jy0);
1780 dz10 = _fjsp_sub_v2r8(iz1,jz0);
1781 dx11 = _fjsp_sub_v2r8(ix1,jx1);
1782 dy11 = _fjsp_sub_v2r8(iy1,jy1);
1783 dz11 = _fjsp_sub_v2r8(iz1,jz1);
1784 dx12 = _fjsp_sub_v2r8(ix1,jx2);
1785 dy12 = _fjsp_sub_v2r8(iy1,jy2);
1786 dz12 = _fjsp_sub_v2r8(iz1,jz2);
1787 dx20 = _fjsp_sub_v2r8(ix2,jx0);
1788 dy20 = _fjsp_sub_v2r8(iy2,jy0);
1789 dz20 = _fjsp_sub_v2r8(iz2,jz0);
1790 dx21 = _fjsp_sub_v2r8(ix2,jx1);
1791 dy21 = _fjsp_sub_v2r8(iy2,jy1);
1792 dz21 = _fjsp_sub_v2r8(iz2,jz1);
1793 dx22 = _fjsp_sub_v2r8(ix2,jx2);
1794 dy22 = _fjsp_sub_v2r8(iy2,jy2);
1795 dz22 = _fjsp_sub_v2r8(iz2,jz2);
1797 /* Calculate squared distance and things based on it */
1798 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
1799 rsq01 = gmx_fjsp_calc_rsq_v2r8(dx01,dy01,dz01);
1800 rsq02 = gmx_fjsp_calc_rsq_v2r8(dx02,dy02,dz02);
1801 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
1802 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
1803 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
1804 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
1805 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
1806 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
1808 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
1809 rinv01 = gmx_fjsp_invsqrt_v2r8(rsq01);
1810 rinv02 = gmx_fjsp_invsqrt_v2r8(rsq02);
1811 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
1812 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
1813 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
1814 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
1815 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
1816 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
1818 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
1819 rinvsq01 = _fjsp_mul_v2r8(rinv01,rinv01);
1820 rinvsq02 = _fjsp_mul_v2r8(rinv02,rinv02);
1821 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
1822 rinvsq11 = _fjsp_mul_v2r8(rinv11,rinv11);
1823 rinvsq12 = _fjsp_mul_v2r8(rinv12,rinv12);
1824 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
1825 rinvsq21 = _fjsp_mul_v2r8(rinv21,rinv21);
1826 rinvsq22 = _fjsp_mul_v2r8(rinv22,rinv22);
1828 fjx0 = _fjsp_setzero_v2r8();
1829 fjy0 = _fjsp_setzero_v2r8();
1830 fjz0 = _fjsp_setzero_v2r8();
1831 fjx1 = _fjsp_setzero_v2r8();
1832 fjy1 = _fjsp_setzero_v2r8();
1833 fjz1 = _fjsp_setzero_v2r8();
1834 fjx2 = _fjsp_setzero_v2r8();
1835 fjy2 = _fjsp_setzero_v2r8();
1836 fjz2 = _fjsp_setzero_v2r8();
1838 /**************************
1839 * CALCULATE INTERACTIONS *
1840 **************************/
1842 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
1844 /* Calculate table index by multiplying r with table scale and truncate to integer */
1845 rt = _fjsp_mul_v2r8(r00,vftabscale);
1846 itab_tmp = _fjsp_dtox_v2r8(rt);
1847 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1848 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1849 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1854 /* EWALD ELECTROSTATICS */
1856 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1857 ewrt = _fjsp_mul_v2r8(r00,ewtabscale);
1858 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1859 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1860 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1862 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
1863 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1864 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq00,rinv00),_fjsp_sub_v2r8(rinvsq00,felec));
1866 /* CUBIC SPLINE TABLE DISPERSION */
1867 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1868 F = _fjsp_setzero_v2r8();
1869 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1870 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
1871 H = _fjsp_setzero_v2r8();
1872 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1873 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
1874 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
1875 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
1877 /* CUBIC SPLINE TABLE REPULSION */
1878 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
1879 F = _fjsp_setzero_v2r8();
1880 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1881 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
1882 H = _fjsp_setzero_v2r8();
1883 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1884 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
1885 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
1886 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
1887 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
1889 fscal = _fjsp_add_v2r8(felec,fvdw);
1891 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1893 /* Update vectorial force */
1894 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
1895 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
1896 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
1898 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
1899 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
1900 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
1902 /**************************
1903 * CALCULATE INTERACTIONS *
1904 **************************/
1906 r01 = _fjsp_mul_v2r8(rsq01,rinv01);
1908 /* EWALD ELECTROSTATICS */
1910 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1911 ewrt = _fjsp_mul_v2r8(r01,ewtabscale);
1912 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1913 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1914 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1916 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
1917 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1918 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq01,rinv01),_fjsp_sub_v2r8(rinvsq01,felec));
1922 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1924 /* Update vectorial force */
1925 fix0 = _fjsp_madd_v2r8(dx01,fscal,fix0);
1926 fiy0 = _fjsp_madd_v2r8(dy01,fscal,fiy0);
1927 fiz0 = _fjsp_madd_v2r8(dz01,fscal,fiz0);
1929 fjx1 = _fjsp_madd_v2r8(dx01,fscal,fjx1);
1930 fjy1 = _fjsp_madd_v2r8(dy01,fscal,fjy1);
1931 fjz1 = _fjsp_madd_v2r8(dz01,fscal,fjz1);
1933 /**************************
1934 * CALCULATE INTERACTIONS *
1935 **************************/
1937 r02 = _fjsp_mul_v2r8(rsq02,rinv02);
1939 /* EWALD ELECTROSTATICS */
1941 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1942 ewrt = _fjsp_mul_v2r8(r02,ewtabscale);
1943 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1944 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1945 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1947 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
1948 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1949 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq02,rinv02),_fjsp_sub_v2r8(rinvsq02,felec));
1953 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1955 /* Update vectorial force */
1956 fix0 = _fjsp_madd_v2r8(dx02,fscal,fix0);
1957 fiy0 = _fjsp_madd_v2r8(dy02,fscal,fiy0);
1958 fiz0 = _fjsp_madd_v2r8(dz02,fscal,fiz0);
1960 fjx2 = _fjsp_madd_v2r8(dx02,fscal,fjx2);
1961 fjy2 = _fjsp_madd_v2r8(dy02,fscal,fjy2);
1962 fjz2 = _fjsp_madd_v2r8(dz02,fscal,fjz2);
1964 /**************************
1965 * CALCULATE INTERACTIONS *
1966 **************************/
1968 r10 = _fjsp_mul_v2r8(rsq10,rinv10);
1970 /* EWALD ELECTROSTATICS */
1972 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1973 ewrt = _fjsp_mul_v2r8(r10,ewtabscale);
1974 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1975 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1976 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1978 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
1979 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1980 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,rinv10),_fjsp_sub_v2r8(rinvsq10,felec));
1984 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1986 /* Update vectorial force */
1987 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
1988 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
1989 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
1991 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
1992 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
1993 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
1995 /**************************
1996 * CALCULATE INTERACTIONS *
1997 **************************/
1999 r11 = _fjsp_mul_v2r8(rsq11,rinv11);
2001 /* EWALD ELECTROSTATICS */
2003 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
2004 ewrt = _fjsp_mul_v2r8(r11,ewtabscale);
2005 itab_tmp = _fjsp_dtox_v2r8(ewrt);
2006 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
2007 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
2009 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
2010 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
2011 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq11,rinv11),_fjsp_sub_v2r8(rinvsq11,felec));
2015 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2017 /* Update vectorial force */
2018 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
2019 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
2020 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
2022 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
2023 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
2024 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
2026 /**************************
2027 * CALCULATE INTERACTIONS *
2028 **************************/
2030 r12 = _fjsp_mul_v2r8(rsq12,rinv12);
2032 /* EWALD ELECTROSTATICS */
2034 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
2035 ewrt = _fjsp_mul_v2r8(r12,ewtabscale);
2036 itab_tmp = _fjsp_dtox_v2r8(ewrt);
2037 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
2038 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
2040 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
2041 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
2042 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq12,rinv12),_fjsp_sub_v2r8(rinvsq12,felec));
2046 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2048 /* Update vectorial force */
2049 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
2050 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
2051 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
2053 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
2054 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
2055 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
2057 /**************************
2058 * CALCULATE INTERACTIONS *
2059 **************************/
2061 r20 = _fjsp_mul_v2r8(rsq20,rinv20);
2063 /* EWALD ELECTROSTATICS */
2065 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
2066 ewrt = _fjsp_mul_v2r8(r20,ewtabscale);
2067 itab_tmp = _fjsp_dtox_v2r8(ewrt);
2068 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
2069 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
2071 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
2072 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
2073 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,rinv20),_fjsp_sub_v2r8(rinvsq20,felec));
2077 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2079 /* Update vectorial force */
2080 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
2081 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
2082 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
2084 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
2085 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
2086 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
2088 /**************************
2089 * CALCULATE INTERACTIONS *
2090 **************************/
2092 r21 = _fjsp_mul_v2r8(rsq21,rinv21);
2094 /* EWALD ELECTROSTATICS */
2096 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
2097 ewrt = _fjsp_mul_v2r8(r21,ewtabscale);
2098 itab_tmp = _fjsp_dtox_v2r8(ewrt);
2099 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
2100 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
2102 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
2103 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
2104 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq21,rinv21),_fjsp_sub_v2r8(rinvsq21,felec));
2108 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2110 /* Update vectorial force */
2111 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
2112 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
2113 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
2115 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
2116 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
2117 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
2119 /**************************
2120 * CALCULATE INTERACTIONS *
2121 **************************/
2123 r22 = _fjsp_mul_v2r8(rsq22,rinv22);
2125 /* EWALD ELECTROSTATICS */
2127 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
2128 ewrt = _fjsp_mul_v2r8(r22,ewtabscale);
2129 itab_tmp = _fjsp_dtox_v2r8(ewrt);
2130 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
2131 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
2133 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
2134 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
2135 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq22,rinv22),_fjsp_sub_v2r8(rinvsq22,felec));
2139 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2141 /* Update vectorial force */
2142 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
2143 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
2144 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
2146 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
2147 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
2148 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
2150 gmx_fjsp_decrement_3rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2);
2152 /* Inner loop uses 377 flops */
2155 /* End of innermost loop */
2157 gmx_fjsp_update_iforce_3atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,
2158 f+i_coord_offset,fshift+i_shift_offset);
2160 /* Increment number of inner iterations */
2161 inneriter += j_index_end - j_index_start;
2163 /* Outer loop uses 18 flops */
2166 /* Increment number of outer iterations */
2169 /* Update outer/inner flops */
2171 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3W3_F,outeriter*18 + inneriter*377);