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 "gromacs/legacyheaders/types/simple.h"
46 #include "gromacs/math/vec.h"
47 #include "gromacs/legacyheaders/nrnb.h"
49 #include "kernelutil_sparc64_hpc_ace_double.h"
52 * Gromacs nonbonded kernel: nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_VF_sparc64_hpc_ace_double
53 * Electrostatics interaction: ReactionField
54 * VdW interaction: LennardJones
55 * Geometry: Water4-Particle
56 * Calculate force/pot: PotentialAndForce
59 nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_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;
88 _fjsp_v2r8 ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
89 int vdwjidx0A,vdwjidx0B;
90 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
91 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
92 _fjsp_v2r8 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
93 _fjsp_v2r8 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
94 _fjsp_v2r8 dx30,dy30,dz30,rsq30,rinv30,rinvsq30,r30,qq30,c6_30,c12_30;
95 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
98 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
101 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
102 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
104 _fjsp_v2r8 dummy_mask,cutoff_mask;
105 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
106 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
107 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
114 jindex = nlist->jindex;
116 shiftidx = nlist->shift;
118 shiftvec = fr->shift_vec[0];
119 fshift = fr->fshift[0];
120 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
121 charge = mdatoms->chargeA;
122 krf = gmx_fjsp_set1_v2r8(fr->ic->k_rf);
123 krf2 = gmx_fjsp_set1_v2r8(fr->ic->k_rf*2.0);
124 crf = gmx_fjsp_set1_v2r8(fr->ic->c_rf);
125 nvdwtype = fr->ntype;
127 vdwtype = mdatoms->typeA;
129 /* Setup water-specific parameters */
130 inr = nlist->iinr[0];
131 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
132 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
133 iq3 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+3]));
134 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
136 /* When we use explicit cutoffs the value must be identical for elec and VdW, so use elec as an arbitrary choice */
137 rcutoff_scalar = fr->rcoulomb;
138 rcutoff = gmx_fjsp_set1_v2r8(rcutoff_scalar);
139 rcutoff2 = _fjsp_mul_v2r8(rcutoff,rcutoff);
141 sh_vdw_invrcut6 = gmx_fjsp_set1_v2r8(fr->ic->sh_invrc6);
142 rvdw = gmx_fjsp_set1_v2r8(fr->rvdw);
144 /* Avoid stupid compiler warnings */
152 /* Start outer loop over neighborlists */
153 for(iidx=0; iidx<nri; iidx++)
155 /* Load shift vector for this list */
156 i_shift_offset = DIM*shiftidx[iidx];
158 /* Load limits for loop over neighbors */
159 j_index_start = jindex[iidx];
160 j_index_end = jindex[iidx+1];
162 /* Get outer coordinate index */
164 i_coord_offset = DIM*inr;
166 /* Load i particle coords and add shift vector */
167 gmx_fjsp_load_shift_and_4rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
168 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
170 fix0 = _fjsp_setzero_v2r8();
171 fiy0 = _fjsp_setzero_v2r8();
172 fiz0 = _fjsp_setzero_v2r8();
173 fix1 = _fjsp_setzero_v2r8();
174 fiy1 = _fjsp_setzero_v2r8();
175 fiz1 = _fjsp_setzero_v2r8();
176 fix2 = _fjsp_setzero_v2r8();
177 fiy2 = _fjsp_setzero_v2r8();
178 fiz2 = _fjsp_setzero_v2r8();
179 fix3 = _fjsp_setzero_v2r8();
180 fiy3 = _fjsp_setzero_v2r8();
181 fiz3 = _fjsp_setzero_v2r8();
183 /* Reset potential sums */
184 velecsum = _fjsp_setzero_v2r8();
185 vvdwsum = _fjsp_setzero_v2r8();
187 /* Start inner kernel loop */
188 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
191 /* Get j neighbor index, and coordinate index */
194 j_coord_offsetA = DIM*jnrA;
195 j_coord_offsetB = DIM*jnrB;
197 /* load j atom coordinates */
198 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
201 /* Calculate displacement vector */
202 dx00 = _fjsp_sub_v2r8(ix0,jx0);
203 dy00 = _fjsp_sub_v2r8(iy0,jy0);
204 dz00 = _fjsp_sub_v2r8(iz0,jz0);
205 dx10 = _fjsp_sub_v2r8(ix1,jx0);
206 dy10 = _fjsp_sub_v2r8(iy1,jy0);
207 dz10 = _fjsp_sub_v2r8(iz1,jz0);
208 dx20 = _fjsp_sub_v2r8(ix2,jx0);
209 dy20 = _fjsp_sub_v2r8(iy2,jy0);
210 dz20 = _fjsp_sub_v2r8(iz2,jz0);
211 dx30 = _fjsp_sub_v2r8(ix3,jx0);
212 dy30 = _fjsp_sub_v2r8(iy3,jy0);
213 dz30 = _fjsp_sub_v2r8(iz3,jz0);
215 /* Calculate squared distance and things based on it */
216 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
217 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
218 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
219 rsq30 = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
221 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
222 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
223 rinv30 = gmx_fjsp_invsqrt_v2r8(rsq30);
225 rinvsq00 = gmx_fjsp_inv_v2r8(rsq00);
226 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
227 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
228 rinvsq30 = _fjsp_mul_v2r8(rinv30,rinv30);
230 /* Load parameters for j particles */
231 jq0 = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
232 vdwjidx0A = 2*vdwtype[jnrA+0];
233 vdwjidx0B = 2*vdwtype[jnrB+0];
235 fjx0 = _fjsp_setzero_v2r8();
236 fjy0 = _fjsp_setzero_v2r8();
237 fjz0 = _fjsp_setzero_v2r8();
239 /**************************
240 * CALCULATE INTERACTIONS *
241 **************************/
243 if (gmx_fjsp_any_lt_v2r8(rsq00,rcutoff2))
246 /* Compute parameters for interactions between i and j atoms */
247 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
248 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
250 /* LENNARD-JONES DISPERSION/REPULSION */
252 rinvsix = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
253 vvdw6 = _fjsp_mul_v2r8(c6_00,rinvsix);
254 vvdw12 = _fjsp_mul_v2r8(c12_00,_fjsp_mul_v2r8(rinvsix,rinvsix));
255 vvdw = _fjsp_msub_v2r8(_fjsp_nmsub_v2r8(c12_00,_fjsp_mul_v2r8(sh_vdw_invrcut6,sh_vdw_invrcut6),vvdw12),one_twelfth,
256 _fjsp_mul_v2r8(_fjsp_nmsub_v2r8( c6_00,sh_vdw_invrcut6,vvdw6),one_sixth));
257 fvdw = _fjsp_mul_v2r8(_fjsp_sub_v2r8(vvdw12,vvdw6),rinvsq00);
259 cutoff_mask = _fjsp_cmplt_v2r8(rsq00,rcutoff2);
261 /* Update potential sum for this i atom from the interaction with this j atom. */
262 vvdw = _fjsp_and_v2r8(vvdw,cutoff_mask);
263 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
267 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
269 /* Update vectorial force */
270 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
271 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
272 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
274 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
275 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
276 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
280 /**************************
281 * CALCULATE INTERACTIONS *
282 **************************/
284 if (gmx_fjsp_any_lt_v2r8(rsq10,rcutoff2))
287 /* Compute parameters for interactions between i and j atoms */
288 qq10 = _fjsp_mul_v2r8(iq1,jq0);
290 /* REACTION-FIELD ELECTROSTATICS */
291 velec = _fjsp_mul_v2r8(qq10,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq10,rinv10),crf));
292 felec = _fjsp_mul_v2r8(qq10,_fjsp_msub_v2r8(rinv10,rinvsq10,krf2));
294 cutoff_mask = _fjsp_cmplt_v2r8(rsq10,rcutoff2);
296 /* Update potential sum for this i atom from the interaction with this j atom. */
297 velec = _fjsp_and_v2r8(velec,cutoff_mask);
298 velecsum = _fjsp_add_v2r8(velecsum,velec);
302 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
304 /* Update vectorial force */
305 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
306 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
307 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
309 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
310 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
311 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
315 /**************************
316 * CALCULATE INTERACTIONS *
317 **************************/
319 if (gmx_fjsp_any_lt_v2r8(rsq20,rcutoff2))
322 /* Compute parameters for interactions between i and j atoms */
323 qq20 = _fjsp_mul_v2r8(iq2,jq0);
325 /* REACTION-FIELD ELECTROSTATICS */
326 velec = _fjsp_mul_v2r8(qq20,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq20,rinv20),crf));
327 felec = _fjsp_mul_v2r8(qq20,_fjsp_msub_v2r8(rinv20,rinvsq20,krf2));
329 cutoff_mask = _fjsp_cmplt_v2r8(rsq20,rcutoff2);
331 /* Update potential sum for this i atom from the interaction with this j atom. */
332 velec = _fjsp_and_v2r8(velec,cutoff_mask);
333 velecsum = _fjsp_add_v2r8(velecsum,velec);
337 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
339 /* Update vectorial force */
340 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
341 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
342 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
344 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
345 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
346 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
350 /**************************
351 * CALCULATE INTERACTIONS *
352 **************************/
354 if (gmx_fjsp_any_lt_v2r8(rsq30,rcutoff2))
357 /* Compute parameters for interactions between i and j atoms */
358 qq30 = _fjsp_mul_v2r8(iq3,jq0);
360 /* REACTION-FIELD ELECTROSTATICS */
361 velec = _fjsp_mul_v2r8(qq30,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq30,rinv30),crf));
362 felec = _fjsp_mul_v2r8(qq30,_fjsp_msub_v2r8(rinv30,rinvsq30,krf2));
364 cutoff_mask = _fjsp_cmplt_v2r8(rsq30,rcutoff2);
366 /* Update potential sum for this i atom from the interaction with this j atom. */
367 velec = _fjsp_and_v2r8(velec,cutoff_mask);
368 velecsum = _fjsp_add_v2r8(velecsum,velec);
372 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
374 /* Update vectorial force */
375 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
376 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
377 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
379 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
380 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
381 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
385 gmx_fjsp_decrement_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0);
387 /* Inner loop uses 164 flops */
394 j_coord_offsetA = DIM*jnrA;
396 /* load j atom coordinates */
397 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
400 /* Calculate displacement vector */
401 dx00 = _fjsp_sub_v2r8(ix0,jx0);
402 dy00 = _fjsp_sub_v2r8(iy0,jy0);
403 dz00 = _fjsp_sub_v2r8(iz0,jz0);
404 dx10 = _fjsp_sub_v2r8(ix1,jx0);
405 dy10 = _fjsp_sub_v2r8(iy1,jy0);
406 dz10 = _fjsp_sub_v2r8(iz1,jz0);
407 dx20 = _fjsp_sub_v2r8(ix2,jx0);
408 dy20 = _fjsp_sub_v2r8(iy2,jy0);
409 dz20 = _fjsp_sub_v2r8(iz2,jz0);
410 dx30 = _fjsp_sub_v2r8(ix3,jx0);
411 dy30 = _fjsp_sub_v2r8(iy3,jy0);
412 dz30 = _fjsp_sub_v2r8(iz3,jz0);
414 /* Calculate squared distance and things based on it */
415 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
416 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
417 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
418 rsq30 = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
420 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
421 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
422 rinv30 = gmx_fjsp_invsqrt_v2r8(rsq30);
424 rinvsq00 = gmx_fjsp_inv_v2r8(rsq00);
425 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
426 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
427 rinvsq30 = _fjsp_mul_v2r8(rinv30,rinv30);
429 /* Load parameters for j particles */
430 jq0 = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
431 vdwjidx0A = 2*vdwtype[jnrA+0];
433 fjx0 = _fjsp_setzero_v2r8();
434 fjy0 = _fjsp_setzero_v2r8();
435 fjz0 = _fjsp_setzero_v2r8();
437 /**************************
438 * CALCULATE INTERACTIONS *
439 **************************/
441 if (gmx_fjsp_any_lt_v2r8(rsq00,rcutoff2))
444 /* Compute parameters for interactions between i and j atoms */
445 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
446 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
448 /* LENNARD-JONES DISPERSION/REPULSION */
450 rinvsix = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
451 vvdw6 = _fjsp_mul_v2r8(c6_00,rinvsix);
452 vvdw12 = _fjsp_mul_v2r8(c12_00,_fjsp_mul_v2r8(rinvsix,rinvsix));
453 vvdw = _fjsp_msub_v2r8(_fjsp_nmsub_v2r8(c12_00,_fjsp_mul_v2r8(sh_vdw_invrcut6,sh_vdw_invrcut6),vvdw12),one_twelfth,
454 _fjsp_mul_v2r8(_fjsp_nmsub_v2r8( c6_00,sh_vdw_invrcut6,vvdw6),one_sixth));
455 fvdw = _fjsp_mul_v2r8(_fjsp_sub_v2r8(vvdw12,vvdw6),rinvsq00);
457 cutoff_mask = _fjsp_cmplt_v2r8(rsq00,rcutoff2);
459 /* Update potential sum for this i atom from the interaction with this j atom. */
460 vvdw = _fjsp_and_v2r8(vvdw,cutoff_mask);
461 vvdw = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
462 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
466 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
468 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
470 /* Update vectorial force */
471 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
472 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
473 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
475 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
476 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
477 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
481 /**************************
482 * CALCULATE INTERACTIONS *
483 **************************/
485 if (gmx_fjsp_any_lt_v2r8(rsq10,rcutoff2))
488 /* Compute parameters for interactions between i and j atoms */
489 qq10 = _fjsp_mul_v2r8(iq1,jq0);
491 /* REACTION-FIELD ELECTROSTATICS */
492 velec = _fjsp_mul_v2r8(qq10,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq10,rinv10),crf));
493 felec = _fjsp_mul_v2r8(qq10,_fjsp_msub_v2r8(rinv10,rinvsq10,krf2));
495 cutoff_mask = _fjsp_cmplt_v2r8(rsq10,rcutoff2);
497 /* Update potential sum for this i atom from the interaction with this j atom. */
498 velec = _fjsp_and_v2r8(velec,cutoff_mask);
499 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
500 velecsum = _fjsp_add_v2r8(velecsum,velec);
504 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
506 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
508 /* Update vectorial force */
509 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
510 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
511 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
513 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
514 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
515 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
519 /**************************
520 * CALCULATE INTERACTIONS *
521 **************************/
523 if (gmx_fjsp_any_lt_v2r8(rsq20,rcutoff2))
526 /* Compute parameters for interactions between i and j atoms */
527 qq20 = _fjsp_mul_v2r8(iq2,jq0);
529 /* REACTION-FIELD ELECTROSTATICS */
530 velec = _fjsp_mul_v2r8(qq20,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq20,rinv20),crf));
531 felec = _fjsp_mul_v2r8(qq20,_fjsp_msub_v2r8(rinv20,rinvsq20,krf2));
533 cutoff_mask = _fjsp_cmplt_v2r8(rsq20,rcutoff2);
535 /* Update potential sum for this i atom from the interaction with this j atom. */
536 velec = _fjsp_and_v2r8(velec,cutoff_mask);
537 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
538 velecsum = _fjsp_add_v2r8(velecsum,velec);
542 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
544 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
546 /* Update vectorial force */
547 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
548 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
549 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
551 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
552 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
553 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
557 /**************************
558 * CALCULATE INTERACTIONS *
559 **************************/
561 if (gmx_fjsp_any_lt_v2r8(rsq30,rcutoff2))
564 /* Compute parameters for interactions between i and j atoms */
565 qq30 = _fjsp_mul_v2r8(iq3,jq0);
567 /* REACTION-FIELD ELECTROSTATICS */
568 velec = _fjsp_mul_v2r8(qq30,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq30,rinv30),crf));
569 felec = _fjsp_mul_v2r8(qq30,_fjsp_msub_v2r8(rinv30,rinvsq30,krf2));
571 cutoff_mask = _fjsp_cmplt_v2r8(rsq30,rcutoff2);
573 /* Update potential sum for this i atom from the interaction with this j atom. */
574 velec = _fjsp_and_v2r8(velec,cutoff_mask);
575 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
576 velecsum = _fjsp_add_v2r8(velecsum,velec);
580 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
582 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
584 /* Update vectorial force */
585 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
586 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
587 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
589 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
590 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
591 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
595 gmx_fjsp_decrement_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0);
597 /* Inner loop uses 164 flops */
600 /* End of innermost loop */
602 gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
603 f+i_coord_offset,fshift+i_shift_offset);
606 /* Update potential energies */
607 gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
608 gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
610 /* Increment number of inner iterations */
611 inneriter += j_index_end - j_index_start;
613 /* Outer loop uses 26 flops */
616 /* Increment number of outer iterations */
619 /* Update outer/inner flops */
621 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4_VF,outeriter*26 + inneriter*164);
624 * Gromacs nonbonded kernel: nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_F_sparc64_hpc_ace_double
625 * Electrostatics interaction: ReactionField
626 * VdW interaction: LennardJones
627 * Geometry: Water4-Particle
628 * Calculate force/pot: Force
631 nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_F_sparc64_hpc_ace_double
632 (t_nblist * gmx_restrict nlist,
633 rvec * gmx_restrict xx,
634 rvec * gmx_restrict ff,
635 t_forcerec * gmx_restrict fr,
636 t_mdatoms * gmx_restrict mdatoms,
637 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
638 t_nrnb * gmx_restrict nrnb)
640 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
641 * just 0 for non-waters.
642 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
643 * jnr indices corresponding to data put in the four positions in the SIMD register.
645 int i_shift_offset,i_coord_offset,outeriter,inneriter;
646 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
648 int j_coord_offsetA,j_coord_offsetB;
649 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
651 real *shiftvec,*fshift,*x,*f;
652 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
654 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
656 _fjsp_v2r8 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
658 _fjsp_v2r8 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
660 _fjsp_v2r8 ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
661 int vdwjidx0A,vdwjidx0B;
662 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
663 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
664 _fjsp_v2r8 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
665 _fjsp_v2r8 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
666 _fjsp_v2r8 dx30,dy30,dz30,rsq30,rinv30,rinvsq30,r30,qq30,c6_30,c12_30;
667 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
670 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
673 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
674 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
676 _fjsp_v2r8 dummy_mask,cutoff_mask;
677 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
678 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
679 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
686 jindex = nlist->jindex;
688 shiftidx = nlist->shift;
690 shiftvec = fr->shift_vec[0];
691 fshift = fr->fshift[0];
692 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
693 charge = mdatoms->chargeA;
694 krf = gmx_fjsp_set1_v2r8(fr->ic->k_rf);
695 krf2 = gmx_fjsp_set1_v2r8(fr->ic->k_rf*2.0);
696 crf = gmx_fjsp_set1_v2r8(fr->ic->c_rf);
697 nvdwtype = fr->ntype;
699 vdwtype = mdatoms->typeA;
701 /* Setup water-specific parameters */
702 inr = nlist->iinr[0];
703 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
704 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
705 iq3 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+3]));
706 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
708 /* When we use explicit cutoffs the value must be identical for elec and VdW, so use elec as an arbitrary choice */
709 rcutoff_scalar = fr->rcoulomb;
710 rcutoff = gmx_fjsp_set1_v2r8(rcutoff_scalar);
711 rcutoff2 = _fjsp_mul_v2r8(rcutoff,rcutoff);
713 sh_vdw_invrcut6 = gmx_fjsp_set1_v2r8(fr->ic->sh_invrc6);
714 rvdw = gmx_fjsp_set1_v2r8(fr->rvdw);
716 /* Avoid stupid compiler warnings */
724 /* Start outer loop over neighborlists */
725 for(iidx=0; iidx<nri; iidx++)
727 /* Load shift vector for this list */
728 i_shift_offset = DIM*shiftidx[iidx];
730 /* Load limits for loop over neighbors */
731 j_index_start = jindex[iidx];
732 j_index_end = jindex[iidx+1];
734 /* Get outer coordinate index */
736 i_coord_offset = DIM*inr;
738 /* Load i particle coords and add shift vector */
739 gmx_fjsp_load_shift_and_4rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
740 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
742 fix0 = _fjsp_setzero_v2r8();
743 fiy0 = _fjsp_setzero_v2r8();
744 fiz0 = _fjsp_setzero_v2r8();
745 fix1 = _fjsp_setzero_v2r8();
746 fiy1 = _fjsp_setzero_v2r8();
747 fiz1 = _fjsp_setzero_v2r8();
748 fix2 = _fjsp_setzero_v2r8();
749 fiy2 = _fjsp_setzero_v2r8();
750 fiz2 = _fjsp_setzero_v2r8();
751 fix3 = _fjsp_setzero_v2r8();
752 fiy3 = _fjsp_setzero_v2r8();
753 fiz3 = _fjsp_setzero_v2r8();
755 /* Start inner kernel loop */
756 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
759 /* Get j neighbor index, and coordinate index */
762 j_coord_offsetA = DIM*jnrA;
763 j_coord_offsetB = DIM*jnrB;
765 /* load j atom coordinates */
766 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
769 /* Calculate displacement vector */
770 dx00 = _fjsp_sub_v2r8(ix0,jx0);
771 dy00 = _fjsp_sub_v2r8(iy0,jy0);
772 dz00 = _fjsp_sub_v2r8(iz0,jz0);
773 dx10 = _fjsp_sub_v2r8(ix1,jx0);
774 dy10 = _fjsp_sub_v2r8(iy1,jy0);
775 dz10 = _fjsp_sub_v2r8(iz1,jz0);
776 dx20 = _fjsp_sub_v2r8(ix2,jx0);
777 dy20 = _fjsp_sub_v2r8(iy2,jy0);
778 dz20 = _fjsp_sub_v2r8(iz2,jz0);
779 dx30 = _fjsp_sub_v2r8(ix3,jx0);
780 dy30 = _fjsp_sub_v2r8(iy3,jy0);
781 dz30 = _fjsp_sub_v2r8(iz3,jz0);
783 /* Calculate squared distance and things based on it */
784 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
785 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
786 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
787 rsq30 = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
789 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
790 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
791 rinv30 = gmx_fjsp_invsqrt_v2r8(rsq30);
793 rinvsq00 = gmx_fjsp_inv_v2r8(rsq00);
794 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
795 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
796 rinvsq30 = _fjsp_mul_v2r8(rinv30,rinv30);
798 /* Load parameters for j particles */
799 jq0 = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
800 vdwjidx0A = 2*vdwtype[jnrA+0];
801 vdwjidx0B = 2*vdwtype[jnrB+0];
803 fjx0 = _fjsp_setzero_v2r8();
804 fjy0 = _fjsp_setzero_v2r8();
805 fjz0 = _fjsp_setzero_v2r8();
807 /**************************
808 * CALCULATE INTERACTIONS *
809 **************************/
811 if (gmx_fjsp_any_lt_v2r8(rsq00,rcutoff2))
814 /* Compute parameters for interactions between i and j atoms */
815 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
816 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
818 /* LENNARD-JONES DISPERSION/REPULSION */
820 rinvsix = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
821 fvdw = _fjsp_mul_v2r8(_fjsp_msub_v2r8(c12_00,rinvsix,c6_00),_fjsp_mul_v2r8(rinvsix,rinvsq00));
823 cutoff_mask = _fjsp_cmplt_v2r8(rsq00,rcutoff2);
827 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
829 /* Update vectorial force */
830 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
831 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
832 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
834 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
835 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
836 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
840 /**************************
841 * CALCULATE INTERACTIONS *
842 **************************/
844 if (gmx_fjsp_any_lt_v2r8(rsq10,rcutoff2))
847 /* Compute parameters for interactions between i and j atoms */
848 qq10 = _fjsp_mul_v2r8(iq1,jq0);
850 /* REACTION-FIELD ELECTROSTATICS */
851 felec = _fjsp_mul_v2r8(qq10,_fjsp_msub_v2r8(rinv10,rinvsq10,krf2));
853 cutoff_mask = _fjsp_cmplt_v2r8(rsq10,rcutoff2);
857 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
859 /* Update vectorial force */
860 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
861 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
862 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
864 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
865 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
866 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
870 /**************************
871 * CALCULATE INTERACTIONS *
872 **************************/
874 if (gmx_fjsp_any_lt_v2r8(rsq20,rcutoff2))
877 /* Compute parameters for interactions between i and j atoms */
878 qq20 = _fjsp_mul_v2r8(iq2,jq0);
880 /* REACTION-FIELD ELECTROSTATICS */
881 felec = _fjsp_mul_v2r8(qq20,_fjsp_msub_v2r8(rinv20,rinvsq20,krf2));
883 cutoff_mask = _fjsp_cmplt_v2r8(rsq20,rcutoff2);
887 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
889 /* Update vectorial force */
890 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
891 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
892 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
894 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
895 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
896 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
900 /**************************
901 * CALCULATE INTERACTIONS *
902 **************************/
904 if (gmx_fjsp_any_lt_v2r8(rsq30,rcutoff2))
907 /* Compute parameters for interactions between i and j atoms */
908 qq30 = _fjsp_mul_v2r8(iq3,jq0);
910 /* REACTION-FIELD ELECTROSTATICS */
911 felec = _fjsp_mul_v2r8(qq30,_fjsp_msub_v2r8(rinv30,rinvsq30,krf2));
913 cutoff_mask = _fjsp_cmplt_v2r8(rsq30,rcutoff2);
917 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
919 /* Update vectorial force */
920 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
921 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
922 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
924 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
925 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
926 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
930 gmx_fjsp_decrement_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0);
932 /* Inner loop uses 135 flops */
939 j_coord_offsetA = DIM*jnrA;
941 /* load j atom coordinates */
942 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
945 /* Calculate displacement vector */
946 dx00 = _fjsp_sub_v2r8(ix0,jx0);
947 dy00 = _fjsp_sub_v2r8(iy0,jy0);
948 dz00 = _fjsp_sub_v2r8(iz0,jz0);
949 dx10 = _fjsp_sub_v2r8(ix1,jx0);
950 dy10 = _fjsp_sub_v2r8(iy1,jy0);
951 dz10 = _fjsp_sub_v2r8(iz1,jz0);
952 dx20 = _fjsp_sub_v2r8(ix2,jx0);
953 dy20 = _fjsp_sub_v2r8(iy2,jy0);
954 dz20 = _fjsp_sub_v2r8(iz2,jz0);
955 dx30 = _fjsp_sub_v2r8(ix3,jx0);
956 dy30 = _fjsp_sub_v2r8(iy3,jy0);
957 dz30 = _fjsp_sub_v2r8(iz3,jz0);
959 /* Calculate squared distance and things based on it */
960 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
961 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
962 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
963 rsq30 = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
965 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
966 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
967 rinv30 = gmx_fjsp_invsqrt_v2r8(rsq30);
969 rinvsq00 = gmx_fjsp_inv_v2r8(rsq00);
970 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
971 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
972 rinvsq30 = _fjsp_mul_v2r8(rinv30,rinv30);
974 /* Load parameters for j particles */
975 jq0 = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
976 vdwjidx0A = 2*vdwtype[jnrA+0];
978 fjx0 = _fjsp_setzero_v2r8();
979 fjy0 = _fjsp_setzero_v2r8();
980 fjz0 = _fjsp_setzero_v2r8();
982 /**************************
983 * CALCULATE INTERACTIONS *
984 **************************/
986 if (gmx_fjsp_any_lt_v2r8(rsq00,rcutoff2))
989 /* Compute parameters for interactions between i and j atoms */
990 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
991 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
993 /* LENNARD-JONES DISPERSION/REPULSION */
995 rinvsix = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
996 fvdw = _fjsp_mul_v2r8(_fjsp_msub_v2r8(c12_00,rinvsix,c6_00),_fjsp_mul_v2r8(rinvsix,rinvsq00));
998 cutoff_mask = _fjsp_cmplt_v2r8(rsq00,rcutoff2);
1002 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
1004 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1006 /* Update vectorial force */
1007 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
1008 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
1009 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
1011 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
1012 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
1013 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
1017 /**************************
1018 * CALCULATE INTERACTIONS *
1019 **************************/
1021 if (gmx_fjsp_any_lt_v2r8(rsq10,rcutoff2))
1024 /* Compute parameters for interactions between i and j atoms */
1025 qq10 = _fjsp_mul_v2r8(iq1,jq0);
1027 /* REACTION-FIELD ELECTROSTATICS */
1028 felec = _fjsp_mul_v2r8(qq10,_fjsp_msub_v2r8(rinv10,rinvsq10,krf2));
1030 cutoff_mask = _fjsp_cmplt_v2r8(rsq10,rcutoff2);
1034 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
1036 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1038 /* Update vectorial force */
1039 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
1040 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
1041 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
1043 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
1044 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
1045 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
1049 /**************************
1050 * CALCULATE INTERACTIONS *
1051 **************************/
1053 if (gmx_fjsp_any_lt_v2r8(rsq20,rcutoff2))
1056 /* Compute parameters for interactions between i and j atoms */
1057 qq20 = _fjsp_mul_v2r8(iq2,jq0);
1059 /* REACTION-FIELD ELECTROSTATICS */
1060 felec = _fjsp_mul_v2r8(qq20,_fjsp_msub_v2r8(rinv20,rinvsq20,krf2));
1062 cutoff_mask = _fjsp_cmplt_v2r8(rsq20,rcutoff2);
1066 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
1068 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1070 /* Update vectorial force */
1071 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
1072 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
1073 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
1075 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
1076 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
1077 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
1081 /**************************
1082 * CALCULATE INTERACTIONS *
1083 **************************/
1085 if (gmx_fjsp_any_lt_v2r8(rsq30,rcutoff2))
1088 /* Compute parameters for interactions between i and j atoms */
1089 qq30 = _fjsp_mul_v2r8(iq3,jq0);
1091 /* REACTION-FIELD ELECTROSTATICS */
1092 felec = _fjsp_mul_v2r8(qq30,_fjsp_msub_v2r8(rinv30,rinvsq30,krf2));
1094 cutoff_mask = _fjsp_cmplt_v2r8(rsq30,rcutoff2);
1098 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
1100 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1102 /* Update vectorial force */
1103 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
1104 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
1105 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
1107 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
1108 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
1109 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
1113 gmx_fjsp_decrement_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0);
1115 /* Inner loop uses 135 flops */
1118 /* End of innermost loop */
1120 gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
1121 f+i_coord_offset,fshift+i_shift_offset);
1123 /* Increment number of inner iterations */
1124 inneriter += j_index_end - j_index_start;
1126 /* Outer loop uses 24 flops */
1129 /* Increment number of outer iterations */
1132 /* Update outer/inner flops */
1134 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4_F,outeriter*24 + inneriter*135);