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.
44 #include "../nb_kernel.h"
45 #include "types/simple.h"
46 #include "gromacs/legacyheaders/vec.h"
49 #include "kernelutil_sparc64_hpc_ace_double.h"
52 * Gromacs nonbonded kernel: nb_kernel_ElecEwSh_VdwNone_GeomW3W3_VF_sparc64_hpc_ace_double
53 * Electrostatics interaction: Ewald
54 * VdW interaction: None
55 * Geometry: Water3-Water3
56 * Calculate force/pot: PotentialAndForce
59 nb_kernel_ElecEwSh_VdwNone_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_unused * 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;
104 _fjsp_v2r8 ewtabscale,eweps,sh_ewald,ewrt,ewtabhalfspace,ewtabF,ewtabFn,ewtabD,ewtabV;
107 _fjsp_v2r8 dummy_mask,cutoff_mask;
108 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
109 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
110 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
117 jindex = nlist->jindex;
119 shiftidx = nlist->shift;
121 shiftvec = fr->shift_vec[0];
122 fshift = fr->fshift[0];
123 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
124 charge = mdatoms->chargeA;
126 sh_ewald = gmx_fjsp_set1_v2r8(fr->ic->sh_ewald);
127 ewtab = fr->ic->tabq_coul_FDV0;
128 ewtabscale = gmx_fjsp_set1_v2r8(fr->ic->tabq_scale);
129 ewtabhalfspace = gmx_fjsp_set1_v2r8(0.5/fr->ic->tabq_scale);
131 /* Setup water-specific parameters */
132 inr = nlist->iinr[0];
133 iq0 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+0]));
134 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
135 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
137 jq0 = gmx_fjsp_set1_v2r8(charge[inr+0]);
138 jq1 = gmx_fjsp_set1_v2r8(charge[inr+1]);
139 jq2 = gmx_fjsp_set1_v2r8(charge[inr+2]);
140 qq00 = _fjsp_mul_v2r8(iq0,jq0);
141 qq01 = _fjsp_mul_v2r8(iq0,jq1);
142 qq02 = _fjsp_mul_v2r8(iq0,jq2);
143 qq10 = _fjsp_mul_v2r8(iq1,jq0);
144 qq11 = _fjsp_mul_v2r8(iq1,jq1);
145 qq12 = _fjsp_mul_v2r8(iq1,jq2);
146 qq20 = _fjsp_mul_v2r8(iq2,jq0);
147 qq21 = _fjsp_mul_v2r8(iq2,jq1);
148 qq22 = _fjsp_mul_v2r8(iq2,jq2);
150 /* When we use explicit cutoffs the value must be identical for elec and VdW, so use elec as an arbitrary choice */
151 rcutoff_scalar = fr->rcoulomb;
152 rcutoff = gmx_fjsp_set1_v2r8(rcutoff_scalar);
153 rcutoff2 = _fjsp_mul_v2r8(rcutoff,rcutoff);
155 /* Avoid stupid compiler warnings */
163 /* Start outer loop over neighborlists */
164 for(iidx=0; iidx<nri; iidx++)
166 /* Load shift vector for this list */
167 i_shift_offset = DIM*shiftidx[iidx];
169 /* Load limits for loop over neighbors */
170 j_index_start = jindex[iidx];
171 j_index_end = jindex[iidx+1];
173 /* Get outer coordinate index */
175 i_coord_offset = DIM*inr;
177 /* Load i particle coords and add shift vector */
178 gmx_fjsp_load_shift_and_3rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
179 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2);
181 fix0 = _fjsp_setzero_v2r8();
182 fiy0 = _fjsp_setzero_v2r8();
183 fiz0 = _fjsp_setzero_v2r8();
184 fix1 = _fjsp_setzero_v2r8();
185 fiy1 = _fjsp_setzero_v2r8();
186 fiz1 = _fjsp_setzero_v2r8();
187 fix2 = _fjsp_setzero_v2r8();
188 fiy2 = _fjsp_setzero_v2r8();
189 fiz2 = _fjsp_setzero_v2r8();
191 /* Reset potential sums */
192 velecsum = _fjsp_setzero_v2r8();
194 /* Start inner kernel loop */
195 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
198 /* Get j neighbor index, and coordinate index */
201 j_coord_offsetA = DIM*jnrA;
202 j_coord_offsetB = DIM*jnrB;
204 /* load j atom coordinates */
205 gmx_fjsp_load_3rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
206 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,&jy2,&jz2);
208 /* Calculate displacement vector */
209 dx00 = _fjsp_sub_v2r8(ix0,jx0);
210 dy00 = _fjsp_sub_v2r8(iy0,jy0);
211 dz00 = _fjsp_sub_v2r8(iz0,jz0);
212 dx01 = _fjsp_sub_v2r8(ix0,jx1);
213 dy01 = _fjsp_sub_v2r8(iy0,jy1);
214 dz01 = _fjsp_sub_v2r8(iz0,jz1);
215 dx02 = _fjsp_sub_v2r8(ix0,jx2);
216 dy02 = _fjsp_sub_v2r8(iy0,jy2);
217 dz02 = _fjsp_sub_v2r8(iz0,jz2);
218 dx10 = _fjsp_sub_v2r8(ix1,jx0);
219 dy10 = _fjsp_sub_v2r8(iy1,jy0);
220 dz10 = _fjsp_sub_v2r8(iz1,jz0);
221 dx11 = _fjsp_sub_v2r8(ix1,jx1);
222 dy11 = _fjsp_sub_v2r8(iy1,jy1);
223 dz11 = _fjsp_sub_v2r8(iz1,jz1);
224 dx12 = _fjsp_sub_v2r8(ix1,jx2);
225 dy12 = _fjsp_sub_v2r8(iy1,jy2);
226 dz12 = _fjsp_sub_v2r8(iz1,jz2);
227 dx20 = _fjsp_sub_v2r8(ix2,jx0);
228 dy20 = _fjsp_sub_v2r8(iy2,jy0);
229 dz20 = _fjsp_sub_v2r8(iz2,jz0);
230 dx21 = _fjsp_sub_v2r8(ix2,jx1);
231 dy21 = _fjsp_sub_v2r8(iy2,jy1);
232 dz21 = _fjsp_sub_v2r8(iz2,jz1);
233 dx22 = _fjsp_sub_v2r8(ix2,jx2);
234 dy22 = _fjsp_sub_v2r8(iy2,jy2);
235 dz22 = _fjsp_sub_v2r8(iz2,jz2);
237 /* Calculate squared distance and things based on it */
238 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
239 rsq01 = gmx_fjsp_calc_rsq_v2r8(dx01,dy01,dz01);
240 rsq02 = gmx_fjsp_calc_rsq_v2r8(dx02,dy02,dz02);
241 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
242 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
243 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
244 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
245 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
246 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
248 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
249 rinv01 = gmx_fjsp_invsqrt_v2r8(rsq01);
250 rinv02 = gmx_fjsp_invsqrt_v2r8(rsq02);
251 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
252 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
253 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
254 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
255 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
256 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
258 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
259 rinvsq01 = _fjsp_mul_v2r8(rinv01,rinv01);
260 rinvsq02 = _fjsp_mul_v2r8(rinv02,rinv02);
261 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
262 rinvsq11 = _fjsp_mul_v2r8(rinv11,rinv11);
263 rinvsq12 = _fjsp_mul_v2r8(rinv12,rinv12);
264 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
265 rinvsq21 = _fjsp_mul_v2r8(rinv21,rinv21);
266 rinvsq22 = _fjsp_mul_v2r8(rinv22,rinv22);
268 fjx0 = _fjsp_setzero_v2r8();
269 fjy0 = _fjsp_setzero_v2r8();
270 fjz0 = _fjsp_setzero_v2r8();
271 fjx1 = _fjsp_setzero_v2r8();
272 fjy1 = _fjsp_setzero_v2r8();
273 fjz1 = _fjsp_setzero_v2r8();
274 fjx2 = _fjsp_setzero_v2r8();
275 fjy2 = _fjsp_setzero_v2r8();
276 fjz2 = _fjsp_setzero_v2r8();
278 /**************************
279 * CALCULATE INTERACTIONS *
280 **************************/
282 if (gmx_fjsp_any_lt_v2r8(rsq00,rcutoff2))
285 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
287 /* EWALD ELECTROSTATICS */
289 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
290 ewrt = _fjsp_mul_v2r8(r00,ewtabscale);
291 itab_tmp = _fjsp_dtox_v2r8(ewrt);
292 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
293 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
295 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
296 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
297 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
298 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
299 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
300 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
301 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
302 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
303 velec = _fjsp_mul_v2r8(qq00,_fjsp_sub_v2r8(_fjsp_sub_v2r8(rinv00,sh_ewald),velec));
304 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq00,rinv00),_fjsp_sub_v2r8(rinvsq00,felec));
306 cutoff_mask = _fjsp_cmplt_v2r8(rsq00,rcutoff2);
308 /* Update potential sum for this i atom from the interaction with this j atom. */
309 velec = _fjsp_and_v2r8(velec,cutoff_mask);
310 velecsum = _fjsp_add_v2r8(velecsum,velec);
314 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
316 /* Update vectorial force */
317 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
318 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
319 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
321 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
322 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
323 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
327 /**************************
328 * CALCULATE INTERACTIONS *
329 **************************/
331 if (gmx_fjsp_any_lt_v2r8(rsq01,rcutoff2))
334 r01 = _fjsp_mul_v2r8(rsq01,rinv01);
336 /* EWALD ELECTROSTATICS */
338 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
339 ewrt = _fjsp_mul_v2r8(r01,ewtabscale);
340 itab_tmp = _fjsp_dtox_v2r8(ewrt);
341 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
342 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
344 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
345 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
346 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
347 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
348 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
349 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
350 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
351 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
352 velec = _fjsp_mul_v2r8(qq01,_fjsp_sub_v2r8(_fjsp_sub_v2r8(rinv01,sh_ewald),velec));
353 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq01,rinv01),_fjsp_sub_v2r8(rinvsq01,felec));
355 cutoff_mask = _fjsp_cmplt_v2r8(rsq01,rcutoff2);
357 /* Update potential sum for this i atom from the interaction with this j atom. */
358 velec = _fjsp_and_v2r8(velec,cutoff_mask);
359 velecsum = _fjsp_add_v2r8(velecsum,velec);
363 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
365 /* Update vectorial force */
366 fix0 = _fjsp_madd_v2r8(dx01,fscal,fix0);
367 fiy0 = _fjsp_madd_v2r8(dy01,fscal,fiy0);
368 fiz0 = _fjsp_madd_v2r8(dz01,fscal,fiz0);
370 fjx1 = _fjsp_madd_v2r8(dx01,fscal,fjx1);
371 fjy1 = _fjsp_madd_v2r8(dy01,fscal,fjy1);
372 fjz1 = _fjsp_madd_v2r8(dz01,fscal,fjz1);
376 /**************************
377 * CALCULATE INTERACTIONS *
378 **************************/
380 if (gmx_fjsp_any_lt_v2r8(rsq02,rcutoff2))
383 r02 = _fjsp_mul_v2r8(rsq02,rinv02);
385 /* EWALD ELECTROSTATICS */
387 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
388 ewrt = _fjsp_mul_v2r8(r02,ewtabscale);
389 itab_tmp = _fjsp_dtox_v2r8(ewrt);
390 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
391 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
393 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
394 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
395 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
396 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
397 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
398 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
399 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
400 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
401 velec = _fjsp_mul_v2r8(qq02,_fjsp_sub_v2r8(_fjsp_sub_v2r8(rinv02,sh_ewald),velec));
402 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq02,rinv02),_fjsp_sub_v2r8(rinvsq02,felec));
404 cutoff_mask = _fjsp_cmplt_v2r8(rsq02,rcutoff2);
406 /* Update potential sum for this i atom from the interaction with this j atom. */
407 velec = _fjsp_and_v2r8(velec,cutoff_mask);
408 velecsum = _fjsp_add_v2r8(velecsum,velec);
412 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
414 /* Update vectorial force */
415 fix0 = _fjsp_madd_v2r8(dx02,fscal,fix0);
416 fiy0 = _fjsp_madd_v2r8(dy02,fscal,fiy0);
417 fiz0 = _fjsp_madd_v2r8(dz02,fscal,fiz0);
419 fjx2 = _fjsp_madd_v2r8(dx02,fscal,fjx2);
420 fjy2 = _fjsp_madd_v2r8(dy02,fscal,fjy2);
421 fjz2 = _fjsp_madd_v2r8(dz02,fscal,fjz2);
425 /**************************
426 * CALCULATE INTERACTIONS *
427 **************************/
429 if (gmx_fjsp_any_lt_v2r8(rsq10,rcutoff2))
432 r10 = _fjsp_mul_v2r8(rsq10,rinv10);
434 /* EWALD ELECTROSTATICS */
436 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
437 ewrt = _fjsp_mul_v2r8(r10,ewtabscale);
438 itab_tmp = _fjsp_dtox_v2r8(ewrt);
439 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
440 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
442 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
443 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
444 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
445 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
446 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
447 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
448 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
449 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
450 velec = _fjsp_mul_v2r8(qq10,_fjsp_sub_v2r8(_fjsp_sub_v2r8(rinv10,sh_ewald),velec));
451 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,rinv10),_fjsp_sub_v2r8(rinvsq10,felec));
453 cutoff_mask = _fjsp_cmplt_v2r8(rsq10,rcutoff2);
455 /* Update potential sum for this i atom from the interaction with this j atom. */
456 velec = _fjsp_and_v2r8(velec,cutoff_mask);
457 velecsum = _fjsp_add_v2r8(velecsum,velec);
461 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
463 /* Update vectorial force */
464 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
465 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
466 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
468 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
469 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
470 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
474 /**************************
475 * CALCULATE INTERACTIONS *
476 **************************/
478 if (gmx_fjsp_any_lt_v2r8(rsq11,rcutoff2))
481 r11 = _fjsp_mul_v2r8(rsq11,rinv11);
483 /* EWALD ELECTROSTATICS */
485 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
486 ewrt = _fjsp_mul_v2r8(r11,ewtabscale);
487 itab_tmp = _fjsp_dtox_v2r8(ewrt);
488 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
489 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
491 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
492 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
493 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
494 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
495 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
496 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
497 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
498 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
499 velec = _fjsp_mul_v2r8(qq11,_fjsp_sub_v2r8(_fjsp_sub_v2r8(rinv11,sh_ewald),velec));
500 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq11,rinv11),_fjsp_sub_v2r8(rinvsq11,felec));
502 cutoff_mask = _fjsp_cmplt_v2r8(rsq11,rcutoff2);
504 /* Update potential sum for this i atom from the interaction with this j atom. */
505 velec = _fjsp_and_v2r8(velec,cutoff_mask);
506 velecsum = _fjsp_add_v2r8(velecsum,velec);
510 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
512 /* Update vectorial force */
513 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
514 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
515 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
517 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
518 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
519 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
523 /**************************
524 * CALCULATE INTERACTIONS *
525 **************************/
527 if (gmx_fjsp_any_lt_v2r8(rsq12,rcutoff2))
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(_fjsp_sub_v2r8(rinv12,sh_ewald),velec));
549 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq12,rinv12),_fjsp_sub_v2r8(rinvsq12,felec));
551 cutoff_mask = _fjsp_cmplt_v2r8(rsq12,rcutoff2);
553 /* Update potential sum for this i atom from the interaction with this j atom. */
554 velec = _fjsp_and_v2r8(velec,cutoff_mask);
555 velecsum = _fjsp_add_v2r8(velecsum,velec);
559 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
561 /* Update vectorial force */
562 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
563 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
564 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
566 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
567 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
568 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
572 /**************************
573 * CALCULATE INTERACTIONS *
574 **************************/
576 if (gmx_fjsp_any_lt_v2r8(rsq20,rcutoff2))
579 r20 = _fjsp_mul_v2r8(rsq20,rinv20);
581 /* EWALD ELECTROSTATICS */
583 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
584 ewrt = _fjsp_mul_v2r8(r20,ewtabscale);
585 itab_tmp = _fjsp_dtox_v2r8(ewrt);
586 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
587 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
589 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
590 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
591 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
592 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
593 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
594 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
595 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
596 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
597 velec = _fjsp_mul_v2r8(qq20,_fjsp_sub_v2r8(_fjsp_sub_v2r8(rinv20,sh_ewald),velec));
598 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,rinv20),_fjsp_sub_v2r8(rinvsq20,felec));
600 cutoff_mask = _fjsp_cmplt_v2r8(rsq20,rcutoff2);
602 /* Update potential sum for this i atom from the interaction with this j atom. */
603 velec = _fjsp_and_v2r8(velec,cutoff_mask);
604 velecsum = _fjsp_add_v2r8(velecsum,velec);
608 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
610 /* Update vectorial force */
611 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
612 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
613 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
615 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
616 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
617 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
621 /**************************
622 * CALCULATE INTERACTIONS *
623 **************************/
625 if (gmx_fjsp_any_lt_v2r8(rsq21,rcutoff2))
628 r21 = _fjsp_mul_v2r8(rsq21,rinv21);
630 /* EWALD ELECTROSTATICS */
632 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
633 ewrt = _fjsp_mul_v2r8(r21,ewtabscale);
634 itab_tmp = _fjsp_dtox_v2r8(ewrt);
635 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
636 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
638 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
639 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
640 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
641 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
642 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
643 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
644 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
645 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
646 velec = _fjsp_mul_v2r8(qq21,_fjsp_sub_v2r8(_fjsp_sub_v2r8(rinv21,sh_ewald),velec));
647 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq21,rinv21),_fjsp_sub_v2r8(rinvsq21,felec));
649 cutoff_mask = _fjsp_cmplt_v2r8(rsq21,rcutoff2);
651 /* Update potential sum for this i atom from the interaction with this j atom. */
652 velec = _fjsp_and_v2r8(velec,cutoff_mask);
653 velecsum = _fjsp_add_v2r8(velecsum,velec);
657 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
659 /* Update vectorial force */
660 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
661 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
662 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
664 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
665 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
666 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
670 /**************************
671 * CALCULATE INTERACTIONS *
672 **************************/
674 if (gmx_fjsp_any_lt_v2r8(rsq22,rcutoff2))
677 r22 = _fjsp_mul_v2r8(rsq22,rinv22);
679 /* EWALD ELECTROSTATICS */
681 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
682 ewrt = _fjsp_mul_v2r8(r22,ewtabscale);
683 itab_tmp = _fjsp_dtox_v2r8(ewrt);
684 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
685 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
687 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
688 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
689 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
690 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
691 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
692 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
693 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
694 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
695 velec = _fjsp_mul_v2r8(qq22,_fjsp_sub_v2r8(_fjsp_sub_v2r8(rinv22,sh_ewald),velec));
696 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq22,rinv22),_fjsp_sub_v2r8(rinvsq22,felec));
698 cutoff_mask = _fjsp_cmplt_v2r8(rsq22,rcutoff2);
700 /* Update potential sum for this i atom from the interaction with this j atom. */
701 velec = _fjsp_and_v2r8(velec,cutoff_mask);
702 velecsum = _fjsp_add_v2r8(velecsum,velec);
706 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
708 /* Update vectorial force */
709 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
710 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
711 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
713 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
714 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
715 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
719 gmx_fjsp_decrement_3rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2);
721 /* Inner loop uses 441 flops */
728 j_coord_offsetA = DIM*jnrA;
730 /* load j atom coordinates */
731 gmx_fjsp_load_3rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
732 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,&jy2,&jz2);
734 /* Calculate displacement vector */
735 dx00 = _fjsp_sub_v2r8(ix0,jx0);
736 dy00 = _fjsp_sub_v2r8(iy0,jy0);
737 dz00 = _fjsp_sub_v2r8(iz0,jz0);
738 dx01 = _fjsp_sub_v2r8(ix0,jx1);
739 dy01 = _fjsp_sub_v2r8(iy0,jy1);
740 dz01 = _fjsp_sub_v2r8(iz0,jz1);
741 dx02 = _fjsp_sub_v2r8(ix0,jx2);
742 dy02 = _fjsp_sub_v2r8(iy0,jy2);
743 dz02 = _fjsp_sub_v2r8(iz0,jz2);
744 dx10 = _fjsp_sub_v2r8(ix1,jx0);
745 dy10 = _fjsp_sub_v2r8(iy1,jy0);
746 dz10 = _fjsp_sub_v2r8(iz1,jz0);
747 dx11 = _fjsp_sub_v2r8(ix1,jx1);
748 dy11 = _fjsp_sub_v2r8(iy1,jy1);
749 dz11 = _fjsp_sub_v2r8(iz1,jz1);
750 dx12 = _fjsp_sub_v2r8(ix1,jx2);
751 dy12 = _fjsp_sub_v2r8(iy1,jy2);
752 dz12 = _fjsp_sub_v2r8(iz1,jz2);
753 dx20 = _fjsp_sub_v2r8(ix2,jx0);
754 dy20 = _fjsp_sub_v2r8(iy2,jy0);
755 dz20 = _fjsp_sub_v2r8(iz2,jz0);
756 dx21 = _fjsp_sub_v2r8(ix2,jx1);
757 dy21 = _fjsp_sub_v2r8(iy2,jy1);
758 dz21 = _fjsp_sub_v2r8(iz2,jz1);
759 dx22 = _fjsp_sub_v2r8(ix2,jx2);
760 dy22 = _fjsp_sub_v2r8(iy2,jy2);
761 dz22 = _fjsp_sub_v2r8(iz2,jz2);
763 /* Calculate squared distance and things based on it */
764 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
765 rsq01 = gmx_fjsp_calc_rsq_v2r8(dx01,dy01,dz01);
766 rsq02 = gmx_fjsp_calc_rsq_v2r8(dx02,dy02,dz02);
767 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
768 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
769 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
770 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
771 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
772 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
774 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
775 rinv01 = gmx_fjsp_invsqrt_v2r8(rsq01);
776 rinv02 = gmx_fjsp_invsqrt_v2r8(rsq02);
777 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
778 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
779 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
780 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
781 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
782 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
784 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
785 rinvsq01 = _fjsp_mul_v2r8(rinv01,rinv01);
786 rinvsq02 = _fjsp_mul_v2r8(rinv02,rinv02);
787 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
788 rinvsq11 = _fjsp_mul_v2r8(rinv11,rinv11);
789 rinvsq12 = _fjsp_mul_v2r8(rinv12,rinv12);
790 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
791 rinvsq21 = _fjsp_mul_v2r8(rinv21,rinv21);
792 rinvsq22 = _fjsp_mul_v2r8(rinv22,rinv22);
794 fjx0 = _fjsp_setzero_v2r8();
795 fjy0 = _fjsp_setzero_v2r8();
796 fjz0 = _fjsp_setzero_v2r8();
797 fjx1 = _fjsp_setzero_v2r8();
798 fjy1 = _fjsp_setzero_v2r8();
799 fjz1 = _fjsp_setzero_v2r8();
800 fjx2 = _fjsp_setzero_v2r8();
801 fjy2 = _fjsp_setzero_v2r8();
802 fjz2 = _fjsp_setzero_v2r8();
804 /**************************
805 * CALCULATE INTERACTIONS *
806 **************************/
808 if (gmx_fjsp_any_lt_v2r8(rsq00,rcutoff2))
811 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
813 /* EWALD ELECTROSTATICS */
815 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
816 ewrt = _fjsp_mul_v2r8(r00,ewtabscale);
817 itab_tmp = _fjsp_dtox_v2r8(ewrt);
818 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
819 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
821 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
822 ewtabD = _fjsp_setzero_v2r8();
823 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
824 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
825 ewtabFn = _fjsp_setzero_v2r8();
826 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
827 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
828 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
829 velec = _fjsp_mul_v2r8(qq00,_fjsp_sub_v2r8(_fjsp_sub_v2r8(rinv00,sh_ewald),velec));
830 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq00,rinv00),_fjsp_sub_v2r8(rinvsq00,felec));
832 cutoff_mask = _fjsp_cmplt_v2r8(rsq00,rcutoff2);
834 /* Update potential sum for this i atom from the interaction with this j atom. */
835 velec = _fjsp_and_v2r8(velec,cutoff_mask);
836 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
837 velecsum = _fjsp_add_v2r8(velecsum,velec);
841 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
843 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
845 /* Update vectorial force */
846 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
847 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
848 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
850 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
851 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
852 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
856 /**************************
857 * CALCULATE INTERACTIONS *
858 **************************/
860 if (gmx_fjsp_any_lt_v2r8(rsq01,rcutoff2))
863 r01 = _fjsp_mul_v2r8(rsq01,rinv01);
865 /* EWALD ELECTROSTATICS */
867 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
868 ewrt = _fjsp_mul_v2r8(r01,ewtabscale);
869 itab_tmp = _fjsp_dtox_v2r8(ewrt);
870 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
871 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
873 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
874 ewtabD = _fjsp_setzero_v2r8();
875 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
876 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
877 ewtabFn = _fjsp_setzero_v2r8();
878 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
879 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
880 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
881 velec = _fjsp_mul_v2r8(qq01,_fjsp_sub_v2r8(_fjsp_sub_v2r8(rinv01,sh_ewald),velec));
882 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq01,rinv01),_fjsp_sub_v2r8(rinvsq01,felec));
884 cutoff_mask = _fjsp_cmplt_v2r8(rsq01,rcutoff2);
886 /* Update potential sum for this i atom from the interaction with this j atom. */
887 velec = _fjsp_and_v2r8(velec,cutoff_mask);
888 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
889 velecsum = _fjsp_add_v2r8(velecsum,velec);
893 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
895 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
897 /* Update vectorial force */
898 fix0 = _fjsp_madd_v2r8(dx01,fscal,fix0);
899 fiy0 = _fjsp_madd_v2r8(dy01,fscal,fiy0);
900 fiz0 = _fjsp_madd_v2r8(dz01,fscal,fiz0);
902 fjx1 = _fjsp_madd_v2r8(dx01,fscal,fjx1);
903 fjy1 = _fjsp_madd_v2r8(dy01,fscal,fjy1);
904 fjz1 = _fjsp_madd_v2r8(dz01,fscal,fjz1);
908 /**************************
909 * CALCULATE INTERACTIONS *
910 **************************/
912 if (gmx_fjsp_any_lt_v2r8(rsq02,rcutoff2))
915 r02 = _fjsp_mul_v2r8(rsq02,rinv02);
917 /* EWALD ELECTROSTATICS */
919 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
920 ewrt = _fjsp_mul_v2r8(r02,ewtabscale);
921 itab_tmp = _fjsp_dtox_v2r8(ewrt);
922 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
923 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
925 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
926 ewtabD = _fjsp_setzero_v2r8();
927 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
928 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
929 ewtabFn = _fjsp_setzero_v2r8();
930 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
931 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
932 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
933 velec = _fjsp_mul_v2r8(qq02,_fjsp_sub_v2r8(_fjsp_sub_v2r8(rinv02,sh_ewald),velec));
934 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq02,rinv02),_fjsp_sub_v2r8(rinvsq02,felec));
936 cutoff_mask = _fjsp_cmplt_v2r8(rsq02,rcutoff2);
938 /* Update potential sum for this i atom from the interaction with this j atom. */
939 velec = _fjsp_and_v2r8(velec,cutoff_mask);
940 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
941 velecsum = _fjsp_add_v2r8(velecsum,velec);
945 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
947 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
949 /* Update vectorial force */
950 fix0 = _fjsp_madd_v2r8(dx02,fscal,fix0);
951 fiy0 = _fjsp_madd_v2r8(dy02,fscal,fiy0);
952 fiz0 = _fjsp_madd_v2r8(dz02,fscal,fiz0);
954 fjx2 = _fjsp_madd_v2r8(dx02,fscal,fjx2);
955 fjy2 = _fjsp_madd_v2r8(dy02,fscal,fjy2);
956 fjz2 = _fjsp_madd_v2r8(dz02,fscal,fjz2);
960 /**************************
961 * CALCULATE INTERACTIONS *
962 **************************/
964 if (gmx_fjsp_any_lt_v2r8(rsq10,rcutoff2))
967 r10 = _fjsp_mul_v2r8(rsq10,rinv10);
969 /* EWALD ELECTROSTATICS */
971 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
972 ewrt = _fjsp_mul_v2r8(r10,ewtabscale);
973 itab_tmp = _fjsp_dtox_v2r8(ewrt);
974 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
975 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
977 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
978 ewtabD = _fjsp_setzero_v2r8();
979 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
980 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
981 ewtabFn = _fjsp_setzero_v2r8();
982 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
983 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
984 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
985 velec = _fjsp_mul_v2r8(qq10,_fjsp_sub_v2r8(_fjsp_sub_v2r8(rinv10,sh_ewald),velec));
986 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,rinv10),_fjsp_sub_v2r8(rinvsq10,felec));
988 cutoff_mask = _fjsp_cmplt_v2r8(rsq10,rcutoff2);
990 /* Update potential sum for this i atom from the interaction with this j atom. */
991 velec = _fjsp_and_v2r8(velec,cutoff_mask);
992 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
993 velecsum = _fjsp_add_v2r8(velecsum,velec);
997 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
999 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1001 /* Update vectorial force */
1002 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
1003 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
1004 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
1006 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
1007 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
1008 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
1012 /**************************
1013 * CALCULATE INTERACTIONS *
1014 **************************/
1016 if (gmx_fjsp_any_lt_v2r8(rsq11,rcutoff2))
1019 r11 = _fjsp_mul_v2r8(rsq11,rinv11);
1021 /* EWALD ELECTROSTATICS */
1023 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1024 ewrt = _fjsp_mul_v2r8(r11,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(qq11,_fjsp_sub_v2r8(_fjsp_sub_v2r8(rinv11,sh_ewald),velec));
1038 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq11,rinv11),_fjsp_sub_v2r8(rinvsq11,felec));
1040 cutoff_mask = _fjsp_cmplt_v2r8(rsq11,rcutoff2);
1042 /* Update potential sum for this i atom from the interaction with this j atom. */
1043 velec = _fjsp_and_v2r8(velec,cutoff_mask);
1044 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1045 velecsum = _fjsp_add_v2r8(velecsum,velec);
1049 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
1051 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1053 /* Update vectorial force */
1054 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
1055 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
1056 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
1058 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
1059 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
1060 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
1064 /**************************
1065 * CALCULATE INTERACTIONS *
1066 **************************/
1068 if (gmx_fjsp_any_lt_v2r8(rsq12,rcutoff2))
1071 r12 = _fjsp_mul_v2r8(rsq12,rinv12);
1073 /* EWALD ELECTROSTATICS */
1075 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1076 ewrt = _fjsp_mul_v2r8(r12,ewtabscale);
1077 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1078 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1079 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1081 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
1082 ewtabD = _fjsp_setzero_v2r8();
1083 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
1084 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
1085 ewtabFn = _fjsp_setzero_v2r8();
1086 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
1087 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
1088 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
1089 velec = _fjsp_mul_v2r8(qq12,_fjsp_sub_v2r8(_fjsp_sub_v2r8(rinv12,sh_ewald),velec));
1090 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq12,rinv12),_fjsp_sub_v2r8(rinvsq12,felec));
1092 cutoff_mask = _fjsp_cmplt_v2r8(rsq12,rcutoff2);
1094 /* Update potential sum for this i atom from the interaction with this j atom. */
1095 velec = _fjsp_and_v2r8(velec,cutoff_mask);
1096 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1097 velecsum = _fjsp_add_v2r8(velecsum,velec);
1101 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
1103 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1105 /* Update vectorial force */
1106 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
1107 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
1108 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
1110 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
1111 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
1112 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
1116 /**************************
1117 * CALCULATE INTERACTIONS *
1118 **************************/
1120 if (gmx_fjsp_any_lt_v2r8(rsq20,rcutoff2))
1123 r20 = _fjsp_mul_v2r8(rsq20,rinv20);
1125 /* EWALD ELECTROSTATICS */
1127 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1128 ewrt = _fjsp_mul_v2r8(r20,ewtabscale);
1129 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1130 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1131 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1133 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
1134 ewtabD = _fjsp_setzero_v2r8();
1135 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
1136 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
1137 ewtabFn = _fjsp_setzero_v2r8();
1138 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
1139 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
1140 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
1141 velec = _fjsp_mul_v2r8(qq20,_fjsp_sub_v2r8(_fjsp_sub_v2r8(rinv20,sh_ewald),velec));
1142 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,rinv20),_fjsp_sub_v2r8(rinvsq20,felec));
1144 cutoff_mask = _fjsp_cmplt_v2r8(rsq20,rcutoff2);
1146 /* Update potential sum for this i atom from the interaction with this j atom. */
1147 velec = _fjsp_and_v2r8(velec,cutoff_mask);
1148 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1149 velecsum = _fjsp_add_v2r8(velecsum,velec);
1153 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
1155 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1157 /* Update vectorial force */
1158 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
1159 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
1160 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
1162 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
1163 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
1164 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
1168 /**************************
1169 * CALCULATE INTERACTIONS *
1170 **************************/
1172 if (gmx_fjsp_any_lt_v2r8(rsq21,rcutoff2))
1175 r21 = _fjsp_mul_v2r8(rsq21,rinv21);
1177 /* EWALD ELECTROSTATICS */
1179 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1180 ewrt = _fjsp_mul_v2r8(r21,ewtabscale);
1181 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1182 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1183 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1185 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
1186 ewtabD = _fjsp_setzero_v2r8();
1187 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
1188 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
1189 ewtabFn = _fjsp_setzero_v2r8();
1190 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
1191 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
1192 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
1193 velec = _fjsp_mul_v2r8(qq21,_fjsp_sub_v2r8(_fjsp_sub_v2r8(rinv21,sh_ewald),velec));
1194 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq21,rinv21),_fjsp_sub_v2r8(rinvsq21,felec));
1196 cutoff_mask = _fjsp_cmplt_v2r8(rsq21,rcutoff2);
1198 /* Update potential sum for this i atom from the interaction with this j atom. */
1199 velec = _fjsp_and_v2r8(velec,cutoff_mask);
1200 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1201 velecsum = _fjsp_add_v2r8(velecsum,velec);
1205 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
1207 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1209 /* Update vectorial force */
1210 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
1211 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
1212 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
1214 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
1215 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
1216 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
1220 /**************************
1221 * CALCULATE INTERACTIONS *
1222 **************************/
1224 if (gmx_fjsp_any_lt_v2r8(rsq22,rcutoff2))
1227 r22 = _fjsp_mul_v2r8(rsq22,rinv22);
1229 /* EWALD ELECTROSTATICS */
1231 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1232 ewrt = _fjsp_mul_v2r8(r22,ewtabscale);
1233 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1234 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1235 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1237 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
1238 ewtabD = _fjsp_setzero_v2r8();
1239 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
1240 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
1241 ewtabFn = _fjsp_setzero_v2r8();
1242 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
1243 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
1244 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
1245 velec = _fjsp_mul_v2r8(qq22,_fjsp_sub_v2r8(_fjsp_sub_v2r8(rinv22,sh_ewald),velec));
1246 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq22,rinv22),_fjsp_sub_v2r8(rinvsq22,felec));
1248 cutoff_mask = _fjsp_cmplt_v2r8(rsq22,rcutoff2);
1250 /* Update potential sum for this i atom from the interaction with this j atom. */
1251 velec = _fjsp_and_v2r8(velec,cutoff_mask);
1252 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1253 velecsum = _fjsp_add_v2r8(velecsum,velec);
1257 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
1259 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1261 /* Update vectorial force */
1262 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
1263 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
1264 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
1266 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
1267 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
1268 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
1272 gmx_fjsp_decrement_3rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2);
1274 /* Inner loop uses 441 flops */
1277 /* End of innermost loop */
1279 gmx_fjsp_update_iforce_3atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,
1280 f+i_coord_offset,fshift+i_shift_offset);
1283 /* Update potential energies */
1284 gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
1286 /* Increment number of inner iterations */
1287 inneriter += j_index_end - j_index_start;
1289 /* Outer loop uses 19 flops */
1292 /* Increment number of outer iterations */
1295 /* Update outer/inner flops */
1297 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_W3W3_VF,outeriter*19 + inneriter*441);
1300 * Gromacs nonbonded kernel: nb_kernel_ElecEwSh_VdwNone_GeomW3W3_F_sparc64_hpc_ace_double
1301 * Electrostatics interaction: Ewald
1302 * VdW interaction: None
1303 * Geometry: Water3-Water3
1304 * Calculate force/pot: Force
1307 nb_kernel_ElecEwSh_VdwNone_GeomW3W3_F_sparc64_hpc_ace_double
1308 (t_nblist * gmx_restrict nlist,
1309 rvec * gmx_restrict xx,
1310 rvec * gmx_restrict ff,
1311 t_forcerec * gmx_restrict fr,
1312 t_mdatoms * gmx_restrict mdatoms,
1313 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
1314 t_nrnb * gmx_restrict nrnb)
1316 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
1317 * just 0 for non-waters.
1318 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
1319 * jnr indices corresponding to data put in the four positions in the SIMD register.
1321 int i_shift_offset,i_coord_offset,outeriter,inneriter;
1322 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
1324 int j_coord_offsetA,j_coord_offsetB;
1325 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
1326 real rcutoff_scalar;
1327 real *shiftvec,*fshift,*x,*f;
1328 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
1330 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
1332 _fjsp_v2r8 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
1334 _fjsp_v2r8 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
1335 int vdwjidx0A,vdwjidx0B;
1336 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
1337 int vdwjidx1A,vdwjidx1B;
1338 _fjsp_v2r8 jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
1339 int vdwjidx2A,vdwjidx2B;
1340 _fjsp_v2r8 jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
1341 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
1342 _fjsp_v2r8 dx01,dy01,dz01,rsq01,rinv01,rinvsq01,r01,qq01,c6_01,c12_01;
1343 _fjsp_v2r8 dx02,dy02,dz02,rsq02,rinv02,rinvsq02,r02,qq02,c6_02,c12_02;
1344 _fjsp_v2r8 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
1345 _fjsp_v2r8 dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11;
1346 _fjsp_v2r8 dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12;
1347 _fjsp_v2r8 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
1348 _fjsp_v2r8 dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21;
1349 _fjsp_v2r8 dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22;
1350 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
1352 _fjsp_v2r8 ewtabscale,eweps,sh_ewald,ewrt,ewtabhalfspace,ewtabF,ewtabFn,ewtabD,ewtabV;
1354 _fjsp_v2r8 itab_tmp;
1355 _fjsp_v2r8 dummy_mask,cutoff_mask;
1356 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
1357 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
1358 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
1365 jindex = nlist->jindex;
1367 shiftidx = nlist->shift;
1369 shiftvec = fr->shift_vec[0];
1370 fshift = fr->fshift[0];
1371 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
1372 charge = mdatoms->chargeA;
1374 sh_ewald = gmx_fjsp_set1_v2r8(fr->ic->sh_ewald);
1375 ewtab = fr->ic->tabq_coul_F;
1376 ewtabscale = gmx_fjsp_set1_v2r8(fr->ic->tabq_scale);
1377 ewtabhalfspace = gmx_fjsp_set1_v2r8(0.5/fr->ic->tabq_scale);
1379 /* Setup water-specific parameters */
1380 inr = nlist->iinr[0];
1381 iq0 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+0]));
1382 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
1383 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
1385 jq0 = gmx_fjsp_set1_v2r8(charge[inr+0]);
1386 jq1 = gmx_fjsp_set1_v2r8(charge[inr+1]);
1387 jq2 = gmx_fjsp_set1_v2r8(charge[inr+2]);
1388 qq00 = _fjsp_mul_v2r8(iq0,jq0);
1389 qq01 = _fjsp_mul_v2r8(iq0,jq1);
1390 qq02 = _fjsp_mul_v2r8(iq0,jq2);
1391 qq10 = _fjsp_mul_v2r8(iq1,jq0);
1392 qq11 = _fjsp_mul_v2r8(iq1,jq1);
1393 qq12 = _fjsp_mul_v2r8(iq1,jq2);
1394 qq20 = _fjsp_mul_v2r8(iq2,jq0);
1395 qq21 = _fjsp_mul_v2r8(iq2,jq1);
1396 qq22 = _fjsp_mul_v2r8(iq2,jq2);
1398 /* When we use explicit cutoffs the value must be identical for elec and VdW, so use elec as an arbitrary choice */
1399 rcutoff_scalar = fr->rcoulomb;
1400 rcutoff = gmx_fjsp_set1_v2r8(rcutoff_scalar);
1401 rcutoff2 = _fjsp_mul_v2r8(rcutoff,rcutoff);
1403 /* Avoid stupid compiler warnings */
1405 j_coord_offsetA = 0;
1406 j_coord_offsetB = 0;
1411 /* Start outer loop over neighborlists */
1412 for(iidx=0; iidx<nri; iidx++)
1414 /* Load shift vector for this list */
1415 i_shift_offset = DIM*shiftidx[iidx];
1417 /* Load limits for loop over neighbors */
1418 j_index_start = jindex[iidx];
1419 j_index_end = jindex[iidx+1];
1421 /* Get outer coordinate index */
1423 i_coord_offset = DIM*inr;
1425 /* Load i particle coords and add shift vector */
1426 gmx_fjsp_load_shift_and_3rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
1427 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2);
1429 fix0 = _fjsp_setzero_v2r8();
1430 fiy0 = _fjsp_setzero_v2r8();
1431 fiz0 = _fjsp_setzero_v2r8();
1432 fix1 = _fjsp_setzero_v2r8();
1433 fiy1 = _fjsp_setzero_v2r8();
1434 fiz1 = _fjsp_setzero_v2r8();
1435 fix2 = _fjsp_setzero_v2r8();
1436 fiy2 = _fjsp_setzero_v2r8();
1437 fiz2 = _fjsp_setzero_v2r8();
1439 /* Start inner kernel loop */
1440 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
1443 /* Get j neighbor index, and coordinate index */
1445 jnrB = jjnr[jidx+1];
1446 j_coord_offsetA = DIM*jnrA;
1447 j_coord_offsetB = DIM*jnrB;
1449 /* load j atom coordinates */
1450 gmx_fjsp_load_3rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
1451 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,&jy2,&jz2);
1453 /* Calculate displacement vector */
1454 dx00 = _fjsp_sub_v2r8(ix0,jx0);
1455 dy00 = _fjsp_sub_v2r8(iy0,jy0);
1456 dz00 = _fjsp_sub_v2r8(iz0,jz0);
1457 dx01 = _fjsp_sub_v2r8(ix0,jx1);
1458 dy01 = _fjsp_sub_v2r8(iy0,jy1);
1459 dz01 = _fjsp_sub_v2r8(iz0,jz1);
1460 dx02 = _fjsp_sub_v2r8(ix0,jx2);
1461 dy02 = _fjsp_sub_v2r8(iy0,jy2);
1462 dz02 = _fjsp_sub_v2r8(iz0,jz2);
1463 dx10 = _fjsp_sub_v2r8(ix1,jx0);
1464 dy10 = _fjsp_sub_v2r8(iy1,jy0);
1465 dz10 = _fjsp_sub_v2r8(iz1,jz0);
1466 dx11 = _fjsp_sub_v2r8(ix1,jx1);
1467 dy11 = _fjsp_sub_v2r8(iy1,jy1);
1468 dz11 = _fjsp_sub_v2r8(iz1,jz1);
1469 dx12 = _fjsp_sub_v2r8(ix1,jx2);
1470 dy12 = _fjsp_sub_v2r8(iy1,jy2);
1471 dz12 = _fjsp_sub_v2r8(iz1,jz2);
1472 dx20 = _fjsp_sub_v2r8(ix2,jx0);
1473 dy20 = _fjsp_sub_v2r8(iy2,jy0);
1474 dz20 = _fjsp_sub_v2r8(iz2,jz0);
1475 dx21 = _fjsp_sub_v2r8(ix2,jx1);
1476 dy21 = _fjsp_sub_v2r8(iy2,jy1);
1477 dz21 = _fjsp_sub_v2r8(iz2,jz1);
1478 dx22 = _fjsp_sub_v2r8(ix2,jx2);
1479 dy22 = _fjsp_sub_v2r8(iy2,jy2);
1480 dz22 = _fjsp_sub_v2r8(iz2,jz2);
1482 /* Calculate squared distance and things based on it */
1483 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
1484 rsq01 = gmx_fjsp_calc_rsq_v2r8(dx01,dy01,dz01);
1485 rsq02 = gmx_fjsp_calc_rsq_v2r8(dx02,dy02,dz02);
1486 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
1487 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
1488 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
1489 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
1490 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
1491 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
1493 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
1494 rinv01 = gmx_fjsp_invsqrt_v2r8(rsq01);
1495 rinv02 = gmx_fjsp_invsqrt_v2r8(rsq02);
1496 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
1497 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
1498 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
1499 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
1500 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
1501 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
1503 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
1504 rinvsq01 = _fjsp_mul_v2r8(rinv01,rinv01);
1505 rinvsq02 = _fjsp_mul_v2r8(rinv02,rinv02);
1506 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
1507 rinvsq11 = _fjsp_mul_v2r8(rinv11,rinv11);
1508 rinvsq12 = _fjsp_mul_v2r8(rinv12,rinv12);
1509 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
1510 rinvsq21 = _fjsp_mul_v2r8(rinv21,rinv21);
1511 rinvsq22 = _fjsp_mul_v2r8(rinv22,rinv22);
1513 fjx0 = _fjsp_setzero_v2r8();
1514 fjy0 = _fjsp_setzero_v2r8();
1515 fjz0 = _fjsp_setzero_v2r8();
1516 fjx1 = _fjsp_setzero_v2r8();
1517 fjy1 = _fjsp_setzero_v2r8();
1518 fjz1 = _fjsp_setzero_v2r8();
1519 fjx2 = _fjsp_setzero_v2r8();
1520 fjy2 = _fjsp_setzero_v2r8();
1521 fjz2 = _fjsp_setzero_v2r8();
1523 /**************************
1524 * CALCULATE INTERACTIONS *
1525 **************************/
1527 if (gmx_fjsp_any_lt_v2r8(rsq00,rcutoff2))
1530 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
1532 /* EWALD ELECTROSTATICS */
1534 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1535 ewrt = _fjsp_mul_v2r8(r00,ewtabscale);
1536 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1537 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1538 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1540 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1542 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1543 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq00,rinv00),_fjsp_sub_v2r8(rinvsq00,felec));
1545 cutoff_mask = _fjsp_cmplt_v2r8(rsq00,rcutoff2);
1549 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
1551 /* Update vectorial force */
1552 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
1553 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
1554 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
1556 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
1557 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
1558 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
1562 /**************************
1563 * CALCULATE INTERACTIONS *
1564 **************************/
1566 if (gmx_fjsp_any_lt_v2r8(rsq01,rcutoff2))
1569 r01 = _fjsp_mul_v2r8(rsq01,rinv01);
1571 /* EWALD ELECTROSTATICS */
1573 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1574 ewrt = _fjsp_mul_v2r8(r01,ewtabscale);
1575 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1576 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1577 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1579 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1581 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1582 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq01,rinv01),_fjsp_sub_v2r8(rinvsq01,felec));
1584 cutoff_mask = _fjsp_cmplt_v2r8(rsq01,rcutoff2);
1588 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
1590 /* Update vectorial force */
1591 fix0 = _fjsp_madd_v2r8(dx01,fscal,fix0);
1592 fiy0 = _fjsp_madd_v2r8(dy01,fscal,fiy0);
1593 fiz0 = _fjsp_madd_v2r8(dz01,fscal,fiz0);
1595 fjx1 = _fjsp_madd_v2r8(dx01,fscal,fjx1);
1596 fjy1 = _fjsp_madd_v2r8(dy01,fscal,fjy1);
1597 fjz1 = _fjsp_madd_v2r8(dz01,fscal,fjz1);
1601 /**************************
1602 * CALCULATE INTERACTIONS *
1603 **************************/
1605 if (gmx_fjsp_any_lt_v2r8(rsq02,rcutoff2))
1608 r02 = _fjsp_mul_v2r8(rsq02,rinv02);
1610 /* EWALD ELECTROSTATICS */
1612 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1613 ewrt = _fjsp_mul_v2r8(r02,ewtabscale);
1614 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1615 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1616 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1618 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1620 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1621 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq02,rinv02),_fjsp_sub_v2r8(rinvsq02,felec));
1623 cutoff_mask = _fjsp_cmplt_v2r8(rsq02,rcutoff2);
1627 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
1629 /* Update vectorial force */
1630 fix0 = _fjsp_madd_v2r8(dx02,fscal,fix0);
1631 fiy0 = _fjsp_madd_v2r8(dy02,fscal,fiy0);
1632 fiz0 = _fjsp_madd_v2r8(dz02,fscal,fiz0);
1634 fjx2 = _fjsp_madd_v2r8(dx02,fscal,fjx2);
1635 fjy2 = _fjsp_madd_v2r8(dy02,fscal,fjy2);
1636 fjz2 = _fjsp_madd_v2r8(dz02,fscal,fjz2);
1640 /**************************
1641 * CALCULATE INTERACTIONS *
1642 **************************/
1644 if (gmx_fjsp_any_lt_v2r8(rsq10,rcutoff2))
1647 r10 = _fjsp_mul_v2r8(rsq10,rinv10);
1649 /* EWALD ELECTROSTATICS */
1651 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1652 ewrt = _fjsp_mul_v2r8(r10,ewtabscale);
1653 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1654 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1655 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1657 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1659 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1660 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,rinv10),_fjsp_sub_v2r8(rinvsq10,felec));
1662 cutoff_mask = _fjsp_cmplt_v2r8(rsq10,rcutoff2);
1666 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
1668 /* Update vectorial force */
1669 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
1670 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
1671 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
1673 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
1674 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
1675 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
1679 /**************************
1680 * CALCULATE INTERACTIONS *
1681 **************************/
1683 if (gmx_fjsp_any_lt_v2r8(rsq11,rcutoff2))
1686 r11 = _fjsp_mul_v2r8(rsq11,rinv11);
1688 /* EWALD ELECTROSTATICS */
1690 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1691 ewrt = _fjsp_mul_v2r8(r11,ewtabscale);
1692 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1693 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1694 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1696 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1698 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1699 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq11,rinv11),_fjsp_sub_v2r8(rinvsq11,felec));
1701 cutoff_mask = _fjsp_cmplt_v2r8(rsq11,rcutoff2);
1705 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
1707 /* Update vectorial force */
1708 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
1709 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
1710 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
1712 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
1713 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
1714 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
1718 /**************************
1719 * CALCULATE INTERACTIONS *
1720 **************************/
1722 if (gmx_fjsp_any_lt_v2r8(rsq12,rcutoff2))
1725 r12 = _fjsp_mul_v2r8(rsq12,rinv12);
1727 /* EWALD ELECTROSTATICS */
1729 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1730 ewrt = _fjsp_mul_v2r8(r12,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(qq12,rinv12),_fjsp_sub_v2r8(rinvsq12,felec));
1740 cutoff_mask = _fjsp_cmplt_v2r8(rsq12,rcutoff2);
1744 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
1746 /* Update vectorial force */
1747 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
1748 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
1749 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
1751 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
1752 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
1753 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
1757 /**************************
1758 * CALCULATE INTERACTIONS *
1759 **************************/
1761 if (gmx_fjsp_any_lt_v2r8(rsq20,rcutoff2))
1764 r20 = _fjsp_mul_v2r8(rsq20,rinv20);
1766 /* EWALD ELECTROSTATICS */
1768 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1769 ewrt = _fjsp_mul_v2r8(r20,ewtabscale);
1770 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1771 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1772 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1774 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1776 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1777 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,rinv20),_fjsp_sub_v2r8(rinvsq20,felec));
1779 cutoff_mask = _fjsp_cmplt_v2r8(rsq20,rcutoff2);
1783 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
1785 /* Update vectorial force */
1786 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
1787 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
1788 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
1790 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
1791 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
1792 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
1796 /**************************
1797 * CALCULATE INTERACTIONS *
1798 **************************/
1800 if (gmx_fjsp_any_lt_v2r8(rsq21,rcutoff2))
1803 r21 = _fjsp_mul_v2r8(rsq21,rinv21);
1805 /* EWALD ELECTROSTATICS */
1807 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1808 ewrt = _fjsp_mul_v2r8(r21,ewtabscale);
1809 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1810 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1811 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1813 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1815 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1816 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq21,rinv21),_fjsp_sub_v2r8(rinvsq21,felec));
1818 cutoff_mask = _fjsp_cmplt_v2r8(rsq21,rcutoff2);
1822 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
1824 /* Update vectorial force */
1825 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
1826 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
1827 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
1829 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
1830 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
1831 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
1835 /**************************
1836 * CALCULATE INTERACTIONS *
1837 **************************/
1839 if (gmx_fjsp_any_lt_v2r8(rsq22,rcutoff2))
1842 r22 = _fjsp_mul_v2r8(rsq22,rinv22);
1844 /* EWALD ELECTROSTATICS */
1846 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1847 ewrt = _fjsp_mul_v2r8(r22,ewtabscale);
1848 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1849 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1850 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1852 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1854 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1855 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq22,rinv22),_fjsp_sub_v2r8(rinvsq22,felec));
1857 cutoff_mask = _fjsp_cmplt_v2r8(rsq22,rcutoff2);
1861 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
1863 /* Update vectorial force */
1864 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
1865 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
1866 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
1868 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
1869 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
1870 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
1874 gmx_fjsp_decrement_3rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2);
1876 /* Inner loop uses 378 flops */
1879 if(jidx<j_index_end)
1883 j_coord_offsetA = DIM*jnrA;
1885 /* load j atom coordinates */
1886 gmx_fjsp_load_3rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
1887 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,&jy2,&jz2);
1889 /* Calculate displacement vector */
1890 dx00 = _fjsp_sub_v2r8(ix0,jx0);
1891 dy00 = _fjsp_sub_v2r8(iy0,jy0);
1892 dz00 = _fjsp_sub_v2r8(iz0,jz0);
1893 dx01 = _fjsp_sub_v2r8(ix0,jx1);
1894 dy01 = _fjsp_sub_v2r8(iy0,jy1);
1895 dz01 = _fjsp_sub_v2r8(iz0,jz1);
1896 dx02 = _fjsp_sub_v2r8(ix0,jx2);
1897 dy02 = _fjsp_sub_v2r8(iy0,jy2);
1898 dz02 = _fjsp_sub_v2r8(iz0,jz2);
1899 dx10 = _fjsp_sub_v2r8(ix1,jx0);
1900 dy10 = _fjsp_sub_v2r8(iy1,jy0);
1901 dz10 = _fjsp_sub_v2r8(iz1,jz0);
1902 dx11 = _fjsp_sub_v2r8(ix1,jx1);
1903 dy11 = _fjsp_sub_v2r8(iy1,jy1);
1904 dz11 = _fjsp_sub_v2r8(iz1,jz1);
1905 dx12 = _fjsp_sub_v2r8(ix1,jx2);
1906 dy12 = _fjsp_sub_v2r8(iy1,jy2);
1907 dz12 = _fjsp_sub_v2r8(iz1,jz2);
1908 dx20 = _fjsp_sub_v2r8(ix2,jx0);
1909 dy20 = _fjsp_sub_v2r8(iy2,jy0);
1910 dz20 = _fjsp_sub_v2r8(iz2,jz0);
1911 dx21 = _fjsp_sub_v2r8(ix2,jx1);
1912 dy21 = _fjsp_sub_v2r8(iy2,jy1);
1913 dz21 = _fjsp_sub_v2r8(iz2,jz1);
1914 dx22 = _fjsp_sub_v2r8(ix2,jx2);
1915 dy22 = _fjsp_sub_v2r8(iy2,jy2);
1916 dz22 = _fjsp_sub_v2r8(iz2,jz2);
1918 /* Calculate squared distance and things based on it */
1919 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
1920 rsq01 = gmx_fjsp_calc_rsq_v2r8(dx01,dy01,dz01);
1921 rsq02 = gmx_fjsp_calc_rsq_v2r8(dx02,dy02,dz02);
1922 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
1923 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
1924 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
1925 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
1926 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
1927 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
1929 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
1930 rinv01 = gmx_fjsp_invsqrt_v2r8(rsq01);
1931 rinv02 = gmx_fjsp_invsqrt_v2r8(rsq02);
1932 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
1933 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
1934 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
1935 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
1936 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
1937 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
1939 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
1940 rinvsq01 = _fjsp_mul_v2r8(rinv01,rinv01);
1941 rinvsq02 = _fjsp_mul_v2r8(rinv02,rinv02);
1942 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
1943 rinvsq11 = _fjsp_mul_v2r8(rinv11,rinv11);
1944 rinvsq12 = _fjsp_mul_v2r8(rinv12,rinv12);
1945 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
1946 rinvsq21 = _fjsp_mul_v2r8(rinv21,rinv21);
1947 rinvsq22 = _fjsp_mul_v2r8(rinv22,rinv22);
1949 fjx0 = _fjsp_setzero_v2r8();
1950 fjy0 = _fjsp_setzero_v2r8();
1951 fjz0 = _fjsp_setzero_v2r8();
1952 fjx1 = _fjsp_setzero_v2r8();
1953 fjy1 = _fjsp_setzero_v2r8();
1954 fjz1 = _fjsp_setzero_v2r8();
1955 fjx2 = _fjsp_setzero_v2r8();
1956 fjy2 = _fjsp_setzero_v2r8();
1957 fjz2 = _fjsp_setzero_v2r8();
1959 /**************************
1960 * CALCULATE INTERACTIONS *
1961 **************************/
1963 if (gmx_fjsp_any_lt_v2r8(rsq00,rcutoff2))
1966 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
1968 /* EWALD ELECTROSTATICS */
1970 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1971 ewrt = _fjsp_mul_v2r8(r00,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(qq00,rinv00),_fjsp_sub_v2r8(rinvsq00,felec));
1980 cutoff_mask = _fjsp_cmplt_v2r8(rsq00,rcutoff2);
1984 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
1986 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1988 /* Update vectorial force */
1989 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
1990 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
1991 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
1993 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
1994 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
1995 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
1999 /**************************
2000 * CALCULATE INTERACTIONS *
2001 **************************/
2003 if (gmx_fjsp_any_lt_v2r8(rsq01,rcutoff2))
2006 r01 = _fjsp_mul_v2r8(rsq01,rinv01);
2008 /* EWALD ELECTROSTATICS */
2010 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
2011 ewrt = _fjsp_mul_v2r8(r01,ewtabscale);
2012 itab_tmp = _fjsp_dtox_v2r8(ewrt);
2013 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
2014 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
2016 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
2017 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
2018 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq01,rinv01),_fjsp_sub_v2r8(rinvsq01,felec));
2020 cutoff_mask = _fjsp_cmplt_v2r8(rsq01,rcutoff2);
2024 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
2026 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2028 /* Update vectorial force */
2029 fix0 = _fjsp_madd_v2r8(dx01,fscal,fix0);
2030 fiy0 = _fjsp_madd_v2r8(dy01,fscal,fiy0);
2031 fiz0 = _fjsp_madd_v2r8(dz01,fscal,fiz0);
2033 fjx1 = _fjsp_madd_v2r8(dx01,fscal,fjx1);
2034 fjy1 = _fjsp_madd_v2r8(dy01,fscal,fjy1);
2035 fjz1 = _fjsp_madd_v2r8(dz01,fscal,fjz1);
2039 /**************************
2040 * CALCULATE INTERACTIONS *
2041 **************************/
2043 if (gmx_fjsp_any_lt_v2r8(rsq02,rcutoff2))
2046 r02 = _fjsp_mul_v2r8(rsq02,rinv02);
2048 /* EWALD ELECTROSTATICS */
2050 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
2051 ewrt = _fjsp_mul_v2r8(r02,ewtabscale);
2052 itab_tmp = _fjsp_dtox_v2r8(ewrt);
2053 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
2054 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
2056 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
2057 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
2058 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq02,rinv02),_fjsp_sub_v2r8(rinvsq02,felec));
2060 cutoff_mask = _fjsp_cmplt_v2r8(rsq02,rcutoff2);
2064 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
2066 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2068 /* Update vectorial force */
2069 fix0 = _fjsp_madd_v2r8(dx02,fscal,fix0);
2070 fiy0 = _fjsp_madd_v2r8(dy02,fscal,fiy0);
2071 fiz0 = _fjsp_madd_v2r8(dz02,fscal,fiz0);
2073 fjx2 = _fjsp_madd_v2r8(dx02,fscal,fjx2);
2074 fjy2 = _fjsp_madd_v2r8(dy02,fscal,fjy2);
2075 fjz2 = _fjsp_madd_v2r8(dz02,fscal,fjz2);
2079 /**************************
2080 * CALCULATE INTERACTIONS *
2081 **************************/
2083 if (gmx_fjsp_any_lt_v2r8(rsq10,rcutoff2))
2086 r10 = _fjsp_mul_v2r8(rsq10,rinv10);
2088 /* EWALD ELECTROSTATICS */
2090 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
2091 ewrt = _fjsp_mul_v2r8(r10,ewtabscale);
2092 itab_tmp = _fjsp_dtox_v2r8(ewrt);
2093 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
2094 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
2096 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
2097 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
2098 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,rinv10),_fjsp_sub_v2r8(rinvsq10,felec));
2100 cutoff_mask = _fjsp_cmplt_v2r8(rsq10,rcutoff2);
2104 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
2106 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2108 /* Update vectorial force */
2109 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
2110 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
2111 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
2113 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
2114 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
2115 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
2119 /**************************
2120 * CALCULATE INTERACTIONS *
2121 **************************/
2123 if (gmx_fjsp_any_lt_v2r8(rsq11,rcutoff2))
2126 r11 = _fjsp_mul_v2r8(rsq11,rinv11);
2128 /* EWALD ELECTROSTATICS */
2130 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
2131 ewrt = _fjsp_mul_v2r8(r11,ewtabscale);
2132 itab_tmp = _fjsp_dtox_v2r8(ewrt);
2133 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
2134 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
2136 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
2137 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
2138 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq11,rinv11),_fjsp_sub_v2r8(rinvsq11,felec));
2140 cutoff_mask = _fjsp_cmplt_v2r8(rsq11,rcutoff2);
2144 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
2146 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2148 /* Update vectorial force */
2149 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
2150 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
2151 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
2153 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
2154 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
2155 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
2159 /**************************
2160 * CALCULATE INTERACTIONS *
2161 **************************/
2163 if (gmx_fjsp_any_lt_v2r8(rsq12,rcutoff2))
2166 r12 = _fjsp_mul_v2r8(rsq12,rinv12);
2168 /* EWALD ELECTROSTATICS */
2170 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
2171 ewrt = _fjsp_mul_v2r8(r12,ewtabscale);
2172 itab_tmp = _fjsp_dtox_v2r8(ewrt);
2173 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
2174 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
2176 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
2177 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
2178 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq12,rinv12),_fjsp_sub_v2r8(rinvsq12,felec));
2180 cutoff_mask = _fjsp_cmplt_v2r8(rsq12,rcutoff2);
2184 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
2186 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2188 /* Update vectorial force */
2189 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
2190 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
2191 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
2193 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
2194 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
2195 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
2199 /**************************
2200 * CALCULATE INTERACTIONS *
2201 **************************/
2203 if (gmx_fjsp_any_lt_v2r8(rsq20,rcutoff2))
2206 r20 = _fjsp_mul_v2r8(rsq20,rinv20);
2208 /* EWALD ELECTROSTATICS */
2210 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
2211 ewrt = _fjsp_mul_v2r8(r20,ewtabscale);
2212 itab_tmp = _fjsp_dtox_v2r8(ewrt);
2213 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
2214 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
2216 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
2217 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
2218 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,rinv20),_fjsp_sub_v2r8(rinvsq20,felec));
2220 cutoff_mask = _fjsp_cmplt_v2r8(rsq20,rcutoff2);
2224 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
2226 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2228 /* Update vectorial force */
2229 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
2230 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
2231 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
2233 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
2234 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
2235 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
2239 /**************************
2240 * CALCULATE INTERACTIONS *
2241 **************************/
2243 if (gmx_fjsp_any_lt_v2r8(rsq21,rcutoff2))
2246 r21 = _fjsp_mul_v2r8(rsq21,rinv21);
2248 /* EWALD ELECTROSTATICS */
2250 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
2251 ewrt = _fjsp_mul_v2r8(r21,ewtabscale);
2252 itab_tmp = _fjsp_dtox_v2r8(ewrt);
2253 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
2254 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
2256 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
2257 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
2258 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq21,rinv21),_fjsp_sub_v2r8(rinvsq21,felec));
2260 cutoff_mask = _fjsp_cmplt_v2r8(rsq21,rcutoff2);
2264 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
2266 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2268 /* Update vectorial force */
2269 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
2270 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
2271 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
2273 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
2274 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
2275 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
2279 /**************************
2280 * CALCULATE INTERACTIONS *
2281 **************************/
2283 if (gmx_fjsp_any_lt_v2r8(rsq22,rcutoff2))
2286 r22 = _fjsp_mul_v2r8(rsq22,rinv22);
2288 /* EWALD ELECTROSTATICS */
2290 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
2291 ewrt = _fjsp_mul_v2r8(r22,ewtabscale);
2292 itab_tmp = _fjsp_dtox_v2r8(ewrt);
2293 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
2294 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
2296 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
2297 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
2298 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq22,rinv22),_fjsp_sub_v2r8(rinvsq22,felec));
2300 cutoff_mask = _fjsp_cmplt_v2r8(rsq22,rcutoff2);
2304 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
2306 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2308 /* Update vectorial force */
2309 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
2310 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
2311 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
2313 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
2314 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
2315 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
2319 gmx_fjsp_decrement_3rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2);
2321 /* Inner loop uses 378 flops */
2324 /* End of innermost loop */
2326 gmx_fjsp_update_iforce_3atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,
2327 f+i_coord_offset,fshift+i_shift_offset);
2329 /* Increment number of inner iterations */
2330 inneriter += j_index_end - j_index_start;
2332 /* Outer loop uses 18 flops */
2335 /* Increment number of outer iterations */
2338 /* Update outer/inner flops */
2340 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_W3W3_F,outeriter*18 + inneriter*378);