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_ElecEw_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_ElecEw_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 /* Avoid stupid compiler warnings */
158 /* Start outer loop over neighborlists */
159 for(iidx=0; iidx<nri; iidx++)
161 /* Load shift vector for this list */
162 i_shift_offset = DIM*shiftidx[iidx];
164 /* Load limits for loop over neighbors */
165 j_index_start = jindex[iidx];
166 j_index_end = jindex[iidx+1];
168 /* Get outer coordinate index */
170 i_coord_offset = DIM*inr;
172 /* Load i particle coords and add shift vector */
173 gmx_fjsp_load_shift_and_3rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
174 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2);
176 fix0 = _fjsp_setzero_v2r8();
177 fiy0 = _fjsp_setzero_v2r8();
178 fiz0 = _fjsp_setzero_v2r8();
179 fix1 = _fjsp_setzero_v2r8();
180 fiy1 = _fjsp_setzero_v2r8();
181 fiz1 = _fjsp_setzero_v2r8();
182 fix2 = _fjsp_setzero_v2r8();
183 fiy2 = _fjsp_setzero_v2r8();
184 fiz2 = _fjsp_setzero_v2r8();
186 /* Reset potential sums */
187 velecsum = _fjsp_setzero_v2r8();
189 /* Start inner kernel loop */
190 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
193 /* Get j neighbor index, and coordinate index */
196 j_coord_offsetA = DIM*jnrA;
197 j_coord_offsetB = DIM*jnrB;
199 /* load j atom coordinates */
200 gmx_fjsp_load_3rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
201 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,&jy2,&jz2);
203 /* Calculate displacement vector */
204 dx00 = _fjsp_sub_v2r8(ix0,jx0);
205 dy00 = _fjsp_sub_v2r8(iy0,jy0);
206 dz00 = _fjsp_sub_v2r8(iz0,jz0);
207 dx01 = _fjsp_sub_v2r8(ix0,jx1);
208 dy01 = _fjsp_sub_v2r8(iy0,jy1);
209 dz01 = _fjsp_sub_v2r8(iz0,jz1);
210 dx02 = _fjsp_sub_v2r8(ix0,jx2);
211 dy02 = _fjsp_sub_v2r8(iy0,jy2);
212 dz02 = _fjsp_sub_v2r8(iz0,jz2);
213 dx10 = _fjsp_sub_v2r8(ix1,jx0);
214 dy10 = _fjsp_sub_v2r8(iy1,jy0);
215 dz10 = _fjsp_sub_v2r8(iz1,jz0);
216 dx11 = _fjsp_sub_v2r8(ix1,jx1);
217 dy11 = _fjsp_sub_v2r8(iy1,jy1);
218 dz11 = _fjsp_sub_v2r8(iz1,jz1);
219 dx12 = _fjsp_sub_v2r8(ix1,jx2);
220 dy12 = _fjsp_sub_v2r8(iy1,jy2);
221 dz12 = _fjsp_sub_v2r8(iz1,jz2);
222 dx20 = _fjsp_sub_v2r8(ix2,jx0);
223 dy20 = _fjsp_sub_v2r8(iy2,jy0);
224 dz20 = _fjsp_sub_v2r8(iz2,jz0);
225 dx21 = _fjsp_sub_v2r8(ix2,jx1);
226 dy21 = _fjsp_sub_v2r8(iy2,jy1);
227 dz21 = _fjsp_sub_v2r8(iz2,jz1);
228 dx22 = _fjsp_sub_v2r8(ix2,jx2);
229 dy22 = _fjsp_sub_v2r8(iy2,jy2);
230 dz22 = _fjsp_sub_v2r8(iz2,jz2);
232 /* Calculate squared distance and things based on it */
233 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
234 rsq01 = gmx_fjsp_calc_rsq_v2r8(dx01,dy01,dz01);
235 rsq02 = gmx_fjsp_calc_rsq_v2r8(dx02,dy02,dz02);
236 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
237 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
238 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
239 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
240 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
241 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
243 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
244 rinv01 = gmx_fjsp_invsqrt_v2r8(rsq01);
245 rinv02 = gmx_fjsp_invsqrt_v2r8(rsq02);
246 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
247 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
248 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
249 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
250 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
251 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
253 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
254 rinvsq01 = _fjsp_mul_v2r8(rinv01,rinv01);
255 rinvsq02 = _fjsp_mul_v2r8(rinv02,rinv02);
256 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
257 rinvsq11 = _fjsp_mul_v2r8(rinv11,rinv11);
258 rinvsq12 = _fjsp_mul_v2r8(rinv12,rinv12);
259 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
260 rinvsq21 = _fjsp_mul_v2r8(rinv21,rinv21);
261 rinvsq22 = _fjsp_mul_v2r8(rinv22,rinv22);
263 fjx0 = _fjsp_setzero_v2r8();
264 fjy0 = _fjsp_setzero_v2r8();
265 fjz0 = _fjsp_setzero_v2r8();
266 fjx1 = _fjsp_setzero_v2r8();
267 fjy1 = _fjsp_setzero_v2r8();
268 fjz1 = _fjsp_setzero_v2r8();
269 fjx2 = _fjsp_setzero_v2r8();
270 fjy2 = _fjsp_setzero_v2r8();
271 fjz2 = _fjsp_setzero_v2r8();
273 /**************************
274 * CALCULATE INTERACTIONS *
275 **************************/
277 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
279 /* EWALD ELECTROSTATICS */
281 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
282 ewrt = _fjsp_mul_v2r8(r00,ewtabscale);
283 itab_tmp = _fjsp_dtox_v2r8(ewrt);
284 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
285 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
287 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
288 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
289 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
290 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
291 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
292 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
293 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
294 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
295 velec = _fjsp_mul_v2r8(qq00,_fjsp_sub_v2r8(rinv00,velec));
296 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq00,rinv00),_fjsp_sub_v2r8(rinvsq00,felec));
298 /* Update potential sum for this i atom from the interaction with this j atom. */
299 velecsum = _fjsp_add_v2r8(velecsum,velec);
303 /* Update vectorial force */
304 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
305 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
306 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
308 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
309 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
310 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
312 /**************************
313 * CALCULATE INTERACTIONS *
314 **************************/
316 r01 = _fjsp_mul_v2r8(rsq01,rinv01);
318 /* EWALD ELECTROSTATICS */
320 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
321 ewrt = _fjsp_mul_v2r8(r01,ewtabscale);
322 itab_tmp = _fjsp_dtox_v2r8(ewrt);
323 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
324 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
326 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
327 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
328 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
329 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
330 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
331 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
332 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
333 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
334 velec = _fjsp_mul_v2r8(qq01,_fjsp_sub_v2r8(rinv01,velec));
335 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq01,rinv01),_fjsp_sub_v2r8(rinvsq01,felec));
337 /* Update potential sum for this i atom from the interaction with this j atom. */
338 velecsum = _fjsp_add_v2r8(velecsum,velec);
342 /* Update vectorial force */
343 fix0 = _fjsp_madd_v2r8(dx01,fscal,fix0);
344 fiy0 = _fjsp_madd_v2r8(dy01,fscal,fiy0);
345 fiz0 = _fjsp_madd_v2r8(dz01,fscal,fiz0);
347 fjx1 = _fjsp_madd_v2r8(dx01,fscal,fjx1);
348 fjy1 = _fjsp_madd_v2r8(dy01,fscal,fjy1);
349 fjz1 = _fjsp_madd_v2r8(dz01,fscal,fjz1);
351 /**************************
352 * CALCULATE INTERACTIONS *
353 **************************/
355 r02 = _fjsp_mul_v2r8(rsq02,rinv02);
357 /* EWALD ELECTROSTATICS */
359 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
360 ewrt = _fjsp_mul_v2r8(r02,ewtabscale);
361 itab_tmp = _fjsp_dtox_v2r8(ewrt);
362 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
363 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
365 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
366 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
367 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
368 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
369 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
370 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
371 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
372 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
373 velec = _fjsp_mul_v2r8(qq02,_fjsp_sub_v2r8(rinv02,velec));
374 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq02,rinv02),_fjsp_sub_v2r8(rinvsq02,felec));
376 /* Update potential sum for this i atom from the interaction with this j atom. */
377 velecsum = _fjsp_add_v2r8(velecsum,velec);
381 /* Update vectorial force */
382 fix0 = _fjsp_madd_v2r8(dx02,fscal,fix0);
383 fiy0 = _fjsp_madd_v2r8(dy02,fscal,fiy0);
384 fiz0 = _fjsp_madd_v2r8(dz02,fscal,fiz0);
386 fjx2 = _fjsp_madd_v2r8(dx02,fscal,fjx2);
387 fjy2 = _fjsp_madd_v2r8(dy02,fscal,fjy2);
388 fjz2 = _fjsp_madd_v2r8(dz02,fscal,fjz2);
390 /**************************
391 * CALCULATE INTERACTIONS *
392 **************************/
394 r10 = _fjsp_mul_v2r8(rsq10,rinv10);
396 /* EWALD ELECTROSTATICS */
398 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
399 ewrt = _fjsp_mul_v2r8(r10,ewtabscale);
400 itab_tmp = _fjsp_dtox_v2r8(ewrt);
401 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
402 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
404 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
405 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
406 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
407 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
408 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
409 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
410 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
411 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
412 velec = _fjsp_mul_v2r8(qq10,_fjsp_sub_v2r8(rinv10,velec));
413 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,rinv10),_fjsp_sub_v2r8(rinvsq10,felec));
415 /* Update potential sum for this i atom from the interaction with this j atom. */
416 velecsum = _fjsp_add_v2r8(velecsum,velec);
420 /* Update vectorial force */
421 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
422 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
423 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
425 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
426 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
427 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
429 /**************************
430 * CALCULATE INTERACTIONS *
431 **************************/
433 r11 = _fjsp_mul_v2r8(rsq11,rinv11);
435 /* EWALD ELECTROSTATICS */
437 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
438 ewrt = _fjsp_mul_v2r8(r11,ewtabscale);
439 itab_tmp = _fjsp_dtox_v2r8(ewrt);
440 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
441 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
443 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
444 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
445 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
446 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
447 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
448 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
449 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
450 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
451 velec = _fjsp_mul_v2r8(qq11,_fjsp_sub_v2r8(rinv11,velec));
452 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq11,rinv11),_fjsp_sub_v2r8(rinvsq11,felec));
454 /* Update potential sum for this i atom from the interaction with this j atom. */
455 velecsum = _fjsp_add_v2r8(velecsum,velec);
459 /* Update vectorial force */
460 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
461 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
462 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
464 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
465 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
466 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
468 /**************************
469 * CALCULATE INTERACTIONS *
470 **************************/
472 r12 = _fjsp_mul_v2r8(rsq12,rinv12);
474 /* EWALD ELECTROSTATICS */
476 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
477 ewrt = _fjsp_mul_v2r8(r12,ewtabscale);
478 itab_tmp = _fjsp_dtox_v2r8(ewrt);
479 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
480 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
482 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
483 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
484 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
485 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
486 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
487 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
488 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
489 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
490 velec = _fjsp_mul_v2r8(qq12,_fjsp_sub_v2r8(rinv12,velec));
491 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq12,rinv12),_fjsp_sub_v2r8(rinvsq12,felec));
493 /* Update potential sum for this i atom from the interaction with this j atom. */
494 velecsum = _fjsp_add_v2r8(velecsum,velec);
498 /* Update vectorial force */
499 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
500 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
501 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
503 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
504 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
505 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
507 /**************************
508 * CALCULATE INTERACTIONS *
509 **************************/
511 r20 = _fjsp_mul_v2r8(rsq20,rinv20);
513 /* EWALD ELECTROSTATICS */
515 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
516 ewrt = _fjsp_mul_v2r8(r20,ewtabscale);
517 itab_tmp = _fjsp_dtox_v2r8(ewrt);
518 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
519 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
521 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
522 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
523 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
524 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
525 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
526 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
527 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
528 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
529 velec = _fjsp_mul_v2r8(qq20,_fjsp_sub_v2r8(rinv20,velec));
530 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,rinv20),_fjsp_sub_v2r8(rinvsq20,felec));
532 /* Update potential sum for this i atom from the interaction with this j atom. */
533 velecsum = _fjsp_add_v2r8(velecsum,velec);
537 /* Update vectorial force */
538 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
539 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
540 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
542 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
543 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
544 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
546 /**************************
547 * CALCULATE INTERACTIONS *
548 **************************/
550 r21 = _fjsp_mul_v2r8(rsq21,rinv21);
552 /* EWALD ELECTROSTATICS */
554 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
555 ewrt = _fjsp_mul_v2r8(r21,ewtabscale);
556 itab_tmp = _fjsp_dtox_v2r8(ewrt);
557 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
558 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
560 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
561 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
562 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
563 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
564 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
565 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
566 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
567 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
568 velec = _fjsp_mul_v2r8(qq21,_fjsp_sub_v2r8(rinv21,velec));
569 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq21,rinv21),_fjsp_sub_v2r8(rinvsq21,felec));
571 /* Update potential sum for this i atom from the interaction with this j atom. */
572 velecsum = _fjsp_add_v2r8(velecsum,velec);
576 /* Update vectorial force */
577 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
578 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
579 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
581 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
582 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
583 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
585 /**************************
586 * CALCULATE INTERACTIONS *
587 **************************/
589 r22 = _fjsp_mul_v2r8(rsq22,rinv22);
591 /* EWALD ELECTROSTATICS */
593 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
594 ewrt = _fjsp_mul_v2r8(r22,ewtabscale);
595 itab_tmp = _fjsp_dtox_v2r8(ewrt);
596 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
597 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
599 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
600 ewtabD = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
601 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
602 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
603 ewtabFn = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
604 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
605 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
606 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
607 velec = _fjsp_mul_v2r8(qq22,_fjsp_sub_v2r8(rinv22,velec));
608 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq22,rinv22),_fjsp_sub_v2r8(rinvsq22,felec));
610 /* Update potential sum for this i atom from the interaction with this j atom. */
611 velecsum = _fjsp_add_v2r8(velecsum,velec);
615 /* Update vectorial force */
616 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
617 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
618 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
620 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
621 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
622 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
624 gmx_fjsp_decrement_3rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2);
626 /* Inner loop uses 396 flops */
633 j_coord_offsetA = DIM*jnrA;
635 /* load j atom coordinates */
636 gmx_fjsp_load_3rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
637 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,&jy2,&jz2);
639 /* Calculate displacement vector */
640 dx00 = _fjsp_sub_v2r8(ix0,jx0);
641 dy00 = _fjsp_sub_v2r8(iy0,jy0);
642 dz00 = _fjsp_sub_v2r8(iz0,jz0);
643 dx01 = _fjsp_sub_v2r8(ix0,jx1);
644 dy01 = _fjsp_sub_v2r8(iy0,jy1);
645 dz01 = _fjsp_sub_v2r8(iz0,jz1);
646 dx02 = _fjsp_sub_v2r8(ix0,jx2);
647 dy02 = _fjsp_sub_v2r8(iy0,jy2);
648 dz02 = _fjsp_sub_v2r8(iz0,jz2);
649 dx10 = _fjsp_sub_v2r8(ix1,jx0);
650 dy10 = _fjsp_sub_v2r8(iy1,jy0);
651 dz10 = _fjsp_sub_v2r8(iz1,jz0);
652 dx11 = _fjsp_sub_v2r8(ix1,jx1);
653 dy11 = _fjsp_sub_v2r8(iy1,jy1);
654 dz11 = _fjsp_sub_v2r8(iz1,jz1);
655 dx12 = _fjsp_sub_v2r8(ix1,jx2);
656 dy12 = _fjsp_sub_v2r8(iy1,jy2);
657 dz12 = _fjsp_sub_v2r8(iz1,jz2);
658 dx20 = _fjsp_sub_v2r8(ix2,jx0);
659 dy20 = _fjsp_sub_v2r8(iy2,jy0);
660 dz20 = _fjsp_sub_v2r8(iz2,jz0);
661 dx21 = _fjsp_sub_v2r8(ix2,jx1);
662 dy21 = _fjsp_sub_v2r8(iy2,jy1);
663 dz21 = _fjsp_sub_v2r8(iz2,jz1);
664 dx22 = _fjsp_sub_v2r8(ix2,jx2);
665 dy22 = _fjsp_sub_v2r8(iy2,jy2);
666 dz22 = _fjsp_sub_v2r8(iz2,jz2);
668 /* Calculate squared distance and things based on it */
669 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
670 rsq01 = gmx_fjsp_calc_rsq_v2r8(dx01,dy01,dz01);
671 rsq02 = gmx_fjsp_calc_rsq_v2r8(dx02,dy02,dz02);
672 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
673 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
674 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
675 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
676 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
677 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
679 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
680 rinv01 = gmx_fjsp_invsqrt_v2r8(rsq01);
681 rinv02 = gmx_fjsp_invsqrt_v2r8(rsq02);
682 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
683 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
684 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
685 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
686 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
687 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
689 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
690 rinvsq01 = _fjsp_mul_v2r8(rinv01,rinv01);
691 rinvsq02 = _fjsp_mul_v2r8(rinv02,rinv02);
692 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
693 rinvsq11 = _fjsp_mul_v2r8(rinv11,rinv11);
694 rinvsq12 = _fjsp_mul_v2r8(rinv12,rinv12);
695 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
696 rinvsq21 = _fjsp_mul_v2r8(rinv21,rinv21);
697 rinvsq22 = _fjsp_mul_v2r8(rinv22,rinv22);
699 fjx0 = _fjsp_setzero_v2r8();
700 fjy0 = _fjsp_setzero_v2r8();
701 fjz0 = _fjsp_setzero_v2r8();
702 fjx1 = _fjsp_setzero_v2r8();
703 fjy1 = _fjsp_setzero_v2r8();
704 fjz1 = _fjsp_setzero_v2r8();
705 fjx2 = _fjsp_setzero_v2r8();
706 fjy2 = _fjsp_setzero_v2r8();
707 fjz2 = _fjsp_setzero_v2r8();
709 /**************************
710 * CALCULATE INTERACTIONS *
711 **************************/
713 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
715 /* EWALD ELECTROSTATICS */
717 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
718 ewrt = _fjsp_mul_v2r8(r00,ewtabscale);
719 itab_tmp = _fjsp_dtox_v2r8(ewrt);
720 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
721 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
723 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
724 ewtabD = _fjsp_setzero_v2r8();
725 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
726 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
727 ewtabFn = _fjsp_setzero_v2r8();
728 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
729 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
730 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
731 velec = _fjsp_mul_v2r8(qq00,_fjsp_sub_v2r8(rinv00,velec));
732 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq00,rinv00),_fjsp_sub_v2r8(rinvsq00,felec));
734 /* Update potential sum for this i atom from the interaction with this j atom. */
735 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
736 velecsum = _fjsp_add_v2r8(velecsum,velec);
740 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
742 /* Update vectorial force */
743 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
744 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
745 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
747 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
748 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
749 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
751 /**************************
752 * CALCULATE INTERACTIONS *
753 **************************/
755 r01 = _fjsp_mul_v2r8(rsq01,rinv01);
757 /* EWALD ELECTROSTATICS */
759 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
760 ewrt = _fjsp_mul_v2r8(r01,ewtabscale);
761 itab_tmp = _fjsp_dtox_v2r8(ewrt);
762 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
763 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
765 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
766 ewtabD = _fjsp_setzero_v2r8();
767 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
768 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
769 ewtabFn = _fjsp_setzero_v2r8();
770 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
771 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
772 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
773 velec = _fjsp_mul_v2r8(qq01,_fjsp_sub_v2r8(rinv01,velec));
774 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq01,rinv01),_fjsp_sub_v2r8(rinvsq01,felec));
776 /* Update potential sum for this i atom from the interaction with this j atom. */
777 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
778 velecsum = _fjsp_add_v2r8(velecsum,velec);
782 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
784 /* Update vectorial force */
785 fix0 = _fjsp_madd_v2r8(dx01,fscal,fix0);
786 fiy0 = _fjsp_madd_v2r8(dy01,fscal,fiy0);
787 fiz0 = _fjsp_madd_v2r8(dz01,fscal,fiz0);
789 fjx1 = _fjsp_madd_v2r8(dx01,fscal,fjx1);
790 fjy1 = _fjsp_madd_v2r8(dy01,fscal,fjy1);
791 fjz1 = _fjsp_madd_v2r8(dz01,fscal,fjz1);
793 /**************************
794 * CALCULATE INTERACTIONS *
795 **************************/
797 r02 = _fjsp_mul_v2r8(rsq02,rinv02);
799 /* EWALD ELECTROSTATICS */
801 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
802 ewrt = _fjsp_mul_v2r8(r02,ewtabscale);
803 itab_tmp = _fjsp_dtox_v2r8(ewrt);
804 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
805 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
807 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
808 ewtabD = _fjsp_setzero_v2r8();
809 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
810 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
811 ewtabFn = _fjsp_setzero_v2r8();
812 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
813 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
814 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
815 velec = _fjsp_mul_v2r8(qq02,_fjsp_sub_v2r8(rinv02,velec));
816 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq02,rinv02),_fjsp_sub_v2r8(rinvsq02,felec));
818 /* Update potential sum for this i atom from the interaction with this j atom. */
819 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
820 velecsum = _fjsp_add_v2r8(velecsum,velec);
824 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
826 /* Update vectorial force */
827 fix0 = _fjsp_madd_v2r8(dx02,fscal,fix0);
828 fiy0 = _fjsp_madd_v2r8(dy02,fscal,fiy0);
829 fiz0 = _fjsp_madd_v2r8(dz02,fscal,fiz0);
831 fjx2 = _fjsp_madd_v2r8(dx02,fscal,fjx2);
832 fjy2 = _fjsp_madd_v2r8(dy02,fscal,fjy2);
833 fjz2 = _fjsp_madd_v2r8(dz02,fscal,fjz2);
835 /**************************
836 * CALCULATE INTERACTIONS *
837 **************************/
839 r10 = _fjsp_mul_v2r8(rsq10,rinv10);
841 /* EWALD ELECTROSTATICS */
843 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
844 ewrt = _fjsp_mul_v2r8(r10,ewtabscale);
845 itab_tmp = _fjsp_dtox_v2r8(ewrt);
846 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
847 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
849 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
850 ewtabD = _fjsp_setzero_v2r8();
851 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
852 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
853 ewtabFn = _fjsp_setzero_v2r8();
854 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
855 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
856 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
857 velec = _fjsp_mul_v2r8(qq10,_fjsp_sub_v2r8(rinv10,velec));
858 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,rinv10),_fjsp_sub_v2r8(rinvsq10,felec));
860 /* Update potential sum for this i atom from the interaction with this j atom. */
861 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
862 velecsum = _fjsp_add_v2r8(velecsum,velec);
866 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
868 /* Update vectorial force */
869 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
870 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
871 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
873 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
874 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
875 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
877 /**************************
878 * CALCULATE INTERACTIONS *
879 **************************/
881 r11 = _fjsp_mul_v2r8(rsq11,rinv11);
883 /* EWALD ELECTROSTATICS */
885 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
886 ewrt = _fjsp_mul_v2r8(r11,ewtabscale);
887 itab_tmp = _fjsp_dtox_v2r8(ewrt);
888 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
889 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
891 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
892 ewtabD = _fjsp_setzero_v2r8();
893 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
894 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
895 ewtabFn = _fjsp_setzero_v2r8();
896 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
897 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
898 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
899 velec = _fjsp_mul_v2r8(qq11,_fjsp_sub_v2r8(rinv11,velec));
900 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq11,rinv11),_fjsp_sub_v2r8(rinvsq11,felec));
902 /* Update potential sum for this i atom from the interaction with this j atom. */
903 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
904 velecsum = _fjsp_add_v2r8(velecsum,velec);
908 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
910 /* Update vectorial force */
911 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
912 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
913 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
915 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
916 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
917 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
919 /**************************
920 * CALCULATE INTERACTIONS *
921 **************************/
923 r12 = _fjsp_mul_v2r8(rsq12,rinv12);
925 /* EWALD ELECTROSTATICS */
927 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
928 ewrt = _fjsp_mul_v2r8(r12,ewtabscale);
929 itab_tmp = _fjsp_dtox_v2r8(ewrt);
930 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
931 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
933 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
934 ewtabD = _fjsp_setzero_v2r8();
935 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
936 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
937 ewtabFn = _fjsp_setzero_v2r8();
938 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
939 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
940 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
941 velec = _fjsp_mul_v2r8(qq12,_fjsp_sub_v2r8(rinv12,velec));
942 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq12,rinv12),_fjsp_sub_v2r8(rinvsq12,felec));
944 /* Update potential sum for this i atom from the interaction with this j atom. */
945 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
946 velecsum = _fjsp_add_v2r8(velecsum,velec);
950 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
952 /* Update vectorial force */
953 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
954 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
955 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
957 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
958 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
959 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
961 /**************************
962 * CALCULATE INTERACTIONS *
963 **************************/
965 r20 = _fjsp_mul_v2r8(rsq20,rinv20);
967 /* EWALD ELECTROSTATICS */
969 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
970 ewrt = _fjsp_mul_v2r8(r20,ewtabscale);
971 itab_tmp = _fjsp_dtox_v2r8(ewrt);
972 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
973 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
975 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
976 ewtabD = _fjsp_setzero_v2r8();
977 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
978 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
979 ewtabFn = _fjsp_setzero_v2r8();
980 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
981 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
982 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
983 velec = _fjsp_mul_v2r8(qq20,_fjsp_sub_v2r8(rinv20,velec));
984 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,rinv20),_fjsp_sub_v2r8(rinvsq20,felec));
986 /* Update potential sum for this i atom from the interaction with this j atom. */
987 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
988 velecsum = _fjsp_add_v2r8(velecsum,velec);
992 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
994 /* Update vectorial force */
995 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
996 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
997 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
999 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
1000 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
1001 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
1003 /**************************
1004 * CALCULATE INTERACTIONS *
1005 **************************/
1007 r21 = _fjsp_mul_v2r8(rsq21,rinv21);
1009 /* EWALD ELECTROSTATICS */
1011 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1012 ewrt = _fjsp_mul_v2r8(r21,ewtabscale);
1013 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1014 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1015 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1017 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
1018 ewtabD = _fjsp_setzero_v2r8();
1019 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
1020 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
1021 ewtabFn = _fjsp_setzero_v2r8();
1022 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
1023 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
1024 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
1025 velec = _fjsp_mul_v2r8(qq21,_fjsp_sub_v2r8(rinv21,velec));
1026 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq21,rinv21),_fjsp_sub_v2r8(rinvsq21,felec));
1028 /* Update potential sum for this i atom from the interaction with this j atom. */
1029 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1030 velecsum = _fjsp_add_v2r8(velecsum,velec);
1034 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1036 /* Update vectorial force */
1037 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
1038 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
1039 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
1041 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
1042 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
1043 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
1045 /**************************
1046 * CALCULATE INTERACTIONS *
1047 **************************/
1049 r22 = _fjsp_mul_v2r8(rsq22,rinv22);
1051 /* EWALD ELECTROSTATICS */
1053 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1054 ewrt = _fjsp_mul_v2r8(r22,ewtabscale);
1055 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1056 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1057 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1059 ewtabF = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
1060 ewtabD = _fjsp_setzero_v2r8();
1061 GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
1062 ewtabV = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
1063 ewtabFn = _fjsp_setzero_v2r8();
1064 GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
1065 felec = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
1066 velec = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
1067 velec = _fjsp_mul_v2r8(qq22,_fjsp_sub_v2r8(rinv22,velec));
1068 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq22,rinv22),_fjsp_sub_v2r8(rinvsq22,felec));
1070 /* Update potential sum for this i atom from the interaction with this j atom. */
1071 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1072 velecsum = _fjsp_add_v2r8(velecsum,velec);
1076 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1078 /* Update vectorial force */
1079 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
1080 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
1081 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
1083 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
1084 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
1085 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
1087 gmx_fjsp_decrement_3rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2);
1089 /* Inner loop uses 396 flops */
1092 /* End of innermost loop */
1094 gmx_fjsp_update_iforce_3atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,
1095 f+i_coord_offset,fshift+i_shift_offset);
1098 /* Update potential energies */
1099 gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
1101 /* Increment number of inner iterations */
1102 inneriter += j_index_end - j_index_start;
1104 /* Outer loop uses 19 flops */
1107 /* Increment number of outer iterations */
1110 /* Update outer/inner flops */
1112 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_W3W3_VF,outeriter*19 + inneriter*396);
1115 * Gromacs nonbonded kernel: nb_kernel_ElecEw_VdwNone_GeomW3W3_F_sparc64_hpc_ace_double
1116 * Electrostatics interaction: Ewald
1117 * VdW interaction: None
1118 * Geometry: Water3-Water3
1119 * Calculate force/pot: Force
1122 nb_kernel_ElecEw_VdwNone_GeomW3W3_F_sparc64_hpc_ace_double
1123 (t_nblist * gmx_restrict nlist,
1124 rvec * gmx_restrict xx,
1125 rvec * gmx_restrict ff,
1126 t_forcerec * gmx_restrict fr,
1127 t_mdatoms * gmx_restrict mdatoms,
1128 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
1129 t_nrnb * gmx_restrict nrnb)
1131 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
1132 * just 0 for non-waters.
1133 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
1134 * jnr indices corresponding to data put in the four positions in the SIMD register.
1136 int i_shift_offset,i_coord_offset,outeriter,inneriter;
1137 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
1139 int j_coord_offsetA,j_coord_offsetB;
1140 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
1141 real rcutoff_scalar;
1142 real *shiftvec,*fshift,*x,*f;
1143 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
1145 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
1147 _fjsp_v2r8 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
1149 _fjsp_v2r8 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
1150 int vdwjidx0A,vdwjidx0B;
1151 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
1152 int vdwjidx1A,vdwjidx1B;
1153 _fjsp_v2r8 jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
1154 int vdwjidx2A,vdwjidx2B;
1155 _fjsp_v2r8 jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
1156 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
1157 _fjsp_v2r8 dx01,dy01,dz01,rsq01,rinv01,rinvsq01,r01,qq01,c6_01,c12_01;
1158 _fjsp_v2r8 dx02,dy02,dz02,rsq02,rinv02,rinvsq02,r02,qq02,c6_02,c12_02;
1159 _fjsp_v2r8 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
1160 _fjsp_v2r8 dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11;
1161 _fjsp_v2r8 dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12;
1162 _fjsp_v2r8 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
1163 _fjsp_v2r8 dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21;
1164 _fjsp_v2r8 dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22;
1165 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
1167 _fjsp_v2r8 ewtabscale,eweps,sh_ewald,ewrt,ewtabhalfspace,ewtabF,ewtabFn,ewtabD,ewtabV;
1169 _fjsp_v2r8 itab_tmp;
1170 _fjsp_v2r8 dummy_mask,cutoff_mask;
1171 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
1172 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
1173 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
1180 jindex = nlist->jindex;
1182 shiftidx = nlist->shift;
1184 shiftvec = fr->shift_vec[0];
1185 fshift = fr->fshift[0];
1186 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
1187 charge = mdatoms->chargeA;
1189 sh_ewald = gmx_fjsp_set1_v2r8(fr->ic->sh_ewald);
1190 ewtab = fr->ic->tabq_coul_F;
1191 ewtabscale = gmx_fjsp_set1_v2r8(fr->ic->tabq_scale);
1192 ewtabhalfspace = gmx_fjsp_set1_v2r8(0.5/fr->ic->tabq_scale);
1194 /* Setup water-specific parameters */
1195 inr = nlist->iinr[0];
1196 iq0 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+0]));
1197 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
1198 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
1200 jq0 = gmx_fjsp_set1_v2r8(charge[inr+0]);
1201 jq1 = gmx_fjsp_set1_v2r8(charge[inr+1]);
1202 jq2 = gmx_fjsp_set1_v2r8(charge[inr+2]);
1203 qq00 = _fjsp_mul_v2r8(iq0,jq0);
1204 qq01 = _fjsp_mul_v2r8(iq0,jq1);
1205 qq02 = _fjsp_mul_v2r8(iq0,jq2);
1206 qq10 = _fjsp_mul_v2r8(iq1,jq0);
1207 qq11 = _fjsp_mul_v2r8(iq1,jq1);
1208 qq12 = _fjsp_mul_v2r8(iq1,jq2);
1209 qq20 = _fjsp_mul_v2r8(iq2,jq0);
1210 qq21 = _fjsp_mul_v2r8(iq2,jq1);
1211 qq22 = _fjsp_mul_v2r8(iq2,jq2);
1213 /* Avoid stupid compiler warnings */
1215 j_coord_offsetA = 0;
1216 j_coord_offsetB = 0;
1221 /* Start outer loop over neighborlists */
1222 for(iidx=0; iidx<nri; iidx++)
1224 /* Load shift vector for this list */
1225 i_shift_offset = DIM*shiftidx[iidx];
1227 /* Load limits for loop over neighbors */
1228 j_index_start = jindex[iidx];
1229 j_index_end = jindex[iidx+1];
1231 /* Get outer coordinate index */
1233 i_coord_offset = DIM*inr;
1235 /* Load i particle coords and add shift vector */
1236 gmx_fjsp_load_shift_and_3rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
1237 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2);
1239 fix0 = _fjsp_setzero_v2r8();
1240 fiy0 = _fjsp_setzero_v2r8();
1241 fiz0 = _fjsp_setzero_v2r8();
1242 fix1 = _fjsp_setzero_v2r8();
1243 fiy1 = _fjsp_setzero_v2r8();
1244 fiz1 = _fjsp_setzero_v2r8();
1245 fix2 = _fjsp_setzero_v2r8();
1246 fiy2 = _fjsp_setzero_v2r8();
1247 fiz2 = _fjsp_setzero_v2r8();
1249 /* Start inner kernel loop */
1250 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
1253 /* Get j neighbor index, and coordinate index */
1255 jnrB = jjnr[jidx+1];
1256 j_coord_offsetA = DIM*jnrA;
1257 j_coord_offsetB = DIM*jnrB;
1259 /* load j atom coordinates */
1260 gmx_fjsp_load_3rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
1261 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,&jy2,&jz2);
1263 /* Calculate displacement vector */
1264 dx00 = _fjsp_sub_v2r8(ix0,jx0);
1265 dy00 = _fjsp_sub_v2r8(iy0,jy0);
1266 dz00 = _fjsp_sub_v2r8(iz0,jz0);
1267 dx01 = _fjsp_sub_v2r8(ix0,jx1);
1268 dy01 = _fjsp_sub_v2r8(iy0,jy1);
1269 dz01 = _fjsp_sub_v2r8(iz0,jz1);
1270 dx02 = _fjsp_sub_v2r8(ix0,jx2);
1271 dy02 = _fjsp_sub_v2r8(iy0,jy2);
1272 dz02 = _fjsp_sub_v2r8(iz0,jz2);
1273 dx10 = _fjsp_sub_v2r8(ix1,jx0);
1274 dy10 = _fjsp_sub_v2r8(iy1,jy0);
1275 dz10 = _fjsp_sub_v2r8(iz1,jz0);
1276 dx11 = _fjsp_sub_v2r8(ix1,jx1);
1277 dy11 = _fjsp_sub_v2r8(iy1,jy1);
1278 dz11 = _fjsp_sub_v2r8(iz1,jz1);
1279 dx12 = _fjsp_sub_v2r8(ix1,jx2);
1280 dy12 = _fjsp_sub_v2r8(iy1,jy2);
1281 dz12 = _fjsp_sub_v2r8(iz1,jz2);
1282 dx20 = _fjsp_sub_v2r8(ix2,jx0);
1283 dy20 = _fjsp_sub_v2r8(iy2,jy0);
1284 dz20 = _fjsp_sub_v2r8(iz2,jz0);
1285 dx21 = _fjsp_sub_v2r8(ix2,jx1);
1286 dy21 = _fjsp_sub_v2r8(iy2,jy1);
1287 dz21 = _fjsp_sub_v2r8(iz2,jz1);
1288 dx22 = _fjsp_sub_v2r8(ix2,jx2);
1289 dy22 = _fjsp_sub_v2r8(iy2,jy2);
1290 dz22 = _fjsp_sub_v2r8(iz2,jz2);
1292 /* Calculate squared distance and things based on it */
1293 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
1294 rsq01 = gmx_fjsp_calc_rsq_v2r8(dx01,dy01,dz01);
1295 rsq02 = gmx_fjsp_calc_rsq_v2r8(dx02,dy02,dz02);
1296 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
1297 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
1298 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
1299 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
1300 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
1301 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
1303 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
1304 rinv01 = gmx_fjsp_invsqrt_v2r8(rsq01);
1305 rinv02 = gmx_fjsp_invsqrt_v2r8(rsq02);
1306 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
1307 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
1308 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
1309 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
1310 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
1311 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
1313 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
1314 rinvsq01 = _fjsp_mul_v2r8(rinv01,rinv01);
1315 rinvsq02 = _fjsp_mul_v2r8(rinv02,rinv02);
1316 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
1317 rinvsq11 = _fjsp_mul_v2r8(rinv11,rinv11);
1318 rinvsq12 = _fjsp_mul_v2r8(rinv12,rinv12);
1319 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
1320 rinvsq21 = _fjsp_mul_v2r8(rinv21,rinv21);
1321 rinvsq22 = _fjsp_mul_v2r8(rinv22,rinv22);
1323 fjx0 = _fjsp_setzero_v2r8();
1324 fjy0 = _fjsp_setzero_v2r8();
1325 fjz0 = _fjsp_setzero_v2r8();
1326 fjx1 = _fjsp_setzero_v2r8();
1327 fjy1 = _fjsp_setzero_v2r8();
1328 fjz1 = _fjsp_setzero_v2r8();
1329 fjx2 = _fjsp_setzero_v2r8();
1330 fjy2 = _fjsp_setzero_v2r8();
1331 fjz2 = _fjsp_setzero_v2r8();
1333 /**************************
1334 * CALCULATE INTERACTIONS *
1335 **************************/
1337 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
1339 /* EWALD ELECTROSTATICS */
1341 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1342 ewrt = _fjsp_mul_v2r8(r00,ewtabscale);
1343 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1344 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1345 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1347 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1349 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1350 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq00,rinv00),_fjsp_sub_v2r8(rinvsq00,felec));
1354 /* Update vectorial force */
1355 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
1356 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
1357 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
1359 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
1360 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
1361 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
1363 /**************************
1364 * CALCULATE INTERACTIONS *
1365 **************************/
1367 r01 = _fjsp_mul_v2r8(rsq01,rinv01);
1369 /* EWALD ELECTROSTATICS */
1371 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1372 ewrt = _fjsp_mul_v2r8(r01,ewtabscale);
1373 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1374 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1375 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1377 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1379 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1380 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq01,rinv01),_fjsp_sub_v2r8(rinvsq01,felec));
1384 /* Update vectorial force */
1385 fix0 = _fjsp_madd_v2r8(dx01,fscal,fix0);
1386 fiy0 = _fjsp_madd_v2r8(dy01,fscal,fiy0);
1387 fiz0 = _fjsp_madd_v2r8(dz01,fscal,fiz0);
1389 fjx1 = _fjsp_madd_v2r8(dx01,fscal,fjx1);
1390 fjy1 = _fjsp_madd_v2r8(dy01,fscal,fjy1);
1391 fjz1 = _fjsp_madd_v2r8(dz01,fscal,fjz1);
1393 /**************************
1394 * CALCULATE INTERACTIONS *
1395 **************************/
1397 r02 = _fjsp_mul_v2r8(rsq02,rinv02);
1399 /* EWALD ELECTROSTATICS */
1401 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1402 ewrt = _fjsp_mul_v2r8(r02,ewtabscale);
1403 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1404 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1405 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1407 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1409 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1410 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq02,rinv02),_fjsp_sub_v2r8(rinvsq02,felec));
1414 /* Update vectorial force */
1415 fix0 = _fjsp_madd_v2r8(dx02,fscal,fix0);
1416 fiy0 = _fjsp_madd_v2r8(dy02,fscal,fiy0);
1417 fiz0 = _fjsp_madd_v2r8(dz02,fscal,fiz0);
1419 fjx2 = _fjsp_madd_v2r8(dx02,fscal,fjx2);
1420 fjy2 = _fjsp_madd_v2r8(dy02,fscal,fjy2);
1421 fjz2 = _fjsp_madd_v2r8(dz02,fscal,fjz2);
1423 /**************************
1424 * CALCULATE INTERACTIONS *
1425 **************************/
1427 r10 = _fjsp_mul_v2r8(rsq10,rinv10);
1429 /* EWALD ELECTROSTATICS */
1431 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1432 ewrt = _fjsp_mul_v2r8(r10,ewtabscale);
1433 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1434 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1435 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1437 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1439 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1440 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,rinv10),_fjsp_sub_v2r8(rinvsq10,felec));
1444 /* Update vectorial force */
1445 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
1446 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
1447 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
1449 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
1450 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
1451 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
1453 /**************************
1454 * CALCULATE INTERACTIONS *
1455 **************************/
1457 r11 = _fjsp_mul_v2r8(rsq11,rinv11);
1459 /* EWALD ELECTROSTATICS */
1461 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1462 ewrt = _fjsp_mul_v2r8(r11,ewtabscale);
1463 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1464 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1465 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1467 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1469 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1470 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq11,rinv11),_fjsp_sub_v2r8(rinvsq11,felec));
1474 /* Update vectorial force */
1475 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
1476 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
1477 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
1479 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
1480 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
1481 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
1483 /**************************
1484 * CALCULATE INTERACTIONS *
1485 **************************/
1487 r12 = _fjsp_mul_v2r8(rsq12,rinv12);
1489 /* EWALD ELECTROSTATICS */
1491 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1492 ewrt = _fjsp_mul_v2r8(r12,ewtabscale);
1493 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1494 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1495 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1497 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1499 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1500 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq12,rinv12),_fjsp_sub_v2r8(rinvsq12,felec));
1504 /* Update vectorial force */
1505 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
1506 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
1507 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
1509 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
1510 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
1511 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
1513 /**************************
1514 * CALCULATE INTERACTIONS *
1515 **************************/
1517 r20 = _fjsp_mul_v2r8(rsq20,rinv20);
1519 /* EWALD ELECTROSTATICS */
1521 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1522 ewrt = _fjsp_mul_v2r8(r20,ewtabscale);
1523 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1524 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1525 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1527 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1529 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1530 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,rinv20),_fjsp_sub_v2r8(rinvsq20,felec));
1534 /* Update vectorial force */
1535 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
1536 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
1537 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
1539 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
1540 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
1541 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
1543 /**************************
1544 * CALCULATE INTERACTIONS *
1545 **************************/
1547 r21 = _fjsp_mul_v2r8(rsq21,rinv21);
1549 /* EWALD ELECTROSTATICS */
1551 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1552 ewrt = _fjsp_mul_v2r8(r21,ewtabscale);
1553 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1554 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1555 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1557 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1559 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1560 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq21,rinv21),_fjsp_sub_v2r8(rinvsq21,felec));
1564 /* Update vectorial force */
1565 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
1566 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
1567 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
1569 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
1570 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
1571 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
1573 /**************************
1574 * CALCULATE INTERACTIONS *
1575 **************************/
1577 r22 = _fjsp_mul_v2r8(rsq22,rinv22);
1579 /* EWALD ELECTROSTATICS */
1581 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1582 ewrt = _fjsp_mul_v2r8(r22,ewtabscale);
1583 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1584 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1585 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1587 gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1589 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1590 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq22,rinv22),_fjsp_sub_v2r8(rinvsq22,felec));
1594 /* Update vectorial force */
1595 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
1596 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
1597 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
1599 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
1600 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
1601 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
1603 gmx_fjsp_decrement_3rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2);
1605 /* Inner loop uses 351 flops */
1608 if(jidx<j_index_end)
1612 j_coord_offsetA = DIM*jnrA;
1614 /* load j atom coordinates */
1615 gmx_fjsp_load_3rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
1616 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,&jy2,&jz2);
1618 /* Calculate displacement vector */
1619 dx00 = _fjsp_sub_v2r8(ix0,jx0);
1620 dy00 = _fjsp_sub_v2r8(iy0,jy0);
1621 dz00 = _fjsp_sub_v2r8(iz0,jz0);
1622 dx01 = _fjsp_sub_v2r8(ix0,jx1);
1623 dy01 = _fjsp_sub_v2r8(iy0,jy1);
1624 dz01 = _fjsp_sub_v2r8(iz0,jz1);
1625 dx02 = _fjsp_sub_v2r8(ix0,jx2);
1626 dy02 = _fjsp_sub_v2r8(iy0,jy2);
1627 dz02 = _fjsp_sub_v2r8(iz0,jz2);
1628 dx10 = _fjsp_sub_v2r8(ix1,jx0);
1629 dy10 = _fjsp_sub_v2r8(iy1,jy0);
1630 dz10 = _fjsp_sub_v2r8(iz1,jz0);
1631 dx11 = _fjsp_sub_v2r8(ix1,jx1);
1632 dy11 = _fjsp_sub_v2r8(iy1,jy1);
1633 dz11 = _fjsp_sub_v2r8(iz1,jz1);
1634 dx12 = _fjsp_sub_v2r8(ix1,jx2);
1635 dy12 = _fjsp_sub_v2r8(iy1,jy2);
1636 dz12 = _fjsp_sub_v2r8(iz1,jz2);
1637 dx20 = _fjsp_sub_v2r8(ix2,jx0);
1638 dy20 = _fjsp_sub_v2r8(iy2,jy0);
1639 dz20 = _fjsp_sub_v2r8(iz2,jz0);
1640 dx21 = _fjsp_sub_v2r8(ix2,jx1);
1641 dy21 = _fjsp_sub_v2r8(iy2,jy1);
1642 dz21 = _fjsp_sub_v2r8(iz2,jz1);
1643 dx22 = _fjsp_sub_v2r8(ix2,jx2);
1644 dy22 = _fjsp_sub_v2r8(iy2,jy2);
1645 dz22 = _fjsp_sub_v2r8(iz2,jz2);
1647 /* Calculate squared distance and things based on it */
1648 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
1649 rsq01 = gmx_fjsp_calc_rsq_v2r8(dx01,dy01,dz01);
1650 rsq02 = gmx_fjsp_calc_rsq_v2r8(dx02,dy02,dz02);
1651 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
1652 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
1653 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
1654 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
1655 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
1656 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
1658 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
1659 rinv01 = gmx_fjsp_invsqrt_v2r8(rsq01);
1660 rinv02 = gmx_fjsp_invsqrt_v2r8(rsq02);
1661 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
1662 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
1663 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
1664 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
1665 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
1666 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
1668 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
1669 rinvsq01 = _fjsp_mul_v2r8(rinv01,rinv01);
1670 rinvsq02 = _fjsp_mul_v2r8(rinv02,rinv02);
1671 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
1672 rinvsq11 = _fjsp_mul_v2r8(rinv11,rinv11);
1673 rinvsq12 = _fjsp_mul_v2r8(rinv12,rinv12);
1674 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
1675 rinvsq21 = _fjsp_mul_v2r8(rinv21,rinv21);
1676 rinvsq22 = _fjsp_mul_v2r8(rinv22,rinv22);
1678 fjx0 = _fjsp_setzero_v2r8();
1679 fjy0 = _fjsp_setzero_v2r8();
1680 fjz0 = _fjsp_setzero_v2r8();
1681 fjx1 = _fjsp_setzero_v2r8();
1682 fjy1 = _fjsp_setzero_v2r8();
1683 fjz1 = _fjsp_setzero_v2r8();
1684 fjx2 = _fjsp_setzero_v2r8();
1685 fjy2 = _fjsp_setzero_v2r8();
1686 fjz2 = _fjsp_setzero_v2r8();
1688 /**************************
1689 * CALCULATE INTERACTIONS *
1690 **************************/
1692 r00 = _fjsp_mul_v2r8(rsq00,rinv00);
1694 /* EWALD ELECTROSTATICS */
1696 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1697 ewrt = _fjsp_mul_v2r8(r00,ewtabscale);
1698 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1699 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1700 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1702 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
1703 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1704 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq00,rinv00),_fjsp_sub_v2r8(rinvsq00,felec));
1708 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1710 /* Update vectorial force */
1711 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
1712 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
1713 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
1715 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
1716 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
1717 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
1719 /**************************
1720 * CALCULATE INTERACTIONS *
1721 **************************/
1723 r01 = _fjsp_mul_v2r8(rsq01,rinv01);
1725 /* EWALD ELECTROSTATICS */
1727 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1728 ewrt = _fjsp_mul_v2r8(r01,ewtabscale);
1729 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1730 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1731 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1733 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
1734 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1735 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq01,rinv01),_fjsp_sub_v2r8(rinvsq01,felec));
1739 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1741 /* Update vectorial force */
1742 fix0 = _fjsp_madd_v2r8(dx01,fscal,fix0);
1743 fiy0 = _fjsp_madd_v2r8(dy01,fscal,fiy0);
1744 fiz0 = _fjsp_madd_v2r8(dz01,fscal,fiz0);
1746 fjx1 = _fjsp_madd_v2r8(dx01,fscal,fjx1);
1747 fjy1 = _fjsp_madd_v2r8(dy01,fscal,fjy1);
1748 fjz1 = _fjsp_madd_v2r8(dz01,fscal,fjz1);
1750 /**************************
1751 * CALCULATE INTERACTIONS *
1752 **************************/
1754 r02 = _fjsp_mul_v2r8(rsq02,rinv02);
1756 /* EWALD ELECTROSTATICS */
1758 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1759 ewrt = _fjsp_mul_v2r8(r02,ewtabscale);
1760 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1761 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1762 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1764 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
1765 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1766 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq02,rinv02),_fjsp_sub_v2r8(rinvsq02,felec));
1770 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1772 /* Update vectorial force */
1773 fix0 = _fjsp_madd_v2r8(dx02,fscal,fix0);
1774 fiy0 = _fjsp_madd_v2r8(dy02,fscal,fiy0);
1775 fiz0 = _fjsp_madd_v2r8(dz02,fscal,fiz0);
1777 fjx2 = _fjsp_madd_v2r8(dx02,fscal,fjx2);
1778 fjy2 = _fjsp_madd_v2r8(dy02,fscal,fjy2);
1779 fjz2 = _fjsp_madd_v2r8(dz02,fscal,fjz2);
1781 /**************************
1782 * CALCULATE INTERACTIONS *
1783 **************************/
1785 r10 = _fjsp_mul_v2r8(rsq10,rinv10);
1787 /* EWALD ELECTROSTATICS */
1789 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1790 ewrt = _fjsp_mul_v2r8(r10,ewtabscale);
1791 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1792 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1793 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1795 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
1796 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1797 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,rinv10),_fjsp_sub_v2r8(rinvsq10,felec));
1801 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1803 /* Update vectorial force */
1804 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
1805 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
1806 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
1808 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
1809 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
1810 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
1812 /**************************
1813 * CALCULATE INTERACTIONS *
1814 **************************/
1816 r11 = _fjsp_mul_v2r8(rsq11,rinv11);
1818 /* EWALD ELECTROSTATICS */
1820 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1821 ewrt = _fjsp_mul_v2r8(r11,ewtabscale);
1822 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1823 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1824 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1826 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
1827 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1828 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq11,rinv11),_fjsp_sub_v2r8(rinvsq11,felec));
1832 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1834 /* Update vectorial force */
1835 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
1836 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
1837 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
1839 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
1840 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
1841 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
1843 /**************************
1844 * CALCULATE INTERACTIONS *
1845 **************************/
1847 r12 = _fjsp_mul_v2r8(rsq12,rinv12);
1849 /* EWALD ELECTROSTATICS */
1851 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1852 ewrt = _fjsp_mul_v2r8(r12,ewtabscale);
1853 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1854 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1855 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1857 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
1858 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1859 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq12,rinv12),_fjsp_sub_v2r8(rinvsq12,felec));
1863 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1865 /* Update vectorial force */
1866 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
1867 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
1868 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
1870 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
1871 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
1872 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
1874 /**************************
1875 * CALCULATE INTERACTIONS *
1876 **************************/
1878 r20 = _fjsp_mul_v2r8(rsq20,rinv20);
1880 /* EWALD ELECTROSTATICS */
1882 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1883 ewrt = _fjsp_mul_v2r8(r20,ewtabscale);
1884 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1885 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1886 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1888 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
1889 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1890 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,rinv20),_fjsp_sub_v2r8(rinvsq20,felec));
1894 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1896 /* Update vectorial force */
1897 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
1898 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
1899 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
1901 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
1902 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
1903 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
1905 /**************************
1906 * CALCULATE INTERACTIONS *
1907 **************************/
1909 r21 = _fjsp_mul_v2r8(rsq21,rinv21);
1911 /* EWALD ELECTROSTATICS */
1913 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1914 ewrt = _fjsp_mul_v2r8(r21,ewtabscale);
1915 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1916 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1917 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1919 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
1920 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1921 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq21,rinv21),_fjsp_sub_v2r8(rinvsq21,felec));
1925 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1927 /* Update vectorial force */
1928 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
1929 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
1930 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
1932 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
1933 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
1934 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
1936 /**************************
1937 * CALCULATE INTERACTIONS *
1938 **************************/
1940 r22 = _fjsp_mul_v2r8(rsq22,rinv22);
1942 /* EWALD ELECTROSTATICS */
1944 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1945 ewrt = _fjsp_mul_v2r8(r22,ewtabscale);
1946 itab_tmp = _fjsp_dtox_v2r8(ewrt);
1947 eweps = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1948 _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1950 gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
1951 felec = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1952 felec = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq22,rinv22),_fjsp_sub_v2r8(rinvsq22,felec));
1956 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1958 /* Update vectorial force */
1959 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
1960 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
1961 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
1963 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
1964 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
1965 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
1967 gmx_fjsp_decrement_3rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2);
1969 /* Inner loop uses 351 flops */
1972 /* End of innermost loop */
1974 gmx_fjsp_update_iforce_3atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,
1975 f+i_coord_offset,fshift+i_shift_offset);
1977 /* Increment number of inner iterations */
1978 inneriter += j_index_end - j_index_start;
1980 /* Outer loop uses 18 flops */
1983 /* Increment number of outer iterations */
1986 /* Update outer/inner flops */
1988 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_W3W3_F,outeriter*18 + inneriter*351);