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_VdwNone_GeomW4W4_VF_sparc64_hpc_ace_double
53 * Electrostatics interaction: ReactionField
54 * VdW interaction: None
55 * Geometry: Water4-Water4
56 * Calculate force/pot: PotentialAndForce
59 nb_kernel_ElecRF_VdwNone_GeomW4W4_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 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
84 _fjsp_v2r8 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
86 _fjsp_v2r8 ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
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 int vdwjidx3A,vdwjidx3B;
92 _fjsp_v2r8 jx3,jy3,jz3,fjx3,fjy3,fjz3,jq3,isaj3;
93 _fjsp_v2r8 dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11;
94 _fjsp_v2r8 dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12;
95 _fjsp_v2r8 dx13,dy13,dz13,rsq13,rinv13,rinvsq13,r13,qq13,c6_13,c12_13;
96 _fjsp_v2r8 dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21;
97 _fjsp_v2r8 dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22;
98 _fjsp_v2r8 dx23,dy23,dz23,rsq23,rinv23,rinvsq23,r23,qq23,c6_23,c12_23;
99 _fjsp_v2r8 dx31,dy31,dz31,rsq31,rinv31,rinvsq31,r31,qq31,c6_31,c12_31;
100 _fjsp_v2r8 dx32,dy32,dz32,rsq32,rinv32,rinvsq32,r32,qq32,c6_32,c12_32;
101 _fjsp_v2r8 dx33,dy33,dz33,rsq33,rinv33,rinvsq33,r33,qq33,c6_33,c12_33;
102 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
105 _fjsp_v2r8 dummy_mask,cutoff_mask;
106 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
107 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
108 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
115 jindex = nlist->jindex;
117 shiftidx = nlist->shift;
119 shiftvec = fr->shift_vec[0];
120 fshift = fr->fshift[0];
121 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
122 charge = mdatoms->chargeA;
123 krf = gmx_fjsp_set1_v2r8(fr->ic->k_rf);
124 krf2 = gmx_fjsp_set1_v2r8(fr->ic->k_rf*2.0);
125 crf = gmx_fjsp_set1_v2r8(fr->ic->c_rf);
127 /* Setup water-specific parameters */
128 inr = nlist->iinr[0];
129 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
130 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
131 iq3 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+3]));
133 jq1 = gmx_fjsp_set1_v2r8(charge[inr+1]);
134 jq2 = gmx_fjsp_set1_v2r8(charge[inr+2]);
135 jq3 = gmx_fjsp_set1_v2r8(charge[inr+3]);
136 qq11 = _fjsp_mul_v2r8(iq1,jq1);
137 qq12 = _fjsp_mul_v2r8(iq1,jq2);
138 qq13 = _fjsp_mul_v2r8(iq1,jq3);
139 qq21 = _fjsp_mul_v2r8(iq2,jq1);
140 qq22 = _fjsp_mul_v2r8(iq2,jq2);
141 qq23 = _fjsp_mul_v2r8(iq2,jq3);
142 qq31 = _fjsp_mul_v2r8(iq3,jq1);
143 qq32 = _fjsp_mul_v2r8(iq3,jq2);
144 qq33 = _fjsp_mul_v2r8(iq3,jq3);
146 /* Avoid stupid compiler warnings */
154 /* Start outer loop over neighborlists */
155 for(iidx=0; iidx<nri; iidx++)
157 /* Load shift vector for this list */
158 i_shift_offset = DIM*shiftidx[iidx];
160 /* Load limits for loop over neighbors */
161 j_index_start = jindex[iidx];
162 j_index_end = jindex[iidx+1];
164 /* Get outer coordinate index */
166 i_coord_offset = DIM*inr;
168 /* Load i particle coords and add shift vector */
169 gmx_fjsp_load_shift_and_3rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset+DIM,
170 &ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
172 fix1 = _fjsp_setzero_v2r8();
173 fiy1 = _fjsp_setzero_v2r8();
174 fiz1 = _fjsp_setzero_v2r8();
175 fix2 = _fjsp_setzero_v2r8();
176 fiy2 = _fjsp_setzero_v2r8();
177 fiz2 = _fjsp_setzero_v2r8();
178 fix3 = _fjsp_setzero_v2r8();
179 fiy3 = _fjsp_setzero_v2r8();
180 fiz3 = _fjsp_setzero_v2r8();
182 /* Reset potential sums */
183 velecsum = _fjsp_setzero_v2r8();
185 /* Start inner kernel loop */
186 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
189 /* Get j neighbor index, and coordinate index */
192 j_coord_offsetA = DIM*jnrA;
193 j_coord_offsetB = DIM*jnrB;
195 /* load j atom coordinates */
196 gmx_fjsp_load_3rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA+DIM,x+j_coord_offsetB+DIM,
197 &jx1,&jy1,&jz1,&jx2,&jy2,&jz2,&jx3,&jy3,&jz3);
199 /* Calculate displacement vector */
200 dx11 = _fjsp_sub_v2r8(ix1,jx1);
201 dy11 = _fjsp_sub_v2r8(iy1,jy1);
202 dz11 = _fjsp_sub_v2r8(iz1,jz1);
203 dx12 = _fjsp_sub_v2r8(ix1,jx2);
204 dy12 = _fjsp_sub_v2r8(iy1,jy2);
205 dz12 = _fjsp_sub_v2r8(iz1,jz2);
206 dx13 = _fjsp_sub_v2r8(ix1,jx3);
207 dy13 = _fjsp_sub_v2r8(iy1,jy3);
208 dz13 = _fjsp_sub_v2r8(iz1,jz3);
209 dx21 = _fjsp_sub_v2r8(ix2,jx1);
210 dy21 = _fjsp_sub_v2r8(iy2,jy1);
211 dz21 = _fjsp_sub_v2r8(iz2,jz1);
212 dx22 = _fjsp_sub_v2r8(ix2,jx2);
213 dy22 = _fjsp_sub_v2r8(iy2,jy2);
214 dz22 = _fjsp_sub_v2r8(iz2,jz2);
215 dx23 = _fjsp_sub_v2r8(ix2,jx3);
216 dy23 = _fjsp_sub_v2r8(iy2,jy3);
217 dz23 = _fjsp_sub_v2r8(iz2,jz3);
218 dx31 = _fjsp_sub_v2r8(ix3,jx1);
219 dy31 = _fjsp_sub_v2r8(iy3,jy1);
220 dz31 = _fjsp_sub_v2r8(iz3,jz1);
221 dx32 = _fjsp_sub_v2r8(ix3,jx2);
222 dy32 = _fjsp_sub_v2r8(iy3,jy2);
223 dz32 = _fjsp_sub_v2r8(iz3,jz2);
224 dx33 = _fjsp_sub_v2r8(ix3,jx3);
225 dy33 = _fjsp_sub_v2r8(iy3,jy3);
226 dz33 = _fjsp_sub_v2r8(iz3,jz3);
228 /* Calculate squared distance and things based on it */
229 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
230 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
231 rsq13 = gmx_fjsp_calc_rsq_v2r8(dx13,dy13,dz13);
232 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
233 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
234 rsq23 = gmx_fjsp_calc_rsq_v2r8(dx23,dy23,dz23);
235 rsq31 = gmx_fjsp_calc_rsq_v2r8(dx31,dy31,dz31);
236 rsq32 = gmx_fjsp_calc_rsq_v2r8(dx32,dy32,dz32);
237 rsq33 = gmx_fjsp_calc_rsq_v2r8(dx33,dy33,dz33);
239 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
240 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
241 rinv13 = gmx_fjsp_invsqrt_v2r8(rsq13);
242 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
243 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
244 rinv23 = gmx_fjsp_invsqrt_v2r8(rsq23);
245 rinv31 = gmx_fjsp_invsqrt_v2r8(rsq31);
246 rinv32 = gmx_fjsp_invsqrt_v2r8(rsq32);
247 rinv33 = gmx_fjsp_invsqrt_v2r8(rsq33);
249 rinvsq11 = _fjsp_mul_v2r8(rinv11,rinv11);
250 rinvsq12 = _fjsp_mul_v2r8(rinv12,rinv12);
251 rinvsq13 = _fjsp_mul_v2r8(rinv13,rinv13);
252 rinvsq21 = _fjsp_mul_v2r8(rinv21,rinv21);
253 rinvsq22 = _fjsp_mul_v2r8(rinv22,rinv22);
254 rinvsq23 = _fjsp_mul_v2r8(rinv23,rinv23);
255 rinvsq31 = _fjsp_mul_v2r8(rinv31,rinv31);
256 rinvsq32 = _fjsp_mul_v2r8(rinv32,rinv32);
257 rinvsq33 = _fjsp_mul_v2r8(rinv33,rinv33);
259 fjx1 = _fjsp_setzero_v2r8();
260 fjy1 = _fjsp_setzero_v2r8();
261 fjz1 = _fjsp_setzero_v2r8();
262 fjx2 = _fjsp_setzero_v2r8();
263 fjy2 = _fjsp_setzero_v2r8();
264 fjz2 = _fjsp_setzero_v2r8();
265 fjx3 = _fjsp_setzero_v2r8();
266 fjy3 = _fjsp_setzero_v2r8();
267 fjz3 = _fjsp_setzero_v2r8();
269 /**************************
270 * CALCULATE INTERACTIONS *
271 **************************/
273 /* REACTION-FIELD ELECTROSTATICS */
274 velec = _fjsp_mul_v2r8(qq11,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq11,rinv11),crf));
275 felec = _fjsp_mul_v2r8(qq11,_fjsp_msub_v2r8(rinv11,rinvsq11,krf2));
277 /* Update potential sum for this i atom from the interaction with this j atom. */
278 velecsum = _fjsp_add_v2r8(velecsum,velec);
282 /* Update vectorial force */
283 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
284 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
285 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
287 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
288 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
289 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
291 /**************************
292 * CALCULATE INTERACTIONS *
293 **************************/
295 /* REACTION-FIELD ELECTROSTATICS */
296 velec = _fjsp_mul_v2r8(qq12,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq12,rinv12),crf));
297 felec = _fjsp_mul_v2r8(qq12,_fjsp_msub_v2r8(rinv12,rinvsq12,krf2));
299 /* Update potential sum for this i atom from the interaction with this j atom. */
300 velecsum = _fjsp_add_v2r8(velecsum,velec);
304 /* Update vectorial force */
305 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
306 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
307 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
309 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
310 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
311 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
313 /**************************
314 * CALCULATE INTERACTIONS *
315 **************************/
317 /* REACTION-FIELD ELECTROSTATICS */
318 velec = _fjsp_mul_v2r8(qq13,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq13,rinv13),crf));
319 felec = _fjsp_mul_v2r8(qq13,_fjsp_msub_v2r8(rinv13,rinvsq13,krf2));
321 /* Update potential sum for this i atom from the interaction with this j atom. */
322 velecsum = _fjsp_add_v2r8(velecsum,velec);
326 /* Update vectorial force */
327 fix1 = _fjsp_madd_v2r8(dx13,fscal,fix1);
328 fiy1 = _fjsp_madd_v2r8(dy13,fscal,fiy1);
329 fiz1 = _fjsp_madd_v2r8(dz13,fscal,fiz1);
331 fjx3 = _fjsp_madd_v2r8(dx13,fscal,fjx3);
332 fjy3 = _fjsp_madd_v2r8(dy13,fscal,fjy3);
333 fjz3 = _fjsp_madd_v2r8(dz13,fscal,fjz3);
335 /**************************
336 * CALCULATE INTERACTIONS *
337 **************************/
339 /* REACTION-FIELD ELECTROSTATICS */
340 velec = _fjsp_mul_v2r8(qq21,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq21,rinv21),crf));
341 felec = _fjsp_mul_v2r8(qq21,_fjsp_msub_v2r8(rinv21,rinvsq21,krf2));
343 /* Update potential sum for this i atom from the interaction with this j atom. */
344 velecsum = _fjsp_add_v2r8(velecsum,velec);
348 /* Update vectorial force */
349 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
350 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
351 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
353 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
354 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
355 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
357 /**************************
358 * CALCULATE INTERACTIONS *
359 **************************/
361 /* REACTION-FIELD ELECTROSTATICS */
362 velec = _fjsp_mul_v2r8(qq22,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq22,rinv22),crf));
363 felec = _fjsp_mul_v2r8(qq22,_fjsp_msub_v2r8(rinv22,rinvsq22,krf2));
365 /* Update potential sum for this i atom from the interaction with this j atom. */
366 velecsum = _fjsp_add_v2r8(velecsum,velec);
370 /* Update vectorial force */
371 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
372 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
373 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
375 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
376 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
377 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
379 /**************************
380 * CALCULATE INTERACTIONS *
381 **************************/
383 /* REACTION-FIELD ELECTROSTATICS */
384 velec = _fjsp_mul_v2r8(qq23,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq23,rinv23),crf));
385 felec = _fjsp_mul_v2r8(qq23,_fjsp_msub_v2r8(rinv23,rinvsq23,krf2));
387 /* Update potential sum for this i atom from the interaction with this j atom. */
388 velecsum = _fjsp_add_v2r8(velecsum,velec);
392 /* Update vectorial force */
393 fix2 = _fjsp_madd_v2r8(dx23,fscal,fix2);
394 fiy2 = _fjsp_madd_v2r8(dy23,fscal,fiy2);
395 fiz2 = _fjsp_madd_v2r8(dz23,fscal,fiz2);
397 fjx3 = _fjsp_madd_v2r8(dx23,fscal,fjx3);
398 fjy3 = _fjsp_madd_v2r8(dy23,fscal,fjy3);
399 fjz3 = _fjsp_madd_v2r8(dz23,fscal,fjz3);
401 /**************************
402 * CALCULATE INTERACTIONS *
403 **************************/
405 /* REACTION-FIELD ELECTROSTATICS */
406 velec = _fjsp_mul_v2r8(qq31,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq31,rinv31),crf));
407 felec = _fjsp_mul_v2r8(qq31,_fjsp_msub_v2r8(rinv31,rinvsq31,krf2));
409 /* Update potential sum for this i atom from the interaction with this j atom. */
410 velecsum = _fjsp_add_v2r8(velecsum,velec);
414 /* Update vectorial force */
415 fix3 = _fjsp_madd_v2r8(dx31,fscal,fix3);
416 fiy3 = _fjsp_madd_v2r8(dy31,fscal,fiy3);
417 fiz3 = _fjsp_madd_v2r8(dz31,fscal,fiz3);
419 fjx1 = _fjsp_madd_v2r8(dx31,fscal,fjx1);
420 fjy1 = _fjsp_madd_v2r8(dy31,fscal,fjy1);
421 fjz1 = _fjsp_madd_v2r8(dz31,fscal,fjz1);
423 /**************************
424 * CALCULATE INTERACTIONS *
425 **************************/
427 /* REACTION-FIELD ELECTROSTATICS */
428 velec = _fjsp_mul_v2r8(qq32,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq32,rinv32),crf));
429 felec = _fjsp_mul_v2r8(qq32,_fjsp_msub_v2r8(rinv32,rinvsq32,krf2));
431 /* Update potential sum for this i atom from the interaction with this j atom. */
432 velecsum = _fjsp_add_v2r8(velecsum,velec);
436 /* Update vectorial force */
437 fix3 = _fjsp_madd_v2r8(dx32,fscal,fix3);
438 fiy3 = _fjsp_madd_v2r8(dy32,fscal,fiy3);
439 fiz3 = _fjsp_madd_v2r8(dz32,fscal,fiz3);
441 fjx2 = _fjsp_madd_v2r8(dx32,fscal,fjx2);
442 fjy2 = _fjsp_madd_v2r8(dy32,fscal,fjy2);
443 fjz2 = _fjsp_madd_v2r8(dz32,fscal,fjz2);
445 /**************************
446 * CALCULATE INTERACTIONS *
447 **************************/
449 /* REACTION-FIELD ELECTROSTATICS */
450 velec = _fjsp_mul_v2r8(qq33,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq33,rinv33),crf));
451 felec = _fjsp_mul_v2r8(qq33,_fjsp_msub_v2r8(rinv33,rinvsq33,krf2));
453 /* Update potential sum for this i atom from the interaction with this j atom. */
454 velecsum = _fjsp_add_v2r8(velecsum,velec);
458 /* Update vectorial force */
459 fix3 = _fjsp_madd_v2r8(dx33,fscal,fix3);
460 fiy3 = _fjsp_madd_v2r8(dy33,fscal,fiy3);
461 fiz3 = _fjsp_madd_v2r8(dz33,fscal,fiz3);
463 fjx3 = _fjsp_madd_v2r8(dx33,fscal,fjx3);
464 fjy3 = _fjsp_madd_v2r8(dy33,fscal,fjy3);
465 fjz3 = _fjsp_madd_v2r8(dz33,fscal,fjz3);
467 gmx_fjsp_decrement_3rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA+DIM,f+j_coord_offsetB+DIM,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2,fjx3,fjy3,fjz3);
469 /* Inner loop uses 315 flops */
476 j_coord_offsetA = DIM*jnrA;
478 /* load j atom coordinates */
479 gmx_fjsp_load_3rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA+DIM,
480 &jx1,&jy1,&jz1,&jx2,&jy2,&jz2,&jx3,&jy3,&jz3);
482 /* Calculate displacement vector */
483 dx11 = _fjsp_sub_v2r8(ix1,jx1);
484 dy11 = _fjsp_sub_v2r8(iy1,jy1);
485 dz11 = _fjsp_sub_v2r8(iz1,jz1);
486 dx12 = _fjsp_sub_v2r8(ix1,jx2);
487 dy12 = _fjsp_sub_v2r8(iy1,jy2);
488 dz12 = _fjsp_sub_v2r8(iz1,jz2);
489 dx13 = _fjsp_sub_v2r8(ix1,jx3);
490 dy13 = _fjsp_sub_v2r8(iy1,jy3);
491 dz13 = _fjsp_sub_v2r8(iz1,jz3);
492 dx21 = _fjsp_sub_v2r8(ix2,jx1);
493 dy21 = _fjsp_sub_v2r8(iy2,jy1);
494 dz21 = _fjsp_sub_v2r8(iz2,jz1);
495 dx22 = _fjsp_sub_v2r8(ix2,jx2);
496 dy22 = _fjsp_sub_v2r8(iy2,jy2);
497 dz22 = _fjsp_sub_v2r8(iz2,jz2);
498 dx23 = _fjsp_sub_v2r8(ix2,jx3);
499 dy23 = _fjsp_sub_v2r8(iy2,jy3);
500 dz23 = _fjsp_sub_v2r8(iz2,jz3);
501 dx31 = _fjsp_sub_v2r8(ix3,jx1);
502 dy31 = _fjsp_sub_v2r8(iy3,jy1);
503 dz31 = _fjsp_sub_v2r8(iz3,jz1);
504 dx32 = _fjsp_sub_v2r8(ix3,jx2);
505 dy32 = _fjsp_sub_v2r8(iy3,jy2);
506 dz32 = _fjsp_sub_v2r8(iz3,jz2);
507 dx33 = _fjsp_sub_v2r8(ix3,jx3);
508 dy33 = _fjsp_sub_v2r8(iy3,jy3);
509 dz33 = _fjsp_sub_v2r8(iz3,jz3);
511 /* Calculate squared distance and things based on it */
512 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
513 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
514 rsq13 = gmx_fjsp_calc_rsq_v2r8(dx13,dy13,dz13);
515 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
516 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
517 rsq23 = gmx_fjsp_calc_rsq_v2r8(dx23,dy23,dz23);
518 rsq31 = gmx_fjsp_calc_rsq_v2r8(dx31,dy31,dz31);
519 rsq32 = gmx_fjsp_calc_rsq_v2r8(dx32,dy32,dz32);
520 rsq33 = gmx_fjsp_calc_rsq_v2r8(dx33,dy33,dz33);
522 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
523 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
524 rinv13 = gmx_fjsp_invsqrt_v2r8(rsq13);
525 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
526 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
527 rinv23 = gmx_fjsp_invsqrt_v2r8(rsq23);
528 rinv31 = gmx_fjsp_invsqrt_v2r8(rsq31);
529 rinv32 = gmx_fjsp_invsqrt_v2r8(rsq32);
530 rinv33 = gmx_fjsp_invsqrt_v2r8(rsq33);
532 rinvsq11 = _fjsp_mul_v2r8(rinv11,rinv11);
533 rinvsq12 = _fjsp_mul_v2r8(rinv12,rinv12);
534 rinvsq13 = _fjsp_mul_v2r8(rinv13,rinv13);
535 rinvsq21 = _fjsp_mul_v2r8(rinv21,rinv21);
536 rinvsq22 = _fjsp_mul_v2r8(rinv22,rinv22);
537 rinvsq23 = _fjsp_mul_v2r8(rinv23,rinv23);
538 rinvsq31 = _fjsp_mul_v2r8(rinv31,rinv31);
539 rinvsq32 = _fjsp_mul_v2r8(rinv32,rinv32);
540 rinvsq33 = _fjsp_mul_v2r8(rinv33,rinv33);
542 fjx1 = _fjsp_setzero_v2r8();
543 fjy1 = _fjsp_setzero_v2r8();
544 fjz1 = _fjsp_setzero_v2r8();
545 fjx2 = _fjsp_setzero_v2r8();
546 fjy2 = _fjsp_setzero_v2r8();
547 fjz2 = _fjsp_setzero_v2r8();
548 fjx3 = _fjsp_setzero_v2r8();
549 fjy3 = _fjsp_setzero_v2r8();
550 fjz3 = _fjsp_setzero_v2r8();
552 /**************************
553 * CALCULATE INTERACTIONS *
554 **************************/
556 /* REACTION-FIELD ELECTROSTATICS */
557 velec = _fjsp_mul_v2r8(qq11,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq11,rinv11),crf));
558 felec = _fjsp_mul_v2r8(qq11,_fjsp_msub_v2r8(rinv11,rinvsq11,krf2));
560 /* Update potential sum for this i atom from the interaction with this j atom. */
561 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
562 velecsum = _fjsp_add_v2r8(velecsum,velec);
566 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
568 /* Update vectorial force */
569 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
570 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
571 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
573 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
574 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
575 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
577 /**************************
578 * CALCULATE INTERACTIONS *
579 **************************/
581 /* REACTION-FIELD ELECTROSTATICS */
582 velec = _fjsp_mul_v2r8(qq12,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq12,rinv12),crf));
583 felec = _fjsp_mul_v2r8(qq12,_fjsp_msub_v2r8(rinv12,rinvsq12,krf2));
585 /* Update potential sum for this i atom from the interaction with this j atom. */
586 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
587 velecsum = _fjsp_add_v2r8(velecsum,velec);
591 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
593 /* Update vectorial force */
594 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
595 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
596 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
598 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
599 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
600 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
602 /**************************
603 * CALCULATE INTERACTIONS *
604 **************************/
606 /* REACTION-FIELD ELECTROSTATICS */
607 velec = _fjsp_mul_v2r8(qq13,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq13,rinv13),crf));
608 felec = _fjsp_mul_v2r8(qq13,_fjsp_msub_v2r8(rinv13,rinvsq13,krf2));
610 /* Update potential sum for this i atom from the interaction with this j atom. */
611 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
612 velecsum = _fjsp_add_v2r8(velecsum,velec);
616 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
618 /* Update vectorial force */
619 fix1 = _fjsp_madd_v2r8(dx13,fscal,fix1);
620 fiy1 = _fjsp_madd_v2r8(dy13,fscal,fiy1);
621 fiz1 = _fjsp_madd_v2r8(dz13,fscal,fiz1);
623 fjx3 = _fjsp_madd_v2r8(dx13,fscal,fjx3);
624 fjy3 = _fjsp_madd_v2r8(dy13,fscal,fjy3);
625 fjz3 = _fjsp_madd_v2r8(dz13,fscal,fjz3);
627 /**************************
628 * CALCULATE INTERACTIONS *
629 **************************/
631 /* REACTION-FIELD ELECTROSTATICS */
632 velec = _fjsp_mul_v2r8(qq21,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq21,rinv21),crf));
633 felec = _fjsp_mul_v2r8(qq21,_fjsp_msub_v2r8(rinv21,rinvsq21,krf2));
635 /* Update potential sum for this i atom from the interaction with this j atom. */
636 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
637 velecsum = _fjsp_add_v2r8(velecsum,velec);
641 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
643 /* Update vectorial force */
644 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
645 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
646 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
648 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
649 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
650 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
652 /**************************
653 * CALCULATE INTERACTIONS *
654 **************************/
656 /* REACTION-FIELD ELECTROSTATICS */
657 velec = _fjsp_mul_v2r8(qq22,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq22,rinv22),crf));
658 felec = _fjsp_mul_v2r8(qq22,_fjsp_msub_v2r8(rinv22,rinvsq22,krf2));
660 /* Update potential sum for this i atom from the interaction with this j atom. */
661 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
662 velecsum = _fjsp_add_v2r8(velecsum,velec);
666 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
668 /* Update vectorial force */
669 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
670 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
671 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
673 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
674 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
675 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
677 /**************************
678 * CALCULATE INTERACTIONS *
679 **************************/
681 /* REACTION-FIELD ELECTROSTATICS */
682 velec = _fjsp_mul_v2r8(qq23,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq23,rinv23),crf));
683 felec = _fjsp_mul_v2r8(qq23,_fjsp_msub_v2r8(rinv23,rinvsq23,krf2));
685 /* Update potential sum for this i atom from the interaction with this j atom. */
686 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
687 velecsum = _fjsp_add_v2r8(velecsum,velec);
691 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
693 /* Update vectorial force */
694 fix2 = _fjsp_madd_v2r8(dx23,fscal,fix2);
695 fiy2 = _fjsp_madd_v2r8(dy23,fscal,fiy2);
696 fiz2 = _fjsp_madd_v2r8(dz23,fscal,fiz2);
698 fjx3 = _fjsp_madd_v2r8(dx23,fscal,fjx3);
699 fjy3 = _fjsp_madd_v2r8(dy23,fscal,fjy3);
700 fjz3 = _fjsp_madd_v2r8(dz23,fscal,fjz3);
702 /**************************
703 * CALCULATE INTERACTIONS *
704 **************************/
706 /* REACTION-FIELD ELECTROSTATICS */
707 velec = _fjsp_mul_v2r8(qq31,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq31,rinv31),crf));
708 felec = _fjsp_mul_v2r8(qq31,_fjsp_msub_v2r8(rinv31,rinvsq31,krf2));
710 /* Update potential sum for this i atom from the interaction with this j atom. */
711 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
712 velecsum = _fjsp_add_v2r8(velecsum,velec);
716 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
718 /* Update vectorial force */
719 fix3 = _fjsp_madd_v2r8(dx31,fscal,fix3);
720 fiy3 = _fjsp_madd_v2r8(dy31,fscal,fiy3);
721 fiz3 = _fjsp_madd_v2r8(dz31,fscal,fiz3);
723 fjx1 = _fjsp_madd_v2r8(dx31,fscal,fjx1);
724 fjy1 = _fjsp_madd_v2r8(dy31,fscal,fjy1);
725 fjz1 = _fjsp_madd_v2r8(dz31,fscal,fjz1);
727 /**************************
728 * CALCULATE INTERACTIONS *
729 **************************/
731 /* REACTION-FIELD ELECTROSTATICS */
732 velec = _fjsp_mul_v2r8(qq32,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq32,rinv32),crf));
733 felec = _fjsp_mul_v2r8(qq32,_fjsp_msub_v2r8(rinv32,rinvsq32,krf2));
735 /* Update potential sum for this i atom from the interaction with this j atom. */
736 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
737 velecsum = _fjsp_add_v2r8(velecsum,velec);
741 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
743 /* Update vectorial force */
744 fix3 = _fjsp_madd_v2r8(dx32,fscal,fix3);
745 fiy3 = _fjsp_madd_v2r8(dy32,fscal,fiy3);
746 fiz3 = _fjsp_madd_v2r8(dz32,fscal,fiz3);
748 fjx2 = _fjsp_madd_v2r8(dx32,fscal,fjx2);
749 fjy2 = _fjsp_madd_v2r8(dy32,fscal,fjy2);
750 fjz2 = _fjsp_madd_v2r8(dz32,fscal,fjz2);
752 /**************************
753 * CALCULATE INTERACTIONS *
754 **************************/
756 /* REACTION-FIELD ELECTROSTATICS */
757 velec = _fjsp_mul_v2r8(qq33,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq33,rinv33),crf));
758 felec = _fjsp_mul_v2r8(qq33,_fjsp_msub_v2r8(rinv33,rinvsq33,krf2));
760 /* Update potential sum for this i atom from the interaction with this j atom. */
761 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
762 velecsum = _fjsp_add_v2r8(velecsum,velec);
766 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
768 /* Update vectorial force */
769 fix3 = _fjsp_madd_v2r8(dx33,fscal,fix3);
770 fiy3 = _fjsp_madd_v2r8(dy33,fscal,fiy3);
771 fiz3 = _fjsp_madd_v2r8(dz33,fscal,fiz3);
773 fjx3 = _fjsp_madd_v2r8(dx33,fscal,fjx3);
774 fjy3 = _fjsp_madd_v2r8(dy33,fscal,fjy3);
775 fjz3 = _fjsp_madd_v2r8(dz33,fscal,fjz3);
777 gmx_fjsp_decrement_3rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA+DIM,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2,fjx3,fjy3,fjz3);
779 /* Inner loop uses 315 flops */
782 /* End of innermost loop */
784 gmx_fjsp_update_iforce_3atom_swizzle_v2r8(fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
785 f+i_coord_offset+DIM,fshift+i_shift_offset);
788 /* Update potential energies */
789 gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
791 /* Increment number of inner iterations */
792 inneriter += j_index_end - j_index_start;
794 /* Outer loop uses 19 flops */
797 /* Increment number of outer iterations */
800 /* Update outer/inner flops */
802 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_W4W4_VF,outeriter*19 + inneriter*315);
805 * Gromacs nonbonded kernel: nb_kernel_ElecRF_VdwNone_GeomW4W4_F_sparc64_hpc_ace_double
806 * Electrostatics interaction: ReactionField
807 * VdW interaction: None
808 * Geometry: Water4-Water4
809 * Calculate force/pot: Force
812 nb_kernel_ElecRF_VdwNone_GeomW4W4_F_sparc64_hpc_ace_double
813 (t_nblist * gmx_restrict nlist,
814 rvec * gmx_restrict xx,
815 rvec * gmx_restrict ff,
816 t_forcerec * gmx_restrict fr,
817 t_mdatoms * gmx_restrict mdatoms,
818 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
819 t_nrnb * gmx_restrict nrnb)
821 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
822 * just 0 for non-waters.
823 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
824 * jnr indices corresponding to data put in the four positions in the SIMD register.
826 int i_shift_offset,i_coord_offset,outeriter,inneriter;
827 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
829 int j_coord_offsetA,j_coord_offsetB;
830 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
832 real *shiftvec,*fshift,*x,*f;
833 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
835 _fjsp_v2r8 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
837 _fjsp_v2r8 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
839 _fjsp_v2r8 ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
840 int vdwjidx1A,vdwjidx1B;
841 _fjsp_v2r8 jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
842 int vdwjidx2A,vdwjidx2B;
843 _fjsp_v2r8 jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
844 int vdwjidx3A,vdwjidx3B;
845 _fjsp_v2r8 jx3,jy3,jz3,fjx3,fjy3,fjz3,jq3,isaj3;
846 _fjsp_v2r8 dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11;
847 _fjsp_v2r8 dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12;
848 _fjsp_v2r8 dx13,dy13,dz13,rsq13,rinv13,rinvsq13,r13,qq13,c6_13,c12_13;
849 _fjsp_v2r8 dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21;
850 _fjsp_v2r8 dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22;
851 _fjsp_v2r8 dx23,dy23,dz23,rsq23,rinv23,rinvsq23,r23,qq23,c6_23,c12_23;
852 _fjsp_v2r8 dx31,dy31,dz31,rsq31,rinv31,rinvsq31,r31,qq31,c6_31,c12_31;
853 _fjsp_v2r8 dx32,dy32,dz32,rsq32,rinv32,rinvsq32,r32,qq32,c6_32,c12_32;
854 _fjsp_v2r8 dx33,dy33,dz33,rsq33,rinv33,rinvsq33,r33,qq33,c6_33,c12_33;
855 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
858 _fjsp_v2r8 dummy_mask,cutoff_mask;
859 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
860 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
861 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
868 jindex = nlist->jindex;
870 shiftidx = nlist->shift;
872 shiftvec = fr->shift_vec[0];
873 fshift = fr->fshift[0];
874 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
875 charge = mdatoms->chargeA;
876 krf = gmx_fjsp_set1_v2r8(fr->ic->k_rf);
877 krf2 = gmx_fjsp_set1_v2r8(fr->ic->k_rf*2.0);
878 crf = gmx_fjsp_set1_v2r8(fr->ic->c_rf);
880 /* Setup water-specific parameters */
881 inr = nlist->iinr[0];
882 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
883 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
884 iq3 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+3]));
886 jq1 = gmx_fjsp_set1_v2r8(charge[inr+1]);
887 jq2 = gmx_fjsp_set1_v2r8(charge[inr+2]);
888 jq3 = gmx_fjsp_set1_v2r8(charge[inr+3]);
889 qq11 = _fjsp_mul_v2r8(iq1,jq1);
890 qq12 = _fjsp_mul_v2r8(iq1,jq2);
891 qq13 = _fjsp_mul_v2r8(iq1,jq3);
892 qq21 = _fjsp_mul_v2r8(iq2,jq1);
893 qq22 = _fjsp_mul_v2r8(iq2,jq2);
894 qq23 = _fjsp_mul_v2r8(iq2,jq3);
895 qq31 = _fjsp_mul_v2r8(iq3,jq1);
896 qq32 = _fjsp_mul_v2r8(iq3,jq2);
897 qq33 = _fjsp_mul_v2r8(iq3,jq3);
899 /* Avoid stupid compiler warnings */
907 /* Start outer loop over neighborlists */
908 for(iidx=0; iidx<nri; iidx++)
910 /* Load shift vector for this list */
911 i_shift_offset = DIM*shiftidx[iidx];
913 /* Load limits for loop over neighbors */
914 j_index_start = jindex[iidx];
915 j_index_end = jindex[iidx+1];
917 /* Get outer coordinate index */
919 i_coord_offset = DIM*inr;
921 /* Load i particle coords and add shift vector */
922 gmx_fjsp_load_shift_and_3rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset+DIM,
923 &ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
925 fix1 = _fjsp_setzero_v2r8();
926 fiy1 = _fjsp_setzero_v2r8();
927 fiz1 = _fjsp_setzero_v2r8();
928 fix2 = _fjsp_setzero_v2r8();
929 fiy2 = _fjsp_setzero_v2r8();
930 fiz2 = _fjsp_setzero_v2r8();
931 fix3 = _fjsp_setzero_v2r8();
932 fiy3 = _fjsp_setzero_v2r8();
933 fiz3 = _fjsp_setzero_v2r8();
935 /* Start inner kernel loop */
936 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
939 /* Get j neighbor index, and coordinate index */
942 j_coord_offsetA = DIM*jnrA;
943 j_coord_offsetB = DIM*jnrB;
945 /* load j atom coordinates */
946 gmx_fjsp_load_3rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA+DIM,x+j_coord_offsetB+DIM,
947 &jx1,&jy1,&jz1,&jx2,&jy2,&jz2,&jx3,&jy3,&jz3);
949 /* Calculate displacement vector */
950 dx11 = _fjsp_sub_v2r8(ix1,jx1);
951 dy11 = _fjsp_sub_v2r8(iy1,jy1);
952 dz11 = _fjsp_sub_v2r8(iz1,jz1);
953 dx12 = _fjsp_sub_v2r8(ix1,jx2);
954 dy12 = _fjsp_sub_v2r8(iy1,jy2);
955 dz12 = _fjsp_sub_v2r8(iz1,jz2);
956 dx13 = _fjsp_sub_v2r8(ix1,jx3);
957 dy13 = _fjsp_sub_v2r8(iy1,jy3);
958 dz13 = _fjsp_sub_v2r8(iz1,jz3);
959 dx21 = _fjsp_sub_v2r8(ix2,jx1);
960 dy21 = _fjsp_sub_v2r8(iy2,jy1);
961 dz21 = _fjsp_sub_v2r8(iz2,jz1);
962 dx22 = _fjsp_sub_v2r8(ix2,jx2);
963 dy22 = _fjsp_sub_v2r8(iy2,jy2);
964 dz22 = _fjsp_sub_v2r8(iz2,jz2);
965 dx23 = _fjsp_sub_v2r8(ix2,jx3);
966 dy23 = _fjsp_sub_v2r8(iy2,jy3);
967 dz23 = _fjsp_sub_v2r8(iz2,jz3);
968 dx31 = _fjsp_sub_v2r8(ix3,jx1);
969 dy31 = _fjsp_sub_v2r8(iy3,jy1);
970 dz31 = _fjsp_sub_v2r8(iz3,jz1);
971 dx32 = _fjsp_sub_v2r8(ix3,jx2);
972 dy32 = _fjsp_sub_v2r8(iy3,jy2);
973 dz32 = _fjsp_sub_v2r8(iz3,jz2);
974 dx33 = _fjsp_sub_v2r8(ix3,jx3);
975 dy33 = _fjsp_sub_v2r8(iy3,jy3);
976 dz33 = _fjsp_sub_v2r8(iz3,jz3);
978 /* Calculate squared distance and things based on it */
979 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
980 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
981 rsq13 = gmx_fjsp_calc_rsq_v2r8(dx13,dy13,dz13);
982 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
983 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
984 rsq23 = gmx_fjsp_calc_rsq_v2r8(dx23,dy23,dz23);
985 rsq31 = gmx_fjsp_calc_rsq_v2r8(dx31,dy31,dz31);
986 rsq32 = gmx_fjsp_calc_rsq_v2r8(dx32,dy32,dz32);
987 rsq33 = gmx_fjsp_calc_rsq_v2r8(dx33,dy33,dz33);
989 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
990 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
991 rinv13 = gmx_fjsp_invsqrt_v2r8(rsq13);
992 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
993 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
994 rinv23 = gmx_fjsp_invsqrt_v2r8(rsq23);
995 rinv31 = gmx_fjsp_invsqrt_v2r8(rsq31);
996 rinv32 = gmx_fjsp_invsqrt_v2r8(rsq32);
997 rinv33 = gmx_fjsp_invsqrt_v2r8(rsq33);
999 rinvsq11 = _fjsp_mul_v2r8(rinv11,rinv11);
1000 rinvsq12 = _fjsp_mul_v2r8(rinv12,rinv12);
1001 rinvsq13 = _fjsp_mul_v2r8(rinv13,rinv13);
1002 rinvsq21 = _fjsp_mul_v2r8(rinv21,rinv21);
1003 rinvsq22 = _fjsp_mul_v2r8(rinv22,rinv22);
1004 rinvsq23 = _fjsp_mul_v2r8(rinv23,rinv23);
1005 rinvsq31 = _fjsp_mul_v2r8(rinv31,rinv31);
1006 rinvsq32 = _fjsp_mul_v2r8(rinv32,rinv32);
1007 rinvsq33 = _fjsp_mul_v2r8(rinv33,rinv33);
1009 fjx1 = _fjsp_setzero_v2r8();
1010 fjy1 = _fjsp_setzero_v2r8();
1011 fjz1 = _fjsp_setzero_v2r8();
1012 fjx2 = _fjsp_setzero_v2r8();
1013 fjy2 = _fjsp_setzero_v2r8();
1014 fjz2 = _fjsp_setzero_v2r8();
1015 fjx3 = _fjsp_setzero_v2r8();
1016 fjy3 = _fjsp_setzero_v2r8();
1017 fjz3 = _fjsp_setzero_v2r8();
1019 /**************************
1020 * CALCULATE INTERACTIONS *
1021 **************************/
1023 /* REACTION-FIELD ELECTROSTATICS */
1024 felec = _fjsp_mul_v2r8(qq11,_fjsp_msub_v2r8(rinv11,rinvsq11,krf2));
1028 /* Update vectorial force */
1029 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
1030 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
1031 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
1033 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
1034 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
1035 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
1037 /**************************
1038 * CALCULATE INTERACTIONS *
1039 **************************/
1041 /* REACTION-FIELD ELECTROSTATICS */
1042 felec = _fjsp_mul_v2r8(qq12,_fjsp_msub_v2r8(rinv12,rinvsq12,krf2));
1046 /* Update vectorial force */
1047 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
1048 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
1049 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
1051 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
1052 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
1053 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
1055 /**************************
1056 * CALCULATE INTERACTIONS *
1057 **************************/
1059 /* REACTION-FIELD ELECTROSTATICS */
1060 felec = _fjsp_mul_v2r8(qq13,_fjsp_msub_v2r8(rinv13,rinvsq13,krf2));
1064 /* Update vectorial force */
1065 fix1 = _fjsp_madd_v2r8(dx13,fscal,fix1);
1066 fiy1 = _fjsp_madd_v2r8(dy13,fscal,fiy1);
1067 fiz1 = _fjsp_madd_v2r8(dz13,fscal,fiz1);
1069 fjx3 = _fjsp_madd_v2r8(dx13,fscal,fjx3);
1070 fjy3 = _fjsp_madd_v2r8(dy13,fscal,fjy3);
1071 fjz3 = _fjsp_madd_v2r8(dz13,fscal,fjz3);
1073 /**************************
1074 * CALCULATE INTERACTIONS *
1075 **************************/
1077 /* REACTION-FIELD ELECTROSTATICS */
1078 felec = _fjsp_mul_v2r8(qq21,_fjsp_msub_v2r8(rinv21,rinvsq21,krf2));
1082 /* Update vectorial force */
1083 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
1084 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
1085 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
1087 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
1088 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
1089 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
1091 /**************************
1092 * CALCULATE INTERACTIONS *
1093 **************************/
1095 /* REACTION-FIELD ELECTROSTATICS */
1096 felec = _fjsp_mul_v2r8(qq22,_fjsp_msub_v2r8(rinv22,rinvsq22,krf2));
1100 /* Update vectorial force */
1101 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
1102 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
1103 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
1105 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
1106 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
1107 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
1109 /**************************
1110 * CALCULATE INTERACTIONS *
1111 **************************/
1113 /* REACTION-FIELD ELECTROSTATICS */
1114 felec = _fjsp_mul_v2r8(qq23,_fjsp_msub_v2r8(rinv23,rinvsq23,krf2));
1118 /* Update vectorial force */
1119 fix2 = _fjsp_madd_v2r8(dx23,fscal,fix2);
1120 fiy2 = _fjsp_madd_v2r8(dy23,fscal,fiy2);
1121 fiz2 = _fjsp_madd_v2r8(dz23,fscal,fiz2);
1123 fjx3 = _fjsp_madd_v2r8(dx23,fscal,fjx3);
1124 fjy3 = _fjsp_madd_v2r8(dy23,fscal,fjy3);
1125 fjz3 = _fjsp_madd_v2r8(dz23,fscal,fjz3);
1127 /**************************
1128 * CALCULATE INTERACTIONS *
1129 **************************/
1131 /* REACTION-FIELD ELECTROSTATICS */
1132 felec = _fjsp_mul_v2r8(qq31,_fjsp_msub_v2r8(rinv31,rinvsq31,krf2));
1136 /* Update vectorial force */
1137 fix3 = _fjsp_madd_v2r8(dx31,fscal,fix3);
1138 fiy3 = _fjsp_madd_v2r8(dy31,fscal,fiy3);
1139 fiz3 = _fjsp_madd_v2r8(dz31,fscal,fiz3);
1141 fjx1 = _fjsp_madd_v2r8(dx31,fscal,fjx1);
1142 fjy1 = _fjsp_madd_v2r8(dy31,fscal,fjy1);
1143 fjz1 = _fjsp_madd_v2r8(dz31,fscal,fjz1);
1145 /**************************
1146 * CALCULATE INTERACTIONS *
1147 **************************/
1149 /* REACTION-FIELD ELECTROSTATICS */
1150 felec = _fjsp_mul_v2r8(qq32,_fjsp_msub_v2r8(rinv32,rinvsq32,krf2));
1154 /* Update vectorial force */
1155 fix3 = _fjsp_madd_v2r8(dx32,fscal,fix3);
1156 fiy3 = _fjsp_madd_v2r8(dy32,fscal,fiy3);
1157 fiz3 = _fjsp_madd_v2r8(dz32,fscal,fiz3);
1159 fjx2 = _fjsp_madd_v2r8(dx32,fscal,fjx2);
1160 fjy2 = _fjsp_madd_v2r8(dy32,fscal,fjy2);
1161 fjz2 = _fjsp_madd_v2r8(dz32,fscal,fjz2);
1163 /**************************
1164 * CALCULATE INTERACTIONS *
1165 **************************/
1167 /* REACTION-FIELD ELECTROSTATICS */
1168 felec = _fjsp_mul_v2r8(qq33,_fjsp_msub_v2r8(rinv33,rinvsq33,krf2));
1172 /* Update vectorial force */
1173 fix3 = _fjsp_madd_v2r8(dx33,fscal,fix3);
1174 fiy3 = _fjsp_madd_v2r8(dy33,fscal,fiy3);
1175 fiz3 = _fjsp_madd_v2r8(dz33,fscal,fiz3);
1177 fjx3 = _fjsp_madd_v2r8(dx33,fscal,fjx3);
1178 fjy3 = _fjsp_madd_v2r8(dy33,fscal,fjy3);
1179 fjz3 = _fjsp_madd_v2r8(dz33,fscal,fjz3);
1181 gmx_fjsp_decrement_3rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA+DIM,f+j_coord_offsetB+DIM,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2,fjx3,fjy3,fjz3);
1183 /* Inner loop uses 270 flops */
1186 if(jidx<j_index_end)
1190 j_coord_offsetA = DIM*jnrA;
1192 /* load j atom coordinates */
1193 gmx_fjsp_load_3rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA+DIM,
1194 &jx1,&jy1,&jz1,&jx2,&jy2,&jz2,&jx3,&jy3,&jz3);
1196 /* Calculate displacement vector */
1197 dx11 = _fjsp_sub_v2r8(ix1,jx1);
1198 dy11 = _fjsp_sub_v2r8(iy1,jy1);
1199 dz11 = _fjsp_sub_v2r8(iz1,jz1);
1200 dx12 = _fjsp_sub_v2r8(ix1,jx2);
1201 dy12 = _fjsp_sub_v2r8(iy1,jy2);
1202 dz12 = _fjsp_sub_v2r8(iz1,jz2);
1203 dx13 = _fjsp_sub_v2r8(ix1,jx3);
1204 dy13 = _fjsp_sub_v2r8(iy1,jy3);
1205 dz13 = _fjsp_sub_v2r8(iz1,jz3);
1206 dx21 = _fjsp_sub_v2r8(ix2,jx1);
1207 dy21 = _fjsp_sub_v2r8(iy2,jy1);
1208 dz21 = _fjsp_sub_v2r8(iz2,jz1);
1209 dx22 = _fjsp_sub_v2r8(ix2,jx2);
1210 dy22 = _fjsp_sub_v2r8(iy2,jy2);
1211 dz22 = _fjsp_sub_v2r8(iz2,jz2);
1212 dx23 = _fjsp_sub_v2r8(ix2,jx3);
1213 dy23 = _fjsp_sub_v2r8(iy2,jy3);
1214 dz23 = _fjsp_sub_v2r8(iz2,jz3);
1215 dx31 = _fjsp_sub_v2r8(ix3,jx1);
1216 dy31 = _fjsp_sub_v2r8(iy3,jy1);
1217 dz31 = _fjsp_sub_v2r8(iz3,jz1);
1218 dx32 = _fjsp_sub_v2r8(ix3,jx2);
1219 dy32 = _fjsp_sub_v2r8(iy3,jy2);
1220 dz32 = _fjsp_sub_v2r8(iz3,jz2);
1221 dx33 = _fjsp_sub_v2r8(ix3,jx3);
1222 dy33 = _fjsp_sub_v2r8(iy3,jy3);
1223 dz33 = _fjsp_sub_v2r8(iz3,jz3);
1225 /* Calculate squared distance and things based on it */
1226 rsq11 = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
1227 rsq12 = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
1228 rsq13 = gmx_fjsp_calc_rsq_v2r8(dx13,dy13,dz13);
1229 rsq21 = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
1230 rsq22 = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
1231 rsq23 = gmx_fjsp_calc_rsq_v2r8(dx23,dy23,dz23);
1232 rsq31 = gmx_fjsp_calc_rsq_v2r8(dx31,dy31,dz31);
1233 rsq32 = gmx_fjsp_calc_rsq_v2r8(dx32,dy32,dz32);
1234 rsq33 = gmx_fjsp_calc_rsq_v2r8(dx33,dy33,dz33);
1236 rinv11 = gmx_fjsp_invsqrt_v2r8(rsq11);
1237 rinv12 = gmx_fjsp_invsqrt_v2r8(rsq12);
1238 rinv13 = gmx_fjsp_invsqrt_v2r8(rsq13);
1239 rinv21 = gmx_fjsp_invsqrt_v2r8(rsq21);
1240 rinv22 = gmx_fjsp_invsqrt_v2r8(rsq22);
1241 rinv23 = gmx_fjsp_invsqrt_v2r8(rsq23);
1242 rinv31 = gmx_fjsp_invsqrt_v2r8(rsq31);
1243 rinv32 = gmx_fjsp_invsqrt_v2r8(rsq32);
1244 rinv33 = gmx_fjsp_invsqrt_v2r8(rsq33);
1246 rinvsq11 = _fjsp_mul_v2r8(rinv11,rinv11);
1247 rinvsq12 = _fjsp_mul_v2r8(rinv12,rinv12);
1248 rinvsq13 = _fjsp_mul_v2r8(rinv13,rinv13);
1249 rinvsq21 = _fjsp_mul_v2r8(rinv21,rinv21);
1250 rinvsq22 = _fjsp_mul_v2r8(rinv22,rinv22);
1251 rinvsq23 = _fjsp_mul_v2r8(rinv23,rinv23);
1252 rinvsq31 = _fjsp_mul_v2r8(rinv31,rinv31);
1253 rinvsq32 = _fjsp_mul_v2r8(rinv32,rinv32);
1254 rinvsq33 = _fjsp_mul_v2r8(rinv33,rinv33);
1256 fjx1 = _fjsp_setzero_v2r8();
1257 fjy1 = _fjsp_setzero_v2r8();
1258 fjz1 = _fjsp_setzero_v2r8();
1259 fjx2 = _fjsp_setzero_v2r8();
1260 fjy2 = _fjsp_setzero_v2r8();
1261 fjz2 = _fjsp_setzero_v2r8();
1262 fjx3 = _fjsp_setzero_v2r8();
1263 fjy3 = _fjsp_setzero_v2r8();
1264 fjz3 = _fjsp_setzero_v2r8();
1266 /**************************
1267 * CALCULATE INTERACTIONS *
1268 **************************/
1270 /* REACTION-FIELD ELECTROSTATICS */
1271 felec = _fjsp_mul_v2r8(qq11,_fjsp_msub_v2r8(rinv11,rinvsq11,krf2));
1275 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1277 /* Update vectorial force */
1278 fix1 = _fjsp_madd_v2r8(dx11,fscal,fix1);
1279 fiy1 = _fjsp_madd_v2r8(dy11,fscal,fiy1);
1280 fiz1 = _fjsp_madd_v2r8(dz11,fscal,fiz1);
1282 fjx1 = _fjsp_madd_v2r8(dx11,fscal,fjx1);
1283 fjy1 = _fjsp_madd_v2r8(dy11,fscal,fjy1);
1284 fjz1 = _fjsp_madd_v2r8(dz11,fscal,fjz1);
1286 /**************************
1287 * CALCULATE INTERACTIONS *
1288 **************************/
1290 /* REACTION-FIELD ELECTROSTATICS */
1291 felec = _fjsp_mul_v2r8(qq12,_fjsp_msub_v2r8(rinv12,rinvsq12,krf2));
1295 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1297 /* Update vectorial force */
1298 fix1 = _fjsp_madd_v2r8(dx12,fscal,fix1);
1299 fiy1 = _fjsp_madd_v2r8(dy12,fscal,fiy1);
1300 fiz1 = _fjsp_madd_v2r8(dz12,fscal,fiz1);
1302 fjx2 = _fjsp_madd_v2r8(dx12,fscal,fjx2);
1303 fjy2 = _fjsp_madd_v2r8(dy12,fscal,fjy2);
1304 fjz2 = _fjsp_madd_v2r8(dz12,fscal,fjz2);
1306 /**************************
1307 * CALCULATE INTERACTIONS *
1308 **************************/
1310 /* REACTION-FIELD ELECTROSTATICS */
1311 felec = _fjsp_mul_v2r8(qq13,_fjsp_msub_v2r8(rinv13,rinvsq13,krf2));
1315 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1317 /* Update vectorial force */
1318 fix1 = _fjsp_madd_v2r8(dx13,fscal,fix1);
1319 fiy1 = _fjsp_madd_v2r8(dy13,fscal,fiy1);
1320 fiz1 = _fjsp_madd_v2r8(dz13,fscal,fiz1);
1322 fjx3 = _fjsp_madd_v2r8(dx13,fscal,fjx3);
1323 fjy3 = _fjsp_madd_v2r8(dy13,fscal,fjy3);
1324 fjz3 = _fjsp_madd_v2r8(dz13,fscal,fjz3);
1326 /**************************
1327 * CALCULATE INTERACTIONS *
1328 **************************/
1330 /* REACTION-FIELD ELECTROSTATICS */
1331 felec = _fjsp_mul_v2r8(qq21,_fjsp_msub_v2r8(rinv21,rinvsq21,krf2));
1335 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1337 /* Update vectorial force */
1338 fix2 = _fjsp_madd_v2r8(dx21,fscal,fix2);
1339 fiy2 = _fjsp_madd_v2r8(dy21,fscal,fiy2);
1340 fiz2 = _fjsp_madd_v2r8(dz21,fscal,fiz2);
1342 fjx1 = _fjsp_madd_v2r8(dx21,fscal,fjx1);
1343 fjy1 = _fjsp_madd_v2r8(dy21,fscal,fjy1);
1344 fjz1 = _fjsp_madd_v2r8(dz21,fscal,fjz1);
1346 /**************************
1347 * CALCULATE INTERACTIONS *
1348 **************************/
1350 /* REACTION-FIELD ELECTROSTATICS */
1351 felec = _fjsp_mul_v2r8(qq22,_fjsp_msub_v2r8(rinv22,rinvsq22,krf2));
1355 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1357 /* Update vectorial force */
1358 fix2 = _fjsp_madd_v2r8(dx22,fscal,fix2);
1359 fiy2 = _fjsp_madd_v2r8(dy22,fscal,fiy2);
1360 fiz2 = _fjsp_madd_v2r8(dz22,fscal,fiz2);
1362 fjx2 = _fjsp_madd_v2r8(dx22,fscal,fjx2);
1363 fjy2 = _fjsp_madd_v2r8(dy22,fscal,fjy2);
1364 fjz2 = _fjsp_madd_v2r8(dz22,fscal,fjz2);
1366 /**************************
1367 * CALCULATE INTERACTIONS *
1368 **************************/
1370 /* REACTION-FIELD ELECTROSTATICS */
1371 felec = _fjsp_mul_v2r8(qq23,_fjsp_msub_v2r8(rinv23,rinvsq23,krf2));
1375 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1377 /* Update vectorial force */
1378 fix2 = _fjsp_madd_v2r8(dx23,fscal,fix2);
1379 fiy2 = _fjsp_madd_v2r8(dy23,fscal,fiy2);
1380 fiz2 = _fjsp_madd_v2r8(dz23,fscal,fiz2);
1382 fjx3 = _fjsp_madd_v2r8(dx23,fscal,fjx3);
1383 fjy3 = _fjsp_madd_v2r8(dy23,fscal,fjy3);
1384 fjz3 = _fjsp_madd_v2r8(dz23,fscal,fjz3);
1386 /**************************
1387 * CALCULATE INTERACTIONS *
1388 **************************/
1390 /* REACTION-FIELD ELECTROSTATICS */
1391 felec = _fjsp_mul_v2r8(qq31,_fjsp_msub_v2r8(rinv31,rinvsq31,krf2));
1395 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1397 /* Update vectorial force */
1398 fix3 = _fjsp_madd_v2r8(dx31,fscal,fix3);
1399 fiy3 = _fjsp_madd_v2r8(dy31,fscal,fiy3);
1400 fiz3 = _fjsp_madd_v2r8(dz31,fscal,fiz3);
1402 fjx1 = _fjsp_madd_v2r8(dx31,fscal,fjx1);
1403 fjy1 = _fjsp_madd_v2r8(dy31,fscal,fjy1);
1404 fjz1 = _fjsp_madd_v2r8(dz31,fscal,fjz1);
1406 /**************************
1407 * CALCULATE INTERACTIONS *
1408 **************************/
1410 /* REACTION-FIELD ELECTROSTATICS */
1411 felec = _fjsp_mul_v2r8(qq32,_fjsp_msub_v2r8(rinv32,rinvsq32,krf2));
1415 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1417 /* Update vectorial force */
1418 fix3 = _fjsp_madd_v2r8(dx32,fscal,fix3);
1419 fiy3 = _fjsp_madd_v2r8(dy32,fscal,fiy3);
1420 fiz3 = _fjsp_madd_v2r8(dz32,fscal,fiz3);
1422 fjx2 = _fjsp_madd_v2r8(dx32,fscal,fjx2);
1423 fjy2 = _fjsp_madd_v2r8(dy32,fscal,fjy2);
1424 fjz2 = _fjsp_madd_v2r8(dz32,fscal,fjz2);
1426 /**************************
1427 * CALCULATE INTERACTIONS *
1428 **************************/
1430 /* REACTION-FIELD ELECTROSTATICS */
1431 felec = _fjsp_mul_v2r8(qq33,_fjsp_msub_v2r8(rinv33,rinvsq33,krf2));
1435 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1437 /* Update vectorial force */
1438 fix3 = _fjsp_madd_v2r8(dx33,fscal,fix3);
1439 fiy3 = _fjsp_madd_v2r8(dy33,fscal,fiy3);
1440 fiz3 = _fjsp_madd_v2r8(dz33,fscal,fiz3);
1442 fjx3 = _fjsp_madd_v2r8(dx33,fscal,fjx3);
1443 fjy3 = _fjsp_madd_v2r8(dy33,fscal,fjy3);
1444 fjz3 = _fjsp_madd_v2r8(dz33,fscal,fjz3);
1446 gmx_fjsp_decrement_3rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA+DIM,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2,fjx3,fjy3,fjz3);
1448 /* Inner loop uses 270 flops */
1451 /* End of innermost loop */
1453 gmx_fjsp_update_iforce_3atom_swizzle_v2r8(fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
1454 f+i_coord_offset+DIM,fshift+i_shift_offset);
1456 /* Increment number of inner iterations */
1457 inneriter += j_index_end - j_index_start;
1459 /* Outer loop uses 18 flops */
1462 /* Increment number of outer iterations */
1465 /* Update outer/inner flops */
1467 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_W4W4_F,outeriter*18 + inneriter*270);