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_ElecRF_VdwLJ_GeomW3W3_VF_sparc64_hpc_ace_double
53 * Electrostatics interaction: ReactionField
54 * VdW interaction: LennardJones
55 * Geometry: Water3-Water3
56 * Calculate force/pot: PotentialAndForce
59 nb_kernel_ElecRF_VdwLJ_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;
105 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
108 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
109 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
111 _fjsp_v2r8 dummy_mask,cutoff_mask;
112 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
113 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
114 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
121 jindex = nlist->jindex;
123 shiftidx = nlist->shift;
125 shiftvec = fr->shift_vec[0];
126 fshift = fr->fshift[0];
127 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
128 charge = mdatoms->chargeA;
129 krf = gmx_fjsp_set1_v2r8(fr->ic->k_rf);
130 krf2 = gmx_fjsp_set1_v2r8(fr->ic->k_rf*2.0);
131 crf = gmx_fjsp_set1_v2r8(fr->ic->c_rf);
132 nvdwtype = fr->ntype;
134 vdwtype = mdatoms->typeA;
136 /* Setup water-specific parameters */
137 inr = nlist->iinr[0];
138 iq0 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+0]));
139 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
140 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
141 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
143 jq0 = gmx_fjsp_set1_v2r8(charge[inr+0]);
144 jq1 = gmx_fjsp_set1_v2r8(charge[inr+1]);
145 jq2 = gmx_fjsp_set1_v2r8(charge[inr+2]);
146 vdwjidx0A = 2*vdwtype[inr+0];
147 qq00 = _fjsp_mul_v2r8(iq0,jq0);
148 c6_00 = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A]);
149 c12_00 = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A+1]);
150 qq01 = _fjsp_mul_v2r8(iq0,jq1);
151 qq02 = _fjsp_mul_v2r8(iq0,jq2);
152 qq10 = _fjsp_mul_v2r8(iq1,jq0);
153 qq11 = _fjsp_mul_v2r8(iq1,jq1);
154 qq12 = _fjsp_mul_v2r8(iq1,jq2);
155 qq20 = _fjsp_mul_v2r8(iq2,jq0);
156 qq21 = _fjsp_mul_v2r8(iq2,jq1);
157 qq22 = _fjsp_mul_v2r8(iq2,jq2);
159 /* Avoid stupid compiler warnings */
167 /* Start outer loop over neighborlists */
168 for(iidx=0; iidx<nri; iidx++)
170 /* Load shift vector for this list */
171 i_shift_offset = DIM*shiftidx[iidx];
173 /* Load limits for loop over neighbors */
174 j_index_start = jindex[iidx];
175 j_index_end = jindex[iidx+1];
177 /* Get outer coordinate index */
179 i_coord_offset = DIM*inr;
181 /* Load i particle coords and add shift vector */
182 gmx_fjsp_load_shift_and_3rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
183 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2);
185 fix0 = _fjsp_setzero_v2r8();
186 fiy0 = _fjsp_setzero_v2r8();
187 fiz0 = _fjsp_setzero_v2r8();
188 fix1 = _fjsp_setzero_v2r8();
189 fiy1 = _fjsp_setzero_v2r8();
190 fiz1 = _fjsp_setzero_v2r8();
191 fix2 = _fjsp_setzero_v2r8();
192 fiy2 = _fjsp_setzero_v2r8();
193 fiz2 = _fjsp_setzero_v2r8();
195 /* Reset potential sums */
196 velecsum = _fjsp_setzero_v2r8();
197 vvdwsum = _fjsp_setzero_v2r8();
199 /* Start inner kernel loop */
200 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
203 /* Get j neighbor index, and coordinate index */
206 j_coord_offsetA = DIM*jnrA;
207 j_coord_offsetB = DIM*jnrB;
209 /* load j atom coordinates */
210 gmx_fjsp_load_3rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
211 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,&jy2,&jz2);
213 /* Calculate displacement vector */
214 dx00 = _fjsp_sub_v2r8(ix0,jx0);
215 dy00 = _fjsp_sub_v2r8(iy0,jy0);
216 dz00 = _fjsp_sub_v2r8(iz0,jz0);
217 dx01 = _fjsp_sub_v2r8(ix0,jx1);
218 dy01 = _fjsp_sub_v2r8(iy0,jy1);
219 dz01 = _fjsp_sub_v2r8(iz0,jz1);
220 dx02 = _fjsp_sub_v2r8(ix0,jx2);
221 dy02 = _fjsp_sub_v2r8(iy0,jy2);
222 dz02 = _fjsp_sub_v2r8(iz0,jz2);
223 dx10 = _fjsp_sub_v2r8(ix1,jx0);
224 dy10 = _fjsp_sub_v2r8(iy1,jy0);
225 dz10 = _fjsp_sub_v2r8(iz1,jz0);
226 dx11 = _fjsp_sub_v2r8(ix1,jx1);
227 dy11 = _fjsp_sub_v2r8(iy1,jy1);
228 dz11 = _fjsp_sub_v2r8(iz1,jz1);
229 dx12 = _fjsp_sub_v2r8(ix1,jx2);
230 dy12 = _fjsp_sub_v2r8(iy1,jy2);
231 dz12 = _fjsp_sub_v2r8(iz1,jz2);
232 dx20 = _fjsp_sub_v2r8(ix2,jx0);
233 dy20 = _fjsp_sub_v2r8(iy2,jy0);
234 dz20 = _fjsp_sub_v2r8(iz2,jz0);
235 dx21 = _fjsp_sub_v2r8(ix2,jx1);
236 dy21 = _fjsp_sub_v2r8(iy2,jy1);
237 dz21 = _fjsp_sub_v2r8(iz2,jz1);
238 dx22 = _fjsp_sub_v2r8(ix2,jx2);
239 dy22 = _fjsp_sub_v2r8(iy2,jy2);
240 dz22 = _fjsp_sub_v2r8(iz2,jz2);
242 /* Calculate squared distance and things based on it */
243 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
244 rsq01 = gmx_fjsp_calc_rsq_v2r8(dx01,dy01,dz01);
245 rsq02 = gmx_fjsp_calc_rsq_v2r8(dx02,dy02,dz02);
246 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
247 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
248 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
249 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
250 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
251 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
253 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
254 rinv01 = gmx_fjsp_invsqrt_v2r8(rsq01);
255 rinv02 = gmx_fjsp_invsqrt_v2r8(rsq02);
256 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
257 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
258 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
259 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
260 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
261 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
263 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
264 rinvsq01 = _fjsp_mul_v2r8(rinv01,rinv01);
265 rinvsq02 = _fjsp_mul_v2r8(rinv02,rinv02);
266 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
267 rinvsq11 = _fjsp_mul_v2r8(rinv11,rinv11);
268 rinvsq12 = _fjsp_mul_v2r8(rinv12,rinv12);
269 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
270 rinvsq21 = _fjsp_mul_v2r8(rinv21,rinv21);
271 rinvsq22 = _fjsp_mul_v2r8(rinv22,rinv22);
273 fjx0 = _fjsp_setzero_v2r8();
274 fjy0 = _fjsp_setzero_v2r8();
275 fjz0 = _fjsp_setzero_v2r8();
276 fjx1 = _fjsp_setzero_v2r8();
277 fjy1 = _fjsp_setzero_v2r8();
278 fjz1 = _fjsp_setzero_v2r8();
279 fjx2 = _fjsp_setzero_v2r8();
280 fjy2 = _fjsp_setzero_v2r8();
281 fjz2 = _fjsp_setzero_v2r8();
283 /**************************
284 * CALCULATE INTERACTIONS *
285 **************************/
287 /* REACTION-FIELD ELECTROSTATICS */
288 velec = _fjsp_mul_v2r8(qq00,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq00,rinv00),crf));
289 felec = _fjsp_mul_v2r8(qq00,_fjsp_msub_v2r8(rinv00,rinvsq00,krf2));
291 /* LENNARD-JONES DISPERSION/REPULSION */
293 rinvsix = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
294 vvdw6 = _fjsp_mul_v2r8(c6_00,rinvsix);
295 vvdw12 = _fjsp_mul_v2r8(c12_00,_fjsp_mul_v2r8(rinvsix,rinvsix));
296 vvdw = _fjsp_msub_v2r8( vvdw12,one_twelfth, _fjsp_mul_v2r8(vvdw6,one_sixth) );
297 fvdw = _fjsp_mul_v2r8(_fjsp_sub_v2r8(vvdw12,vvdw6),rinvsq00);
299 /* Update potential sum for this i atom from the interaction with this j atom. */
300 velecsum = _fjsp_add_v2r8(velecsum,velec);
301 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
303 fscal = _fjsp_add_v2r8(felec,fvdw);
305 /* Update vectorial force */
306 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
307 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
308 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
310 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
311 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
312 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
314 /**************************
315 * CALCULATE INTERACTIONS *
316 **************************/
318 /* REACTION-FIELD ELECTROSTATICS */
319 velec = _fjsp_mul_v2r8(qq01,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq01,rinv01),crf));
320 felec = _fjsp_mul_v2r8(qq01,_fjsp_msub_v2r8(rinv01,rinvsq01,krf2));
322 /* Update potential sum for this i atom from the interaction with this j atom. */
323 velecsum = _fjsp_add_v2r8(velecsum,velec);
327 /* Update vectorial force */
328 fix0 = _fjsp_madd_v2r8(dx01,fscal,fix0);
329 fiy0 = _fjsp_madd_v2r8(dy01,fscal,fiy0);
330 fiz0 = _fjsp_madd_v2r8(dz01,fscal,fiz0);
332 fjx1 = _fjsp_madd_v2r8(dx01,fscal,fjx1);
333 fjy1 = _fjsp_madd_v2r8(dy01,fscal,fjy1);
334 fjz1 = _fjsp_madd_v2r8(dz01,fscal,fjz1);
336 /**************************
337 * CALCULATE INTERACTIONS *
338 **************************/
340 /* REACTION-FIELD ELECTROSTATICS */
341 velec = _fjsp_mul_v2r8(qq02,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq02,rinv02),crf));
342 felec = _fjsp_mul_v2r8(qq02,_fjsp_msub_v2r8(rinv02,rinvsq02,krf2));
344 /* Update potential sum for this i atom from the interaction with this j atom. */
345 velecsum = _fjsp_add_v2r8(velecsum,velec);
349 /* Update vectorial force */
350 fix0 = _fjsp_madd_v2r8(dx02,fscal,fix0);
351 fiy0 = _fjsp_madd_v2r8(dy02,fscal,fiy0);
352 fiz0 = _fjsp_madd_v2r8(dz02,fscal,fiz0);
354 fjx2 = _fjsp_madd_v2r8(dx02,fscal,fjx2);
355 fjy2 = _fjsp_madd_v2r8(dy02,fscal,fjy2);
356 fjz2 = _fjsp_madd_v2r8(dz02,fscal,fjz2);
358 /**************************
359 * CALCULATE INTERACTIONS *
360 **************************/
362 /* REACTION-FIELD ELECTROSTATICS */
363 velec = _fjsp_mul_v2r8(qq10,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq10,rinv10),crf));
364 felec = _fjsp_mul_v2r8(qq10,_fjsp_msub_v2r8(rinv10,rinvsq10,krf2));
366 /* Update potential sum for this i atom from the interaction with this j atom. */
367 velecsum = _fjsp_add_v2r8(velecsum,velec);
371 /* Update vectorial force */
372 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
373 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
374 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
376 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
377 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
378 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
380 /**************************
381 * CALCULATE INTERACTIONS *
382 **************************/
384 /* REACTION-FIELD ELECTROSTATICS */
385 velec = _fjsp_mul_v2r8(qq11,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq11,rinv11),crf));
386 felec = _fjsp_mul_v2r8(qq11,_fjsp_msub_v2r8(rinv11,rinvsq11,krf2));
388 /* Update potential sum for this i atom from the interaction with this j atom. */
389 velecsum = _fjsp_add_v2r8(velecsum,velec);
393 /* Update vectorial force */
394 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
395 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
396 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
398 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
399 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
400 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
402 /**************************
403 * CALCULATE INTERACTIONS *
404 **************************/
406 /* REACTION-FIELD ELECTROSTATICS */
407 velec = _fjsp_mul_v2r8(qq12,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq12,rinv12),crf));
408 felec = _fjsp_mul_v2r8(qq12,_fjsp_msub_v2r8(rinv12,rinvsq12,krf2));
410 /* Update potential sum for this i atom from the interaction with this j atom. */
411 velecsum = _fjsp_add_v2r8(velecsum,velec);
415 /* Update vectorial force */
416 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
417 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
418 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
420 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
421 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
422 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
424 /**************************
425 * CALCULATE INTERACTIONS *
426 **************************/
428 /* REACTION-FIELD ELECTROSTATICS */
429 velec = _fjsp_mul_v2r8(qq20,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq20,rinv20),crf));
430 felec = _fjsp_mul_v2r8(qq20,_fjsp_msub_v2r8(rinv20,rinvsq20,krf2));
432 /* Update potential sum for this i atom from the interaction with this j atom. */
433 velecsum = _fjsp_add_v2r8(velecsum,velec);
437 /* Update vectorial force */
438 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
439 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
440 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
442 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
443 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
444 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
446 /**************************
447 * CALCULATE INTERACTIONS *
448 **************************/
450 /* REACTION-FIELD ELECTROSTATICS */
451 velec = _fjsp_mul_v2r8(qq21,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq21,rinv21),crf));
452 felec = _fjsp_mul_v2r8(qq21,_fjsp_msub_v2r8(rinv21,rinvsq21,krf2));
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 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
461 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
462 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
464 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
465 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
466 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
468 /**************************
469 * CALCULATE INTERACTIONS *
470 **************************/
472 /* REACTION-FIELD ELECTROSTATICS */
473 velec = _fjsp_mul_v2r8(qq22,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq22,rinv22),crf));
474 felec = _fjsp_mul_v2r8(qq22,_fjsp_msub_v2r8(rinv22,rinvsq22,krf2));
476 /* Update potential sum for this i atom from the interaction with this j atom. */
477 velecsum = _fjsp_add_v2r8(velecsum,velec);
481 /* Update vectorial force */
482 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
483 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
484 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
486 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
487 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
488 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
490 gmx_fjsp_decrement_3rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2);
492 /* Inner loop uses 327 flops */
499 j_coord_offsetA = DIM*jnrA;
501 /* load j atom coordinates */
502 gmx_fjsp_load_3rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
503 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,&jy2,&jz2);
505 /* Calculate displacement vector */
506 dx00 = _fjsp_sub_v2r8(ix0,jx0);
507 dy00 = _fjsp_sub_v2r8(iy0,jy0);
508 dz00 = _fjsp_sub_v2r8(iz0,jz0);
509 dx01 = _fjsp_sub_v2r8(ix0,jx1);
510 dy01 = _fjsp_sub_v2r8(iy0,jy1);
511 dz01 = _fjsp_sub_v2r8(iz0,jz1);
512 dx02 = _fjsp_sub_v2r8(ix0,jx2);
513 dy02 = _fjsp_sub_v2r8(iy0,jy2);
514 dz02 = _fjsp_sub_v2r8(iz0,jz2);
515 dx10 = _fjsp_sub_v2r8(ix1,jx0);
516 dy10 = _fjsp_sub_v2r8(iy1,jy0);
517 dz10 = _fjsp_sub_v2r8(iz1,jz0);
518 dx11 = _fjsp_sub_v2r8(ix1,jx1);
519 dy11 = _fjsp_sub_v2r8(iy1,jy1);
520 dz11 = _fjsp_sub_v2r8(iz1,jz1);
521 dx12 = _fjsp_sub_v2r8(ix1,jx2);
522 dy12 = _fjsp_sub_v2r8(iy1,jy2);
523 dz12 = _fjsp_sub_v2r8(iz1,jz2);
524 dx20 = _fjsp_sub_v2r8(ix2,jx0);
525 dy20 = _fjsp_sub_v2r8(iy2,jy0);
526 dz20 = _fjsp_sub_v2r8(iz2,jz0);
527 dx21 = _fjsp_sub_v2r8(ix2,jx1);
528 dy21 = _fjsp_sub_v2r8(iy2,jy1);
529 dz21 = _fjsp_sub_v2r8(iz2,jz1);
530 dx22 = _fjsp_sub_v2r8(ix2,jx2);
531 dy22 = _fjsp_sub_v2r8(iy2,jy2);
532 dz22 = _fjsp_sub_v2r8(iz2,jz2);
534 /* Calculate squared distance and things based on it */
535 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
536 rsq01 = gmx_fjsp_calc_rsq_v2r8(dx01,dy01,dz01);
537 rsq02 = gmx_fjsp_calc_rsq_v2r8(dx02,dy02,dz02);
538 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
539 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
540 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
541 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
542 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
543 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
545 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
546 rinv01 = gmx_fjsp_invsqrt_v2r8(rsq01);
547 rinv02 = gmx_fjsp_invsqrt_v2r8(rsq02);
548 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
549 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
550 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
551 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
552 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
553 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
555 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
556 rinvsq01 = _fjsp_mul_v2r8(rinv01,rinv01);
557 rinvsq02 = _fjsp_mul_v2r8(rinv02,rinv02);
558 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
559 rinvsq11 = _fjsp_mul_v2r8(rinv11,rinv11);
560 rinvsq12 = _fjsp_mul_v2r8(rinv12,rinv12);
561 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
562 rinvsq21 = _fjsp_mul_v2r8(rinv21,rinv21);
563 rinvsq22 = _fjsp_mul_v2r8(rinv22,rinv22);
565 fjx0 = _fjsp_setzero_v2r8();
566 fjy0 = _fjsp_setzero_v2r8();
567 fjz0 = _fjsp_setzero_v2r8();
568 fjx1 = _fjsp_setzero_v2r8();
569 fjy1 = _fjsp_setzero_v2r8();
570 fjz1 = _fjsp_setzero_v2r8();
571 fjx2 = _fjsp_setzero_v2r8();
572 fjy2 = _fjsp_setzero_v2r8();
573 fjz2 = _fjsp_setzero_v2r8();
575 /**************************
576 * CALCULATE INTERACTIONS *
577 **************************/
579 /* REACTION-FIELD ELECTROSTATICS */
580 velec = _fjsp_mul_v2r8(qq00,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq00,rinv00),crf));
581 felec = _fjsp_mul_v2r8(qq00,_fjsp_msub_v2r8(rinv00,rinvsq00,krf2));
583 /* LENNARD-JONES DISPERSION/REPULSION */
585 rinvsix = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
586 vvdw6 = _fjsp_mul_v2r8(c6_00,rinvsix);
587 vvdw12 = _fjsp_mul_v2r8(c12_00,_fjsp_mul_v2r8(rinvsix,rinvsix));
588 vvdw = _fjsp_msub_v2r8( vvdw12,one_twelfth, _fjsp_mul_v2r8(vvdw6,one_sixth) );
589 fvdw = _fjsp_mul_v2r8(_fjsp_sub_v2r8(vvdw12,vvdw6),rinvsq00);
591 /* Update potential sum for this i atom from the interaction with this j atom. */
592 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
593 velecsum = _fjsp_add_v2r8(velecsum,velec);
594 vvdw = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
595 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
597 fscal = _fjsp_add_v2r8(felec,fvdw);
599 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
601 /* Update vectorial force */
602 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
603 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
604 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
606 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
607 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
608 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
610 /**************************
611 * CALCULATE INTERACTIONS *
612 **************************/
614 /* REACTION-FIELD ELECTROSTATICS */
615 velec = _fjsp_mul_v2r8(qq01,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq01,rinv01),crf));
616 felec = _fjsp_mul_v2r8(qq01,_fjsp_msub_v2r8(rinv01,rinvsq01,krf2));
618 /* Update potential sum for this i atom from the interaction with this j atom. */
619 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
620 velecsum = _fjsp_add_v2r8(velecsum,velec);
624 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
626 /* Update vectorial force */
627 fix0 = _fjsp_madd_v2r8(dx01,fscal,fix0);
628 fiy0 = _fjsp_madd_v2r8(dy01,fscal,fiy0);
629 fiz0 = _fjsp_madd_v2r8(dz01,fscal,fiz0);
631 fjx1 = _fjsp_madd_v2r8(dx01,fscal,fjx1);
632 fjy1 = _fjsp_madd_v2r8(dy01,fscal,fjy1);
633 fjz1 = _fjsp_madd_v2r8(dz01,fscal,fjz1);
635 /**************************
636 * CALCULATE INTERACTIONS *
637 **************************/
639 /* REACTION-FIELD ELECTROSTATICS */
640 velec = _fjsp_mul_v2r8(qq02,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq02,rinv02),crf));
641 felec = _fjsp_mul_v2r8(qq02,_fjsp_msub_v2r8(rinv02,rinvsq02,krf2));
643 /* Update potential sum for this i atom from the interaction with this j atom. */
644 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
645 velecsum = _fjsp_add_v2r8(velecsum,velec);
649 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
651 /* Update vectorial force */
652 fix0 = _fjsp_madd_v2r8(dx02,fscal,fix0);
653 fiy0 = _fjsp_madd_v2r8(dy02,fscal,fiy0);
654 fiz0 = _fjsp_madd_v2r8(dz02,fscal,fiz0);
656 fjx2 = _fjsp_madd_v2r8(dx02,fscal,fjx2);
657 fjy2 = _fjsp_madd_v2r8(dy02,fscal,fjy2);
658 fjz2 = _fjsp_madd_v2r8(dz02,fscal,fjz2);
660 /**************************
661 * CALCULATE INTERACTIONS *
662 **************************/
664 /* REACTION-FIELD ELECTROSTATICS */
665 velec = _fjsp_mul_v2r8(qq10,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq10,rinv10),crf));
666 felec = _fjsp_mul_v2r8(qq10,_fjsp_msub_v2r8(rinv10,rinvsq10,krf2));
668 /* Update potential sum for this i atom from the interaction with this j atom. */
669 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
670 velecsum = _fjsp_add_v2r8(velecsum,velec);
674 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
676 /* Update vectorial force */
677 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
678 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
679 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
681 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
682 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
683 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
685 /**************************
686 * CALCULATE INTERACTIONS *
687 **************************/
689 /* REACTION-FIELD ELECTROSTATICS */
690 velec = _fjsp_mul_v2r8(qq11,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq11,rinv11),crf));
691 felec = _fjsp_mul_v2r8(qq11,_fjsp_msub_v2r8(rinv11,rinvsq11,krf2));
693 /* Update potential sum for this i atom from the interaction with this j atom. */
694 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
695 velecsum = _fjsp_add_v2r8(velecsum,velec);
699 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
701 /* Update vectorial force */
702 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
703 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
704 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
706 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
707 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
708 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
710 /**************************
711 * CALCULATE INTERACTIONS *
712 **************************/
714 /* REACTION-FIELD ELECTROSTATICS */
715 velec = _fjsp_mul_v2r8(qq12,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq12,rinv12),crf));
716 felec = _fjsp_mul_v2r8(qq12,_fjsp_msub_v2r8(rinv12,rinvsq12,krf2));
718 /* Update potential sum for this i atom from the interaction with this j atom. */
719 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
720 velecsum = _fjsp_add_v2r8(velecsum,velec);
724 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
726 /* Update vectorial force */
727 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
728 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
729 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
731 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
732 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
733 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
735 /**************************
736 * CALCULATE INTERACTIONS *
737 **************************/
739 /* REACTION-FIELD ELECTROSTATICS */
740 velec = _fjsp_mul_v2r8(qq20,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq20,rinv20),crf));
741 felec = _fjsp_mul_v2r8(qq20,_fjsp_msub_v2r8(rinv20,rinvsq20,krf2));
743 /* Update potential sum for this i atom from the interaction with this j atom. */
744 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
745 velecsum = _fjsp_add_v2r8(velecsum,velec);
749 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
751 /* Update vectorial force */
752 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
753 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
754 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
756 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
757 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
758 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
760 /**************************
761 * CALCULATE INTERACTIONS *
762 **************************/
764 /* REACTION-FIELD ELECTROSTATICS */
765 velec = _fjsp_mul_v2r8(qq21,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq21,rinv21),crf));
766 felec = _fjsp_mul_v2r8(qq21,_fjsp_msub_v2r8(rinv21,rinvsq21,krf2));
768 /* Update potential sum for this i atom from the interaction with this j atom. */
769 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
770 velecsum = _fjsp_add_v2r8(velecsum,velec);
774 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
776 /* Update vectorial force */
777 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
778 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
779 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
781 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
782 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
783 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
785 /**************************
786 * CALCULATE INTERACTIONS *
787 **************************/
789 /* REACTION-FIELD ELECTROSTATICS */
790 velec = _fjsp_mul_v2r8(qq22,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq22,rinv22),crf));
791 felec = _fjsp_mul_v2r8(qq22,_fjsp_msub_v2r8(rinv22,rinvsq22,krf2));
793 /* Update potential sum for this i atom from the interaction with this j atom. */
794 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
795 velecsum = _fjsp_add_v2r8(velecsum,velec);
799 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
801 /* Update vectorial force */
802 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
803 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
804 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
806 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
807 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
808 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
810 gmx_fjsp_decrement_3rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2);
812 /* Inner loop uses 327 flops */
815 /* End of innermost loop */
817 gmx_fjsp_update_iforce_3atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,
818 f+i_coord_offset,fshift+i_shift_offset);
821 /* Update potential energies */
822 gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
823 gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
825 /* Increment number of inner iterations */
826 inneriter += j_index_end - j_index_start;
828 /* Outer loop uses 20 flops */
831 /* Increment number of outer iterations */
834 /* Update outer/inner flops */
836 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3W3_VF,outeriter*20 + inneriter*327);
839 * Gromacs nonbonded kernel: nb_kernel_ElecRF_VdwLJ_GeomW3W3_F_sparc64_hpc_ace_double
840 * Electrostatics interaction: ReactionField
841 * VdW interaction: LennardJones
842 * Geometry: Water3-Water3
843 * Calculate force/pot: Force
846 nb_kernel_ElecRF_VdwLJ_GeomW3W3_F_sparc64_hpc_ace_double
847 (t_nblist * gmx_restrict nlist,
848 rvec * gmx_restrict xx,
849 rvec * gmx_restrict ff,
850 t_forcerec * gmx_restrict fr,
851 t_mdatoms * gmx_restrict mdatoms,
852 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
853 t_nrnb * gmx_restrict nrnb)
855 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
856 * just 0 for non-waters.
857 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
858 * jnr indices corresponding to data put in the four positions in the SIMD register.
860 int i_shift_offset,i_coord_offset,outeriter,inneriter;
861 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
863 int j_coord_offsetA,j_coord_offsetB;
864 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
866 real *shiftvec,*fshift,*x,*f;
867 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
869 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
871 _fjsp_v2r8 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
873 _fjsp_v2r8 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
874 int vdwjidx0A,vdwjidx0B;
875 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
876 int vdwjidx1A,vdwjidx1B;
877 _fjsp_v2r8 jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
878 int vdwjidx2A,vdwjidx2B;
879 _fjsp_v2r8 jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
880 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
881 _fjsp_v2r8 dx01,dy01,dz01,rsq01,rinv01,rinvsq01,r01,qq01,c6_01,c12_01;
882 _fjsp_v2r8 dx02,dy02,dz02,rsq02,rinv02,rinvsq02,r02,qq02,c6_02,c12_02;
883 _fjsp_v2r8 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
884 _fjsp_v2r8 dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11;
885 _fjsp_v2r8 dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12;
886 _fjsp_v2r8 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
887 _fjsp_v2r8 dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21;
888 _fjsp_v2r8 dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22;
889 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
892 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
895 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
896 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
898 _fjsp_v2r8 dummy_mask,cutoff_mask;
899 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
900 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
901 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
908 jindex = nlist->jindex;
910 shiftidx = nlist->shift;
912 shiftvec = fr->shift_vec[0];
913 fshift = fr->fshift[0];
914 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
915 charge = mdatoms->chargeA;
916 krf = gmx_fjsp_set1_v2r8(fr->ic->k_rf);
917 krf2 = gmx_fjsp_set1_v2r8(fr->ic->k_rf*2.0);
918 crf = gmx_fjsp_set1_v2r8(fr->ic->c_rf);
919 nvdwtype = fr->ntype;
921 vdwtype = mdatoms->typeA;
923 /* Setup water-specific parameters */
924 inr = nlist->iinr[0];
925 iq0 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+0]));
926 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
927 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
928 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
930 jq0 = gmx_fjsp_set1_v2r8(charge[inr+0]);
931 jq1 = gmx_fjsp_set1_v2r8(charge[inr+1]);
932 jq2 = gmx_fjsp_set1_v2r8(charge[inr+2]);
933 vdwjidx0A = 2*vdwtype[inr+0];
934 qq00 = _fjsp_mul_v2r8(iq0,jq0);
935 c6_00 = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A]);
936 c12_00 = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A+1]);
937 qq01 = _fjsp_mul_v2r8(iq0,jq1);
938 qq02 = _fjsp_mul_v2r8(iq0,jq2);
939 qq10 = _fjsp_mul_v2r8(iq1,jq0);
940 qq11 = _fjsp_mul_v2r8(iq1,jq1);
941 qq12 = _fjsp_mul_v2r8(iq1,jq2);
942 qq20 = _fjsp_mul_v2r8(iq2,jq0);
943 qq21 = _fjsp_mul_v2r8(iq2,jq1);
944 qq22 = _fjsp_mul_v2r8(iq2,jq2);
946 /* Avoid stupid compiler warnings */
954 /* Start outer loop over neighborlists */
955 for(iidx=0; iidx<nri; iidx++)
957 /* Load shift vector for this list */
958 i_shift_offset = DIM*shiftidx[iidx];
960 /* Load limits for loop over neighbors */
961 j_index_start = jindex[iidx];
962 j_index_end = jindex[iidx+1];
964 /* Get outer coordinate index */
966 i_coord_offset = DIM*inr;
968 /* Load i particle coords and add shift vector */
969 gmx_fjsp_load_shift_and_3rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
970 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2);
972 fix0 = _fjsp_setzero_v2r8();
973 fiy0 = _fjsp_setzero_v2r8();
974 fiz0 = _fjsp_setzero_v2r8();
975 fix1 = _fjsp_setzero_v2r8();
976 fiy1 = _fjsp_setzero_v2r8();
977 fiz1 = _fjsp_setzero_v2r8();
978 fix2 = _fjsp_setzero_v2r8();
979 fiy2 = _fjsp_setzero_v2r8();
980 fiz2 = _fjsp_setzero_v2r8();
982 /* Start inner kernel loop */
983 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
986 /* Get j neighbor index, and coordinate index */
989 j_coord_offsetA = DIM*jnrA;
990 j_coord_offsetB = DIM*jnrB;
992 /* load j atom coordinates */
993 gmx_fjsp_load_3rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
994 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,&jy2,&jz2);
996 /* Calculate displacement vector */
997 dx00 = _fjsp_sub_v2r8(ix0,jx0);
998 dy00 = _fjsp_sub_v2r8(iy0,jy0);
999 dz00 = _fjsp_sub_v2r8(iz0,jz0);
1000 dx01 = _fjsp_sub_v2r8(ix0,jx1);
1001 dy01 = _fjsp_sub_v2r8(iy0,jy1);
1002 dz01 = _fjsp_sub_v2r8(iz0,jz1);
1003 dx02 = _fjsp_sub_v2r8(ix0,jx2);
1004 dy02 = _fjsp_sub_v2r8(iy0,jy2);
1005 dz02 = _fjsp_sub_v2r8(iz0,jz2);
1006 dx10 = _fjsp_sub_v2r8(ix1,jx0);
1007 dy10 = _fjsp_sub_v2r8(iy1,jy0);
1008 dz10 = _fjsp_sub_v2r8(iz1,jz0);
1009 dx11 = _fjsp_sub_v2r8(ix1,jx1);
1010 dy11 = _fjsp_sub_v2r8(iy1,jy1);
1011 dz11 = _fjsp_sub_v2r8(iz1,jz1);
1012 dx12 = _fjsp_sub_v2r8(ix1,jx2);
1013 dy12 = _fjsp_sub_v2r8(iy1,jy2);
1014 dz12 = _fjsp_sub_v2r8(iz1,jz2);
1015 dx20 = _fjsp_sub_v2r8(ix2,jx0);
1016 dy20 = _fjsp_sub_v2r8(iy2,jy0);
1017 dz20 = _fjsp_sub_v2r8(iz2,jz0);
1018 dx21 = _fjsp_sub_v2r8(ix2,jx1);
1019 dy21 = _fjsp_sub_v2r8(iy2,jy1);
1020 dz21 = _fjsp_sub_v2r8(iz2,jz1);
1021 dx22 = _fjsp_sub_v2r8(ix2,jx2);
1022 dy22 = _fjsp_sub_v2r8(iy2,jy2);
1023 dz22 = _fjsp_sub_v2r8(iz2,jz2);
1025 /* Calculate squared distance and things based on it */
1026 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
1027 rsq01 = gmx_fjsp_calc_rsq_v2r8(dx01,dy01,dz01);
1028 rsq02 = gmx_fjsp_calc_rsq_v2r8(dx02,dy02,dz02);
1029 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
1030 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
1031 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
1032 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
1033 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
1034 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
1036 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
1037 rinv01 = gmx_fjsp_invsqrt_v2r8(rsq01);
1038 rinv02 = gmx_fjsp_invsqrt_v2r8(rsq02);
1039 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
1040 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
1041 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
1042 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
1043 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
1044 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
1046 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
1047 rinvsq01 = _fjsp_mul_v2r8(rinv01,rinv01);
1048 rinvsq02 = _fjsp_mul_v2r8(rinv02,rinv02);
1049 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
1050 rinvsq11 = _fjsp_mul_v2r8(rinv11,rinv11);
1051 rinvsq12 = _fjsp_mul_v2r8(rinv12,rinv12);
1052 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
1053 rinvsq21 = _fjsp_mul_v2r8(rinv21,rinv21);
1054 rinvsq22 = _fjsp_mul_v2r8(rinv22,rinv22);
1056 fjx0 = _fjsp_setzero_v2r8();
1057 fjy0 = _fjsp_setzero_v2r8();
1058 fjz0 = _fjsp_setzero_v2r8();
1059 fjx1 = _fjsp_setzero_v2r8();
1060 fjy1 = _fjsp_setzero_v2r8();
1061 fjz1 = _fjsp_setzero_v2r8();
1062 fjx2 = _fjsp_setzero_v2r8();
1063 fjy2 = _fjsp_setzero_v2r8();
1064 fjz2 = _fjsp_setzero_v2r8();
1066 /**************************
1067 * CALCULATE INTERACTIONS *
1068 **************************/
1070 /* REACTION-FIELD ELECTROSTATICS */
1071 felec = _fjsp_mul_v2r8(qq00,_fjsp_msub_v2r8(rinv00,rinvsq00,krf2));
1073 /* LENNARD-JONES DISPERSION/REPULSION */
1075 rinvsix = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
1076 fvdw = _fjsp_mul_v2r8(_fjsp_msub_v2r8(c12_00,rinvsix,c6_00),_fjsp_mul_v2r8(rinvsix,rinvsq00));
1078 fscal = _fjsp_add_v2r8(felec,fvdw);
1080 /* Update vectorial force */
1081 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
1082 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
1083 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
1085 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
1086 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
1087 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
1089 /**************************
1090 * CALCULATE INTERACTIONS *
1091 **************************/
1093 /* REACTION-FIELD ELECTROSTATICS */
1094 felec = _fjsp_mul_v2r8(qq01,_fjsp_msub_v2r8(rinv01,rinvsq01,krf2));
1098 /* Update vectorial force */
1099 fix0 = _fjsp_madd_v2r8(dx01,fscal,fix0);
1100 fiy0 = _fjsp_madd_v2r8(dy01,fscal,fiy0);
1101 fiz0 = _fjsp_madd_v2r8(dz01,fscal,fiz0);
1103 fjx1 = _fjsp_madd_v2r8(dx01,fscal,fjx1);
1104 fjy1 = _fjsp_madd_v2r8(dy01,fscal,fjy1);
1105 fjz1 = _fjsp_madd_v2r8(dz01,fscal,fjz1);
1107 /**************************
1108 * CALCULATE INTERACTIONS *
1109 **************************/
1111 /* REACTION-FIELD ELECTROSTATICS */
1112 felec = _fjsp_mul_v2r8(qq02,_fjsp_msub_v2r8(rinv02,rinvsq02,krf2));
1116 /* Update vectorial force */
1117 fix0 = _fjsp_madd_v2r8(dx02,fscal,fix0);
1118 fiy0 = _fjsp_madd_v2r8(dy02,fscal,fiy0);
1119 fiz0 = _fjsp_madd_v2r8(dz02,fscal,fiz0);
1121 fjx2 = _fjsp_madd_v2r8(dx02,fscal,fjx2);
1122 fjy2 = _fjsp_madd_v2r8(dy02,fscal,fjy2);
1123 fjz2 = _fjsp_madd_v2r8(dz02,fscal,fjz2);
1125 /**************************
1126 * CALCULATE INTERACTIONS *
1127 **************************/
1129 /* REACTION-FIELD ELECTROSTATICS */
1130 felec = _fjsp_mul_v2r8(qq10,_fjsp_msub_v2r8(rinv10,rinvsq10,krf2));
1134 /* Update vectorial force */
1135 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
1136 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
1137 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
1139 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
1140 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
1141 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
1143 /**************************
1144 * CALCULATE INTERACTIONS *
1145 **************************/
1147 /* REACTION-FIELD ELECTROSTATICS */
1148 felec = _fjsp_mul_v2r8(qq11,_fjsp_msub_v2r8(rinv11,rinvsq11,krf2));
1152 /* Update vectorial force */
1153 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
1154 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
1155 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
1157 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
1158 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
1159 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
1161 /**************************
1162 * CALCULATE INTERACTIONS *
1163 **************************/
1165 /* REACTION-FIELD ELECTROSTATICS */
1166 felec = _fjsp_mul_v2r8(qq12,_fjsp_msub_v2r8(rinv12,rinvsq12,krf2));
1170 /* Update vectorial force */
1171 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
1172 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
1173 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
1175 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
1176 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
1177 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
1179 /**************************
1180 * CALCULATE INTERACTIONS *
1181 **************************/
1183 /* REACTION-FIELD ELECTROSTATICS */
1184 felec = _fjsp_mul_v2r8(qq20,_fjsp_msub_v2r8(rinv20,rinvsq20,krf2));
1188 /* Update vectorial force */
1189 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
1190 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
1191 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
1193 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
1194 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
1195 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
1197 /**************************
1198 * CALCULATE INTERACTIONS *
1199 **************************/
1201 /* REACTION-FIELD ELECTROSTATICS */
1202 felec = _fjsp_mul_v2r8(qq21,_fjsp_msub_v2r8(rinv21,rinvsq21,krf2));
1206 /* Update vectorial force */
1207 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
1208 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
1209 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
1211 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
1212 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
1213 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
1215 /**************************
1216 * CALCULATE INTERACTIONS *
1217 **************************/
1219 /* REACTION-FIELD ELECTROSTATICS */
1220 felec = _fjsp_mul_v2r8(qq22,_fjsp_msub_v2r8(rinv22,rinvsq22,krf2));
1224 /* Update vectorial force */
1225 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
1226 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
1227 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
1229 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
1230 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
1231 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
1233 gmx_fjsp_decrement_3rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2);
1235 /* Inner loop uses 277 flops */
1238 if(jidx<j_index_end)
1242 j_coord_offsetA = DIM*jnrA;
1244 /* load j atom coordinates */
1245 gmx_fjsp_load_3rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
1246 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,&jy2,&jz2);
1248 /* Calculate displacement vector */
1249 dx00 = _fjsp_sub_v2r8(ix0,jx0);
1250 dy00 = _fjsp_sub_v2r8(iy0,jy0);
1251 dz00 = _fjsp_sub_v2r8(iz0,jz0);
1252 dx01 = _fjsp_sub_v2r8(ix0,jx1);
1253 dy01 = _fjsp_sub_v2r8(iy0,jy1);
1254 dz01 = _fjsp_sub_v2r8(iz0,jz1);
1255 dx02 = _fjsp_sub_v2r8(ix0,jx2);
1256 dy02 = _fjsp_sub_v2r8(iy0,jy2);
1257 dz02 = _fjsp_sub_v2r8(iz0,jz2);
1258 dx10 = _fjsp_sub_v2r8(ix1,jx0);
1259 dy10 = _fjsp_sub_v2r8(iy1,jy0);
1260 dz10 = _fjsp_sub_v2r8(iz1,jz0);
1261 dx11 = _fjsp_sub_v2r8(ix1,jx1);
1262 dy11 = _fjsp_sub_v2r8(iy1,jy1);
1263 dz11 = _fjsp_sub_v2r8(iz1,jz1);
1264 dx12 = _fjsp_sub_v2r8(ix1,jx2);
1265 dy12 = _fjsp_sub_v2r8(iy1,jy2);
1266 dz12 = _fjsp_sub_v2r8(iz1,jz2);
1267 dx20 = _fjsp_sub_v2r8(ix2,jx0);
1268 dy20 = _fjsp_sub_v2r8(iy2,jy0);
1269 dz20 = _fjsp_sub_v2r8(iz2,jz0);
1270 dx21 = _fjsp_sub_v2r8(ix2,jx1);
1271 dy21 = _fjsp_sub_v2r8(iy2,jy1);
1272 dz21 = _fjsp_sub_v2r8(iz2,jz1);
1273 dx22 = _fjsp_sub_v2r8(ix2,jx2);
1274 dy22 = _fjsp_sub_v2r8(iy2,jy2);
1275 dz22 = _fjsp_sub_v2r8(iz2,jz2);
1277 /* Calculate squared distance and things based on it */
1278 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
1279 rsq01 = gmx_fjsp_calc_rsq_v2r8(dx01,dy01,dz01);
1280 rsq02 = gmx_fjsp_calc_rsq_v2r8(dx02,dy02,dz02);
1281 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
1282 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
1283 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
1284 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
1285 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
1286 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
1288 rinv00 = gmx_fjsp_invsqrt_v2r8(rsq00);
1289 rinv01 = gmx_fjsp_invsqrt_v2r8(rsq01);
1290 rinv02 = gmx_fjsp_invsqrt_v2r8(rsq02);
1291 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
1292 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
1293 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
1294 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
1295 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
1296 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
1298 rinvsq00 = _fjsp_mul_v2r8(rinv00,rinv00);
1299 rinvsq01 = _fjsp_mul_v2r8(rinv01,rinv01);
1300 rinvsq02 = _fjsp_mul_v2r8(rinv02,rinv02);
1301 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
1302 rinvsq11 = _fjsp_mul_v2r8(rinv11,rinv11);
1303 rinvsq12 = _fjsp_mul_v2r8(rinv12,rinv12);
1304 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
1305 rinvsq21 = _fjsp_mul_v2r8(rinv21,rinv21);
1306 rinvsq22 = _fjsp_mul_v2r8(rinv22,rinv22);
1308 fjx0 = _fjsp_setzero_v2r8();
1309 fjy0 = _fjsp_setzero_v2r8();
1310 fjz0 = _fjsp_setzero_v2r8();
1311 fjx1 = _fjsp_setzero_v2r8();
1312 fjy1 = _fjsp_setzero_v2r8();
1313 fjz1 = _fjsp_setzero_v2r8();
1314 fjx2 = _fjsp_setzero_v2r8();
1315 fjy2 = _fjsp_setzero_v2r8();
1316 fjz2 = _fjsp_setzero_v2r8();
1318 /**************************
1319 * CALCULATE INTERACTIONS *
1320 **************************/
1322 /* REACTION-FIELD ELECTROSTATICS */
1323 felec = _fjsp_mul_v2r8(qq00,_fjsp_msub_v2r8(rinv00,rinvsq00,krf2));
1325 /* LENNARD-JONES DISPERSION/REPULSION */
1327 rinvsix = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
1328 fvdw = _fjsp_mul_v2r8(_fjsp_msub_v2r8(c12_00,rinvsix,c6_00),_fjsp_mul_v2r8(rinvsix,rinvsq00));
1330 fscal = _fjsp_add_v2r8(felec,fvdw);
1332 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1334 /* Update vectorial force */
1335 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
1336 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
1337 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
1339 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
1340 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
1341 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
1343 /**************************
1344 * CALCULATE INTERACTIONS *
1345 **************************/
1347 /* REACTION-FIELD ELECTROSTATICS */
1348 felec = _fjsp_mul_v2r8(qq01,_fjsp_msub_v2r8(rinv01,rinvsq01,krf2));
1352 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1354 /* Update vectorial force */
1355 fix0 = _fjsp_madd_v2r8(dx01,fscal,fix0);
1356 fiy0 = _fjsp_madd_v2r8(dy01,fscal,fiy0);
1357 fiz0 = _fjsp_madd_v2r8(dz01,fscal,fiz0);
1359 fjx1 = _fjsp_madd_v2r8(dx01,fscal,fjx1);
1360 fjy1 = _fjsp_madd_v2r8(dy01,fscal,fjy1);
1361 fjz1 = _fjsp_madd_v2r8(dz01,fscal,fjz1);
1363 /**************************
1364 * CALCULATE INTERACTIONS *
1365 **************************/
1367 /* REACTION-FIELD ELECTROSTATICS */
1368 felec = _fjsp_mul_v2r8(qq02,_fjsp_msub_v2r8(rinv02,rinvsq02,krf2));
1372 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1374 /* Update vectorial force */
1375 fix0 = _fjsp_madd_v2r8(dx02,fscal,fix0);
1376 fiy0 = _fjsp_madd_v2r8(dy02,fscal,fiy0);
1377 fiz0 = _fjsp_madd_v2r8(dz02,fscal,fiz0);
1379 fjx2 = _fjsp_madd_v2r8(dx02,fscal,fjx2);
1380 fjy2 = _fjsp_madd_v2r8(dy02,fscal,fjy2);
1381 fjz2 = _fjsp_madd_v2r8(dz02,fscal,fjz2);
1383 /**************************
1384 * CALCULATE INTERACTIONS *
1385 **************************/
1387 /* REACTION-FIELD ELECTROSTATICS */
1388 felec = _fjsp_mul_v2r8(qq10,_fjsp_msub_v2r8(rinv10,rinvsq10,krf2));
1392 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1394 /* Update vectorial force */
1395 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
1396 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
1397 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
1399 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
1400 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
1401 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
1403 /**************************
1404 * CALCULATE INTERACTIONS *
1405 **************************/
1407 /* REACTION-FIELD ELECTROSTATICS */
1408 felec = _fjsp_mul_v2r8(qq11,_fjsp_msub_v2r8(rinv11,rinvsq11,krf2));
1412 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1414 /* Update vectorial force */
1415 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
1416 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
1417 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
1419 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
1420 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
1421 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
1423 /**************************
1424 * CALCULATE INTERACTIONS *
1425 **************************/
1427 /* REACTION-FIELD ELECTROSTATICS */
1428 felec = _fjsp_mul_v2r8(qq12,_fjsp_msub_v2r8(rinv12,rinvsq12,krf2));
1432 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1434 /* Update vectorial force */
1435 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
1436 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
1437 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
1439 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
1440 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
1441 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
1443 /**************************
1444 * CALCULATE INTERACTIONS *
1445 **************************/
1447 /* REACTION-FIELD ELECTROSTATICS */
1448 felec = _fjsp_mul_v2r8(qq20,_fjsp_msub_v2r8(rinv20,rinvsq20,krf2));
1452 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1454 /* Update vectorial force */
1455 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
1456 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
1457 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
1459 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
1460 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
1461 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
1463 /**************************
1464 * CALCULATE INTERACTIONS *
1465 **************************/
1467 /* REACTION-FIELD ELECTROSTATICS */
1468 felec = _fjsp_mul_v2r8(qq21,_fjsp_msub_v2r8(rinv21,rinvsq21,krf2));
1472 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1474 /* Update vectorial force */
1475 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
1476 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
1477 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
1479 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
1480 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
1481 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
1483 /**************************
1484 * CALCULATE INTERACTIONS *
1485 **************************/
1487 /* REACTION-FIELD ELECTROSTATICS */
1488 felec = _fjsp_mul_v2r8(qq22,_fjsp_msub_v2r8(rinv22,rinvsq22,krf2));
1492 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1494 /* Update vectorial force */
1495 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
1496 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
1497 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
1499 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
1500 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
1501 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
1503 gmx_fjsp_decrement_3rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2);
1505 /* Inner loop uses 277 flops */
1508 /* End of innermost loop */
1510 gmx_fjsp_update_iforce_3atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,
1511 f+i_coord_offset,fshift+i_shift_offset);
1513 /* Increment number of inner iterations */
1514 inneriter += j_index_end - j_index_start;
1516 /* Outer loop uses 18 flops */
1519 /* Increment number of outer iterations */
1522 /* Update outer/inner flops */
1524 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3W3_F,outeriter*18 + inneriter*277);