Compile nonbonded kernels as C++
[alexxy/gromacs.git] / src / gromacs / gmxlib / nonbonded / nb_kernel_sparc64_hpc_ace_double / nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_sparc64_hpc_ace_double.cpp
1 /*
2  * This file is part of the GROMACS molecular simulation package.
3  *
4  * Copyright (c) 2012,2013,2014,2015,2017,2018, 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.
8  *
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.
13  *
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.
18  *
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.
23  *
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.
31  *
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.
34  */
35 /*
36  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
37  */
38 #include "gmxpre.h"
39
40 #include "config.h"
41
42 #include <math.h>
43
44 #include "../nb_kernel.h"
45 #include "gromacs/gmxlib/nrnb.h"
46
47 #include "kernelutil_sparc64_hpc_ace_double.h"
48
49 /*
50  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_VF_sparc64_hpc_ace_double
51  * Electrostatics interaction: Ewald
52  * VdW interaction:            LennardJones
53  * Geometry:                   Water4-Particle
54  * Calculate force/pot:        PotentialAndForce
55  */
56 void
57 nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_VF_sparc64_hpc_ace_double
58                     (t_nblist                    * gmx_restrict       nlist,
59                      rvec                        * gmx_restrict          xx,
60                      rvec                        * gmx_restrict          ff,
61                      struct t_forcerec           * gmx_restrict          fr,
62                      t_mdatoms                   * gmx_restrict     mdatoms,
63                      nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
64                      t_nrnb                      * gmx_restrict        nrnb)
65 {
66     /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
67      * just 0 for non-waters.
68      * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
69      * jnr indices corresponding to data put in the four positions in the SIMD register.
70      */
71     int              i_shift_offset,i_coord_offset,outeriter,inneriter;
72     int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
73     int              jnrA,jnrB;
74     int              j_coord_offsetA,j_coord_offsetB;
75     int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
76     real             rcutoff_scalar;
77     real             *shiftvec,*fshift,*x,*f;
78     _fjsp_v2r8       tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
79     int              vdwioffset0;
80     _fjsp_v2r8       ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
81     int              vdwioffset1;
82     _fjsp_v2r8       ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
83     int              vdwioffset2;
84     _fjsp_v2r8       ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
85     int              vdwioffset3;
86     _fjsp_v2r8       ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
87     int              vdwjidx0A,vdwjidx0B;
88     _fjsp_v2r8       jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
89     _fjsp_v2r8       dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
90     _fjsp_v2r8       dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
91     _fjsp_v2r8       dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
92     _fjsp_v2r8       dx30,dy30,dz30,rsq30,rinv30,rinvsq30,r30,qq30,c6_30,c12_30;
93     _fjsp_v2r8       velec,felec,velecsum,facel,crf,krf,krf2;
94     real             *charge;
95     int              nvdwtype;
96     _fjsp_v2r8       rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
97     int              *vdwtype;
98     real             *vdwparam;
99     _fjsp_v2r8       one_sixth   = gmx_fjsp_set1_v2r8(1.0/6.0);
100     _fjsp_v2r8       one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
101     _fjsp_v2r8       ewtabscale,eweps,sh_ewald,ewrt,ewtabhalfspace,ewtabF,ewtabFn,ewtabD,ewtabV;
102     real             *ewtab;
103     _fjsp_v2r8       itab_tmp;
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;
108
109     x                = xx[0];
110     f                = ff[0];
111
112     nri              = nlist->nri;
113     iinr             = nlist->iinr;
114     jindex           = nlist->jindex;
115     jjnr             = nlist->jjnr;
116     shiftidx         = nlist->shift;
117     gid              = nlist->gid;
118     shiftvec         = fr->shift_vec[0];
119     fshift           = fr->fshift[0];
120     facel            = gmx_fjsp_set1_v2r8(fr->ic->epsfac);
121     charge           = mdatoms->chargeA;
122     nvdwtype         = fr->ntype;
123     vdwparam         = fr->nbfp;
124     vdwtype          = mdatoms->typeA;
125
126     sh_ewald         = gmx_fjsp_set1_v2r8(fr->ic->sh_ewald);
127     ewtab            = fr->ic->tabq_coul_FDV0;
128     ewtabscale       = gmx_fjsp_set1_v2r8(fr->ic->tabq_scale);
129     ewtabhalfspace   = gmx_fjsp_set1_v2r8(0.5/fr->ic->tabq_scale);
130
131     /* Setup water-specific parameters */
132     inr              = nlist->iinr[0];
133     iq1              = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
134     iq2              = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
135     iq3              = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+3]));
136     vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
137
138     /* When we use explicit cutoffs the value must be identical for elec and VdW, so use elec as an arbitrary choice */
139     rcutoff_scalar   = fr->ic->rcoulomb;
140     rcutoff          = gmx_fjsp_set1_v2r8(rcutoff_scalar);
141     rcutoff2         = _fjsp_mul_v2r8(rcutoff,rcutoff);
142
143     sh_vdw_invrcut6  = gmx_fjsp_set1_v2r8(fr->ic->sh_invrc6);
144     rvdw             = gmx_fjsp_set1_v2r8(fr->ic->rvdw);
145
146     /* Avoid stupid compiler warnings */
147     jnrA = jnrB = 0;
148     j_coord_offsetA = 0;
149     j_coord_offsetB = 0;
150
151     outeriter        = 0;
152     inneriter        = 0;
153
154     /* Start outer loop over neighborlists */
155     for(iidx=0; iidx<nri; iidx++)
156     {
157         /* Load shift vector for this list */
158         i_shift_offset   = DIM*shiftidx[iidx];
159
160         /* Load limits for loop over neighbors */
161         j_index_start    = jindex[iidx];
162         j_index_end      = jindex[iidx+1];
163
164         /* Get outer coordinate index */
165         inr              = iinr[iidx];
166         i_coord_offset   = DIM*inr;
167
168         /* Load i particle coords and add shift vector */
169         gmx_fjsp_load_shift_and_4rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
170                                                  &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
171
172         fix0             = _fjsp_setzero_v2r8();
173         fiy0             = _fjsp_setzero_v2r8();
174         fiz0             = _fjsp_setzero_v2r8();
175         fix1             = _fjsp_setzero_v2r8();
176         fiy1             = _fjsp_setzero_v2r8();
177         fiz1             = _fjsp_setzero_v2r8();
178         fix2             = _fjsp_setzero_v2r8();
179         fiy2             = _fjsp_setzero_v2r8();
180         fiz2             = _fjsp_setzero_v2r8();
181         fix3             = _fjsp_setzero_v2r8();
182         fiy3             = _fjsp_setzero_v2r8();
183         fiz3             = _fjsp_setzero_v2r8();
184
185         /* Reset potential sums */
186         velecsum         = _fjsp_setzero_v2r8();
187         vvdwsum          = _fjsp_setzero_v2r8();
188
189         /* Start inner kernel loop */
190         for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
191         {
192
193             /* Get j neighbor index, and coordinate index */
194             jnrA             = jjnr[jidx];
195             jnrB             = jjnr[jidx+1];
196             j_coord_offsetA  = DIM*jnrA;
197             j_coord_offsetB  = DIM*jnrB;
198
199             /* load j atom coordinates */
200             gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
201                                               &jx0,&jy0,&jz0);
202
203             /* Calculate displacement vector */
204             dx00             = _fjsp_sub_v2r8(ix0,jx0);
205             dy00             = _fjsp_sub_v2r8(iy0,jy0);
206             dz00             = _fjsp_sub_v2r8(iz0,jz0);
207             dx10             = _fjsp_sub_v2r8(ix1,jx0);
208             dy10             = _fjsp_sub_v2r8(iy1,jy0);
209             dz10             = _fjsp_sub_v2r8(iz1,jz0);
210             dx20             = _fjsp_sub_v2r8(ix2,jx0);
211             dy20             = _fjsp_sub_v2r8(iy2,jy0);
212             dz20             = _fjsp_sub_v2r8(iz2,jz0);
213             dx30             = _fjsp_sub_v2r8(ix3,jx0);
214             dy30             = _fjsp_sub_v2r8(iy3,jy0);
215             dz30             = _fjsp_sub_v2r8(iz3,jz0);
216
217             /* Calculate squared distance and things based on it */
218             rsq00            = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
219             rsq10            = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
220             rsq20            = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
221             rsq30            = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
222
223             rinv10           = gmx_fjsp_invsqrt_v2r8(rsq10);
224             rinv20           = gmx_fjsp_invsqrt_v2r8(rsq20);
225             rinv30           = gmx_fjsp_invsqrt_v2r8(rsq30);
226
227             rinvsq00         = gmx_fjsp_inv_v2r8(rsq00);
228             rinvsq10         = _fjsp_mul_v2r8(rinv10,rinv10);
229             rinvsq20         = _fjsp_mul_v2r8(rinv20,rinv20);
230             rinvsq30         = _fjsp_mul_v2r8(rinv30,rinv30);
231
232             /* Load parameters for j particles */
233             jq0              = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
234             vdwjidx0A        = 2*vdwtype[jnrA+0];
235             vdwjidx0B        = 2*vdwtype[jnrB+0];
236
237             fjx0             = _fjsp_setzero_v2r8();
238             fjy0             = _fjsp_setzero_v2r8();
239             fjz0             = _fjsp_setzero_v2r8();
240
241             /**************************
242              * CALCULATE INTERACTIONS *
243              **************************/
244
245             if (gmx_fjsp_any_lt_v2r8(rsq00,rcutoff2))
246             {
247
248             /* Compute parameters for interactions between i and j atoms */
249             gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
250                                          vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
251
252             /* LENNARD-JONES DISPERSION/REPULSION */
253
254             rinvsix          = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
255             vvdw6            = _fjsp_mul_v2r8(c6_00,rinvsix);
256             vvdw12           = _fjsp_mul_v2r8(c12_00,_fjsp_mul_v2r8(rinvsix,rinvsix));
257             vvdw             = _fjsp_msub_v2r8(_fjsp_nmsub_v2r8(c12_00,_fjsp_mul_v2r8(sh_vdw_invrcut6,sh_vdw_invrcut6),vvdw12),one_twelfth,
258                                            _fjsp_mul_v2r8(_fjsp_nmsub_v2r8( c6_00,sh_vdw_invrcut6,vvdw6),one_sixth));
259             fvdw             = _fjsp_mul_v2r8(_fjsp_sub_v2r8(vvdw12,vvdw6),rinvsq00);
260
261             cutoff_mask      = _fjsp_cmplt_v2r8(rsq00,rcutoff2);
262
263             /* Update potential sum for this i atom from the interaction with this j atom. */
264             vvdw             = _fjsp_and_v2r8(vvdw,cutoff_mask);
265             vvdwsum          = _fjsp_add_v2r8(vvdwsum,vvdw);
266
267             fscal            = fvdw;
268
269             fscal            = _fjsp_and_v2r8(fscal,cutoff_mask);
270
271             /* Update vectorial force */
272             fix0             = _fjsp_madd_v2r8(dx00,fscal,fix0);
273             fiy0             = _fjsp_madd_v2r8(dy00,fscal,fiy0);
274             fiz0             = _fjsp_madd_v2r8(dz00,fscal,fiz0);
275             
276             fjx0             = _fjsp_madd_v2r8(dx00,fscal,fjx0);
277             fjy0             = _fjsp_madd_v2r8(dy00,fscal,fjy0);
278             fjz0             = _fjsp_madd_v2r8(dz00,fscal,fjz0);
279
280             }
281
282             /**************************
283              * CALCULATE INTERACTIONS *
284              **************************/
285
286             if (gmx_fjsp_any_lt_v2r8(rsq10,rcutoff2))
287             {
288
289             r10              = _fjsp_mul_v2r8(rsq10,rinv10);
290
291             /* Compute parameters for interactions between i and j atoms */
292             qq10             = _fjsp_mul_v2r8(iq1,jq0);
293
294             /* EWALD ELECTROSTATICS */
295
296             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
297             ewrt             = _fjsp_mul_v2r8(r10,ewtabscale);
298             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
299             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
300             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
301
302             ewtabF           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
303             ewtabD           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
304             GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
305             ewtabV           = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
306             ewtabFn          = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
307             GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
308             felec            = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
309             velec            = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
310             velec            = _fjsp_mul_v2r8(qq10,_fjsp_sub_v2r8(_fjsp_sub_v2r8(rinv10,sh_ewald),velec));
311             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,rinv10),_fjsp_sub_v2r8(rinvsq10,felec));
312
313             cutoff_mask      = _fjsp_cmplt_v2r8(rsq10,rcutoff2);
314
315             /* Update potential sum for this i atom from the interaction with this j atom. */
316             velec            = _fjsp_and_v2r8(velec,cutoff_mask);
317             velecsum         = _fjsp_add_v2r8(velecsum,velec);
318
319             fscal            = felec;
320
321             fscal            = _fjsp_and_v2r8(fscal,cutoff_mask);
322
323             /* Update vectorial force */
324             fix1             = _fjsp_madd_v2r8(dx10,fscal,fix1);
325             fiy1             = _fjsp_madd_v2r8(dy10,fscal,fiy1);
326             fiz1             = _fjsp_madd_v2r8(dz10,fscal,fiz1);
327             
328             fjx0             = _fjsp_madd_v2r8(dx10,fscal,fjx0);
329             fjy0             = _fjsp_madd_v2r8(dy10,fscal,fjy0);
330             fjz0             = _fjsp_madd_v2r8(dz10,fscal,fjz0);
331
332             }
333
334             /**************************
335              * CALCULATE INTERACTIONS *
336              **************************/
337
338             if (gmx_fjsp_any_lt_v2r8(rsq20,rcutoff2))
339             {
340
341             r20              = _fjsp_mul_v2r8(rsq20,rinv20);
342
343             /* Compute parameters for interactions between i and j atoms */
344             qq20             = _fjsp_mul_v2r8(iq2,jq0);
345
346             /* EWALD ELECTROSTATICS */
347
348             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
349             ewrt             = _fjsp_mul_v2r8(r20,ewtabscale);
350             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
351             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
352             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
353
354             ewtabF           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
355             ewtabD           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
356             GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
357             ewtabV           = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
358             ewtabFn          = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
359             GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
360             felec            = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
361             velec            = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
362             velec            = _fjsp_mul_v2r8(qq20,_fjsp_sub_v2r8(_fjsp_sub_v2r8(rinv20,sh_ewald),velec));
363             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,rinv20),_fjsp_sub_v2r8(rinvsq20,felec));
364
365             cutoff_mask      = _fjsp_cmplt_v2r8(rsq20,rcutoff2);
366
367             /* Update potential sum for this i atom from the interaction with this j atom. */
368             velec            = _fjsp_and_v2r8(velec,cutoff_mask);
369             velecsum         = _fjsp_add_v2r8(velecsum,velec);
370
371             fscal            = felec;
372
373             fscal            = _fjsp_and_v2r8(fscal,cutoff_mask);
374
375             /* Update vectorial force */
376             fix2             = _fjsp_madd_v2r8(dx20,fscal,fix2);
377             fiy2             = _fjsp_madd_v2r8(dy20,fscal,fiy2);
378             fiz2             = _fjsp_madd_v2r8(dz20,fscal,fiz2);
379             
380             fjx0             = _fjsp_madd_v2r8(dx20,fscal,fjx0);
381             fjy0             = _fjsp_madd_v2r8(dy20,fscal,fjy0);
382             fjz0             = _fjsp_madd_v2r8(dz20,fscal,fjz0);
383
384             }
385
386             /**************************
387              * CALCULATE INTERACTIONS *
388              **************************/
389
390             if (gmx_fjsp_any_lt_v2r8(rsq30,rcutoff2))
391             {
392
393             r30              = _fjsp_mul_v2r8(rsq30,rinv30);
394
395             /* Compute parameters for interactions between i and j atoms */
396             qq30             = _fjsp_mul_v2r8(iq3,jq0);
397
398             /* EWALD ELECTROSTATICS */
399
400             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
401             ewrt             = _fjsp_mul_v2r8(r30,ewtabscale);
402             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
403             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
404             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
405
406             ewtabF           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
407             ewtabD           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
408             GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
409             ewtabV           = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
410             ewtabFn          = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
411             GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
412             felec            = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
413             velec            = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
414             velec            = _fjsp_mul_v2r8(qq30,_fjsp_sub_v2r8(_fjsp_sub_v2r8(rinv30,sh_ewald),velec));
415             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq30,rinv30),_fjsp_sub_v2r8(rinvsq30,felec));
416
417             cutoff_mask      = _fjsp_cmplt_v2r8(rsq30,rcutoff2);
418
419             /* Update potential sum for this i atom from the interaction with this j atom. */
420             velec            = _fjsp_and_v2r8(velec,cutoff_mask);
421             velecsum         = _fjsp_add_v2r8(velecsum,velec);
422
423             fscal            = felec;
424
425             fscal            = _fjsp_and_v2r8(fscal,cutoff_mask);
426
427             /* Update vectorial force */
428             fix3             = _fjsp_madd_v2r8(dx30,fscal,fix3);
429             fiy3             = _fjsp_madd_v2r8(dy30,fscal,fiy3);
430             fiz3             = _fjsp_madd_v2r8(dz30,fscal,fiz3);
431             
432             fjx0             = _fjsp_madd_v2r8(dx30,fscal,fjx0);
433             fjy0             = _fjsp_madd_v2r8(dy30,fscal,fjy0);
434             fjz0             = _fjsp_madd_v2r8(dz30,fscal,fjz0);
435
436             }
437
438             gmx_fjsp_decrement_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0);
439
440             /* Inner loop uses 194 flops */
441         }
442
443         if(jidx<j_index_end)
444         {
445
446             jnrA             = jjnr[jidx];
447             j_coord_offsetA  = DIM*jnrA;
448
449             /* load j atom coordinates */
450             gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
451                                               &jx0,&jy0,&jz0);
452
453             /* Calculate displacement vector */
454             dx00             = _fjsp_sub_v2r8(ix0,jx0);
455             dy00             = _fjsp_sub_v2r8(iy0,jy0);
456             dz00             = _fjsp_sub_v2r8(iz0,jz0);
457             dx10             = _fjsp_sub_v2r8(ix1,jx0);
458             dy10             = _fjsp_sub_v2r8(iy1,jy0);
459             dz10             = _fjsp_sub_v2r8(iz1,jz0);
460             dx20             = _fjsp_sub_v2r8(ix2,jx0);
461             dy20             = _fjsp_sub_v2r8(iy2,jy0);
462             dz20             = _fjsp_sub_v2r8(iz2,jz0);
463             dx30             = _fjsp_sub_v2r8(ix3,jx0);
464             dy30             = _fjsp_sub_v2r8(iy3,jy0);
465             dz30             = _fjsp_sub_v2r8(iz3,jz0);
466
467             /* Calculate squared distance and things based on it */
468             rsq00            = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
469             rsq10            = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
470             rsq20            = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
471             rsq30            = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
472
473             rinv10           = gmx_fjsp_invsqrt_v2r8(rsq10);
474             rinv20           = gmx_fjsp_invsqrt_v2r8(rsq20);
475             rinv30           = gmx_fjsp_invsqrt_v2r8(rsq30);
476
477             rinvsq00         = gmx_fjsp_inv_v2r8(rsq00);
478             rinvsq10         = _fjsp_mul_v2r8(rinv10,rinv10);
479             rinvsq20         = _fjsp_mul_v2r8(rinv20,rinv20);
480             rinvsq30         = _fjsp_mul_v2r8(rinv30,rinv30);
481
482             /* Load parameters for j particles */
483             jq0              = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
484             vdwjidx0A        = 2*vdwtype[jnrA+0];
485
486             fjx0             = _fjsp_setzero_v2r8();
487             fjy0             = _fjsp_setzero_v2r8();
488             fjz0             = _fjsp_setzero_v2r8();
489
490             /**************************
491              * CALCULATE INTERACTIONS *
492              **************************/
493
494             if (gmx_fjsp_any_lt_v2r8(rsq00,rcutoff2))
495             {
496
497             /* Compute parameters for interactions between i and j atoms */
498             gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
499                                          vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
500
501             /* LENNARD-JONES DISPERSION/REPULSION */
502
503             rinvsix          = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
504             vvdw6            = _fjsp_mul_v2r8(c6_00,rinvsix);
505             vvdw12           = _fjsp_mul_v2r8(c12_00,_fjsp_mul_v2r8(rinvsix,rinvsix));
506             vvdw             = _fjsp_msub_v2r8(_fjsp_nmsub_v2r8(c12_00,_fjsp_mul_v2r8(sh_vdw_invrcut6,sh_vdw_invrcut6),vvdw12),one_twelfth,
507                                            _fjsp_mul_v2r8(_fjsp_nmsub_v2r8( c6_00,sh_vdw_invrcut6,vvdw6),one_sixth));
508             fvdw             = _fjsp_mul_v2r8(_fjsp_sub_v2r8(vvdw12,vvdw6),rinvsq00);
509
510             cutoff_mask      = _fjsp_cmplt_v2r8(rsq00,rcutoff2);
511
512             /* Update potential sum for this i atom from the interaction with this j atom. */
513             vvdw             = _fjsp_and_v2r8(vvdw,cutoff_mask);
514             vvdw             = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
515             vvdwsum          = _fjsp_add_v2r8(vvdwsum,vvdw);
516
517             fscal            = fvdw;
518
519             fscal            = _fjsp_and_v2r8(fscal,cutoff_mask);
520
521             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
522
523             /* Update vectorial force */
524             fix0             = _fjsp_madd_v2r8(dx00,fscal,fix0);
525             fiy0             = _fjsp_madd_v2r8(dy00,fscal,fiy0);
526             fiz0             = _fjsp_madd_v2r8(dz00,fscal,fiz0);
527             
528             fjx0             = _fjsp_madd_v2r8(dx00,fscal,fjx0);
529             fjy0             = _fjsp_madd_v2r8(dy00,fscal,fjy0);
530             fjz0             = _fjsp_madd_v2r8(dz00,fscal,fjz0);
531
532             }
533
534             /**************************
535              * CALCULATE INTERACTIONS *
536              **************************/
537
538             if (gmx_fjsp_any_lt_v2r8(rsq10,rcutoff2))
539             {
540
541             r10              = _fjsp_mul_v2r8(rsq10,rinv10);
542
543             /* Compute parameters for interactions between i and j atoms */
544             qq10             = _fjsp_mul_v2r8(iq1,jq0);
545
546             /* EWALD ELECTROSTATICS */
547
548             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
549             ewrt             = _fjsp_mul_v2r8(r10,ewtabscale);
550             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
551             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
552             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
553
554             ewtabF           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
555             ewtabD           = _fjsp_setzero_v2r8();
556             GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
557             ewtabV           = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
558             ewtabFn          = _fjsp_setzero_v2r8();
559             GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
560             felec            = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
561             velec            = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
562             velec            = _fjsp_mul_v2r8(qq10,_fjsp_sub_v2r8(_fjsp_sub_v2r8(rinv10,sh_ewald),velec));
563             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,rinv10),_fjsp_sub_v2r8(rinvsq10,felec));
564
565             cutoff_mask      = _fjsp_cmplt_v2r8(rsq10,rcutoff2);
566
567             /* Update potential sum for this i atom from the interaction with this j atom. */
568             velec            = _fjsp_and_v2r8(velec,cutoff_mask);
569             velec            = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
570             velecsum         = _fjsp_add_v2r8(velecsum,velec);
571
572             fscal            = felec;
573
574             fscal            = _fjsp_and_v2r8(fscal,cutoff_mask);
575
576             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
577
578             /* Update vectorial force */
579             fix1             = _fjsp_madd_v2r8(dx10,fscal,fix1);
580             fiy1             = _fjsp_madd_v2r8(dy10,fscal,fiy1);
581             fiz1             = _fjsp_madd_v2r8(dz10,fscal,fiz1);
582             
583             fjx0             = _fjsp_madd_v2r8(dx10,fscal,fjx0);
584             fjy0             = _fjsp_madd_v2r8(dy10,fscal,fjy0);
585             fjz0             = _fjsp_madd_v2r8(dz10,fscal,fjz0);
586
587             }
588
589             /**************************
590              * CALCULATE INTERACTIONS *
591              **************************/
592
593             if (gmx_fjsp_any_lt_v2r8(rsq20,rcutoff2))
594             {
595
596             r20              = _fjsp_mul_v2r8(rsq20,rinv20);
597
598             /* Compute parameters for interactions between i and j atoms */
599             qq20             = _fjsp_mul_v2r8(iq2,jq0);
600
601             /* EWALD ELECTROSTATICS */
602
603             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
604             ewrt             = _fjsp_mul_v2r8(r20,ewtabscale);
605             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
606             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
607             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
608
609             ewtabF           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
610             ewtabD           = _fjsp_setzero_v2r8();
611             GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
612             ewtabV           = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
613             ewtabFn          = _fjsp_setzero_v2r8();
614             GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
615             felec            = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
616             velec            = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
617             velec            = _fjsp_mul_v2r8(qq20,_fjsp_sub_v2r8(_fjsp_sub_v2r8(rinv20,sh_ewald),velec));
618             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,rinv20),_fjsp_sub_v2r8(rinvsq20,felec));
619
620             cutoff_mask      = _fjsp_cmplt_v2r8(rsq20,rcutoff2);
621
622             /* Update potential sum for this i atom from the interaction with this j atom. */
623             velec            = _fjsp_and_v2r8(velec,cutoff_mask);
624             velec            = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
625             velecsum         = _fjsp_add_v2r8(velecsum,velec);
626
627             fscal            = felec;
628
629             fscal            = _fjsp_and_v2r8(fscal,cutoff_mask);
630
631             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
632
633             /* Update vectorial force */
634             fix2             = _fjsp_madd_v2r8(dx20,fscal,fix2);
635             fiy2             = _fjsp_madd_v2r8(dy20,fscal,fiy2);
636             fiz2             = _fjsp_madd_v2r8(dz20,fscal,fiz2);
637             
638             fjx0             = _fjsp_madd_v2r8(dx20,fscal,fjx0);
639             fjy0             = _fjsp_madd_v2r8(dy20,fscal,fjy0);
640             fjz0             = _fjsp_madd_v2r8(dz20,fscal,fjz0);
641
642             }
643
644             /**************************
645              * CALCULATE INTERACTIONS *
646              **************************/
647
648             if (gmx_fjsp_any_lt_v2r8(rsq30,rcutoff2))
649             {
650
651             r30              = _fjsp_mul_v2r8(rsq30,rinv30);
652
653             /* Compute parameters for interactions between i and j atoms */
654             qq30             = _fjsp_mul_v2r8(iq3,jq0);
655
656             /* EWALD ELECTROSTATICS */
657
658             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
659             ewrt             = _fjsp_mul_v2r8(r30,ewtabscale);
660             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
661             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
662             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
663
664             ewtabF           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
665             ewtabD           = _fjsp_setzero_v2r8();
666             GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
667             ewtabV           = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
668             ewtabFn          = _fjsp_setzero_v2r8();
669             GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
670             felec            = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
671             velec            = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
672             velec            = _fjsp_mul_v2r8(qq30,_fjsp_sub_v2r8(_fjsp_sub_v2r8(rinv30,sh_ewald),velec));
673             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq30,rinv30),_fjsp_sub_v2r8(rinvsq30,felec));
674
675             cutoff_mask      = _fjsp_cmplt_v2r8(rsq30,rcutoff2);
676
677             /* Update potential sum for this i atom from the interaction with this j atom. */
678             velec            = _fjsp_and_v2r8(velec,cutoff_mask);
679             velec            = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
680             velecsum         = _fjsp_add_v2r8(velecsum,velec);
681
682             fscal            = felec;
683
684             fscal            = _fjsp_and_v2r8(fscal,cutoff_mask);
685
686             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
687
688             /* Update vectorial force */
689             fix3             = _fjsp_madd_v2r8(dx30,fscal,fix3);
690             fiy3             = _fjsp_madd_v2r8(dy30,fscal,fiy3);
691             fiz3             = _fjsp_madd_v2r8(dz30,fscal,fiz3);
692             
693             fjx0             = _fjsp_madd_v2r8(dx30,fscal,fjx0);
694             fjy0             = _fjsp_madd_v2r8(dy30,fscal,fjy0);
695             fjz0             = _fjsp_madd_v2r8(dz30,fscal,fjz0);
696
697             }
698
699             gmx_fjsp_decrement_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0);
700
701             /* Inner loop uses 194 flops */
702         }
703
704         /* End of innermost loop */
705
706         gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
707                                               f+i_coord_offset,fshift+i_shift_offset);
708
709         ggid                        = gid[iidx];
710         /* Update potential energies */
711         gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
712         gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
713
714         /* Increment number of inner iterations */
715         inneriter                  += j_index_end - j_index_start;
716
717         /* Outer loop uses 26 flops */
718     }
719
720     /* Increment number of outer iterations */
721     outeriter        += nri;
722
723     /* Update outer/inner flops */
724
725     inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4_VF,outeriter*26 + inneriter*194);
726 }
727 /*
728  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_F_sparc64_hpc_ace_double
729  * Electrostatics interaction: Ewald
730  * VdW interaction:            LennardJones
731  * Geometry:                   Water4-Particle
732  * Calculate force/pot:        Force
733  */
734 void
735 nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_F_sparc64_hpc_ace_double
736                     (t_nblist                    * gmx_restrict       nlist,
737                      rvec                        * gmx_restrict          xx,
738                      rvec                        * gmx_restrict          ff,
739                      struct t_forcerec           * gmx_restrict          fr,
740                      t_mdatoms                   * gmx_restrict     mdatoms,
741                      nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
742                      t_nrnb                      * gmx_restrict        nrnb)
743 {
744     /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
745      * just 0 for non-waters.
746      * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
747      * jnr indices corresponding to data put in the four positions in the SIMD register.
748      */
749     int              i_shift_offset,i_coord_offset,outeriter,inneriter;
750     int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
751     int              jnrA,jnrB;
752     int              j_coord_offsetA,j_coord_offsetB;
753     int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
754     real             rcutoff_scalar;
755     real             *shiftvec,*fshift,*x,*f;
756     _fjsp_v2r8       tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
757     int              vdwioffset0;
758     _fjsp_v2r8       ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
759     int              vdwioffset1;
760     _fjsp_v2r8       ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
761     int              vdwioffset2;
762     _fjsp_v2r8       ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
763     int              vdwioffset3;
764     _fjsp_v2r8       ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
765     int              vdwjidx0A,vdwjidx0B;
766     _fjsp_v2r8       jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
767     _fjsp_v2r8       dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
768     _fjsp_v2r8       dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
769     _fjsp_v2r8       dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
770     _fjsp_v2r8       dx30,dy30,dz30,rsq30,rinv30,rinvsq30,r30,qq30,c6_30,c12_30;
771     _fjsp_v2r8       velec,felec,velecsum,facel,crf,krf,krf2;
772     real             *charge;
773     int              nvdwtype;
774     _fjsp_v2r8       rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
775     int              *vdwtype;
776     real             *vdwparam;
777     _fjsp_v2r8       one_sixth   = gmx_fjsp_set1_v2r8(1.0/6.0);
778     _fjsp_v2r8       one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
779     _fjsp_v2r8       ewtabscale,eweps,sh_ewald,ewrt,ewtabhalfspace,ewtabF,ewtabFn,ewtabD,ewtabV;
780     real             *ewtab;
781     _fjsp_v2r8       itab_tmp;
782     _fjsp_v2r8       dummy_mask,cutoff_mask;
783     _fjsp_v2r8       one     = gmx_fjsp_set1_v2r8(1.0);
784     _fjsp_v2r8       two     = gmx_fjsp_set1_v2r8(2.0);
785     union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
786
787     x                = xx[0];
788     f                = ff[0];
789
790     nri              = nlist->nri;
791     iinr             = nlist->iinr;
792     jindex           = nlist->jindex;
793     jjnr             = nlist->jjnr;
794     shiftidx         = nlist->shift;
795     gid              = nlist->gid;
796     shiftvec         = fr->shift_vec[0];
797     fshift           = fr->fshift[0];
798     facel            = gmx_fjsp_set1_v2r8(fr->ic->epsfac);
799     charge           = mdatoms->chargeA;
800     nvdwtype         = fr->ntype;
801     vdwparam         = fr->nbfp;
802     vdwtype          = mdatoms->typeA;
803
804     sh_ewald         = gmx_fjsp_set1_v2r8(fr->ic->sh_ewald);
805     ewtab            = fr->ic->tabq_coul_F;
806     ewtabscale       = gmx_fjsp_set1_v2r8(fr->ic->tabq_scale);
807     ewtabhalfspace   = gmx_fjsp_set1_v2r8(0.5/fr->ic->tabq_scale);
808
809     /* Setup water-specific parameters */
810     inr              = nlist->iinr[0];
811     iq1              = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
812     iq2              = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
813     iq3              = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+3]));
814     vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
815
816     /* When we use explicit cutoffs the value must be identical for elec and VdW, so use elec as an arbitrary choice */
817     rcutoff_scalar   = fr->ic->rcoulomb;
818     rcutoff          = gmx_fjsp_set1_v2r8(rcutoff_scalar);
819     rcutoff2         = _fjsp_mul_v2r8(rcutoff,rcutoff);
820
821     sh_vdw_invrcut6  = gmx_fjsp_set1_v2r8(fr->ic->sh_invrc6);
822     rvdw             = gmx_fjsp_set1_v2r8(fr->ic->rvdw);
823
824     /* Avoid stupid compiler warnings */
825     jnrA = jnrB = 0;
826     j_coord_offsetA = 0;
827     j_coord_offsetB = 0;
828
829     outeriter        = 0;
830     inneriter        = 0;
831
832     /* Start outer loop over neighborlists */
833     for(iidx=0; iidx<nri; iidx++)
834     {
835         /* Load shift vector for this list */
836         i_shift_offset   = DIM*shiftidx[iidx];
837
838         /* Load limits for loop over neighbors */
839         j_index_start    = jindex[iidx];
840         j_index_end      = jindex[iidx+1];
841
842         /* Get outer coordinate index */
843         inr              = iinr[iidx];
844         i_coord_offset   = DIM*inr;
845
846         /* Load i particle coords and add shift vector */
847         gmx_fjsp_load_shift_and_4rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
848                                                  &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
849
850         fix0             = _fjsp_setzero_v2r8();
851         fiy0             = _fjsp_setzero_v2r8();
852         fiz0             = _fjsp_setzero_v2r8();
853         fix1             = _fjsp_setzero_v2r8();
854         fiy1             = _fjsp_setzero_v2r8();
855         fiz1             = _fjsp_setzero_v2r8();
856         fix2             = _fjsp_setzero_v2r8();
857         fiy2             = _fjsp_setzero_v2r8();
858         fiz2             = _fjsp_setzero_v2r8();
859         fix3             = _fjsp_setzero_v2r8();
860         fiy3             = _fjsp_setzero_v2r8();
861         fiz3             = _fjsp_setzero_v2r8();
862
863         /* Start inner kernel loop */
864         for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
865         {
866
867             /* Get j neighbor index, and coordinate index */
868             jnrA             = jjnr[jidx];
869             jnrB             = jjnr[jidx+1];
870             j_coord_offsetA  = DIM*jnrA;
871             j_coord_offsetB  = DIM*jnrB;
872
873             /* load j atom coordinates */
874             gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
875                                               &jx0,&jy0,&jz0);
876
877             /* Calculate displacement vector */
878             dx00             = _fjsp_sub_v2r8(ix0,jx0);
879             dy00             = _fjsp_sub_v2r8(iy0,jy0);
880             dz00             = _fjsp_sub_v2r8(iz0,jz0);
881             dx10             = _fjsp_sub_v2r8(ix1,jx0);
882             dy10             = _fjsp_sub_v2r8(iy1,jy0);
883             dz10             = _fjsp_sub_v2r8(iz1,jz0);
884             dx20             = _fjsp_sub_v2r8(ix2,jx0);
885             dy20             = _fjsp_sub_v2r8(iy2,jy0);
886             dz20             = _fjsp_sub_v2r8(iz2,jz0);
887             dx30             = _fjsp_sub_v2r8(ix3,jx0);
888             dy30             = _fjsp_sub_v2r8(iy3,jy0);
889             dz30             = _fjsp_sub_v2r8(iz3,jz0);
890
891             /* Calculate squared distance and things based on it */
892             rsq00            = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
893             rsq10            = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
894             rsq20            = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
895             rsq30            = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
896
897             rinv10           = gmx_fjsp_invsqrt_v2r8(rsq10);
898             rinv20           = gmx_fjsp_invsqrt_v2r8(rsq20);
899             rinv30           = gmx_fjsp_invsqrt_v2r8(rsq30);
900
901             rinvsq00         = gmx_fjsp_inv_v2r8(rsq00);
902             rinvsq10         = _fjsp_mul_v2r8(rinv10,rinv10);
903             rinvsq20         = _fjsp_mul_v2r8(rinv20,rinv20);
904             rinvsq30         = _fjsp_mul_v2r8(rinv30,rinv30);
905
906             /* Load parameters for j particles */
907             jq0              = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
908             vdwjidx0A        = 2*vdwtype[jnrA+0];
909             vdwjidx0B        = 2*vdwtype[jnrB+0];
910
911             fjx0             = _fjsp_setzero_v2r8();
912             fjy0             = _fjsp_setzero_v2r8();
913             fjz0             = _fjsp_setzero_v2r8();
914
915             /**************************
916              * CALCULATE INTERACTIONS *
917              **************************/
918
919             if (gmx_fjsp_any_lt_v2r8(rsq00,rcutoff2))
920             {
921
922             /* Compute parameters for interactions between i and j atoms */
923             gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
924                                          vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
925
926             /* LENNARD-JONES DISPERSION/REPULSION */
927
928             rinvsix          = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
929             fvdw             = _fjsp_mul_v2r8(_fjsp_msub_v2r8(c12_00,rinvsix,c6_00),_fjsp_mul_v2r8(rinvsix,rinvsq00));
930
931             cutoff_mask      = _fjsp_cmplt_v2r8(rsq00,rcutoff2);
932
933             fscal            = fvdw;
934
935             fscal            = _fjsp_and_v2r8(fscal,cutoff_mask);
936
937             /* Update vectorial force */
938             fix0             = _fjsp_madd_v2r8(dx00,fscal,fix0);
939             fiy0             = _fjsp_madd_v2r8(dy00,fscal,fiy0);
940             fiz0             = _fjsp_madd_v2r8(dz00,fscal,fiz0);
941             
942             fjx0             = _fjsp_madd_v2r8(dx00,fscal,fjx0);
943             fjy0             = _fjsp_madd_v2r8(dy00,fscal,fjy0);
944             fjz0             = _fjsp_madd_v2r8(dz00,fscal,fjz0);
945
946             }
947
948             /**************************
949              * CALCULATE INTERACTIONS *
950              **************************/
951
952             if (gmx_fjsp_any_lt_v2r8(rsq10,rcutoff2))
953             {
954
955             r10              = _fjsp_mul_v2r8(rsq10,rinv10);
956
957             /* Compute parameters for interactions between i and j atoms */
958             qq10             = _fjsp_mul_v2r8(iq1,jq0);
959
960             /* EWALD ELECTROSTATICS */
961
962             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
963             ewrt             = _fjsp_mul_v2r8(r10,ewtabscale);
964             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
965             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
966             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
967
968             gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
969                                          &ewtabF,&ewtabFn);
970             felec            = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
971             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,rinv10),_fjsp_sub_v2r8(rinvsq10,felec));
972
973             cutoff_mask      = _fjsp_cmplt_v2r8(rsq10,rcutoff2);
974
975             fscal            = felec;
976
977             fscal            = _fjsp_and_v2r8(fscal,cutoff_mask);
978
979             /* Update vectorial force */
980             fix1             = _fjsp_madd_v2r8(dx10,fscal,fix1);
981             fiy1             = _fjsp_madd_v2r8(dy10,fscal,fiy1);
982             fiz1             = _fjsp_madd_v2r8(dz10,fscal,fiz1);
983             
984             fjx0             = _fjsp_madd_v2r8(dx10,fscal,fjx0);
985             fjy0             = _fjsp_madd_v2r8(dy10,fscal,fjy0);
986             fjz0             = _fjsp_madd_v2r8(dz10,fscal,fjz0);
987
988             }
989
990             /**************************
991              * CALCULATE INTERACTIONS *
992              **************************/
993
994             if (gmx_fjsp_any_lt_v2r8(rsq20,rcutoff2))
995             {
996
997             r20              = _fjsp_mul_v2r8(rsq20,rinv20);
998
999             /* Compute parameters for interactions between i and j atoms */
1000             qq20             = _fjsp_mul_v2r8(iq2,jq0);
1001
1002             /* EWALD ELECTROSTATICS */
1003
1004             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1005             ewrt             = _fjsp_mul_v2r8(r20,ewtabscale);
1006             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
1007             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1008             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1009
1010             gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1011                                          &ewtabF,&ewtabFn);
1012             felec            = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1013             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,rinv20),_fjsp_sub_v2r8(rinvsq20,felec));
1014
1015             cutoff_mask      = _fjsp_cmplt_v2r8(rsq20,rcutoff2);
1016
1017             fscal            = felec;
1018
1019             fscal            = _fjsp_and_v2r8(fscal,cutoff_mask);
1020
1021             /* Update vectorial force */
1022             fix2             = _fjsp_madd_v2r8(dx20,fscal,fix2);
1023             fiy2             = _fjsp_madd_v2r8(dy20,fscal,fiy2);
1024             fiz2             = _fjsp_madd_v2r8(dz20,fscal,fiz2);
1025             
1026             fjx0             = _fjsp_madd_v2r8(dx20,fscal,fjx0);
1027             fjy0             = _fjsp_madd_v2r8(dy20,fscal,fjy0);
1028             fjz0             = _fjsp_madd_v2r8(dz20,fscal,fjz0);
1029
1030             }
1031
1032             /**************************
1033              * CALCULATE INTERACTIONS *
1034              **************************/
1035
1036             if (gmx_fjsp_any_lt_v2r8(rsq30,rcutoff2))
1037             {
1038
1039             r30              = _fjsp_mul_v2r8(rsq30,rinv30);
1040
1041             /* Compute parameters for interactions between i and j atoms */
1042             qq30             = _fjsp_mul_v2r8(iq3,jq0);
1043
1044             /* EWALD ELECTROSTATICS */
1045
1046             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1047             ewrt             = _fjsp_mul_v2r8(r30,ewtabscale);
1048             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
1049             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1050             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1051
1052             gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1053                                          &ewtabF,&ewtabFn);
1054             felec            = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1055             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq30,rinv30),_fjsp_sub_v2r8(rinvsq30,felec));
1056
1057             cutoff_mask      = _fjsp_cmplt_v2r8(rsq30,rcutoff2);
1058
1059             fscal            = felec;
1060
1061             fscal            = _fjsp_and_v2r8(fscal,cutoff_mask);
1062
1063             /* Update vectorial force */
1064             fix3             = _fjsp_madd_v2r8(dx30,fscal,fix3);
1065             fiy3             = _fjsp_madd_v2r8(dy30,fscal,fiy3);
1066             fiz3             = _fjsp_madd_v2r8(dz30,fscal,fiz3);
1067             
1068             fjx0             = _fjsp_madd_v2r8(dx30,fscal,fjx0);
1069             fjy0             = _fjsp_madd_v2r8(dy30,fscal,fjy0);
1070             fjz0             = _fjsp_madd_v2r8(dz30,fscal,fjz0);
1071
1072             }
1073
1074             gmx_fjsp_decrement_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0);
1075
1076             /* Inner loop uses 162 flops */
1077         }
1078
1079         if(jidx<j_index_end)
1080         {
1081
1082             jnrA             = jjnr[jidx];
1083             j_coord_offsetA  = DIM*jnrA;
1084
1085             /* load j atom coordinates */
1086             gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
1087                                               &jx0,&jy0,&jz0);
1088
1089             /* Calculate displacement vector */
1090             dx00             = _fjsp_sub_v2r8(ix0,jx0);
1091             dy00             = _fjsp_sub_v2r8(iy0,jy0);
1092             dz00             = _fjsp_sub_v2r8(iz0,jz0);
1093             dx10             = _fjsp_sub_v2r8(ix1,jx0);
1094             dy10             = _fjsp_sub_v2r8(iy1,jy0);
1095             dz10             = _fjsp_sub_v2r8(iz1,jz0);
1096             dx20             = _fjsp_sub_v2r8(ix2,jx0);
1097             dy20             = _fjsp_sub_v2r8(iy2,jy0);
1098             dz20             = _fjsp_sub_v2r8(iz2,jz0);
1099             dx30             = _fjsp_sub_v2r8(ix3,jx0);
1100             dy30             = _fjsp_sub_v2r8(iy3,jy0);
1101             dz30             = _fjsp_sub_v2r8(iz3,jz0);
1102
1103             /* Calculate squared distance and things based on it */
1104             rsq00            = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
1105             rsq10            = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
1106             rsq20            = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
1107             rsq30            = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
1108
1109             rinv10           = gmx_fjsp_invsqrt_v2r8(rsq10);
1110             rinv20           = gmx_fjsp_invsqrt_v2r8(rsq20);
1111             rinv30           = gmx_fjsp_invsqrt_v2r8(rsq30);
1112
1113             rinvsq00         = gmx_fjsp_inv_v2r8(rsq00);
1114             rinvsq10         = _fjsp_mul_v2r8(rinv10,rinv10);
1115             rinvsq20         = _fjsp_mul_v2r8(rinv20,rinv20);
1116             rinvsq30         = _fjsp_mul_v2r8(rinv30,rinv30);
1117
1118             /* Load parameters for j particles */
1119             jq0              = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
1120             vdwjidx0A        = 2*vdwtype[jnrA+0];
1121
1122             fjx0             = _fjsp_setzero_v2r8();
1123             fjy0             = _fjsp_setzero_v2r8();
1124             fjz0             = _fjsp_setzero_v2r8();
1125
1126             /**************************
1127              * CALCULATE INTERACTIONS *
1128              **************************/
1129
1130             if (gmx_fjsp_any_lt_v2r8(rsq00,rcutoff2))
1131             {
1132
1133             /* Compute parameters for interactions between i and j atoms */
1134             gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
1135                                          vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
1136
1137             /* LENNARD-JONES DISPERSION/REPULSION */
1138
1139             rinvsix          = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
1140             fvdw             = _fjsp_mul_v2r8(_fjsp_msub_v2r8(c12_00,rinvsix,c6_00),_fjsp_mul_v2r8(rinvsix,rinvsq00));
1141
1142             cutoff_mask      = _fjsp_cmplt_v2r8(rsq00,rcutoff2);
1143
1144             fscal            = fvdw;
1145
1146             fscal            = _fjsp_and_v2r8(fscal,cutoff_mask);
1147
1148             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1149
1150             /* Update vectorial force */
1151             fix0             = _fjsp_madd_v2r8(dx00,fscal,fix0);
1152             fiy0             = _fjsp_madd_v2r8(dy00,fscal,fiy0);
1153             fiz0             = _fjsp_madd_v2r8(dz00,fscal,fiz0);
1154             
1155             fjx0             = _fjsp_madd_v2r8(dx00,fscal,fjx0);
1156             fjy0             = _fjsp_madd_v2r8(dy00,fscal,fjy0);
1157             fjz0             = _fjsp_madd_v2r8(dz00,fscal,fjz0);
1158
1159             }
1160
1161             /**************************
1162              * CALCULATE INTERACTIONS *
1163              **************************/
1164
1165             if (gmx_fjsp_any_lt_v2r8(rsq10,rcutoff2))
1166             {
1167
1168             r10              = _fjsp_mul_v2r8(rsq10,rinv10);
1169
1170             /* Compute parameters for interactions between i and j atoms */
1171             qq10             = _fjsp_mul_v2r8(iq1,jq0);
1172
1173             /* EWALD ELECTROSTATICS */
1174
1175             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1176             ewrt             = _fjsp_mul_v2r8(r10,ewtabscale);
1177             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
1178             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1179             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1180
1181             gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
1182             felec            = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1183             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,rinv10),_fjsp_sub_v2r8(rinvsq10,felec));
1184
1185             cutoff_mask      = _fjsp_cmplt_v2r8(rsq10,rcutoff2);
1186
1187             fscal            = felec;
1188
1189             fscal            = _fjsp_and_v2r8(fscal,cutoff_mask);
1190
1191             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1192
1193             /* Update vectorial force */
1194             fix1             = _fjsp_madd_v2r8(dx10,fscal,fix1);
1195             fiy1             = _fjsp_madd_v2r8(dy10,fscal,fiy1);
1196             fiz1             = _fjsp_madd_v2r8(dz10,fscal,fiz1);
1197             
1198             fjx0             = _fjsp_madd_v2r8(dx10,fscal,fjx0);
1199             fjy0             = _fjsp_madd_v2r8(dy10,fscal,fjy0);
1200             fjz0             = _fjsp_madd_v2r8(dz10,fscal,fjz0);
1201
1202             }
1203
1204             /**************************
1205              * CALCULATE INTERACTIONS *
1206              **************************/
1207
1208             if (gmx_fjsp_any_lt_v2r8(rsq20,rcutoff2))
1209             {
1210
1211             r20              = _fjsp_mul_v2r8(rsq20,rinv20);
1212
1213             /* Compute parameters for interactions between i and j atoms */
1214             qq20             = _fjsp_mul_v2r8(iq2,jq0);
1215
1216             /* EWALD ELECTROSTATICS */
1217
1218             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1219             ewrt             = _fjsp_mul_v2r8(r20,ewtabscale);
1220             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
1221             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1222             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1223
1224             gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
1225             felec            = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1226             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,rinv20),_fjsp_sub_v2r8(rinvsq20,felec));
1227
1228             cutoff_mask      = _fjsp_cmplt_v2r8(rsq20,rcutoff2);
1229
1230             fscal            = felec;
1231
1232             fscal            = _fjsp_and_v2r8(fscal,cutoff_mask);
1233
1234             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1235
1236             /* Update vectorial force */
1237             fix2             = _fjsp_madd_v2r8(dx20,fscal,fix2);
1238             fiy2             = _fjsp_madd_v2r8(dy20,fscal,fiy2);
1239             fiz2             = _fjsp_madd_v2r8(dz20,fscal,fiz2);
1240             
1241             fjx0             = _fjsp_madd_v2r8(dx20,fscal,fjx0);
1242             fjy0             = _fjsp_madd_v2r8(dy20,fscal,fjy0);
1243             fjz0             = _fjsp_madd_v2r8(dz20,fscal,fjz0);
1244
1245             }
1246
1247             /**************************
1248              * CALCULATE INTERACTIONS *
1249              **************************/
1250
1251             if (gmx_fjsp_any_lt_v2r8(rsq30,rcutoff2))
1252             {
1253
1254             r30              = _fjsp_mul_v2r8(rsq30,rinv30);
1255
1256             /* Compute parameters for interactions between i and j atoms */
1257             qq30             = _fjsp_mul_v2r8(iq3,jq0);
1258
1259             /* EWALD ELECTROSTATICS */
1260
1261             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1262             ewrt             = _fjsp_mul_v2r8(r30,ewtabscale);
1263             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
1264             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1265             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1266
1267             gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
1268             felec            = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1269             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq30,rinv30),_fjsp_sub_v2r8(rinvsq30,felec));
1270
1271             cutoff_mask      = _fjsp_cmplt_v2r8(rsq30,rcutoff2);
1272
1273             fscal            = felec;
1274
1275             fscal            = _fjsp_and_v2r8(fscal,cutoff_mask);
1276
1277             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1278
1279             /* Update vectorial force */
1280             fix3             = _fjsp_madd_v2r8(dx30,fscal,fix3);
1281             fiy3             = _fjsp_madd_v2r8(dy30,fscal,fiy3);
1282             fiz3             = _fjsp_madd_v2r8(dz30,fscal,fiz3);
1283             
1284             fjx0             = _fjsp_madd_v2r8(dx30,fscal,fjx0);
1285             fjy0             = _fjsp_madd_v2r8(dy30,fscal,fjy0);
1286             fjz0             = _fjsp_madd_v2r8(dz30,fscal,fjz0);
1287
1288             }
1289
1290             gmx_fjsp_decrement_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0);
1291
1292             /* Inner loop uses 162 flops */
1293         }
1294
1295         /* End of innermost loop */
1296
1297         gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
1298                                               f+i_coord_offset,fshift+i_shift_offset);
1299
1300         /* Increment number of inner iterations */
1301         inneriter                  += j_index_end - j_index_start;
1302
1303         /* Outer loop uses 24 flops */
1304     }
1305
1306     /* Increment number of outer iterations */
1307     outeriter        += nri;
1308
1309     /* Update outer/inner flops */
1310
1311     inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4_F,outeriter*24 + inneriter*162);
1312 }