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_GeomW3W3_VF_sparc64_hpc_ace_double
51 * Electrostatics interaction: Ewald
52 * VdW interaction: CubicSplineTable
53 * Geometry: Water3-Water3
54 * Calculate force/pot: PotentialAndForce
57 nb_kernel_ElecEw_VdwCSTab_GeomW3W3_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;
85 int vdwjidx0A,vdwjidx0B;
86 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
87 int vdwjidx1A,vdwjidx1B;
88 _fjsp_v2r8 jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
89 int vdwjidx2A,vdwjidx2B;
90 _fjsp_v2r8 jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
91 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
92 _fjsp_v2r8 dx01,dy01,dz01,rsq01,rinv01,rinvsq01,r01,qq01,c6_01,c12_01;
93 _fjsp_v2r8 dx02,dy02,dz02,rsq02,rinv02,rinvsq02,r02,qq02,c6_02,c12_02;
94 _fjsp_v2r8 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
95 _fjsp_v2r8 dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11;
96 _fjsp_v2r8 dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12;
97 _fjsp_v2r8 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
98 _fjsp_v2r8 dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21;
99 _fjsp_v2r8 dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22;
100 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
103 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
106 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
107 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
108 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
110 _fjsp_v2r8 ewtabscale,eweps,sh_ewald,ewrt,ewtabhalfspace,ewtabF,ewtabFn,ewtabD,ewtabV;
113 _fjsp_v2r8 dummy_mask,cutoff_mask;
114 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
115 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
116 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
123 jindex = nlist->jindex;
125 shiftidx = nlist->shift;
127 shiftvec = fr->shift_vec[0];
128 fshift = fr->fshift[0];
129 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
130 charge = mdatoms->chargeA;
131 nvdwtype = fr->ntype;
133 vdwtype = mdatoms->typeA;
135 vftab = kernel_data->table_vdw->data;
136 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
138 sh_ewald = gmx_fjsp_set1_v2r8(fr->ic->sh_ewald);
139 ewtab = fr->ic->tabq_coul_FDV0;
140 ewtabscale = gmx_fjsp_set1_v2r8(fr->ic->tabq_scale);
141 ewtabhalfspace = gmx_fjsp_set1_v2r8(0.5/fr->ic->tabq_scale);
143 /* Setup water-specific parameters */
144 inr = nlist->iinr[0];
145 iq0 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+0]));
146 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
147 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
148 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
150 jq0 = gmx_fjsp_set1_v2r8(charge[inr+0]);
151 jq1 = gmx_fjsp_set1_v2r8(charge[inr+1]);
152 jq2 = gmx_fjsp_set1_v2r8(charge[inr+2]);
153 vdwjidx0A = 2*vdwtype[inr+0];
154 qq00 = _fjsp_mul_v2r8(iq0,jq0);
155 c6_00 = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A]);
156 c12_00 = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A+1]);
157 qq01 = _fjsp_mul_v2r8(iq0,jq1);
158 qq02 = _fjsp_mul_v2r8(iq0,jq2);
159 qq10 = _fjsp_mul_v2r8(iq1,jq0);
160 qq11 = _fjsp_mul_v2r8(iq1,jq1);
161 qq12 = _fjsp_mul_v2r8(iq1,jq2);
162 qq20 = _fjsp_mul_v2r8(iq2,jq0);
163 qq21 = _fjsp_mul_v2r8(iq2,jq1);
164 qq22 = _fjsp_mul_v2r8(iq2,jq2);
166 /* Avoid stupid compiler warnings */
174 /* Start outer loop over neighborlists */
175 for(iidx=0; iidx<nri; iidx++)
177 /* Load shift vector for this list */
178 i_shift_offset = DIM*shiftidx[iidx];
180 /* Load limits for loop over neighbors */
181 j_index_start = jindex[iidx];
182 j_index_end = jindex[iidx+1];
184 /* Get outer coordinate index */
186 i_coord_offset = DIM*inr;
188 /* Load i particle coords and add shift vector */
189 gmx_fjsp_load_shift_and_3rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
190 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2);
192 fix0 = _fjsp_setzero_v2r8();
193 fiy0 = _fjsp_setzero_v2r8();
194 fiz0 = _fjsp_setzero_v2r8();
195 fix1 = _fjsp_setzero_v2r8();
196 fiy1 = _fjsp_setzero_v2r8();
197 fiz1 = _fjsp_setzero_v2r8();
198 fix2 = _fjsp_setzero_v2r8();
199 fiy2 = _fjsp_setzero_v2r8();
200 fiz2 = _fjsp_setzero_v2r8();
202 /* Reset potential sums */
203 velecsum = _fjsp_setzero_v2r8();
204 vvdwsum = _fjsp_setzero_v2r8();
206 /* Start inner kernel loop */
207 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
210 /* Get j neighbor index, and coordinate index */
213 j_coord_offsetA = DIM*jnrA;
214 j_coord_offsetB = DIM*jnrB;
216 /* load j atom coordinates */
217 gmx_fjsp_load_3rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
218 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,&jy2,&jz2);
220 /* Calculate displacement vector */
221 dx00 = _fjsp_sub_v2r8(ix0,jx0);
222 dy00 = _fjsp_sub_v2r8(iy0,jy0);
223 dz00 = _fjsp_sub_v2r8(iz0,jz0);
224 dx01 = _fjsp_sub_v2r8(ix0,jx1);
225 dy01 = _fjsp_sub_v2r8(iy0,jy1);
226 dz01 = _fjsp_sub_v2r8(iz0,jz1);
227 dx02 = _fjsp_sub_v2r8(ix0,jx2);
228 dy02 = _fjsp_sub_v2r8(iy0,jy2);
229 dz02 = _fjsp_sub_v2r8(iz0,jz2);
230 dx10 = _fjsp_sub_v2r8(ix1,jx0);
231 dy10 = _fjsp_sub_v2r8(iy1,jy0);
232 dz10 = _fjsp_sub_v2r8(iz1,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 dx20 = _fjsp_sub_v2r8(ix2,jx0);
240 dy20 = _fjsp_sub_v2r8(iy2,jy0);
241 dz20 = _fjsp_sub_v2r8(iz2,jz0);
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);
249 /* Calculate squared distance and things based on it */
250 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
251 rsq01 = gmx_fjsp_calc_rsq_v2r8(dx01,dy01,dz01);
252 rsq02 = gmx_fjsp_calc_rsq_v2r8(dx02,dy02,dz02);
253 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
254 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
255 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
256 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
257 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
258 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
260 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
261 rinv01 = gmx_fjsp_invsqrt_v2r8(rsq01);
262 rinv02 = gmx_fjsp_invsqrt_v2r8(rsq02);
263 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
264 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
265 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
266 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
267 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
268 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
270 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
271 rinvsq01 = _fjsp_mul_v2r8(rinv01,rinv01);
272 rinvsq02 = _fjsp_mul_v2r8(rinv02,rinv02);
273 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
274 rinvsq11 = _fjsp_mul_v2r8(rinv11,rinv11);
275 rinvsq12 = _fjsp_mul_v2r8(rinv12,rinv12);
276 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
277 rinvsq21 = _fjsp_mul_v2r8(rinv21,rinv21);
278 rinvsq22 = _fjsp_mul_v2r8(rinv22,rinv22);
280 fjx0 = _fjsp_setzero_v2r8();
281 fjy0 = _fjsp_setzero_v2r8();
282 fjz0 = _fjsp_setzero_v2r8();
283 fjx1 = _fjsp_setzero_v2r8();
284 fjy1 = _fjsp_setzero_v2r8();
285 fjz1 = _fjsp_setzero_v2r8();
286 fjx2 = _fjsp_setzero_v2r8();
287 fjy2 = _fjsp_setzero_v2r8();
288 fjz2 = _fjsp_setzero_v2r8();
290 /**************************
291 * CALCULATE INTERACTIONS *
292 **************************/
294 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
296 /* Calculate table index by multiplying r with table scale and truncate to integer */
297 rt = _fjsp_mul_v2r8(r00,vftabscale);
298 itab_tmp = _fjsp_dtox_v2r8(rt);
299 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
300 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
301 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
306 /* EWALD ELECTROSTATICS */
308 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
309 ewrt = _fjsp_mul_v2r8(r00,ewtabscale);
310 itab_tmp = _fjsp_dtox_v2r8(ewrt);
311 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
312 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
314 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
315 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
316 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
317 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
318 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
319 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
320 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
321 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
322 velec = _fjsp_mul_v2r8(qq00,_fjsp_sub_v2r8(rinv00,velec));
323 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq00,rinv00),_fjsp_sub_v2r8(rinvsq00,felec));
325 /* CUBIC SPLINE TABLE DISPERSION */
326 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
327 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
328 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
329 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
330 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
331 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
332 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
333 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
334 vvdw6 = _fjsp_mul_v2r8(c6_00,VV);
335 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
336 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
338 /* CUBIC SPLINE TABLE REPULSION */
339 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
340 F = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
341 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
342 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
343 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
344 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
345 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
346 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
347 vvdw12 = _fjsp_mul_v2r8(c12_00,VV);
348 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
349 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
350 vvdw = _fjsp_add_v2r8(vvdw12,vvdw6);
351 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
353 /* Update potential sum for this i atom from the interaction with this j atom. */
354 velecsum = _fjsp_add_v2r8(velecsum,velec);
355 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
357 fscal = _fjsp_add_v2r8(felec,fvdw);
359 /* Update vectorial force */
360 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
361 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
362 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
364 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
365 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
366 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
368 /**************************
369 * CALCULATE INTERACTIONS *
370 **************************/
372 r01 = _fjsp_mul_v2r8(rsq01,rinv01);
374 /* EWALD ELECTROSTATICS */
376 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
377 ewrt = _fjsp_mul_v2r8(r01,ewtabscale);
378 itab_tmp = _fjsp_dtox_v2r8(ewrt);
379 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
380 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
382 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
383 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
384 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
385 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
386 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
387 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
388 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
389 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
390 velec = _fjsp_mul_v2r8(qq01,_fjsp_sub_v2r8(rinv01,velec));
391 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq01,rinv01),_fjsp_sub_v2r8(rinvsq01,felec));
393 /* Update potential sum for this i atom from the interaction with this j atom. */
394 velecsum = _fjsp_add_v2r8(velecsum,velec);
398 /* Update vectorial force */
399 fix0 = _fjsp_madd_v2r8(dx01,fscal,fix0);
400 fiy0 = _fjsp_madd_v2r8(dy01,fscal,fiy0);
401 fiz0 = _fjsp_madd_v2r8(dz01,fscal,fiz0);
403 fjx1 = _fjsp_madd_v2r8(dx01,fscal,fjx1);
404 fjy1 = _fjsp_madd_v2r8(dy01,fscal,fjy1);
405 fjz1 = _fjsp_madd_v2r8(dz01,fscal,fjz1);
407 /**************************
408 * CALCULATE INTERACTIONS *
409 **************************/
411 r02 = _fjsp_mul_v2r8(rsq02,rinv02);
413 /* EWALD ELECTROSTATICS */
415 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
416 ewrt = _fjsp_mul_v2r8(r02,ewtabscale);
417 itab_tmp = _fjsp_dtox_v2r8(ewrt);
418 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
419 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
421 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
422 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
423 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
424 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
425 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
426 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
427 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
428 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
429 velec = _fjsp_mul_v2r8(qq02,_fjsp_sub_v2r8(rinv02,velec));
430 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq02,rinv02),_fjsp_sub_v2r8(rinvsq02,felec));
432 /* Update potential sum for this i atom from the interaction with this j atom. */
433 velecsum = _fjsp_add_v2r8(velecsum,velec);
437 /* Update vectorial force */
438 fix0 = _fjsp_madd_v2r8(dx02,fscal,fix0);
439 fiy0 = _fjsp_madd_v2r8(dy02,fscal,fiy0);
440 fiz0 = _fjsp_madd_v2r8(dz02,fscal,fiz0);
442 fjx2 = _fjsp_madd_v2r8(dx02,fscal,fjx2);
443 fjy2 = _fjsp_madd_v2r8(dy02,fscal,fjy2);
444 fjz2 = _fjsp_madd_v2r8(dz02,fscal,fjz2);
446 /**************************
447 * CALCULATE INTERACTIONS *
448 **************************/
450 r10 = _fjsp_mul_v2r8(rsq10,rinv10);
452 /* EWALD ELECTROSTATICS */
454 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
455 ewrt = _fjsp_mul_v2r8(r10,ewtabscale);
456 itab_tmp = _fjsp_dtox_v2r8(ewrt);
457 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
458 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
460 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
461 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
462 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
463 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
464 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
465 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
466 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
467 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
468 velec = _fjsp_mul_v2r8(qq10,_fjsp_sub_v2r8(rinv10,velec));
469 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,rinv10),_fjsp_sub_v2r8(rinvsq10,felec));
471 /* Update potential sum for this i atom from the interaction with this j atom. */
472 velecsum = _fjsp_add_v2r8(velecsum,velec);
476 /* Update vectorial force */
477 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
478 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
479 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
481 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
482 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
483 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
485 /**************************
486 * CALCULATE INTERACTIONS *
487 **************************/
489 r11 = _fjsp_mul_v2r8(rsq11,rinv11);
491 /* EWALD ELECTROSTATICS */
493 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
494 ewrt = _fjsp_mul_v2r8(r11,ewtabscale);
495 itab_tmp = _fjsp_dtox_v2r8(ewrt);
496 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
497 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
499 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
500 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
501 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
502 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
503 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
504 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
505 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
506 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
507 velec = _fjsp_mul_v2r8(qq11,_fjsp_sub_v2r8(rinv11,velec));
508 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq11,rinv11),_fjsp_sub_v2r8(rinvsq11,felec));
510 /* Update potential sum for this i atom from the interaction with this j atom. */
511 velecsum = _fjsp_add_v2r8(velecsum,velec);
515 /* Update vectorial force */
516 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
517 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
518 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
520 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
521 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
522 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
524 /**************************
525 * CALCULATE INTERACTIONS *
526 **************************/
528 r12 = _fjsp_mul_v2r8(rsq12,rinv12);
530 /* EWALD ELECTROSTATICS */
532 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
533 ewrt = _fjsp_mul_v2r8(r12,ewtabscale);
534 itab_tmp = _fjsp_dtox_v2r8(ewrt);
535 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
536 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
538 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
539 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
540 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
541 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
542 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
543 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
544 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
545 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
546 velec = _fjsp_mul_v2r8(qq12,_fjsp_sub_v2r8(rinv12,velec));
547 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq12,rinv12),_fjsp_sub_v2r8(rinvsq12,felec));
549 /* Update potential sum for this i atom from the interaction with this j atom. */
550 velecsum = _fjsp_add_v2r8(velecsum,velec);
554 /* Update vectorial force */
555 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
556 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
557 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
559 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
560 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
561 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
563 /**************************
564 * CALCULATE INTERACTIONS *
565 **************************/
567 r20 = _fjsp_mul_v2r8(rsq20,rinv20);
569 /* EWALD ELECTROSTATICS */
571 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
572 ewrt = _fjsp_mul_v2r8(r20,ewtabscale);
573 itab_tmp = _fjsp_dtox_v2r8(ewrt);
574 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
575 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
577 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
578 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
579 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
580 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
581 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
582 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
583 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
584 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
585 velec = _fjsp_mul_v2r8(qq20,_fjsp_sub_v2r8(rinv20,velec));
586 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,rinv20),_fjsp_sub_v2r8(rinvsq20,felec));
588 /* Update potential sum for this i atom from the interaction with this j atom. */
589 velecsum = _fjsp_add_v2r8(velecsum,velec);
593 /* Update vectorial force */
594 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
595 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
596 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
598 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
599 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
600 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
602 /**************************
603 * CALCULATE INTERACTIONS *
604 **************************/
606 r21 = _fjsp_mul_v2r8(rsq21,rinv21);
608 /* EWALD ELECTROSTATICS */
610 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
611 ewrt = _fjsp_mul_v2r8(r21,ewtabscale);
612 itab_tmp = _fjsp_dtox_v2r8(ewrt);
613 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
614 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
616 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
617 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
618 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
619 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
620 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
621 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
622 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
623 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
624 velec = _fjsp_mul_v2r8(qq21,_fjsp_sub_v2r8(rinv21,velec));
625 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq21,rinv21),_fjsp_sub_v2r8(rinvsq21,felec));
627 /* Update potential sum for this i atom from the interaction with this j atom. */
628 velecsum = _fjsp_add_v2r8(velecsum,velec);
632 /* Update vectorial force */
633 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
634 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
635 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
637 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
638 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
639 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
641 /**************************
642 * CALCULATE INTERACTIONS *
643 **************************/
645 r22 = _fjsp_mul_v2r8(rsq22,rinv22);
647 /* EWALD ELECTROSTATICS */
649 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
650 ewrt = _fjsp_mul_v2r8(r22,ewtabscale);
651 itab_tmp = _fjsp_dtox_v2r8(ewrt);
652 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
653 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
655 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
656 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
657 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
658 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
659 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
660 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
661 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
662 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
663 velec = _fjsp_mul_v2r8(qq22,_fjsp_sub_v2r8(rinv22,velec));
664 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq22,rinv22),_fjsp_sub_v2r8(rinvsq22,felec));
666 /* Update potential sum for this i atom from the interaction with this j atom. */
667 velecsum = _fjsp_add_v2r8(velecsum,velec);
671 /* Update vectorial force */
672 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
673 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
674 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
676 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
677 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
678 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
680 gmx_fjsp_decrement_3rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2);
682 /* Inner loop uses 430 flops */
689 j_coord_offsetA = DIM*jnrA;
691 /* load j atom coordinates */
692 gmx_fjsp_load_3rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
693 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,&jy2,&jz2);
695 /* Calculate displacement vector */
696 dx00 = _fjsp_sub_v2r8(ix0,jx0);
697 dy00 = _fjsp_sub_v2r8(iy0,jy0);
698 dz00 = _fjsp_sub_v2r8(iz0,jz0);
699 dx01 = _fjsp_sub_v2r8(ix0,jx1);
700 dy01 = _fjsp_sub_v2r8(iy0,jy1);
701 dz01 = _fjsp_sub_v2r8(iz0,jz1);
702 dx02 = _fjsp_sub_v2r8(ix0,jx2);
703 dy02 = _fjsp_sub_v2r8(iy0,jy2);
704 dz02 = _fjsp_sub_v2r8(iz0,jz2);
705 dx10 = _fjsp_sub_v2r8(ix1,jx0);
706 dy10 = _fjsp_sub_v2r8(iy1,jy0);
707 dz10 = _fjsp_sub_v2r8(iz1,jz0);
708 dx11 = _fjsp_sub_v2r8(ix1,jx1);
709 dy11 = _fjsp_sub_v2r8(iy1,jy1);
710 dz11 = _fjsp_sub_v2r8(iz1,jz1);
711 dx12 = _fjsp_sub_v2r8(ix1,jx2);
712 dy12 = _fjsp_sub_v2r8(iy1,jy2);
713 dz12 = _fjsp_sub_v2r8(iz1,jz2);
714 dx20 = _fjsp_sub_v2r8(ix2,jx0);
715 dy20 = _fjsp_sub_v2r8(iy2,jy0);
716 dz20 = _fjsp_sub_v2r8(iz2,jz0);
717 dx21 = _fjsp_sub_v2r8(ix2,jx1);
718 dy21 = _fjsp_sub_v2r8(iy2,jy1);
719 dz21 = _fjsp_sub_v2r8(iz2,jz1);
720 dx22 = _fjsp_sub_v2r8(ix2,jx2);
721 dy22 = _fjsp_sub_v2r8(iy2,jy2);
722 dz22 = _fjsp_sub_v2r8(iz2,jz2);
724 /* Calculate squared distance and things based on it */
725 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
726 rsq01 = gmx_fjsp_calc_rsq_v2r8(dx01,dy01,dz01);
727 rsq02 = gmx_fjsp_calc_rsq_v2r8(dx02,dy02,dz02);
728 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
729 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
730 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
731 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
732 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
733 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
735 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
736 rinv01 = gmx_fjsp_invsqrt_v2r8(rsq01);
737 rinv02 = gmx_fjsp_invsqrt_v2r8(rsq02);
738 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
739 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
740 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
741 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
742 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
743 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
745 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
746 rinvsq01 = _fjsp_mul_v2r8(rinv01,rinv01);
747 rinvsq02 = _fjsp_mul_v2r8(rinv02,rinv02);
748 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
749 rinvsq11 = _fjsp_mul_v2r8(rinv11,rinv11);
750 rinvsq12 = _fjsp_mul_v2r8(rinv12,rinv12);
751 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
752 rinvsq21 = _fjsp_mul_v2r8(rinv21,rinv21);
753 rinvsq22 = _fjsp_mul_v2r8(rinv22,rinv22);
755 fjx0 = _fjsp_setzero_v2r8();
756 fjy0 = _fjsp_setzero_v2r8();
757 fjz0 = _fjsp_setzero_v2r8();
758 fjx1 = _fjsp_setzero_v2r8();
759 fjy1 = _fjsp_setzero_v2r8();
760 fjz1 = _fjsp_setzero_v2r8();
761 fjx2 = _fjsp_setzero_v2r8();
762 fjy2 = _fjsp_setzero_v2r8();
763 fjz2 = _fjsp_setzero_v2r8();
765 /**************************
766 * CALCULATE INTERACTIONS *
767 **************************/
769 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
771 /* Calculate table index by multiplying r with table scale and truncate to integer */
772 rt = _fjsp_mul_v2r8(r00,vftabscale);
773 itab_tmp = _fjsp_dtox_v2r8(rt);
774 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
775 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
776 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
781 /* EWALD ELECTROSTATICS */
783 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
784 ewrt = _fjsp_mul_v2r8(r00,ewtabscale);
785 itab_tmp = _fjsp_dtox_v2r8(ewrt);
786 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
787 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
789 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
790 ewtabD = _fjsp_setzero_v2r8();
791 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
792 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
793 ewtabFn = _fjsp_setzero_v2r8();
794 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
795 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
796 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
797 velec = _fjsp_mul_v2r8(qq00,_fjsp_sub_v2r8(rinv00,velec));
798 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq00,rinv00),_fjsp_sub_v2r8(rinvsq00,felec));
800 /* CUBIC SPLINE TABLE DISPERSION */
801 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
802 F = _fjsp_setzero_v2r8();
803 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
804 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
805 H = _fjsp_setzero_v2r8();
806 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
807 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
808 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
809 vvdw6 = _fjsp_mul_v2r8(c6_00,VV);
810 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
811 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
813 /* CUBIC SPLINE TABLE REPULSION */
814 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
815 F = _fjsp_setzero_v2r8();
816 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
817 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
818 H = _fjsp_setzero_v2r8();
819 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
820 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
821 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
822 vvdw12 = _fjsp_mul_v2r8(c12_00,VV);
823 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
824 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
825 vvdw = _fjsp_add_v2r8(vvdw12,vvdw6);
826 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
828 /* Update potential sum for this i atom from the interaction with this j atom. */
829 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
830 velecsum = _fjsp_add_v2r8(velecsum,velec);
831 vvdw = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
832 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
834 fscal = _fjsp_add_v2r8(felec,fvdw);
836 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
838 /* Update vectorial force */
839 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
840 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
841 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
843 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
844 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
845 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
847 /**************************
848 * CALCULATE INTERACTIONS *
849 **************************/
851 r01 = _fjsp_mul_v2r8(rsq01,rinv01);
853 /* EWALD ELECTROSTATICS */
855 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
856 ewrt = _fjsp_mul_v2r8(r01,ewtabscale);
857 itab_tmp = _fjsp_dtox_v2r8(ewrt);
858 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
859 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
861 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
862 ewtabD = _fjsp_setzero_v2r8();
863 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
864 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
865 ewtabFn = _fjsp_setzero_v2r8();
866 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
867 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
868 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
869 velec = _fjsp_mul_v2r8(qq01,_fjsp_sub_v2r8(rinv01,velec));
870 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq01,rinv01),_fjsp_sub_v2r8(rinvsq01,felec));
872 /* Update potential sum for this i atom from the interaction with this j atom. */
873 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
874 velecsum = _fjsp_add_v2r8(velecsum,velec);
878 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
880 /* Update vectorial force */
881 fix0 = _fjsp_madd_v2r8(dx01,fscal,fix0);
882 fiy0 = _fjsp_madd_v2r8(dy01,fscal,fiy0);
883 fiz0 = _fjsp_madd_v2r8(dz01,fscal,fiz0);
885 fjx1 = _fjsp_madd_v2r8(dx01,fscal,fjx1);
886 fjy1 = _fjsp_madd_v2r8(dy01,fscal,fjy1);
887 fjz1 = _fjsp_madd_v2r8(dz01,fscal,fjz1);
889 /**************************
890 * CALCULATE INTERACTIONS *
891 **************************/
893 r02 = _fjsp_mul_v2r8(rsq02,rinv02);
895 /* EWALD ELECTROSTATICS */
897 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
898 ewrt = _fjsp_mul_v2r8(r02,ewtabscale);
899 itab_tmp = _fjsp_dtox_v2r8(ewrt);
900 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
901 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
903 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
904 ewtabD = _fjsp_setzero_v2r8();
905 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
906 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
907 ewtabFn = _fjsp_setzero_v2r8();
908 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
909 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
910 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
911 velec = _fjsp_mul_v2r8(qq02,_fjsp_sub_v2r8(rinv02,velec));
912 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq02,rinv02),_fjsp_sub_v2r8(rinvsq02,felec));
914 /* Update potential sum for this i atom from the interaction with this j atom. */
915 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
916 velecsum = _fjsp_add_v2r8(velecsum,velec);
920 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
922 /* Update vectorial force */
923 fix0 = _fjsp_madd_v2r8(dx02,fscal,fix0);
924 fiy0 = _fjsp_madd_v2r8(dy02,fscal,fiy0);
925 fiz0 = _fjsp_madd_v2r8(dz02,fscal,fiz0);
927 fjx2 = _fjsp_madd_v2r8(dx02,fscal,fjx2);
928 fjy2 = _fjsp_madd_v2r8(dy02,fscal,fjy2);
929 fjz2 = _fjsp_madd_v2r8(dz02,fscal,fjz2);
931 /**************************
932 * CALCULATE INTERACTIONS *
933 **************************/
935 r10 = _fjsp_mul_v2r8(rsq10,rinv10);
937 /* EWALD ELECTROSTATICS */
939 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
940 ewrt = _fjsp_mul_v2r8(r10,ewtabscale);
941 itab_tmp = _fjsp_dtox_v2r8(ewrt);
942 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
943 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
945 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
946 ewtabD = _fjsp_setzero_v2r8();
947 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
948 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
949 ewtabFn = _fjsp_setzero_v2r8();
950 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
951 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
952 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
953 velec = _fjsp_mul_v2r8(qq10,_fjsp_sub_v2r8(rinv10,velec));
954 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,rinv10),_fjsp_sub_v2r8(rinvsq10,felec));
956 /* Update potential sum for this i atom from the interaction with this j atom. */
957 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
958 velecsum = _fjsp_add_v2r8(velecsum,velec);
962 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
964 /* Update vectorial force */
965 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
966 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
967 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
969 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
970 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
971 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
973 /**************************
974 * CALCULATE INTERACTIONS *
975 **************************/
977 r11 = _fjsp_mul_v2r8(rsq11,rinv11);
979 /* EWALD ELECTROSTATICS */
981 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
982 ewrt = _fjsp_mul_v2r8(r11,ewtabscale);
983 itab_tmp = _fjsp_dtox_v2r8(ewrt);
984 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
985 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
987 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
988 ewtabD = _fjsp_setzero_v2r8();
989 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
990 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
991 ewtabFn = _fjsp_setzero_v2r8();
992 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
993 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
994 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
995 velec = _fjsp_mul_v2r8(qq11,_fjsp_sub_v2r8(rinv11,velec));
996 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq11,rinv11),_fjsp_sub_v2r8(rinvsq11,felec));
998 /* Update potential sum for this i atom from the interaction with this j atom. */
999 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1000 velecsum = _fjsp_add_v2r8(velecsum,velec);
1004 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1006 /* Update vectorial force */
1007 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
1008 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
1009 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
1011 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
1012 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
1013 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
1015 /**************************
1016 * CALCULATE INTERACTIONS *
1017 **************************/
1019 r12 = _fjsp_mul_v2r8(rsq12,rinv12);
1021 /* EWALD ELECTROSTATICS */
1023 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1024 ewrt = _fjsp_mul_v2r8(r12,ewtabscale);
1025 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1026 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1027 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1029 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
1030 ewtabD = _fjsp_setzero_v2r8();
1031 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
1032 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
1033 ewtabFn = _fjsp_setzero_v2r8();
1034 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
1035 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
1036 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
1037 velec = _fjsp_mul_v2r8(qq12,_fjsp_sub_v2r8(rinv12,velec));
1038 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq12,rinv12),_fjsp_sub_v2r8(rinvsq12,felec));
1040 /* Update potential sum for this i atom from the interaction with this j atom. */
1041 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1042 velecsum = _fjsp_add_v2r8(velecsum,velec);
1046 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1048 /* Update vectorial force */
1049 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
1050 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
1051 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
1053 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
1054 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
1055 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
1057 /**************************
1058 * CALCULATE INTERACTIONS *
1059 **************************/
1061 r20 = _fjsp_mul_v2r8(rsq20,rinv20);
1063 /* EWALD ELECTROSTATICS */
1065 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1066 ewrt = _fjsp_mul_v2r8(r20,ewtabscale);
1067 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1068 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1069 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1071 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
1072 ewtabD = _fjsp_setzero_v2r8();
1073 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
1074 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
1075 ewtabFn = _fjsp_setzero_v2r8();
1076 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
1077 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
1078 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
1079 velec = _fjsp_mul_v2r8(qq20,_fjsp_sub_v2r8(rinv20,velec));
1080 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,rinv20),_fjsp_sub_v2r8(rinvsq20,felec));
1082 /* Update potential sum for this i atom from the interaction with this j atom. */
1083 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1084 velecsum = _fjsp_add_v2r8(velecsum,velec);
1088 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1090 /* Update vectorial force */
1091 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
1092 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
1093 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
1095 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
1096 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
1097 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
1099 /**************************
1100 * CALCULATE INTERACTIONS *
1101 **************************/
1103 r21 = _fjsp_mul_v2r8(rsq21,rinv21);
1105 /* EWALD ELECTROSTATICS */
1107 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1108 ewrt = _fjsp_mul_v2r8(r21,ewtabscale);
1109 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1110 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1111 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1113 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
1114 ewtabD = _fjsp_setzero_v2r8();
1115 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
1116 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
1117 ewtabFn = _fjsp_setzero_v2r8();
1118 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
1119 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
1120 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
1121 velec = _fjsp_mul_v2r8(qq21,_fjsp_sub_v2r8(rinv21,velec));
1122 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq21,rinv21),_fjsp_sub_v2r8(rinvsq21,felec));
1124 /* Update potential sum for this i atom from the interaction with this j atom. */
1125 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1126 velecsum = _fjsp_add_v2r8(velecsum,velec);
1130 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1132 /* Update vectorial force */
1133 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
1134 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
1135 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
1137 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
1138 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
1139 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
1141 /**************************
1142 * CALCULATE INTERACTIONS *
1143 **************************/
1145 r22 = _fjsp_mul_v2r8(rsq22,rinv22);
1147 /* EWALD ELECTROSTATICS */
1149 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1150 ewrt = _fjsp_mul_v2r8(r22,ewtabscale);
1151 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1152 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1153 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1155 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
1156 ewtabD = _fjsp_setzero_v2r8();
1157 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
1158 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
1159 ewtabFn = _fjsp_setzero_v2r8();
1160 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
1161 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
1162 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
1163 velec = _fjsp_mul_v2r8(qq22,_fjsp_sub_v2r8(rinv22,velec));
1164 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq22,rinv22),_fjsp_sub_v2r8(rinvsq22,felec));
1166 /* Update potential sum for this i atom from the interaction with this j atom. */
1167 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1168 velecsum = _fjsp_add_v2r8(velecsum,velec);
1172 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1174 /* Update vectorial force */
1175 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
1176 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
1177 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
1179 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
1180 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
1181 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
1183 gmx_fjsp_decrement_3rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2);
1185 /* Inner loop uses 430 flops */
1188 /* End of innermost loop */
1190 gmx_fjsp_update_iforce_3atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,
1191 f+i_coord_offset,fshift+i_shift_offset);
1194 /* Update potential energies */
1195 gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
1196 gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
1198 /* Increment number of inner iterations */
1199 inneriter += j_index_end - j_index_start;
1201 /* Outer loop uses 20 flops */
1204 /* Increment number of outer iterations */
1207 /* Update outer/inner flops */
1209 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3W3_VF,outeriter*20 + inneriter*430);
1212 * Gromacs nonbonded kernel: nb_kernel_ElecEw_VdwCSTab_GeomW3W3_F_sparc64_hpc_ace_double
1213 * Electrostatics interaction: Ewald
1214 * VdW interaction: CubicSplineTable
1215 * Geometry: Water3-Water3
1216 * Calculate force/pot: Force
1219 nb_kernel_ElecEw_VdwCSTab_GeomW3W3_F_sparc64_hpc_ace_double
1220 (t_nblist * gmx_restrict nlist,
1221 rvec * gmx_restrict xx,
1222 rvec * gmx_restrict ff,
1223 t_forcerec * gmx_restrict fr,
1224 t_mdatoms * gmx_restrict mdatoms,
1225 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
1226 t_nrnb * gmx_restrict nrnb)
1228 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
1229 * just 0 for non-waters.
1230 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
1231 * jnr indices corresponding to data put in the four positions in the SIMD register.
1233 int i_shift_offset,i_coord_offset,outeriter,inneriter;
1234 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
1236 int j_coord_offsetA,j_coord_offsetB;
1237 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
1238 real rcutoff_scalar;
1239 real *shiftvec,*fshift,*x,*f;
1240 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
1242 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
1244 _fjsp_v2r8 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
1246 _fjsp_v2r8 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
1247 int vdwjidx0A,vdwjidx0B;
1248 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
1249 int vdwjidx1A,vdwjidx1B;
1250 _fjsp_v2r8 jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
1251 int vdwjidx2A,vdwjidx2B;
1252 _fjsp_v2r8 jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
1253 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
1254 _fjsp_v2r8 dx01,dy01,dz01,rsq01,rinv01,rinvsq01,r01,qq01,c6_01,c12_01;
1255 _fjsp_v2r8 dx02,dy02,dz02,rsq02,rinv02,rinvsq02,r02,qq02,c6_02,c12_02;
1256 _fjsp_v2r8 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
1257 _fjsp_v2r8 dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11;
1258 _fjsp_v2r8 dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12;
1259 _fjsp_v2r8 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
1260 _fjsp_v2r8 dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21;
1261 _fjsp_v2r8 dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22;
1262 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
1265 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
1268 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
1269 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
1270 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
1272 _fjsp_v2r8 ewtabscale,eweps,sh_ewald,ewrt,ewtabhalfspace,ewtabF,ewtabFn,ewtabD,ewtabV;
1274 _fjsp_v2r8 itab_tmp;
1275 _fjsp_v2r8 dummy_mask,cutoff_mask;
1276 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
1277 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
1278 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
1285 jindex = nlist->jindex;
1287 shiftidx = nlist->shift;
1289 shiftvec = fr->shift_vec[0];
1290 fshift = fr->fshift[0];
1291 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
1292 charge = mdatoms->chargeA;
1293 nvdwtype = fr->ntype;
1294 vdwparam = fr->nbfp;
1295 vdwtype = mdatoms->typeA;
1297 vftab = kernel_data->table_vdw->data;
1298 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
1300 sh_ewald = gmx_fjsp_set1_v2r8(fr->ic->sh_ewald);
1301 ewtab = fr->ic->tabq_coul_F;
1302 ewtabscale = gmx_fjsp_set1_v2r8(fr->ic->tabq_scale);
1303 ewtabhalfspace = gmx_fjsp_set1_v2r8(0.5/fr->ic->tabq_scale);
1305 /* Setup water-specific parameters */
1306 inr = nlist->iinr[0];
1307 iq0 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+0]));
1308 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
1309 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
1310 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
1312 jq0 = gmx_fjsp_set1_v2r8(charge[inr+0]);
1313 jq1 = gmx_fjsp_set1_v2r8(charge[inr+1]);
1314 jq2 = gmx_fjsp_set1_v2r8(charge[inr+2]);
1315 vdwjidx0A = 2*vdwtype[inr+0];
1316 qq00 = _fjsp_mul_v2r8(iq0,jq0);
1317 c6_00 = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A]);
1318 c12_00 = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A+1]);
1319 qq01 = _fjsp_mul_v2r8(iq0,jq1);
1320 qq02 = _fjsp_mul_v2r8(iq0,jq2);
1321 qq10 = _fjsp_mul_v2r8(iq1,jq0);
1322 qq11 = _fjsp_mul_v2r8(iq1,jq1);
1323 qq12 = _fjsp_mul_v2r8(iq1,jq2);
1324 qq20 = _fjsp_mul_v2r8(iq2,jq0);
1325 qq21 = _fjsp_mul_v2r8(iq2,jq1);
1326 qq22 = _fjsp_mul_v2r8(iq2,jq2);
1328 /* Avoid stupid compiler warnings */
1330 j_coord_offsetA = 0;
1331 j_coord_offsetB = 0;
1336 /* Start outer loop over neighborlists */
1337 for(iidx=0; iidx<nri; iidx++)
1339 /* Load shift vector for this list */
1340 i_shift_offset = DIM*shiftidx[iidx];
1342 /* Load limits for loop over neighbors */
1343 j_index_start = jindex[iidx];
1344 j_index_end = jindex[iidx+1];
1346 /* Get outer coordinate index */
1348 i_coord_offset = DIM*inr;
1350 /* Load i particle coords and add shift vector */
1351 gmx_fjsp_load_shift_and_3rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
1352 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2);
1354 fix0 = _fjsp_setzero_v2r8();
1355 fiy0 = _fjsp_setzero_v2r8();
1356 fiz0 = _fjsp_setzero_v2r8();
1357 fix1 = _fjsp_setzero_v2r8();
1358 fiy1 = _fjsp_setzero_v2r8();
1359 fiz1 = _fjsp_setzero_v2r8();
1360 fix2 = _fjsp_setzero_v2r8();
1361 fiy2 = _fjsp_setzero_v2r8();
1362 fiz2 = _fjsp_setzero_v2r8();
1364 /* Start inner kernel loop */
1365 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
1368 /* Get j neighbor index, and coordinate index */
1370 jnrB = jjnr[jidx+1];
1371 j_coord_offsetA = DIM*jnrA;
1372 j_coord_offsetB = DIM*jnrB;
1374 /* load j atom coordinates */
1375 gmx_fjsp_load_3rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
1376 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,&jy2,&jz2);
1378 /* Calculate displacement vector */
1379 dx00 = _fjsp_sub_v2r8(ix0,jx0);
1380 dy00 = _fjsp_sub_v2r8(iy0,jy0);
1381 dz00 = _fjsp_sub_v2r8(iz0,jz0);
1382 dx01 = _fjsp_sub_v2r8(ix0,jx1);
1383 dy01 = _fjsp_sub_v2r8(iy0,jy1);
1384 dz01 = _fjsp_sub_v2r8(iz0,jz1);
1385 dx02 = _fjsp_sub_v2r8(ix0,jx2);
1386 dy02 = _fjsp_sub_v2r8(iy0,jy2);
1387 dz02 = _fjsp_sub_v2r8(iz0,jz2);
1388 dx10 = _fjsp_sub_v2r8(ix1,jx0);
1389 dy10 = _fjsp_sub_v2r8(iy1,jy0);
1390 dz10 = _fjsp_sub_v2r8(iz1,jz0);
1391 dx11 = _fjsp_sub_v2r8(ix1,jx1);
1392 dy11 = _fjsp_sub_v2r8(iy1,jy1);
1393 dz11 = _fjsp_sub_v2r8(iz1,jz1);
1394 dx12 = _fjsp_sub_v2r8(ix1,jx2);
1395 dy12 = _fjsp_sub_v2r8(iy1,jy2);
1396 dz12 = _fjsp_sub_v2r8(iz1,jz2);
1397 dx20 = _fjsp_sub_v2r8(ix2,jx0);
1398 dy20 = _fjsp_sub_v2r8(iy2,jy0);
1399 dz20 = _fjsp_sub_v2r8(iz2,jz0);
1400 dx21 = _fjsp_sub_v2r8(ix2,jx1);
1401 dy21 = _fjsp_sub_v2r8(iy2,jy1);
1402 dz21 = _fjsp_sub_v2r8(iz2,jz1);
1403 dx22 = _fjsp_sub_v2r8(ix2,jx2);
1404 dy22 = _fjsp_sub_v2r8(iy2,jy2);
1405 dz22 = _fjsp_sub_v2r8(iz2,jz2);
1407 /* Calculate squared distance and things based on it */
1408 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
1409 rsq01 = gmx_fjsp_calc_rsq_v2r8(dx01,dy01,dz01);
1410 rsq02 = gmx_fjsp_calc_rsq_v2r8(dx02,dy02,dz02);
1411 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
1412 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
1413 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
1414 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
1415 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
1416 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
1418 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
1419 rinv01 = gmx_fjsp_invsqrt_v2r8(rsq01);
1420 rinv02 = gmx_fjsp_invsqrt_v2r8(rsq02);
1421 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
1422 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
1423 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
1424 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
1425 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
1426 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
1428 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
1429 rinvsq01 = _fjsp_mul_v2r8(rinv01,rinv01);
1430 rinvsq02 = _fjsp_mul_v2r8(rinv02,rinv02);
1431 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
1432 rinvsq11 = _fjsp_mul_v2r8(rinv11,rinv11);
1433 rinvsq12 = _fjsp_mul_v2r8(rinv12,rinv12);
1434 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
1435 rinvsq21 = _fjsp_mul_v2r8(rinv21,rinv21);
1436 rinvsq22 = _fjsp_mul_v2r8(rinv22,rinv22);
1438 fjx0 = _fjsp_setzero_v2r8();
1439 fjy0 = _fjsp_setzero_v2r8();
1440 fjz0 = _fjsp_setzero_v2r8();
1441 fjx1 = _fjsp_setzero_v2r8();
1442 fjy1 = _fjsp_setzero_v2r8();
1443 fjz1 = _fjsp_setzero_v2r8();
1444 fjx2 = _fjsp_setzero_v2r8();
1445 fjy2 = _fjsp_setzero_v2r8();
1446 fjz2 = _fjsp_setzero_v2r8();
1448 /**************************
1449 * CALCULATE INTERACTIONS *
1450 **************************/
1452 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
1454 /* Calculate table index by multiplying r with table scale and truncate to integer */
1455 rt = _fjsp_mul_v2r8(r00,vftabscale);
1456 itab_tmp = _fjsp_dtox_v2r8(rt);
1457 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1458 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1459 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1464 /* EWALD ELECTROSTATICS */
1466 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1467 ewrt = _fjsp_mul_v2r8(r00,ewtabscale);
1468 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1469 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1470 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1472 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1474 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1475 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq00,rinv00),_fjsp_sub_v2r8(rinvsq00,felec));
1477 /* CUBIC SPLINE TABLE DISPERSION */
1478 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1479 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
1480 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1481 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
1482 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
1483 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1484 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
1485 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
1486 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
1488 /* CUBIC SPLINE TABLE REPULSION */
1489 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
1490 F = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
1491 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1492 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
1493 H = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
1494 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1495 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
1496 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
1497 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
1498 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
1500 fscal = _fjsp_add_v2r8(felec,fvdw);
1502 /* Update vectorial force */
1503 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
1504 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
1505 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
1507 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
1508 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
1509 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
1511 /**************************
1512 * CALCULATE INTERACTIONS *
1513 **************************/
1515 r01 = _fjsp_mul_v2r8(rsq01,rinv01);
1517 /* EWALD ELECTROSTATICS */
1519 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1520 ewrt = _fjsp_mul_v2r8(r01,ewtabscale);
1521 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1522 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1523 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1525 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1527 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1528 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq01,rinv01),_fjsp_sub_v2r8(rinvsq01,felec));
1532 /* Update vectorial force */
1533 fix0 = _fjsp_madd_v2r8(dx01,fscal,fix0);
1534 fiy0 = _fjsp_madd_v2r8(dy01,fscal,fiy0);
1535 fiz0 = _fjsp_madd_v2r8(dz01,fscal,fiz0);
1537 fjx1 = _fjsp_madd_v2r8(dx01,fscal,fjx1);
1538 fjy1 = _fjsp_madd_v2r8(dy01,fscal,fjy1);
1539 fjz1 = _fjsp_madd_v2r8(dz01,fscal,fjz1);
1541 /**************************
1542 * CALCULATE INTERACTIONS *
1543 **************************/
1545 r02 = _fjsp_mul_v2r8(rsq02,rinv02);
1547 /* EWALD ELECTROSTATICS */
1549 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1550 ewrt = _fjsp_mul_v2r8(r02,ewtabscale);
1551 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1552 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1553 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1555 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1557 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1558 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq02,rinv02),_fjsp_sub_v2r8(rinvsq02,felec));
1562 /* Update vectorial force */
1563 fix0 = _fjsp_madd_v2r8(dx02,fscal,fix0);
1564 fiy0 = _fjsp_madd_v2r8(dy02,fscal,fiy0);
1565 fiz0 = _fjsp_madd_v2r8(dz02,fscal,fiz0);
1567 fjx2 = _fjsp_madd_v2r8(dx02,fscal,fjx2);
1568 fjy2 = _fjsp_madd_v2r8(dy02,fscal,fjy2);
1569 fjz2 = _fjsp_madd_v2r8(dz02,fscal,fjz2);
1571 /**************************
1572 * CALCULATE INTERACTIONS *
1573 **************************/
1575 r10 = _fjsp_mul_v2r8(rsq10,rinv10);
1577 /* EWALD ELECTROSTATICS */
1579 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1580 ewrt = _fjsp_mul_v2r8(r10,ewtabscale);
1581 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1582 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1583 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1585 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1587 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1588 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,rinv10),_fjsp_sub_v2r8(rinvsq10,felec));
1592 /* Update vectorial force */
1593 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
1594 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
1595 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
1597 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
1598 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
1599 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
1601 /**************************
1602 * CALCULATE INTERACTIONS *
1603 **************************/
1605 r11 = _fjsp_mul_v2r8(rsq11,rinv11);
1607 /* EWALD ELECTROSTATICS */
1609 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1610 ewrt = _fjsp_mul_v2r8(r11,ewtabscale);
1611 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1612 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1613 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1615 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1617 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1618 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq11,rinv11),_fjsp_sub_v2r8(rinvsq11,felec));
1622 /* Update vectorial force */
1623 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
1624 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
1625 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
1627 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
1628 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
1629 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
1631 /**************************
1632 * CALCULATE INTERACTIONS *
1633 **************************/
1635 r12 = _fjsp_mul_v2r8(rsq12,rinv12);
1637 /* EWALD ELECTROSTATICS */
1639 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1640 ewrt = _fjsp_mul_v2r8(r12,ewtabscale);
1641 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1642 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1643 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1645 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1647 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1648 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq12,rinv12),_fjsp_sub_v2r8(rinvsq12,felec));
1652 /* Update vectorial force */
1653 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
1654 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
1655 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
1657 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
1658 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
1659 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
1661 /**************************
1662 * CALCULATE INTERACTIONS *
1663 **************************/
1665 r20 = _fjsp_mul_v2r8(rsq20,rinv20);
1667 /* EWALD ELECTROSTATICS */
1669 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1670 ewrt = _fjsp_mul_v2r8(r20,ewtabscale);
1671 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1672 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1673 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1675 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1677 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1678 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,rinv20),_fjsp_sub_v2r8(rinvsq20,felec));
1682 /* Update vectorial force */
1683 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
1684 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
1685 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
1687 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
1688 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
1689 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
1691 /**************************
1692 * CALCULATE INTERACTIONS *
1693 **************************/
1695 r21 = _fjsp_mul_v2r8(rsq21,rinv21);
1697 /* EWALD ELECTROSTATICS */
1699 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1700 ewrt = _fjsp_mul_v2r8(r21,ewtabscale);
1701 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1702 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1703 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1705 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1707 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1708 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq21,rinv21),_fjsp_sub_v2r8(rinvsq21,felec));
1712 /* Update vectorial force */
1713 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
1714 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
1715 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
1717 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
1718 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
1719 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
1721 /**************************
1722 * CALCULATE INTERACTIONS *
1723 **************************/
1725 r22 = _fjsp_mul_v2r8(rsq22,rinv22);
1727 /* EWALD ELECTROSTATICS */
1729 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1730 ewrt = _fjsp_mul_v2r8(r22,ewtabscale);
1731 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1732 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1733 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1735 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1737 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1738 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq22,rinv22),_fjsp_sub_v2r8(rinvsq22,felec));
1742 /* Update vectorial force */
1743 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
1744 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
1745 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
1747 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
1748 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
1749 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
1751 gmx_fjsp_decrement_3rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2);
1753 /* Inner loop uses 377 flops */
1756 if(jidx<j_index_end)
1760 j_coord_offsetA = DIM*jnrA;
1762 /* load j atom coordinates */
1763 gmx_fjsp_load_3rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
1764 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,&jy2,&jz2);
1766 /* Calculate displacement vector */
1767 dx00 = _fjsp_sub_v2r8(ix0,jx0);
1768 dy00 = _fjsp_sub_v2r8(iy0,jy0);
1769 dz00 = _fjsp_sub_v2r8(iz0,jz0);
1770 dx01 = _fjsp_sub_v2r8(ix0,jx1);
1771 dy01 = _fjsp_sub_v2r8(iy0,jy1);
1772 dz01 = _fjsp_sub_v2r8(iz0,jz1);
1773 dx02 = _fjsp_sub_v2r8(ix0,jx2);
1774 dy02 = _fjsp_sub_v2r8(iy0,jy2);
1775 dz02 = _fjsp_sub_v2r8(iz0,jz2);
1776 dx10 = _fjsp_sub_v2r8(ix1,jx0);
1777 dy10 = _fjsp_sub_v2r8(iy1,jy0);
1778 dz10 = _fjsp_sub_v2r8(iz1,jz0);
1779 dx11 = _fjsp_sub_v2r8(ix1,jx1);
1780 dy11 = _fjsp_sub_v2r8(iy1,jy1);
1781 dz11 = _fjsp_sub_v2r8(iz1,jz1);
1782 dx12 = _fjsp_sub_v2r8(ix1,jx2);
1783 dy12 = _fjsp_sub_v2r8(iy1,jy2);
1784 dz12 = _fjsp_sub_v2r8(iz1,jz2);
1785 dx20 = _fjsp_sub_v2r8(ix2,jx0);
1786 dy20 = _fjsp_sub_v2r8(iy2,jy0);
1787 dz20 = _fjsp_sub_v2r8(iz2,jz0);
1788 dx21 = _fjsp_sub_v2r8(ix2,jx1);
1789 dy21 = _fjsp_sub_v2r8(iy2,jy1);
1790 dz21 = _fjsp_sub_v2r8(iz2,jz1);
1791 dx22 = _fjsp_sub_v2r8(ix2,jx2);
1792 dy22 = _fjsp_sub_v2r8(iy2,jy2);
1793 dz22 = _fjsp_sub_v2r8(iz2,jz2);
1795 /* Calculate squared distance and things based on it */
1796 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
1797 rsq01 = gmx_fjsp_calc_rsq_v2r8(dx01,dy01,dz01);
1798 rsq02 = gmx_fjsp_calc_rsq_v2r8(dx02,dy02,dz02);
1799 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
1800 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
1801 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
1802 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
1803 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
1804 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
1806 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
1807 rinv01 = gmx_fjsp_invsqrt_v2r8(rsq01);
1808 rinv02 = gmx_fjsp_invsqrt_v2r8(rsq02);
1809 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
1810 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
1811 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
1812 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
1813 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
1814 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
1816 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
1817 rinvsq01 = _fjsp_mul_v2r8(rinv01,rinv01);
1818 rinvsq02 = _fjsp_mul_v2r8(rinv02,rinv02);
1819 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
1820 rinvsq11 = _fjsp_mul_v2r8(rinv11,rinv11);
1821 rinvsq12 = _fjsp_mul_v2r8(rinv12,rinv12);
1822 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
1823 rinvsq21 = _fjsp_mul_v2r8(rinv21,rinv21);
1824 rinvsq22 = _fjsp_mul_v2r8(rinv22,rinv22);
1826 fjx0 = _fjsp_setzero_v2r8();
1827 fjy0 = _fjsp_setzero_v2r8();
1828 fjz0 = _fjsp_setzero_v2r8();
1829 fjx1 = _fjsp_setzero_v2r8();
1830 fjy1 = _fjsp_setzero_v2r8();
1831 fjz1 = _fjsp_setzero_v2r8();
1832 fjx2 = _fjsp_setzero_v2r8();
1833 fjy2 = _fjsp_setzero_v2r8();
1834 fjz2 = _fjsp_setzero_v2r8();
1836 /**************************
1837 * CALCULATE INTERACTIONS *
1838 **************************/
1840 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
1842 /* Calculate table index by multiplying r with table scale and truncate to integer */
1843 rt = _fjsp_mul_v2r8(r00,vftabscale);
1844 itab_tmp = _fjsp_dtox_v2r8(rt);
1845 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1846 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
1847 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1852 /* EWALD ELECTROSTATICS */
1854 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1855 ewrt = _fjsp_mul_v2r8(r00,ewtabscale);
1856 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1857 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1858 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1860 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
1861 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1862 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq00,rinv00),_fjsp_sub_v2r8(rinvsq00,felec));
1864 /* CUBIC SPLINE TABLE DISPERSION */
1865 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1866 F = _fjsp_setzero_v2r8();
1867 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1868 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
1869 H = _fjsp_setzero_v2r8();
1870 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1871 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
1872 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
1873 fvdw6 = _fjsp_mul_v2r8(c6_00,FF);
1875 /* CUBIC SPLINE TABLE REPULSION */
1876 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
1877 F = _fjsp_setzero_v2r8();
1878 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1879 G = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
1880 H = _fjsp_setzero_v2r8();
1881 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1882 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
1883 FF = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
1884 fvdw12 = _fjsp_mul_v2r8(c12_00,FF);
1885 fvdw = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
1887 fscal = _fjsp_add_v2r8(felec,fvdw);
1889 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1891 /* Update vectorial force */
1892 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
1893 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
1894 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
1896 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
1897 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
1898 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
1900 /**************************
1901 * CALCULATE INTERACTIONS *
1902 **************************/
1904 r01 = _fjsp_mul_v2r8(rsq01,rinv01);
1906 /* EWALD ELECTROSTATICS */
1908 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1909 ewrt = _fjsp_mul_v2r8(r01,ewtabscale);
1910 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1911 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1912 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1914 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
1915 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1916 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq01,rinv01),_fjsp_sub_v2r8(rinvsq01,felec));
1920 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1922 /* Update vectorial force */
1923 fix0 = _fjsp_madd_v2r8(dx01,fscal,fix0);
1924 fiy0 = _fjsp_madd_v2r8(dy01,fscal,fiy0);
1925 fiz0 = _fjsp_madd_v2r8(dz01,fscal,fiz0);
1927 fjx1 = _fjsp_madd_v2r8(dx01,fscal,fjx1);
1928 fjy1 = _fjsp_madd_v2r8(dy01,fscal,fjy1);
1929 fjz1 = _fjsp_madd_v2r8(dz01,fscal,fjz1);
1931 /**************************
1932 * CALCULATE INTERACTIONS *
1933 **************************/
1935 r02 = _fjsp_mul_v2r8(rsq02,rinv02);
1937 /* EWALD ELECTROSTATICS */
1939 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1940 ewrt = _fjsp_mul_v2r8(r02,ewtabscale);
1941 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1942 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1943 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1945 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
1946 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1947 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq02,rinv02),_fjsp_sub_v2r8(rinvsq02,felec));
1951 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1953 /* Update vectorial force */
1954 fix0 = _fjsp_madd_v2r8(dx02,fscal,fix0);
1955 fiy0 = _fjsp_madd_v2r8(dy02,fscal,fiy0);
1956 fiz0 = _fjsp_madd_v2r8(dz02,fscal,fiz0);
1958 fjx2 = _fjsp_madd_v2r8(dx02,fscal,fjx2);
1959 fjy2 = _fjsp_madd_v2r8(dy02,fscal,fjy2);
1960 fjz2 = _fjsp_madd_v2r8(dz02,fscal,fjz2);
1962 /**************************
1963 * CALCULATE INTERACTIONS *
1964 **************************/
1966 r10 = _fjsp_mul_v2r8(rsq10,rinv10);
1968 /* EWALD ELECTROSTATICS */
1970 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1971 ewrt = _fjsp_mul_v2r8(r10,ewtabscale);
1972 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1973 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1974 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1976 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
1977 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1978 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,rinv10),_fjsp_sub_v2r8(rinvsq10,felec));
1982 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1984 /* Update vectorial force */
1985 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
1986 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
1987 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
1989 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
1990 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
1991 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
1993 /**************************
1994 * CALCULATE INTERACTIONS *
1995 **************************/
1997 r11 = _fjsp_mul_v2r8(rsq11,rinv11);
1999 /* EWALD ELECTROSTATICS */
2001 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
2002 ewrt = _fjsp_mul_v2r8(r11,ewtabscale);
2003 itab_tmp = _fjsp_dtox_v2r8(ewrt);
2004 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
2005 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
2007 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
2008 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
2009 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq11,rinv11),_fjsp_sub_v2r8(rinvsq11,felec));
2013 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2015 /* Update vectorial force */
2016 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
2017 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
2018 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
2020 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
2021 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
2022 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
2024 /**************************
2025 * CALCULATE INTERACTIONS *
2026 **************************/
2028 r12 = _fjsp_mul_v2r8(rsq12,rinv12);
2030 /* EWALD ELECTROSTATICS */
2032 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
2033 ewrt = _fjsp_mul_v2r8(r12,ewtabscale);
2034 itab_tmp = _fjsp_dtox_v2r8(ewrt);
2035 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
2036 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
2038 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
2039 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
2040 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq12,rinv12),_fjsp_sub_v2r8(rinvsq12,felec));
2044 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2046 /* Update vectorial force */
2047 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
2048 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
2049 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
2051 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
2052 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
2053 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
2055 /**************************
2056 * CALCULATE INTERACTIONS *
2057 **************************/
2059 r20 = _fjsp_mul_v2r8(rsq20,rinv20);
2061 /* EWALD ELECTROSTATICS */
2063 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
2064 ewrt = _fjsp_mul_v2r8(r20,ewtabscale);
2065 itab_tmp = _fjsp_dtox_v2r8(ewrt);
2066 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
2067 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
2069 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
2070 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
2071 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,rinv20),_fjsp_sub_v2r8(rinvsq20,felec));
2075 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2077 /* Update vectorial force */
2078 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
2079 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
2080 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
2082 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
2083 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
2084 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
2086 /**************************
2087 * CALCULATE INTERACTIONS *
2088 **************************/
2090 r21 = _fjsp_mul_v2r8(rsq21,rinv21);
2092 /* EWALD ELECTROSTATICS */
2094 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
2095 ewrt = _fjsp_mul_v2r8(r21,ewtabscale);
2096 itab_tmp = _fjsp_dtox_v2r8(ewrt);
2097 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
2098 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
2100 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
2101 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
2102 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq21,rinv21),_fjsp_sub_v2r8(rinvsq21,felec));
2106 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2108 /* Update vectorial force */
2109 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
2110 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
2111 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
2113 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
2114 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
2115 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
2117 /**************************
2118 * CALCULATE INTERACTIONS *
2119 **************************/
2121 r22 = _fjsp_mul_v2r8(rsq22,rinv22);
2123 /* EWALD ELECTROSTATICS */
2125 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
2126 ewrt = _fjsp_mul_v2r8(r22,ewtabscale);
2127 itab_tmp = _fjsp_dtox_v2r8(ewrt);
2128 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
2129 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
2131 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
2132 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
2133 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq22,rinv22),_fjsp_sub_v2r8(rinvsq22,felec));
2137 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2139 /* Update vectorial force */
2140 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
2141 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
2142 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
2144 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
2145 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
2146 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
2148 gmx_fjsp_decrement_3rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2);
2150 /* Inner loop uses 377 flops */
2153 /* End of innermost loop */
2155 gmx_fjsp_update_iforce_3atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,
2156 f+i_coord_offset,fshift+i_shift_offset);
2158 /* Increment number of inner iterations */
2159 inneriter += j_index_end - j_index_start;
2161 /* Outer loop uses 18 flops */
2164 /* Increment number of outer iterations */
2167 /* Update outer/inner flops */
2169 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3W3_F,outeriter*18 + inneriter*377);