2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2012, by the GROMACS development team, led by
5 * David van der Spoel, Berk Hess, Erik Lindahl, and including many
6 * others, as listed in the AUTHORS file in the top-level source
7 * 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"
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_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_1pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
447 /* LENNARD-JONES DISPERSION/REPULSION */
449 rinvsix = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
450 vvdw6 = _fjsp_mul_v2r8(c6_00,rinvsix);
451 vvdw12 = _fjsp_mul_v2r8(c12_00,_fjsp_mul_v2r8(rinvsix,rinvsix));
452 vvdw = _fjsp_msub_v2r8(_fjsp_nmsub_v2r8(c12_00,_fjsp_mul_v2r8(sh_vdw_invrcut6,sh_vdw_invrcut6),vvdw12),one_twelfth,
453 _fjsp_mul_v2r8(_fjsp_nmsub_v2r8( c6_00,sh_vdw_invrcut6,vvdw6),one_sixth));
454 fvdw = _fjsp_mul_v2r8(_fjsp_sub_v2r8(vvdw12,vvdw6),rinvsq00);
456 cutoff_mask = _fjsp_cmplt_v2r8(rsq00,rcutoff2);
458 /* Update potential sum for this i atom from the interaction with this j atom. */
459 vvdw = _fjsp_and_v2r8(vvdw,cutoff_mask);
460 vvdw = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
461 vvdwsum = _fjsp_add_v2r8(vvdwsum,vvdw);
465 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
467 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
469 /* Update vectorial force */
470 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
471 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
472 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
474 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
475 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
476 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
480 /**************************
481 * CALCULATE INTERACTIONS *
482 **************************/
484 if (gmx_fjsp_any_lt_v2r8(rsq10,rcutoff2))
487 /* Compute parameters for interactions between i and j atoms */
488 qq10 = _fjsp_mul_v2r8(iq1,jq0);
490 /* REACTION-FIELD ELECTROSTATICS */
491 velec = _fjsp_mul_v2r8(qq10,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq10,rinv10),crf));
492 felec = _fjsp_mul_v2r8(qq10,_fjsp_msub_v2r8(rinv10,rinvsq10,krf2));
494 cutoff_mask = _fjsp_cmplt_v2r8(rsq10,rcutoff2);
496 /* Update potential sum for this i atom from the interaction with this j atom. */
497 velec = _fjsp_and_v2r8(velec,cutoff_mask);
498 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
499 velecsum = _fjsp_add_v2r8(velecsum,velec);
503 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
505 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
507 /* Update vectorial force */
508 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
509 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
510 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
512 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
513 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
514 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
518 /**************************
519 * CALCULATE INTERACTIONS *
520 **************************/
522 if (gmx_fjsp_any_lt_v2r8(rsq20,rcutoff2))
525 /* Compute parameters for interactions between i and j atoms */
526 qq20 = _fjsp_mul_v2r8(iq2,jq0);
528 /* REACTION-FIELD ELECTROSTATICS */
529 velec = _fjsp_mul_v2r8(qq20,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq20,rinv20),crf));
530 felec = _fjsp_mul_v2r8(qq20,_fjsp_msub_v2r8(rinv20,rinvsq20,krf2));
532 cutoff_mask = _fjsp_cmplt_v2r8(rsq20,rcutoff2);
534 /* Update potential sum for this i atom from the interaction with this j atom. */
535 velec = _fjsp_and_v2r8(velec,cutoff_mask);
536 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
537 velecsum = _fjsp_add_v2r8(velecsum,velec);
541 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
543 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
545 /* Update vectorial force */
546 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
547 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
548 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
550 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
551 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
552 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
556 /**************************
557 * CALCULATE INTERACTIONS *
558 **************************/
560 if (gmx_fjsp_any_lt_v2r8(rsq30,rcutoff2))
563 /* Compute parameters for interactions between i and j atoms */
564 qq30 = _fjsp_mul_v2r8(iq3,jq0);
566 /* REACTION-FIELD ELECTROSTATICS */
567 velec = _fjsp_mul_v2r8(qq30,_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq30,rinv30),crf));
568 felec = _fjsp_mul_v2r8(qq30,_fjsp_msub_v2r8(rinv30,rinvsq30,krf2));
570 cutoff_mask = _fjsp_cmplt_v2r8(rsq30,rcutoff2);
572 /* Update potential sum for this i atom from the interaction with this j atom. */
573 velec = _fjsp_and_v2r8(velec,cutoff_mask);
574 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
575 velecsum = _fjsp_add_v2r8(velecsum,velec);
579 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
581 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
583 /* Update vectorial force */
584 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
585 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
586 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
588 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
589 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
590 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
594 gmx_fjsp_decrement_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0);
596 /* Inner loop uses 164 flops */
599 /* End of innermost loop */
601 gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
602 f+i_coord_offset,fshift+i_shift_offset);
605 /* Update potential energies */
606 gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
607 gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
609 /* Increment number of inner iterations */
610 inneriter += j_index_end - j_index_start;
612 /* Outer loop uses 26 flops */
615 /* Increment number of outer iterations */
618 /* Update outer/inner flops */
620 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4_VF,outeriter*26 + inneriter*164);
623 * Gromacs nonbonded kernel: nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_F_sparc64_hpc_ace_double
624 * Electrostatics interaction: ReactionField
625 * VdW interaction: LennardJones
626 * Geometry: Water4-Particle
627 * Calculate force/pot: Force
630 nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_F_sparc64_hpc_ace_double
631 (t_nblist * gmx_restrict nlist,
632 rvec * gmx_restrict xx,
633 rvec * gmx_restrict ff,
634 t_forcerec * gmx_restrict fr,
635 t_mdatoms * gmx_restrict mdatoms,
636 nb_kernel_data_t * gmx_restrict kernel_data,
637 t_nrnb * gmx_restrict nrnb)
639 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
640 * just 0 for non-waters.
641 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
642 * jnr indices corresponding to data put in the four positions in the SIMD register.
644 int i_shift_offset,i_coord_offset,outeriter,inneriter;
645 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
647 int j_coord_offsetA,j_coord_offsetB;
648 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
650 real *shiftvec,*fshift,*x,*f;
651 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
653 _fjsp_v2r8 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
655 _fjsp_v2r8 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
657 _fjsp_v2r8 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
659 _fjsp_v2r8 ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
660 int vdwjidx0A,vdwjidx0B;
661 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
662 _fjsp_v2r8 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
663 _fjsp_v2r8 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
664 _fjsp_v2r8 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
665 _fjsp_v2r8 dx30,dy30,dz30,rsq30,rinv30,rinvsq30,r30,qq30,c6_30,c12_30;
666 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
669 _fjsp_v2r8 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
672 _fjsp_v2r8 one_sixth = gmx_fjsp_set1_v2r8(1.0/6.0);
673 _fjsp_v2r8 one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
675 _fjsp_v2r8 dummy_mask,cutoff_mask;
676 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
677 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
678 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
685 jindex = nlist->jindex;
687 shiftidx = nlist->shift;
689 shiftvec = fr->shift_vec[0];
690 fshift = fr->fshift[0];
691 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
692 charge = mdatoms->chargeA;
693 krf = gmx_fjsp_set1_v2r8(fr->ic->k_rf);
694 krf2 = gmx_fjsp_set1_v2r8(fr->ic->k_rf*2.0);
695 crf = gmx_fjsp_set1_v2r8(fr->ic->c_rf);
696 nvdwtype = fr->ntype;
698 vdwtype = mdatoms->typeA;
700 /* Setup water-specific parameters */
701 inr = nlist->iinr[0];
702 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
703 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
704 iq3 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+3]));
705 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
707 /* When we use explicit cutoffs the value must be identical for elec and VdW, so use elec as an arbitrary choice */
708 rcutoff_scalar = fr->rcoulomb;
709 rcutoff = gmx_fjsp_set1_v2r8(rcutoff_scalar);
710 rcutoff2 = _fjsp_mul_v2r8(rcutoff,rcutoff);
712 sh_vdw_invrcut6 = gmx_fjsp_set1_v2r8(fr->ic->sh_invrc6);
713 rvdw = gmx_fjsp_set1_v2r8(fr->rvdw);
715 /* Avoid stupid compiler warnings */
723 /* Start outer loop over neighborlists */
724 for(iidx=0; iidx<nri; iidx++)
726 /* Load shift vector for this list */
727 i_shift_offset = DIM*shiftidx[iidx];
729 /* Load limits for loop over neighbors */
730 j_index_start = jindex[iidx];
731 j_index_end = jindex[iidx+1];
733 /* Get outer coordinate index */
735 i_coord_offset = DIM*inr;
737 /* Load i particle coords and add shift vector */
738 gmx_fjsp_load_shift_and_4rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
739 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
741 fix0 = _fjsp_setzero_v2r8();
742 fiy0 = _fjsp_setzero_v2r8();
743 fiz0 = _fjsp_setzero_v2r8();
744 fix1 = _fjsp_setzero_v2r8();
745 fiy1 = _fjsp_setzero_v2r8();
746 fiz1 = _fjsp_setzero_v2r8();
747 fix2 = _fjsp_setzero_v2r8();
748 fiy2 = _fjsp_setzero_v2r8();
749 fiz2 = _fjsp_setzero_v2r8();
750 fix3 = _fjsp_setzero_v2r8();
751 fiy3 = _fjsp_setzero_v2r8();
752 fiz3 = _fjsp_setzero_v2r8();
754 /* Start inner kernel loop */
755 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
758 /* Get j neighbor index, and coordinate index */
761 j_coord_offsetA = DIM*jnrA;
762 j_coord_offsetB = DIM*jnrB;
764 /* load j atom coordinates */
765 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
768 /* Calculate displacement vector */
769 dx00 = _fjsp_sub_v2r8(ix0,jx0);
770 dy00 = _fjsp_sub_v2r8(iy0,jy0);
771 dz00 = _fjsp_sub_v2r8(iz0,jz0);
772 dx10 = _fjsp_sub_v2r8(ix1,jx0);
773 dy10 = _fjsp_sub_v2r8(iy1,jy0);
774 dz10 = _fjsp_sub_v2r8(iz1,jz0);
775 dx20 = _fjsp_sub_v2r8(ix2,jx0);
776 dy20 = _fjsp_sub_v2r8(iy2,jy0);
777 dz20 = _fjsp_sub_v2r8(iz2,jz0);
778 dx30 = _fjsp_sub_v2r8(ix3,jx0);
779 dy30 = _fjsp_sub_v2r8(iy3,jy0);
780 dz30 = _fjsp_sub_v2r8(iz3,jz0);
782 /* Calculate squared distance and things based on it */
783 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
784 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
785 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
786 rsq30 = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
788 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
789 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
790 rinv30 = gmx_fjsp_invsqrt_v2r8(rsq30);
792 rinvsq00 = gmx_fjsp_inv_v2r8(rsq00);
793 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
794 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
795 rinvsq30 = _fjsp_mul_v2r8(rinv30,rinv30);
797 /* Load parameters for j particles */
798 jq0 = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
799 vdwjidx0A = 2*vdwtype[jnrA+0];
800 vdwjidx0B = 2*vdwtype[jnrB+0];
802 fjx0 = _fjsp_setzero_v2r8();
803 fjy0 = _fjsp_setzero_v2r8();
804 fjz0 = _fjsp_setzero_v2r8();
806 /**************************
807 * CALCULATE INTERACTIONS *
808 **************************/
810 if (gmx_fjsp_any_lt_v2r8(rsq00,rcutoff2))
813 /* Compute parameters for interactions between i and j atoms */
814 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
815 vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
817 /* LENNARD-JONES DISPERSION/REPULSION */
819 rinvsix = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
820 fvdw = _fjsp_mul_v2r8(_fjsp_msub_v2r8(c12_00,rinvsix,c6_00),_fjsp_mul_v2r8(rinvsix,rinvsq00));
822 cutoff_mask = _fjsp_cmplt_v2r8(rsq00,rcutoff2);
826 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
828 /* Update vectorial force */
829 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
830 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
831 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
833 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
834 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
835 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
839 /**************************
840 * CALCULATE INTERACTIONS *
841 **************************/
843 if (gmx_fjsp_any_lt_v2r8(rsq10,rcutoff2))
846 /* Compute parameters for interactions between i and j atoms */
847 qq10 = _fjsp_mul_v2r8(iq1,jq0);
849 /* REACTION-FIELD ELECTROSTATICS */
850 felec = _fjsp_mul_v2r8(qq10,_fjsp_msub_v2r8(rinv10,rinvsq10,krf2));
852 cutoff_mask = _fjsp_cmplt_v2r8(rsq10,rcutoff2);
856 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
858 /* Update vectorial force */
859 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
860 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
861 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
863 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
864 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
865 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
869 /**************************
870 * CALCULATE INTERACTIONS *
871 **************************/
873 if (gmx_fjsp_any_lt_v2r8(rsq20,rcutoff2))
876 /* Compute parameters for interactions between i and j atoms */
877 qq20 = _fjsp_mul_v2r8(iq2,jq0);
879 /* REACTION-FIELD ELECTROSTATICS */
880 felec = _fjsp_mul_v2r8(qq20,_fjsp_msub_v2r8(rinv20,rinvsq20,krf2));
882 cutoff_mask = _fjsp_cmplt_v2r8(rsq20,rcutoff2);
886 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
888 /* Update vectorial force */
889 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
890 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
891 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
893 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
894 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
895 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
899 /**************************
900 * CALCULATE INTERACTIONS *
901 **************************/
903 if (gmx_fjsp_any_lt_v2r8(rsq30,rcutoff2))
906 /* Compute parameters for interactions between i and j atoms */
907 qq30 = _fjsp_mul_v2r8(iq3,jq0);
909 /* REACTION-FIELD ELECTROSTATICS */
910 felec = _fjsp_mul_v2r8(qq30,_fjsp_msub_v2r8(rinv30,rinvsq30,krf2));
912 cutoff_mask = _fjsp_cmplt_v2r8(rsq30,rcutoff2);
916 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
918 /* Update vectorial force */
919 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
920 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
921 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
923 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
924 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
925 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
929 gmx_fjsp_decrement_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0);
931 /* Inner loop uses 135 flops */
938 j_coord_offsetA = DIM*jnrA;
940 /* load j atom coordinates */
941 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
944 /* Calculate displacement vector */
945 dx00 = _fjsp_sub_v2r8(ix0,jx0);
946 dy00 = _fjsp_sub_v2r8(iy0,jy0);
947 dz00 = _fjsp_sub_v2r8(iz0,jz0);
948 dx10 = _fjsp_sub_v2r8(ix1,jx0);
949 dy10 = _fjsp_sub_v2r8(iy1,jy0);
950 dz10 = _fjsp_sub_v2r8(iz1,jz0);
951 dx20 = _fjsp_sub_v2r8(ix2,jx0);
952 dy20 = _fjsp_sub_v2r8(iy2,jy0);
953 dz20 = _fjsp_sub_v2r8(iz2,jz0);
954 dx30 = _fjsp_sub_v2r8(ix3,jx0);
955 dy30 = _fjsp_sub_v2r8(iy3,jy0);
956 dz30 = _fjsp_sub_v2r8(iz3,jz0);
958 /* Calculate squared distance and things based on it */
959 rsq00 = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
960 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
961 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
962 rsq30 = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
964 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
965 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
966 rinv30 = gmx_fjsp_invsqrt_v2r8(rsq30);
968 rinvsq00 = gmx_fjsp_inv_v2r8(rsq00);
969 rinvsq10 = _fjsp_mul_v2r8(rinv10,rinv10);
970 rinvsq20 = _fjsp_mul_v2r8(rinv20,rinv20);
971 rinvsq30 = _fjsp_mul_v2r8(rinv30,rinv30);
973 /* Load parameters for j particles */
974 jq0 = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
975 vdwjidx0A = 2*vdwtype[jnrA+0];
977 fjx0 = _fjsp_setzero_v2r8();
978 fjy0 = _fjsp_setzero_v2r8();
979 fjz0 = _fjsp_setzero_v2r8();
981 /**************************
982 * CALCULATE INTERACTIONS *
983 **************************/
985 if (gmx_fjsp_any_lt_v2r8(rsq00,rcutoff2))
988 /* Compute parameters for interactions between i and j atoms */
989 gmx_fjsp_load_1pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
991 /* LENNARD-JONES DISPERSION/REPULSION */
993 rinvsix = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
994 fvdw = _fjsp_mul_v2r8(_fjsp_msub_v2r8(c12_00,rinvsix,c6_00),_fjsp_mul_v2r8(rinvsix,rinvsq00));
996 cutoff_mask = _fjsp_cmplt_v2r8(rsq00,rcutoff2);
1000 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
1002 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1004 /* Update vectorial force */
1005 fix0 = _fjsp_madd_v2r8(dx00,fscal,fix0);
1006 fiy0 = _fjsp_madd_v2r8(dy00,fscal,fiy0);
1007 fiz0 = _fjsp_madd_v2r8(dz00,fscal,fiz0);
1009 fjx0 = _fjsp_madd_v2r8(dx00,fscal,fjx0);
1010 fjy0 = _fjsp_madd_v2r8(dy00,fscal,fjy0);
1011 fjz0 = _fjsp_madd_v2r8(dz00,fscal,fjz0);
1015 /**************************
1016 * CALCULATE INTERACTIONS *
1017 **************************/
1019 if (gmx_fjsp_any_lt_v2r8(rsq10,rcutoff2))
1022 /* Compute parameters for interactions between i and j atoms */
1023 qq10 = _fjsp_mul_v2r8(iq1,jq0);
1025 /* REACTION-FIELD ELECTROSTATICS */
1026 felec = _fjsp_mul_v2r8(qq10,_fjsp_msub_v2r8(rinv10,rinvsq10,krf2));
1028 cutoff_mask = _fjsp_cmplt_v2r8(rsq10,rcutoff2);
1032 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
1034 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1036 /* Update vectorial force */
1037 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
1038 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
1039 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
1041 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
1042 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
1043 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
1047 /**************************
1048 * CALCULATE INTERACTIONS *
1049 **************************/
1051 if (gmx_fjsp_any_lt_v2r8(rsq20,rcutoff2))
1054 /* Compute parameters for interactions between i and j atoms */
1055 qq20 = _fjsp_mul_v2r8(iq2,jq0);
1057 /* REACTION-FIELD ELECTROSTATICS */
1058 felec = _fjsp_mul_v2r8(qq20,_fjsp_msub_v2r8(rinv20,rinvsq20,krf2));
1060 cutoff_mask = _fjsp_cmplt_v2r8(rsq20,rcutoff2);
1064 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
1066 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1068 /* Update vectorial force */
1069 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
1070 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
1071 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
1073 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
1074 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
1075 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
1079 /**************************
1080 * CALCULATE INTERACTIONS *
1081 **************************/
1083 if (gmx_fjsp_any_lt_v2r8(rsq30,rcutoff2))
1086 /* Compute parameters for interactions between i and j atoms */
1087 qq30 = _fjsp_mul_v2r8(iq3,jq0);
1089 /* REACTION-FIELD ELECTROSTATICS */
1090 felec = _fjsp_mul_v2r8(qq30,_fjsp_msub_v2r8(rinv30,rinvsq30,krf2));
1092 cutoff_mask = _fjsp_cmplt_v2r8(rsq30,rcutoff2);
1096 fscal = _fjsp_and_v2r8(fscal,cutoff_mask);
1098 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1100 /* Update vectorial force */
1101 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
1102 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
1103 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
1105 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
1106 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
1107 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
1111 gmx_fjsp_decrement_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0);
1113 /* Inner loop uses 135 flops */
1116 /* End of innermost loop */
1118 gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
1119 f+i_coord_offset,fshift+i_shift_offset);
1121 /* Increment number of inner iterations */
1122 inneriter += j_index_end - j_index_start;
1124 /* Outer loop uses 24 flops */
1127 /* Increment number of outer iterations */
1130 /* Update outer/inner flops */
1132 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4_F,outeriter*24 + inneriter*135);