2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
5 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6 * and including many others, as listed in the AUTHORS file in the
7 * top-level source directory and at http://www.gromacs.org.
9 * GROMACS is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 2.1
12 * of the License, or (at your option) any later version.
14 * GROMACS is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with GROMACS; if not, see
21 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 * If you want to redistribute modifications to GROMACS, please
25 * consider that scientific software is very special. Version
26 * control is crucial - bugs must be traceable. We will be happy to
27 * consider code for inclusion in the official distribution, but
28 * derived work must not be called official GROMACS. Details are found
29 * in the README & COPYING files - if they are missing, get the
30 * official version at http://www.gromacs.org.
32 * To help us fund GROMACS development, we humbly ask that you cite
33 * the research papers on the package. Check out http://www.gromacs.org.
36 * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
42 #include "../nb_kernel.h"
43 #include "gromacs/legacyheaders/types/simple.h"
44 #include "gromacs/math/vec.h"
45 #include "gromacs/legacyheaders/nrnb.h"
47 #include "kernelutil_sparc64_hpc_ace_double.h"
50 * Gromacs nonbonded kernel: nb_kernel_ElecRF_VdwLJ_GeomW3W3_VF_sparc64_hpc_ace_double
51 * Electrostatics interaction: ReactionField
52 * VdW interaction: LennardJones
53 * Geometry: Water3-Water3
54 * Calculate force/pot: PotentialAndForce
57 nb_kernel_ElecRF_VdwLJ_GeomW3W3_VF_sparc64_hpc_ace_double
58 (t_nblist * gmx_restrict nlist,
59 rvec * gmx_restrict xx,
60 rvec * gmx_restrict ff,
61 t_forcerec * gmx_restrict fr,
62 t_mdatoms * gmx_restrict mdatoms,
63 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
64 t_nrnb * gmx_restrict nrnb)
66 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
67 * just 0 for non-waters.
68 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
69 * jnr indices corresponding to data put in the four positions in the SIMD register.
71 int i_shift_offset,i_coord_offset,outeriter,inneriter;
72 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
74 int j_coord_offsetA,j_coord_offsetB;
75 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
77 real *shiftvec,*fshift,*x,*f;
78 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
80 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
82 _fjsp_v2r8 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
84 _fjsp_v2r8 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
85 int vdwjidx0A,vdwjidx0B;
86 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
87 int vdwjidx1A,vdwjidx1B;
88 _fjsp_v2r8 jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
89 int vdwjidx2A,vdwjidx2B;
90 _fjsp_v2r8 jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
91 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
92 _fjsp_v2r8 dx01,dy01,dz01,rsq01,rinv01,rinvsq01,r01,qq01,c6_01,c12_01;
93 _fjsp_v2r8 dx02,dy02,dz02,rsq02,rinv02,rinvsq02,r02,qq02,c6_02,c12_02;
94 _fjsp_v2r8 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
95 _fjsp_v2r8 dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11;
96 _fjsp_v2r8 dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12;
97 _fjsp_v2r8 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
98 _fjsp_v2r8 dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21;
99 _fjsp_v2r8 dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22;
100 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
103 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
106 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
107 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
109 _fjsp_v2r8 dummy_mask,cutoff_mask;
110 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
111 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
112 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
119 jindex = nlist->jindex;
121 shiftidx = nlist->shift;
123 shiftvec = fr->shift_vec[0];
124 fshift = fr->fshift[0];
125 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
126 charge = mdatoms->chargeA;
127 krf = gmx_fjsp_set1_v2r8(fr->ic->k_rf);
128 krf2 = gmx_fjsp_set1_v2r8(fr->ic->k_rf*2.0);
129 crf = gmx_fjsp_set1_v2r8(fr->ic->c_rf);
130 nvdwtype = fr->ntype;
132 vdwtype = mdatoms->typeA;
134 /* Setup water-specific parameters */
135 inr = nlist->iinr[0];
136 iq0 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+0]));
137 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
138 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
139 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
141 jq0 = gmx_fjsp_set1_v2r8(charge[inr+0]);
142 jq1 = gmx_fjsp_set1_v2r8(charge[inr+1]);
143 jq2 = gmx_fjsp_set1_v2r8(charge[inr+2]);
144 vdwjidx0A = 2*vdwtype[inr+0];
145 qq00 = _fjsp_mul_v2r8(iq0,jq0);
146 c6_00 = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A]);
147 c12_00 = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A+1]);
148 qq01 = _fjsp_mul_v2r8(iq0,jq1);
149 qq02 = _fjsp_mul_v2r8(iq0,jq2);
150 qq10 = _fjsp_mul_v2r8(iq1,jq0);
151 qq11 = _fjsp_mul_v2r8(iq1,jq1);
152 qq12 = _fjsp_mul_v2r8(iq1,jq2);
153 qq20 = _fjsp_mul_v2r8(iq2,jq0);
154 qq21 = _fjsp_mul_v2r8(iq2,jq1);
155 qq22 = _fjsp_mul_v2r8(iq2,jq2);
157 /* Avoid stupid compiler warnings */
165 /* Start outer loop over neighborlists */
166 for(iidx=0; iidx<nri; iidx++)
168 /* Load shift vector for this list */
169 i_shift_offset = DIM*shiftidx[iidx];
171 /* Load limits for loop over neighbors */
172 j_index_start = jindex[iidx];
173 j_index_end = jindex[iidx+1];
175 /* Get outer coordinate index */
177 i_coord_offset = DIM*inr;
179 /* Load i particle coords and add shift vector */
180 gmx_fjsp_load_shift_and_3rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
181 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2);
183 fix0 = _fjsp_setzero_v2r8();
184 fiy0 = _fjsp_setzero_v2r8();
185 fiz0 = _fjsp_setzero_v2r8();
186 fix1 = _fjsp_setzero_v2r8();
187 fiy1 = _fjsp_setzero_v2r8();
188 fiz1 = _fjsp_setzero_v2r8();
189 fix2 = _fjsp_setzero_v2r8();
190 fiy2 = _fjsp_setzero_v2r8();
191 fiz2 = _fjsp_setzero_v2r8();
193 /* Reset potential sums */
194 velecsum = _fjsp_setzero_v2r8();
195 vvdwsum = _fjsp_setzero_v2r8();
197 /* Start inner kernel loop */
198 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
201 /* Get j neighbor index, and coordinate index */
204 j_coord_offsetA = DIM*jnrA;
205 j_coord_offsetB = DIM*jnrB;
207 /* load j atom coordinates */
208 gmx_fjsp_load_3rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
209 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,&jy2,&jz2);
211 /* Calculate displacement vector */
212 dx00 = _fjsp_sub_v2r8(ix0,jx0);
213 dy00 = _fjsp_sub_v2r8(iy0,jy0);
214 dz00 = _fjsp_sub_v2r8(iz0,jz0);
215 dx01 = _fjsp_sub_v2r8(ix0,jx1);
216 dy01 = _fjsp_sub_v2r8(iy0,jy1);
217 dz01 = _fjsp_sub_v2r8(iz0,jz1);
218 dx02 = _fjsp_sub_v2r8(ix0,jx2);
219 dy02 = _fjsp_sub_v2r8(iy0,jy2);
220 dz02 = _fjsp_sub_v2r8(iz0,jz2);
221 dx10 = _fjsp_sub_v2r8(ix1,jx0);
222 dy10 = _fjsp_sub_v2r8(iy1,jy0);
223 dz10 = _fjsp_sub_v2r8(iz1,jz0);
224 dx11 = _fjsp_sub_v2r8(ix1,jx1);
225 dy11 = _fjsp_sub_v2r8(iy1,jy1);
226 dz11 = _fjsp_sub_v2r8(iz1,jz1);
227 dx12 = _fjsp_sub_v2r8(ix1,jx2);
228 dy12 = _fjsp_sub_v2r8(iy1,jy2);
229 dz12 = _fjsp_sub_v2r8(iz1,jz2);
230 dx20 = _fjsp_sub_v2r8(ix2,jx0);
231 dy20 = _fjsp_sub_v2r8(iy2,jy0);
232 dz20 = _fjsp_sub_v2r8(iz2,jz0);
233 dx21 = _fjsp_sub_v2r8(ix2,jx1);
234 dy21 = _fjsp_sub_v2r8(iy2,jy1);
235 dz21 = _fjsp_sub_v2r8(iz2,jz1);
236 dx22 = _fjsp_sub_v2r8(ix2,jx2);
237 dy22 = _fjsp_sub_v2r8(iy2,jy2);
238 dz22 = _fjsp_sub_v2r8(iz2,jz2);
240 /* Calculate squared distance and things based on it */
241 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
242 rsq01 = gmx_fjsp_calc_rsq_v2r8(dx01,dy01,dz01);
243 rsq02 = gmx_fjsp_calc_rsq_v2r8(dx02,dy02,dz02);
244 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
245 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
246 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
247 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
248 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
249 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
251 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
252 rinv01 = gmx_fjsp_invsqrt_v2r8(rsq01);
253 rinv02 = gmx_fjsp_invsqrt_v2r8(rsq02);
254 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
255 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
256 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
257 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
258 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
259 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
261 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
262 rinvsq01 = _fjsp_mul_v2r8(rinv01,rinv01);
263 rinvsq02 = _fjsp_mul_v2r8(rinv02,rinv02);
264 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
265 rinvsq11 = _fjsp_mul_v2r8(rinv11,rinv11);
266 rinvsq12 = _fjsp_mul_v2r8(rinv12,rinv12);
267 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
268 rinvsq21 = _fjsp_mul_v2r8(rinv21,rinv21);
269 rinvsq22 = _fjsp_mul_v2r8(rinv22,rinv22);
271 fjx0 = _fjsp_setzero_v2r8();
272 fjy0 = _fjsp_setzero_v2r8();
273 fjz0 = _fjsp_setzero_v2r8();
274 fjx1 = _fjsp_setzero_v2r8();
275 fjy1 = _fjsp_setzero_v2r8();
276 fjz1 = _fjsp_setzero_v2r8();
277 fjx2 = _fjsp_setzero_v2r8();
278 fjy2 = _fjsp_setzero_v2r8();
279 fjz2 = _fjsp_setzero_v2r8();
281 /**************************
282 * CALCULATE INTERACTIONS *
283 **************************/
285 /* REACTION-FIELD ELECTROSTATICS */
286 velec = _fjsp_mul_v2r8(qq00,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq00,rinv00),crf));
287 felec = _fjsp_mul_v2r8(qq00,_fjsp_msub_v2r8(rinv00,rinvsq00,krf2));
289 /* LENNARD-JONES DISPERSION/REPULSION */
291 rinvsix = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
292 vvdw6 = _fjsp_mul_v2r8(c6_00,rinvsix);
293 vvdw12 = _fjsp_mul_v2r8(c12_00,_fjsp_mul_v2r8(rinvsix,rinvsix));
294 vvdw = _fjsp_msub_v2r8( vvdw12,one_twelfth, _fjsp_mul_v2r8(vvdw6,one_sixth) );
295 fvdw = _fjsp_mul_v2r8(_fjsp_sub_v2r8(vvdw12,vvdw6),rinvsq00);
297 /* Update potential sum for this i atom from the interaction with this j atom. */
298 velecsum = _fjsp_add_v2r8(velecsum,velec);
299 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
301 fscal = _fjsp_add_v2r8(felec,fvdw);
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 /* REACTION-FIELD ELECTROSTATICS */
317 velec = _fjsp_mul_v2r8(qq01,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq01,rinv01),crf));
318 felec = _fjsp_mul_v2r8(qq01,_fjsp_msub_v2r8(rinv01,rinvsq01,krf2));
320 /* Update potential sum for this i atom from the interaction with this j atom. */
321 velecsum = _fjsp_add_v2r8(velecsum,velec);
325 /* Update vectorial force */
326 fix0 = _fjsp_madd_v2r8(dx01,fscal,fix0);
327 fiy0 = _fjsp_madd_v2r8(dy01,fscal,fiy0);
328 fiz0 = _fjsp_madd_v2r8(dz01,fscal,fiz0);
330 fjx1 = _fjsp_madd_v2r8(dx01,fscal,fjx1);
331 fjy1 = _fjsp_madd_v2r8(dy01,fscal,fjy1);
332 fjz1 = _fjsp_madd_v2r8(dz01,fscal,fjz1);
334 /**************************
335 * CALCULATE INTERACTIONS *
336 **************************/
338 /* REACTION-FIELD ELECTROSTATICS */
339 velec = _fjsp_mul_v2r8(qq02,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq02,rinv02),crf));
340 felec = _fjsp_mul_v2r8(qq02,_fjsp_msub_v2r8(rinv02,rinvsq02,krf2));
342 /* Update potential sum for this i atom from the interaction with this j atom. */
343 velecsum = _fjsp_add_v2r8(velecsum,velec);
347 /* Update vectorial force */
348 fix0 = _fjsp_madd_v2r8(dx02,fscal,fix0);
349 fiy0 = _fjsp_madd_v2r8(dy02,fscal,fiy0);
350 fiz0 = _fjsp_madd_v2r8(dz02,fscal,fiz0);
352 fjx2 = _fjsp_madd_v2r8(dx02,fscal,fjx2);
353 fjy2 = _fjsp_madd_v2r8(dy02,fscal,fjy2);
354 fjz2 = _fjsp_madd_v2r8(dz02,fscal,fjz2);
356 /**************************
357 * CALCULATE INTERACTIONS *
358 **************************/
360 /* REACTION-FIELD ELECTROSTATICS */
361 velec = _fjsp_mul_v2r8(qq10,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq10,rinv10),crf));
362 felec = _fjsp_mul_v2r8(qq10,_fjsp_msub_v2r8(rinv10,rinvsq10,krf2));
364 /* Update potential sum for this i atom from the interaction with this j atom. */
365 velecsum = _fjsp_add_v2r8(velecsum,velec);
369 /* Update vectorial force */
370 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
371 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
372 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
374 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
375 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
376 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
378 /**************************
379 * CALCULATE INTERACTIONS *
380 **************************/
382 /* REACTION-FIELD ELECTROSTATICS */
383 velec = _fjsp_mul_v2r8(qq11,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq11,rinv11),crf));
384 felec = _fjsp_mul_v2r8(qq11,_fjsp_msub_v2r8(rinv11,rinvsq11,krf2));
386 /* Update potential sum for this i atom from the interaction with this j atom. */
387 velecsum = _fjsp_add_v2r8(velecsum,velec);
391 /* Update vectorial force */
392 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
393 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
394 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
396 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
397 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
398 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
400 /**************************
401 * CALCULATE INTERACTIONS *
402 **************************/
404 /* REACTION-FIELD ELECTROSTATICS */
405 velec = _fjsp_mul_v2r8(qq12,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq12,rinv12),crf));
406 felec = _fjsp_mul_v2r8(qq12,_fjsp_msub_v2r8(rinv12,rinvsq12,krf2));
408 /* Update potential sum for this i atom from the interaction with this j atom. */
409 velecsum = _fjsp_add_v2r8(velecsum,velec);
413 /* Update vectorial force */
414 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
415 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
416 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
418 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
419 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
420 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
422 /**************************
423 * CALCULATE INTERACTIONS *
424 **************************/
426 /* REACTION-FIELD ELECTROSTATICS */
427 velec = _fjsp_mul_v2r8(qq20,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq20,rinv20),crf));
428 felec = _fjsp_mul_v2r8(qq20,_fjsp_msub_v2r8(rinv20,rinvsq20,krf2));
430 /* Update potential sum for this i atom from the interaction with this j atom. */
431 velecsum = _fjsp_add_v2r8(velecsum,velec);
435 /* Update vectorial force */
436 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
437 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
438 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
440 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
441 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
442 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
444 /**************************
445 * CALCULATE INTERACTIONS *
446 **************************/
448 /* REACTION-FIELD ELECTROSTATICS */
449 velec = _fjsp_mul_v2r8(qq21,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq21,rinv21),crf));
450 felec = _fjsp_mul_v2r8(qq21,_fjsp_msub_v2r8(rinv21,rinvsq21,krf2));
452 /* Update potential sum for this i atom from the interaction with this j atom. */
453 velecsum = _fjsp_add_v2r8(velecsum,velec);
457 /* Update vectorial force */
458 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
459 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
460 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
462 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
463 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
464 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
466 /**************************
467 * CALCULATE INTERACTIONS *
468 **************************/
470 /* REACTION-FIELD ELECTROSTATICS */
471 velec = _fjsp_mul_v2r8(qq22,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq22,rinv22),crf));
472 felec = _fjsp_mul_v2r8(qq22,_fjsp_msub_v2r8(rinv22,rinvsq22,krf2));
474 /* Update potential sum for this i atom from the interaction with this j atom. */
475 velecsum = _fjsp_add_v2r8(velecsum,velec);
479 /* Update vectorial force */
480 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
481 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
482 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
484 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
485 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
486 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
488 gmx_fjsp_decrement_3rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2);
490 /* Inner loop uses 327 flops */
497 j_coord_offsetA = DIM*jnrA;
499 /* load j atom coordinates */
500 gmx_fjsp_load_3rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
501 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,&jy2,&jz2);
503 /* Calculate displacement vector */
504 dx00 = _fjsp_sub_v2r8(ix0,jx0);
505 dy00 = _fjsp_sub_v2r8(iy0,jy0);
506 dz00 = _fjsp_sub_v2r8(iz0,jz0);
507 dx01 = _fjsp_sub_v2r8(ix0,jx1);
508 dy01 = _fjsp_sub_v2r8(iy0,jy1);
509 dz01 = _fjsp_sub_v2r8(iz0,jz1);
510 dx02 = _fjsp_sub_v2r8(ix0,jx2);
511 dy02 = _fjsp_sub_v2r8(iy0,jy2);
512 dz02 = _fjsp_sub_v2r8(iz0,jz2);
513 dx10 = _fjsp_sub_v2r8(ix1,jx0);
514 dy10 = _fjsp_sub_v2r8(iy1,jy0);
515 dz10 = _fjsp_sub_v2r8(iz1,jz0);
516 dx11 = _fjsp_sub_v2r8(ix1,jx1);
517 dy11 = _fjsp_sub_v2r8(iy1,jy1);
518 dz11 = _fjsp_sub_v2r8(iz1,jz1);
519 dx12 = _fjsp_sub_v2r8(ix1,jx2);
520 dy12 = _fjsp_sub_v2r8(iy1,jy2);
521 dz12 = _fjsp_sub_v2r8(iz1,jz2);
522 dx20 = _fjsp_sub_v2r8(ix2,jx0);
523 dy20 = _fjsp_sub_v2r8(iy2,jy0);
524 dz20 = _fjsp_sub_v2r8(iz2,jz0);
525 dx21 = _fjsp_sub_v2r8(ix2,jx1);
526 dy21 = _fjsp_sub_v2r8(iy2,jy1);
527 dz21 = _fjsp_sub_v2r8(iz2,jz1);
528 dx22 = _fjsp_sub_v2r8(ix2,jx2);
529 dy22 = _fjsp_sub_v2r8(iy2,jy2);
530 dz22 = _fjsp_sub_v2r8(iz2,jz2);
532 /* Calculate squared distance and things based on it */
533 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
534 rsq01 = gmx_fjsp_calc_rsq_v2r8(dx01,dy01,dz01);
535 rsq02 = gmx_fjsp_calc_rsq_v2r8(dx02,dy02,dz02);
536 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
537 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
538 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
539 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
540 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
541 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
543 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
544 rinv01 = gmx_fjsp_invsqrt_v2r8(rsq01);
545 rinv02 = gmx_fjsp_invsqrt_v2r8(rsq02);
546 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
547 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
548 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
549 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
550 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
551 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
553 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
554 rinvsq01 = _fjsp_mul_v2r8(rinv01,rinv01);
555 rinvsq02 = _fjsp_mul_v2r8(rinv02,rinv02);
556 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
557 rinvsq11 = _fjsp_mul_v2r8(rinv11,rinv11);
558 rinvsq12 = _fjsp_mul_v2r8(rinv12,rinv12);
559 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
560 rinvsq21 = _fjsp_mul_v2r8(rinv21,rinv21);
561 rinvsq22 = _fjsp_mul_v2r8(rinv22,rinv22);
563 fjx0 = _fjsp_setzero_v2r8();
564 fjy0 = _fjsp_setzero_v2r8();
565 fjz0 = _fjsp_setzero_v2r8();
566 fjx1 = _fjsp_setzero_v2r8();
567 fjy1 = _fjsp_setzero_v2r8();
568 fjz1 = _fjsp_setzero_v2r8();
569 fjx2 = _fjsp_setzero_v2r8();
570 fjy2 = _fjsp_setzero_v2r8();
571 fjz2 = _fjsp_setzero_v2r8();
573 /**************************
574 * CALCULATE INTERACTIONS *
575 **************************/
577 /* REACTION-FIELD ELECTROSTATICS */
578 velec = _fjsp_mul_v2r8(qq00,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq00,rinv00),crf));
579 felec = _fjsp_mul_v2r8(qq00,_fjsp_msub_v2r8(rinv00,rinvsq00,krf2));
581 /* LENNARD-JONES DISPERSION/REPULSION */
583 rinvsix = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
584 vvdw6 = _fjsp_mul_v2r8(c6_00,rinvsix);
585 vvdw12 = _fjsp_mul_v2r8(c12_00,_fjsp_mul_v2r8(rinvsix,rinvsix));
586 vvdw = _fjsp_msub_v2r8( vvdw12,one_twelfth, _fjsp_mul_v2r8(vvdw6,one_sixth) );
587 fvdw = _fjsp_mul_v2r8(_fjsp_sub_v2r8(vvdw12,vvdw6),rinvsq00);
589 /* Update potential sum for this i atom from the interaction with this j atom. */
590 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
591 velecsum = _fjsp_add_v2r8(velecsum,velec);
592 vvdw = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
593 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
595 fscal = _fjsp_add_v2r8(felec,fvdw);
597 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
599 /* Update vectorial force */
600 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
601 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
602 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
604 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
605 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
606 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
608 /**************************
609 * CALCULATE INTERACTIONS *
610 **************************/
612 /* REACTION-FIELD ELECTROSTATICS */
613 velec = _fjsp_mul_v2r8(qq01,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq01,rinv01),crf));
614 felec = _fjsp_mul_v2r8(qq01,_fjsp_msub_v2r8(rinv01,rinvsq01,krf2));
616 /* Update potential sum for this i atom from the interaction with this j atom. */
617 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
618 velecsum = _fjsp_add_v2r8(velecsum,velec);
622 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
624 /* Update vectorial force */
625 fix0 = _fjsp_madd_v2r8(dx01,fscal,fix0);
626 fiy0 = _fjsp_madd_v2r8(dy01,fscal,fiy0);
627 fiz0 = _fjsp_madd_v2r8(dz01,fscal,fiz0);
629 fjx1 = _fjsp_madd_v2r8(dx01,fscal,fjx1);
630 fjy1 = _fjsp_madd_v2r8(dy01,fscal,fjy1);
631 fjz1 = _fjsp_madd_v2r8(dz01,fscal,fjz1);
633 /**************************
634 * CALCULATE INTERACTIONS *
635 **************************/
637 /* REACTION-FIELD ELECTROSTATICS */
638 velec = _fjsp_mul_v2r8(qq02,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq02,rinv02),crf));
639 felec = _fjsp_mul_v2r8(qq02,_fjsp_msub_v2r8(rinv02,rinvsq02,krf2));
641 /* Update potential sum for this i atom from the interaction with this j atom. */
642 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
643 velecsum = _fjsp_add_v2r8(velecsum,velec);
647 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
649 /* Update vectorial force */
650 fix0 = _fjsp_madd_v2r8(dx02,fscal,fix0);
651 fiy0 = _fjsp_madd_v2r8(dy02,fscal,fiy0);
652 fiz0 = _fjsp_madd_v2r8(dz02,fscal,fiz0);
654 fjx2 = _fjsp_madd_v2r8(dx02,fscal,fjx2);
655 fjy2 = _fjsp_madd_v2r8(dy02,fscal,fjy2);
656 fjz2 = _fjsp_madd_v2r8(dz02,fscal,fjz2);
658 /**************************
659 * CALCULATE INTERACTIONS *
660 **************************/
662 /* REACTION-FIELD ELECTROSTATICS */
663 velec = _fjsp_mul_v2r8(qq10,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq10,rinv10),crf));
664 felec = _fjsp_mul_v2r8(qq10,_fjsp_msub_v2r8(rinv10,rinvsq10,krf2));
666 /* Update potential sum for this i atom from the interaction with this j atom. */
667 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
668 velecsum = _fjsp_add_v2r8(velecsum,velec);
672 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
674 /* Update vectorial force */
675 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
676 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
677 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
679 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
680 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
681 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
683 /**************************
684 * CALCULATE INTERACTIONS *
685 **************************/
687 /* REACTION-FIELD ELECTROSTATICS */
688 velec = _fjsp_mul_v2r8(qq11,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq11,rinv11),crf));
689 felec = _fjsp_mul_v2r8(qq11,_fjsp_msub_v2r8(rinv11,rinvsq11,krf2));
691 /* Update potential sum for this i atom from the interaction with this j atom. */
692 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
693 velecsum = _fjsp_add_v2r8(velecsum,velec);
697 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
699 /* Update vectorial force */
700 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
701 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
702 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
704 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
705 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
706 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
708 /**************************
709 * CALCULATE INTERACTIONS *
710 **************************/
712 /* REACTION-FIELD ELECTROSTATICS */
713 velec = _fjsp_mul_v2r8(qq12,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq12,rinv12),crf));
714 felec = _fjsp_mul_v2r8(qq12,_fjsp_msub_v2r8(rinv12,rinvsq12,krf2));
716 /* Update potential sum for this i atom from the interaction with this j atom. */
717 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
718 velecsum = _fjsp_add_v2r8(velecsum,velec);
722 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
724 /* Update vectorial force */
725 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
726 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
727 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
729 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
730 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
731 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
733 /**************************
734 * CALCULATE INTERACTIONS *
735 **************************/
737 /* REACTION-FIELD ELECTROSTATICS */
738 velec = _fjsp_mul_v2r8(qq20,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq20,rinv20),crf));
739 felec = _fjsp_mul_v2r8(qq20,_fjsp_msub_v2r8(rinv20,rinvsq20,krf2));
741 /* Update potential sum for this i atom from the interaction with this j atom. */
742 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
743 velecsum = _fjsp_add_v2r8(velecsum,velec);
747 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
749 /* Update vectorial force */
750 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
751 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
752 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
754 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
755 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
756 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
758 /**************************
759 * CALCULATE INTERACTIONS *
760 **************************/
762 /* REACTION-FIELD ELECTROSTATICS */
763 velec = _fjsp_mul_v2r8(qq21,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq21,rinv21),crf));
764 felec = _fjsp_mul_v2r8(qq21,_fjsp_msub_v2r8(rinv21,rinvsq21,krf2));
766 /* Update potential sum for this i atom from the interaction with this j atom. */
767 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
768 velecsum = _fjsp_add_v2r8(velecsum,velec);
772 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
774 /* Update vectorial force */
775 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
776 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
777 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
779 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
780 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
781 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
783 /**************************
784 * CALCULATE INTERACTIONS *
785 **************************/
787 /* REACTION-FIELD ELECTROSTATICS */
788 velec = _fjsp_mul_v2r8(qq22,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq22,rinv22),crf));
789 felec = _fjsp_mul_v2r8(qq22,_fjsp_msub_v2r8(rinv22,rinvsq22,krf2));
791 /* Update potential sum for this i atom from the interaction with this j atom. */
792 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
793 velecsum = _fjsp_add_v2r8(velecsum,velec);
797 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
799 /* Update vectorial force */
800 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
801 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
802 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
804 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
805 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
806 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
808 gmx_fjsp_decrement_3rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2);
810 /* Inner loop uses 327 flops */
813 /* End of innermost loop */
815 gmx_fjsp_update_iforce_3atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,
816 f+i_coord_offset,fshift+i_shift_offset);
819 /* Update potential energies */
820 gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
821 gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
823 /* Increment number of inner iterations */
824 inneriter += j_index_end - j_index_start;
826 /* Outer loop uses 20 flops */
829 /* Increment number of outer iterations */
832 /* Update outer/inner flops */
834 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3W3_VF,outeriter*20 + inneriter*327);
837 * Gromacs nonbonded kernel: nb_kernel_ElecRF_VdwLJ_GeomW3W3_F_sparc64_hpc_ace_double
838 * Electrostatics interaction: ReactionField
839 * VdW interaction: LennardJones
840 * Geometry: Water3-Water3
841 * Calculate force/pot: Force
844 nb_kernel_ElecRF_VdwLJ_GeomW3W3_F_sparc64_hpc_ace_double
845 (t_nblist * gmx_restrict nlist,
846 rvec * gmx_restrict xx,
847 rvec * gmx_restrict ff,
848 t_forcerec * gmx_restrict fr,
849 t_mdatoms * gmx_restrict mdatoms,
850 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
851 t_nrnb * gmx_restrict nrnb)
853 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
854 * just 0 for non-waters.
855 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
856 * jnr indices corresponding to data put in the four positions in the SIMD register.
858 int i_shift_offset,i_coord_offset,outeriter,inneriter;
859 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
861 int j_coord_offsetA,j_coord_offsetB;
862 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
864 real *shiftvec,*fshift,*x,*f;
865 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
867 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
869 _fjsp_v2r8 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
871 _fjsp_v2r8 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
872 int vdwjidx0A,vdwjidx0B;
873 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
874 int vdwjidx1A,vdwjidx1B;
875 _fjsp_v2r8 jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
876 int vdwjidx2A,vdwjidx2B;
877 _fjsp_v2r8 jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
878 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
879 _fjsp_v2r8 dx01,dy01,dz01,rsq01,rinv01,rinvsq01,r01,qq01,c6_01,c12_01;
880 _fjsp_v2r8 dx02,dy02,dz02,rsq02,rinv02,rinvsq02,r02,qq02,c6_02,c12_02;
881 _fjsp_v2r8 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
882 _fjsp_v2r8 dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11;
883 _fjsp_v2r8 dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12;
884 _fjsp_v2r8 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
885 _fjsp_v2r8 dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21;
886 _fjsp_v2r8 dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22;
887 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
890 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
893 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
894 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
896 _fjsp_v2r8 dummy_mask,cutoff_mask;
897 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
898 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
899 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
906 jindex = nlist->jindex;
908 shiftidx = nlist->shift;
910 shiftvec = fr->shift_vec[0];
911 fshift = fr->fshift[0];
912 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
913 charge = mdatoms->chargeA;
914 krf = gmx_fjsp_set1_v2r8(fr->ic->k_rf);
915 krf2 = gmx_fjsp_set1_v2r8(fr->ic->k_rf*2.0);
916 crf = gmx_fjsp_set1_v2r8(fr->ic->c_rf);
917 nvdwtype = fr->ntype;
919 vdwtype = mdatoms->typeA;
921 /* Setup water-specific parameters */
922 inr = nlist->iinr[0];
923 iq0 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+0]));
924 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
925 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
926 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
928 jq0 = gmx_fjsp_set1_v2r8(charge[inr+0]);
929 jq1 = gmx_fjsp_set1_v2r8(charge[inr+1]);
930 jq2 = gmx_fjsp_set1_v2r8(charge[inr+2]);
931 vdwjidx0A = 2*vdwtype[inr+0];
932 qq00 = _fjsp_mul_v2r8(iq0,jq0);
933 c6_00 = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A]);
934 c12_00 = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A+1]);
935 qq01 = _fjsp_mul_v2r8(iq0,jq1);
936 qq02 = _fjsp_mul_v2r8(iq0,jq2);
937 qq10 = _fjsp_mul_v2r8(iq1,jq0);
938 qq11 = _fjsp_mul_v2r8(iq1,jq1);
939 qq12 = _fjsp_mul_v2r8(iq1,jq2);
940 qq20 = _fjsp_mul_v2r8(iq2,jq0);
941 qq21 = _fjsp_mul_v2r8(iq2,jq1);
942 qq22 = _fjsp_mul_v2r8(iq2,jq2);
944 /* Avoid stupid compiler warnings */
952 /* Start outer loop over neighborlists */
953 for(iidx=0; iidx<nri; iidx++)
955 /* Load shift vector for this list */
956 i_shift_offset = DIM*shiftidx[iidx];
958 /* Load limits for loop over neighbors */
959 j_index_start = jindex[iidx];
960 j_index_end = jindex[iidx+1];
962 /* Get outer coordinate index */
964 i_coord_offset = DIM*inr;
966 /* Load i particle coords and add shift vector */
967 gmx_fjsp_load_shift_and_3rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
968 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2);
970 fix0 = _fjsp_setzero_v2r8();
971 fiy0 = _fjsp_setzero_v2r8();
972 fiz0 = _fjsp_setzero_v2r8();
973 fix1 = _fjsp_setzero_v2r8();
974 fiy1 = _fjsp_setzero_v2r8();
975 fiz1 = _fjsp_setzero_v2r8();
976 fix2 = _fjsp_setzero_v2r8();
977 fiy2 = _fjsp_setzero_v2r8();
978 fiz2 = _fjsp_setzero_v2r8();
980 /* Start inner kernel loop */
981 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
984 /* Get j neighbor index, and coordinate index */
987 j_coord_offsetA = DIM*jnrA;
988 j_coord_offsetB = DIM*jnrB;
990 /* load j atom coordinates */
991 gmx_fjsp_load_3rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
992 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,&jy2,&jz2);
994 /* Calculate displacement vector */
995 dx00 = _fjsp_sub_v2r8(ix0,jx0);
996 dy00 = _fjsp_sub_v2r8(iy0,jy0);
997 dz00 = _fjsp_sub_v2r8(iz0,jz0);
998 dx01 = _fjsp_sub_v2r8(ix0,jx1);
999 dy01 = _fjsp_sub_v2r8(iy0,jy1);
1000 dz01 = _fjsp_sub_v2r8(iz0,jz1);
1001 dx02 = _fjsp_sub_v2r8(ix0,jx2);
1002 dy02 = _fjsp_sub_v2r8(iy0,jy2);
1003 dz02 = _fjsp_sub_v2r8(iz0,jz2);
1004 dx10 = _fjsp_sub_v2r8(ix1,jx0);
1005 dy10 = _fjsp_sub_v2r8(iy1,jy0);
1006 dz10 = _fjsp_sub_v2r8(iz1,jz0);
1007 dx11 = _fjsp_sub_v2r8(ix1,jx1);
1008 dy11 = _fjsp_sub_v2r8(iy1,jy1);
1009 dz11 = _fjsp_sub_v2r8(iz1,jz1);
1010 dx12 = _fjsp_sub_v2r8(ix1,jx2);
1011 dy12 = _fjsp_sub_v2r8(iy1,jy2);
1012 dz12 = _fjsp_sub_v2r8(iz1,jz2);
1013 dx20 = _fjsp_sub_v2r8(ix2,jx0);
1014 dy20 = _fjsp_sub_v2r8(iy2,jy0);
1015 dz20 = _fjsp_sub_v2r8(iz2,jz0);
1016 dx21 = _fjsp_sub_v2r8(ix2,jx1);
1017 dy21 = _fjsp_sub_v2r8(iy2,jy1);
1018 dz21 = _fjsp_sub_v2r8(iz2,jz1);
1019 dx22 = _fjsp_sub_v2r8(ix2,jx2);
1020 dy22 = _fjsp_sub_v2r8(iy2,jy2);
1021 dz22 = _fjsp_sub_v2r8(iz2,jz2);
1023 /* Calculate squared distance and things based on it */
1024 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
1025 rsq01 = gmx_fjsp_calc_rsq_v2r8(dx01,dy01,dz01);
1026 rsq02 = gmx_fjsp_calc_rsq_v2r8(dx02,dy02,dz02);
1027 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
1028 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
1029 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
1030 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
1031 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
1032 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
1034 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
1035 rinv01 = gmx_fjsp_invsqrt_v2r8(rsq01);
1036 rinv02 = gmx_fjsp_invsqrt_v2r8(rsq02);
1037 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
1038 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
1039 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
1040 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
1041 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
1042 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
1044 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
1045 rinvsq01 = _fjsp_mul_v2r8(rinv01,rinv01);
1046 rinvsq02 = _fjsp_mul_v2r8(rinv02,rinv02);
1047 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
1048 rinvsq11 = _fjsp_mul_v2r8(rinv11,rinv11);
1049 rinvsq12 = _fjsp_mul_v2r8(rinv12,rinv12);
1050 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
1051 rinvsq21 = _fjsp_mul_v2r8(rinv21,rinv21);
1052 rinvsq22 = _fjsp_mul_v2r8(rinv22,rinv22);
1054 fjx0 = _fjsp_setzero_v2r8();
1055 fjy0 = _fjsp_setzero_v2r8();
1056 fjz0 = _fjsp_setzero_v2r8();
1057 fjx1 = _fjsp_setzero_v2r8();
1058 fjy1 = _fjsp_setzero_v2r8();
1059 fjz1 = _fjsp_setzero_v2r8();
1060 fjx2 = _fjsp_setzero_v2r8();
1061 fjy2 = _fjsp_setzero_v2r8();
1062 fjz2 = _fjsp_setzero_v2r8();
1064 /**************************
1065 * CALCULATE INTERACTIONS *
1066 **************************/
1068 /* REACTION-FIELD ELECTROSTATICS */
1069 felec = _fjsp_mul_v2r8(qq00,_fjsp_msub_v2r8(rinv00,rinvsq00,krf2));
1071 /* LENNARD-JONES DISPERSION/REPULSION */
1073 rinvsix = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
1074 fvdw = _fjsp_mul_v2r8(_fjsp_msub_v2r8(c12_00,rinvsix,c6_00),_fjsp_mul_v2r8(rinvsix,rinvsq00));
1076 fscal = _fjsp_add_v2r8(felec,fvdw);
1078 /* Update vectorial force */
1079 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
1080 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
1081 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
1083 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
1084 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
1085 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
1087 /**************************
1088 * CALCULATE INTERACTIONS *
1089 **************************/
1091 /* REACTION-FIELD ELECTROSTATICS */
1092 felec = _fjsp_mul_v2r8(qq01,_fjsp_msub_v2r8(rinv01,rinvsq01,krf2));
1096 /* Update vectorial force */
1097 fix0 = _fjsp_madd_v2r8(dx01,fscal,fix0);
1098 fiy0 = _fjsp_madd_v2r8(dy01,fscal,fiy0);
1099 fiz0 = _fjsp_madd_v2r8(dz01,fscal,fiz0);
1101 fjx1 = _fjsp_madd_v2r8(dx01,fscal,fjx1);
1102 fjy1 = _fjsp_madd_v2r8(dy01,fscal,fjy1);
1103 fjz1 = _fjsp_madd_v2r8(dz01,fscal,fjz1);
1105 /**************************
1106 * CALCULATE INTERACTIONS *
1107 **************************/
1109 /* REACTION-FIELD ELECTROSTATICS */
1110 felec = _fjsp_mul_v2r8(qq02,_fjsp_msub_v2r8(rinv02,rinvsq02,krf2));
1114 /* Update vectorial force */
1115 fix0 = _fjsp_madd_v2r8(dx02,fscal,fix0);
1116 fiy0 = _fjsp_madd_v2r8(dy02,fscal,fiy0);
1117 fiz0 = _fjsp_madd_v2r8(dz02,fscal,fiz0);
1119 fjx2 = _fjsp_madd_v2r8(dx02,fscal,fjx2);
1120 fjy2 = _fjsp_madd_v2r8(dy02,fscal,fjy2);
1121 fjz2 = _fjsp_madd_v2r8(dz02,fscal,fjz2);
1123 /**************************
1124 * CALCULATE INTERACTIONS *
1125 **************************/
1127 /* REACTION-FIELD ELECTROSTATICS */
1128 felec = _fjsp_mul_v2r8(qq10,_fjsp_msub_v2r8(rinv10,rinvsq10,krf2));
1132 /* Update vectorial force */
1133 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
1134 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
1135 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
1137 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
1138 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
1139 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
1141 /**************************
1142 * CALCULATE INTERACTIONS *
1143 **************************/
1145 /* REACTION-FIELD ELECTROSTATICS */
1146 felec = _fjsp_mul_v2r8(qq11,_fjsp_msub_v2r8(rinv11,rinvsq11,krf2));
1150 /* Update vectorial force */
1151 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
1152 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
1153 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
1155 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
1156 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
1157 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
1159 /**************************
1160 * CALCULATE INTERACTIONS *
1161 **************************/
1163 /* REACTION-FIELD ELECTROSTATICS */
1164 felec = _fjsp_mul_v2r8(qq12,_fjsp_msub_v2r8(rinv12,rinvsq12,krf2));
1168 /* Update vectorial force */
1169 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
1170 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
1171 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
1173 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
1174 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
1175 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
1177 /**************************
1178 * CALCULATE INTERACTIONS *
1179 **************************/
1181 /* REACTION-FIELD ELECTROSTATICS */
1182 felec = _fjsp_mul_v2r8(qq20,_fjsp_msub_v2r8(rinv20,rinvsq20,krf2));
1186 /* Update vectorial force */
1187 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
1188 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
1189 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
1191 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
1192 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
1193 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
1195 /**************************
1196 * CALCULATE INTERACTIONS *
1197 **************************/
1199 /* REACTION-FIELD ELECTROSTATICS */
1200 felec = _fjsp_mul_v2r8(qq21,_fjsp_msub_v2r8(rinv21,rinvsq21,krf2));
1204 /* Update vectorial force */
1205 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
1206 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
1207 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
1209 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
1210 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
1211 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
1213 /**************************
1214 * CALCULATE INTERACTIONS *
1215 **************************/
1217 /* REACTION-FIELD ELECTROSTATICS */
1218 felec = _fjsp_mul_v2r8(qq22,_fjsp_msub_v2r8(rinv22,rinvsq22,krf2));
1222 /* Update vectorial force */
1223 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
1224 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
1225 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
1227 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
1228 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
1229 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
1231 gmx_fjsp_decrement_3rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2);
1233 /* Inner loop uses 277 flops */
1236 if(jidx<j_index_end)
1240 j_coord_offsetA = DIM*jnrA;
1242 /* load j atom coordinates */
1243 gmx_fjsp_load_3rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
1244 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,&jy2,&jz2);
1246 /* Calculate displacement vector */
1247 dx00 = _fjsp_sub_v2r8(ix0,jx0);
1248 dy00 = _fjsp_sub_v2r8(iy0,jy0);
1249 dz00 = _fjsp_sub_v2r8(iz0,jz0);
1250 dx01 = _fjsp_sub_v2r8(ix0,jx1);
1251 dy01 = _fjsp_sub_v2r8(iy0,jy1);
1252 dz01 = _fjsp_sub_v2r8(iz0,jz1);
1253 dx02 = _fjsp_sub_v2r8(ix0,jx2);
1254 dy02 = _fjsp_sub_v2r8(iy0,jy2);
1255 dz02 = _fjsp_sub_v2r8(iz0,jz2);
1256 dx10 = _fjsp_sub_v2r8(ix1,jx0);
1257 dy10 = _fjsp_sub_v2r8(iy1,jy0);
1258 dz10 = _fjsp_sub_v2r8(iz1,jz0);
1259 dx11 = _fjsp_sub_v2r8(ix1,jx1);
1260 dy11 = _fjsp_sub_v2r8(iy1,jy1);
1261 dz11 = _fjsp_sub_v2r8(iz1,jz1);
1262 dx12 = _fjsp_sub_v2r8(ix1,jx2);
1263 dy12 = _fjsp_sub_v2r8(iy1,jy2);
1264 dz12 = _fjsp_sub_v2r8(iz1,jz2);
1265 dx20 = _fjsp_sub_v2r8(ix2,jx0);
1266 dy20 = _fjsp_sub_v2r8(iy2,jy0);
1267 dz20 = _fjsp_sub_v2r8(iz2,jz0);
1268 dx21 = _fjsp_sub_v2r8(ix2,jx1);
1269 dy21 = _fjsp_sub_v2r8(iy2,jy1);
1270 dz21 = _fjsp_sub_v2r8(iz2,jz1);
1271 dx22 = _fjsp_sub_v2r8(ix2,jx2);
1272 dy22 = _fjsp_sub_v2r8(iy2,jy2);
1273 dz22 = _fjsp_sub_v2r8(iz2,jz2);
1275 /* Calculate squared distance and things based on it */
1276 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
1277 rsq01 = gmx_fjsp_calc_rsq_v2r8(dx01,dy01,dz01);
1278 rsq02 = gmx_fjsp_calc_rsq_v2r8(dx02,dy02,dz02);
1279 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
1280 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
1281 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
1282 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
1283 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
1284 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
1286 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
1287 rinv01 = gmx_fjsp_invsqrt_v2r8(rsq01);
1288 rinv02 = gmx_fjsp_invsqrt_v2r8(rsq02);
1289 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
1290 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
1291 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
1292 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
1293 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
1294 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
1296 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
1297 rinvsq01 = _fjsp_mul_v2r8(rinv01,rinv01);
1298 rinvsq02 = _fjsp_mul_v2r8(rinv02,rinv02);
1299 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
1300 rinvsq11 = _fjsp_mul_v2r8(rinv11,rinv11);
1301 rinvsq12 = _fjsp_mul_v2r8(rinv12,rinv12);
1302 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
1303 rinvsq21 = _fjsp_mul_v2r8(rinv21,rinv21);
1304 rinvsq22 = _fjsp_mul_v2r8(rinv22,rinv22);
1306 fjx0 = _fjsp_setzero_v2r8();
1307 fjy0 = _fjsp_setzero_v2r8();
1308 fjz0 = _fjsp_setzero_v2r8();
1309 fjx1 = _fjsp_setzero_v2r8();
1310 fjy1 = _fjsp_setzero_v2r8();
1311 fjz1 = _fjsp_setzero_v2r8();
1312 fjx2 = _fjsp_setzero_v2r8();
1313 fjy2 = _fjsp_setzero_v2r8();
1314 fjz2 = _fjsp_setzero_v2r8();
1316 /**************************
1317 * CALCULATE INTERACTIONS *
1318 **************************/
1320 /* REACTION-FIELD ELECTROSTATICS */
1321 felec = _fjsp_mul_v2r8(qq00,_fjsp_msub_v2r8(rinv00,rinvsq00,krf2));
1323 /* LENNARD-JONES DISPERSION/REPULSION */
1325 rinvsix = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
1326 fvdw = _fjsp_mul_v2r8(_fjsp_msub_v2r8(c12_00,rinvsix,c6_00),_fjsp_mul_v2r8(rinvsix,rinvsq00));
1328 fscal = _fjsp_add_v2r8(felec,fvdw);
1330 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1332 /* Update vectorial force */
1333 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
1334 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
1335 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
1337 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
1338 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
1339 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
1341 /**************************
1342 * CALCULATE INTERACTIONS *
1343 **************************/
1345 /* REACTION-FIELD ELECTROSTATICS */
1346 felec = _fjsp_mul_v2r8(qq01,_fjsp_msub_v2r8(rinv01,rinvsq01,krf2));
1350 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1352 /* Update vectorial force */
1353 fix0 = _fjsp_madd_v2r8(dx01,fscal,fix0);
1354 fiy0 = _fjsp_madd_v2r8(dy01,fscal,fiy0);
1355 fiz0 = _fjsp_madd_v2r8(dz01,fscal,fiz0);
1357 fjx1 = _fjsp_madd_v2r8(dx01,fscal,fjx1);
1358 fjy1 = _fjsp_madd_v2r8(dy01,fscal,fjy1);
1359 fjz1 = _fjsp_madd_v2r8(dz01,fscal,fjz1);
1361 /**************************
1362 * CALCULATE INTERACTIONS *
1363 **************************/
1365 /* REACTION-FIELD ELECTROSTATICS */
1366 felec = _fjsp_mul_v2r8(qq02,_fjsp_msub_v2r8(rinv02,rinvsq02,krf2));
1370 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1372 /* Update vectorial force */
1373 fix0 = _fjsp_madd_v2r8(dx02,fscal,fix0);
1374 fiy0 = _fjsp_madd_v2r8(dy02,fscal,fiy0);
1375 fiz0 = _fjsp_madd_v2r8(dz02,fscal,fiz0);
1377 fjx2 = _fjsp_madd_v2r8(dx02,fscal,fjx2);
1378 fjy2 = _fjsp_madd_v2r8(dy02,fscal,fjy2);
1379 fjz2 = _fjsp_madd_v2r8(dz02,fscal,fjz2);
1381 /**************************
1382 * CALCULATE INTERACTIONS *
1383 **************************/
1385 /* REACTION-FIELD ELECTROSTATICS */
1386 felec = _fjsp_mul_v2r8(qq10,_fjsp_msub_v2r8(rinv10,rinvsq10,krf2));
1390 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1392 /* Update vectorial force */
1393 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
1394 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
1395 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
1397 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
1398 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
1399 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
1401 /**************************
1402 * CALCULATE INTERACTIONS *
1403 **************************/
1405 /* REACTION-FIELD ELECTROSTATICS */
1406 felec = _fjsp_mul_v2r8(qq11,_fjsp_msub_v2r8(rinv11,rinvsq11,krf2));
1410 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1412 /* Update vectorial force */
1413 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
1414 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
1415 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
1417 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
1418 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
1419 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
1421 /**************************
1422 * CALCULATE INTERACTIONS *
1423 **************************/
1425 /* REACTION-FIELD ELECTROSTATICS */
1426 felec = _fjsp_mul_v2r8(qq12,_fjsp_msub_v2r8(rinv12,rinvsq12,krf2));
1430 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1432 /* Update vectorial force */
1433 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
1434 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
1435 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
1437 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
1438 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
1439 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
1441 /**************************
1442 * CALCULATE INTERACTIONS *
1443 **************************/
1445 /* REACTION-FIELD ELECTROSTATICS */
1446 felec = _fjsp_mul_v2r8(qq20,_fjsp_msub_v2r8(rinv20,rinvsq20,krf2));
1450 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1452 /* Update vectorial force */
1453 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
1454 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
1455 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
1457 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
1458 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
1459 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
1461 /**************************
1462 * CALCULATE INTERACTIONS *
1463 **************************/
1465 /* REACTION-FIELD ELECTROSTATICS */
1466 felec = _fjsp_mul_v2r8(qq21,_fjsp_msub_v2r8(rinv21,rinvsq21,krf2));
1470 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1472 /* Update vectorial force */
1473 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
1474 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
1475 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
1477 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
1478 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
1479 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
1481 /**************************
1482 * CALCULATE INTERACTIONS *
1483 **************************/
1485 /* REACTION-FIELD ELECTROSTATICS */
1486 felec = _fjsp_mul_v2r8(qq22,_fjsp_msub_v2r8(rinv22,rinvsq22,krf2));
1490 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1492 /* Update vectorial force */
1493 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
1494 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
1495 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
1497 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
1498 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
1499 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
1501 gmx_fjsp_decrement_3rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2);
1503 /* Inner loop uses 277 flops */
1506 /* End of innermost loop */
1508 gmx_fjsp_update_iforce_3atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,
1509 f+i_coord_offset,fshift+i_shift_offset);
1511 /* Increment number of inner iterations */
1512 inneriter += j_index_end - j_index_start;
1514 /* Outer loop uses 18 flops */
1517 /* Increment number of outer iterations */
1520 /* Update outer/inner flops */
1522 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3W3_F,outeriter*18 + inneriter*277);