Remove all unnecessary HAVE_CONFIG_H
[alexxy/gromacs.git] / src / gromacs / gmxlib / nonbonded / nb_kernel_sparc64_hpc_ace_double / nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_sparc64_hpc_ace_double.c
1 /*
2  * This file is part of the GROMACS molecular simulation package.
3  *
4  * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
5  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6  * and including many others, as listed in the AUTHORS file in the
7  * top-level source directory and at http://www.gromacs.org.
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 "config.h"
39
40 #include <math.h>
41
42 #include "../nb_kernel.h"
43 #include "types/simple.h"
44 #include "gromacs/math/vec.h"
45 #include "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                      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->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->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->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_1pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
499
500             /* LENNARD-JONES DISPERSION/REPULSION */
501
502             rinvsix          = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
503             vvdw6            = _fjsp_mul_v2r8(c6_00,rinvsix);
504             vvdw12           = _fjsp_mul_v2r8(c12_00,_fjsp_mul_v2r8(rinvsix,rinvsix));
505             vvdw             = _fjsp_msub_v2r8(_fjsp_nmsub_v2r8(c12_00,_fjsp_mul_v2r8(sh_vdw_invrcut6,sh_vdw_invrcut6),vvdw12),one_twelfth,
506                                            _fjsp_mul_v2r8(_fjsp_nmsub_v2r8( c6_00,sh_vdw_invrcut6,vvdw6),one_sixth));
507             fvdw             = _fjsp_mul_v2r8(_fjsp_sub_v2r8(vvdw12,vvdw6),rinvsq00);
508
509             cutoff_mask      = _fjsp_cmplt_v2r8(rsq00,rcutoff2);
510
511             /* Update potential sum for this i atom from the interaction with this j atom. */
512             vvdw             = _fjsp_and_v2r8(vvdw,cutoff_mask);
513             vvdw             = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
514             vvdwsum          = _fjsp_add_v2r8(vvdwsum,vvdw);
515
516             fscal            = fvdw;
517
518             fscal            = _fjsp_and_v2r8(fscal,cutoff_mask);
519
520             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
521
522             /* Update vectorial force */
523             fix0             = _fjsp_madd_v2r8(dx00,fscal,fix0);
524             fiy0             = _fjsp_madd_v2r8(dy00,fscal,fiy0);
525             fiz0             = _fjsp_madd_v2r8(dz00,fscal,fiz0);
526             
527             fjx0             = _fjsp_madd_v2r8(dx00,fscal,fjx0);
528             fjy0             = _fjsp_madd_v2r8(dy00,fscal,fjy0);
529             fjz0             = _fjsp_madd_v2r8(dz00,fscal,fjz0);
530
531             }
532
533             /**************************
534              * CALCULATE INTERACTIONS *
535              **************************/
536
537             if (gmx_fjsp_any_lt_v2r8(rsq10,rcutoff2))
538             {
539
540             r10              = _fjsp_mul_v2r8(rsq10,rinv10);
541
542             /* Compute parameters for interactions between i and j atoms */
543             qq10             = _fjsp_mul_v2r8(iq1,jq0);
544
545             /* EWALD ELECTROSTATICS */
546
547             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
548             ewrt             = _fjsp_mul_v2r8(r10,ewtabscale);
549             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
550             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
551             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
552
553             ewtabF           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
554             ewtabD           = _fjsp_setzero_v2r8();
555             GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
556             ewtabV           = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
557             ewtabFn          = _fjsp_setzero_v2r8();
558             GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
559             felec            = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
560             velec            = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
561             velec            = _fjsp_mul_v2r8(qq10,_fjsp_sub_v2r8(_fjsp_sub_v2r8(rinv10,sh_ewald),velec));
562             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,rinv10),_fjsp_sub_v2r8(rinvsq10,felec));
563
564             cutoff_mask      = _fjsp_cmplt_v2r8(rsq10,rcutoff2);
565
566             /* Update potential sum for this i atom from the interaction with this j atom. */
567             velec            = _fjsp_and_v2r8(velec,cutoff_mask);
568             velec            = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
569             velecsum         = _fjsp_add_v2r8(velecsum,velec);
570
571             fscal            = felec;
572
573             fscal            = _fjsp_and_v2r8(fscal,cutoff_mask);
574
575             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
576
577             /* Update vectorial force */
578             fix1             = _fjsp_madd_v2r8(dx10,fscal,fix1);
579             fiy1             = _fjsp_madd_v2r8(dy10,fscal,fiy1);
580             fiz1             = _fjsp_madd_v2r8(dz10,fscal,fiz1);
581             
582             fjx0             = _fjsp_madd_v2r8(dx10,fscal,fjx0);
583             fjy0             = _fjsp_madd_v2r8(dy10,fscal,fjy0);
584             fjz0             = _fjsp_madd_v2r8(dz10,fscal,fjz0);
585
586             }
587
588             /**************************
589              * CALCULATE INTERACTIONS *
590              **************************/
591
592             if (gmx_fjsp_any_lt_v2r8(rsq20,rcutoff2))
593             {
594
595             r20              = _fjsp_mul_v2r8(rsq20,rinv20);
596
597             /* Compute parameters for interactions between i and j atoms */
598             qq20             = _fjsp_mul_v2r8(iq2,jq0);
599
600             /* EWALD ELECTROSTATICS */
601
602             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
603             ewrt             = _fjsp_mul_v2r8(r20,ewtabscale);
604             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
605             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
606             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
607
608             ewtabF           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
609             ewtabD           = _fjsp_setzero_v2r8();
610             GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
611             ewtabV           = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
612             ewtabFn          = _fjsp_setzero_v2r8();
613             GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
614             felec            = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
615             velec            = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
616             velec            = _fjsp_mul_v2r8(qq20,_fjsp_sub_v2r8(_fjsp_sub_v2r8(rinv20,sh_ewald),velec));
617             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,rinv20),_fjsp_sub_v2r8(rinvsq20,felec));
618
619             cutoff_mask      = _fjsp_cmplt_v2r8(rsq20,rcutoff2);
620
621             /* Update potential sum for this i atom from the interaction with this j atom. */
622             velec            = _fjsp_and_v2r8(velec,cutoff_mask);
623             velec            = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
624             velecsum         = _fjsp_add_v2r8(velecsum,velec);
625
626             fscal            = felec;
627
628             fscal            = _fjsp_and_v2r8(fscal,cutoff_mask);
629
630             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
631
632             /* Update vectorial force */
633             fix2             = _fjsp_madd_v2r8(dx20,fscal,fix2);
634             fiy2             = _fjsp_madd_v2r8(dy20,fscal,fiy2);
635             fiz2             = _fjsp_madd_v2r8(dz20,fscal,fiz2);
636             
637             fjx0             = _fjsp_madd_v2r8(dx20,fscal,fjx0);
638             fjy0             = _fjsp_madd_v2r8(dy20,fscal,fjy0);
639             fjz0             = _fjsp_madd_v2r8(dz20,fscal,fjz0);
640
641             }
642
643             /**************************
644              * CALCULATE INTERACTIONS *
645              **************************/
646
647             if (gmx_fjsp_any_lt_v2r8(rsq30,rcutoff2))
648             {
649
650             r30              = _fjsp_mul_v2r8(rsq30,rinv30);
651
652             /* Compute parameters for interactions between i and j atoms */
653             qq30             = _fjsp_mul_v2r8(iq3,jq0);
654
655             /* EWALD ELECTROSTATICS */
656
657             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
658             ewrt             = _fjsp_mul_v2r8(r30,ewtabscale);
659             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
660             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
661             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
662
663             ewtabF           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
664             ewtabD           = _fjsp_setzero_v2r8();
665             GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
666             ewtabV           = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
667             ewtabFn          = _fjsp_setzero_v2r8();
668             GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
669             felec            = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
670             velec            = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
671             velec            = _fjsp_mul_v2r8(qq30,_fjsp_sub_v2r8(_fjsp_sub_v2r8(rinv30,sh_ewald),velec));
672             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq30,rinv30),_fjsp_sub_v2r8(rinvsq30,felec));
673
674             cutoff_mask      = _fjsp_cmplt_v2r8(rsq30,rcutoff2);
675
676             /* Update potential sum for this i atom from the interaction with this j atom. */
677             velec            = _fjsp_and_v2r8(velec,cutoff_mask);
678             velec            = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
679             velecsum         = _fjsp_add_v2r8(velecsum,velec);
680
681             fscal            = felec;
682
683             fscal            = _fjsp_and_v2r8(fscal,cutoff_mask);
684
685             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
686
687             /* Update vectorial force */
688             fix3             = _fjsp_madd_v2r8(dx30,fscal,fix3);
689             fiy3             = _fjsp_madd_v2r8(dy30,fscal,fiy3);
690             fiz3             = _fjsp_madd_v2r8(dz30,fscal,fiz3);
691             
692             fjx0             = _fjsp_madd_v2r8(dx30,fscal,fjx0);
693             fjy0             = _fjsp_madd_v2r8(dy30,fscal,fjy0);
694             fjz0             = _fjsp_madd_v2r8(dz30,fscal,fjz0);
695
696             }
697
698             gmx_fjsp_decrement_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0);
699
700             /* Inner loop uses 194 flops */
701         }
702
703         /* End of innermost loop */
704
705         gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
706                                               f+i_coord_offset,fshift+i_shift_offset);
707
708         ggid                        = gid[iidx];
709         /* Update potential energies */
710         gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
711         gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
712
713         /* Increment number of inner iterations */
714         inneriter                  += j_index_end - j_index_start;
715
716         /* Outer loop uses 26 flops */
717     }
718
719     /* Increment number of outer iterations */
720     outeriter        += nri;
721
722     /* Update outer/inner flops */
723
724     inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4_VF,outeriter*26 + inneriter*194);
725 }
726 /*
727  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_F_sparc64_hpc_ace_double
728  * Electrostatics interaction: Ewald
729  * VdW interaction:            LennardJones
730  * Geometry:                   Water4-Particle
731  * Calculate force/pot:        Force
732  */
733 void
734 nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_F_sparc64_hpc_ace_double
735                     (t_nblist                    * gmx_restrict       nlist,
736                      rvec                        * gmx_restrict          xx,
737                      rvec                        * gmx_restrict          ff,
738                      t_forcerec                  * gmx_restrict          fr,
739                      t_mdatoms                   * gmx_restrict     mdatoms,
740                      nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
741                      t_nrnb                      * gmx_restrict        nrnb)
742 {
743     /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
744      * just 0 for non-waters.
745      * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
746      * jnr indices corresponding to data put in the four positions in the SIMD register.
747      */
748     int              i_shift_offset,i_coord_offset,outeriter,inneriter;
749     int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
750     int              jnrA,jnrB;
751     int              j_coord_offsetA,j_coord_offsetB;
752     int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
753     real             rcutoff_scalar;
754     real             *shiftvec,*fshift,*x,*f;
755     _fjsp_v2r8       tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
756     int              vdwioffset0;
757     _fjsp_v2r8       ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
758     int              vdwioffset1;
759     _fjsp_v2r8       ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
760     int              vdwioffset2;
761     _fjsp_v2r8       ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
762     int              vdwioffset3;
763     _fjsp_v2r8       ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
764     int              vdwjidx0A,vdwjidx0B;
765     _fjsp_v2r8       jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
766     _fjsp_v2r8       dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
767     _fjsp_v2r8       dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
768     _fjsp_v2r8       dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
769     _fjsp_v2r8       dx30,dy30,dz30,rsq30,rinv30,rinvsq30,r30,qq30,c6_30,c12_30;
770     _fjsp_v2r8       velec,felec,velecsum,facel,crf,krf,krf2;
771     real             *charge;
772     int              nvdwtype;
773     _fjsp_v2r8       rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
774     int              *vdwtype;
775     real             *vdwparam;
776     _fjsp_v2r8       one_sixth   = gmx_fjsp_set1_v2r8(1.0/6.0);
777     _fjsp_v2r8       one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
778     _fjsp_v2r8       ewtabscale,eweps,sh_ewald,ewrt,ewtabhalfspace,ewtabF,ewtabFn,ewtabD,ewtabV;
779     real             *ewtab;
780     _fjsp_v2r8       itab_tmp;
781     _fjsp_v2r8       dummy_mask,cutoff_mask;
782     _fjsp_v2r8       one     = gmx_fjsp_set1_v2r8(1.0);
783     _fjsp_v2r8       two     = gmx_fjsp_set1_v2r8(2.0);
784     union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
785
786     x                = xx[0];
787     f                = ff[0];
788
789     nri              = nlist->nri;
790     iinr             = nlist->iinr;
791     jindex           = nlist->jindex;
792     jjnr             = nlist->jjnr;
793     shiftidx         = nlist->shift;
794     gid              = nlist->gid;
795     shiftvec         = fr->shift_vec[0];
796     fshift           = fr->fshift[0];
797     facel            = gmx_fjsp_set1_v2r8(fr->epsfac);
798     charge           = mdatoms->chargeA;
799     nvdwtype         = fr->ntype;
800     vdwparam         = fr->nbfp;
801     vdwtype          = mdatoms->typeA;
802
803     sh_ewald         = gmx_fjsp_set1_v2r8(fr->ic->sh_ewald);
804     ewtab            = fr->ic->tabq_coul_F;
805     ewtabscale       = gmx_fjsp_set1_v2r8(fr->ic->tabq_scale);
806     ewtabhalfspace   = gmx_fjsp_set1_v2r8(0.5/fr->ic->tabq_scale);
807
808     /* Setup water-specific parameters */
809     inr              = nlist->iinr[0];
810     iq1              = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
811     iq2              = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
812     iq3              = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+3]));
813     vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
814
815     /* When we use explicit cutoffs the value must be identical for elec and VdW, so use elec as an arbitrary choice */
816     rcutoff_scalar   = fr->rcoulomb;
817     rcutoff          = gmx_fjsp_set1_v2r8(rcutoff_scalar);
818     rcutoff2         = _fjsp_mul_v2r8(rcutoff,rcutoff);
819
820     sh_vdw_invrcut6  = gmx_fjsp_set1_v2r8(fr->ic->sh_invrc6);
821     rvdw             = gmx_fjsp_set1_v2r8(fr->rvdw);
822
823     /* Avoid stupid compiler warnings */
824     jnrA = jnrB = 0;
825     j_coord_offsetA = 0;
826     j_coord_offsetB = 0;
827
828     outeriter        = 0;
829     inneriter        = 0;
830
831     /* Start outer loop over neighborlists */
832     for(iidx=0; iidx<nri; iidx++)
833     {
834         /* Load shift vector for this list */
835         i_shift_offset   = DIM*shiftidx[iidx];
836
837         /* Load limits for loop over neighbors */
838         j_index_start    = jindex[iidx];
839         j_index_end      = jindex[iidx+1];
840
841         /* Get outer coordinate index */
842         inr              = iinr[iidx];
843         i_coord_offset   = DIM*inr;
844
845         /* Load i particle coords and add shift vector */
846         gmx_fjsp_load_shift_and_4rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
847                                                  &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
848
849         fix0             = _fjsp_setzero_v2r8();
850         fiy0             = _fjsp_setzero_v2r8();
851         fiz0             = _fjsp_setzero_v2r8();
852         fix1             = _fjsp_setzero_v2r8();
853         fiy1             = _fjsp_setzero_v2r8();
854         fiz1             = _fjsp_setzero_v2r8();
855         fix2             = _fjsp_setzero_v2r8();
856         fiy2             = _fjsp_setzero_v2r8();
857         fiz2             = _fjsp_setzero_v2r8();
858         fix3             = _fjsp_setzero_v2r8();
859         fiy3             = _fjsp_setzero_v2r8();
860         fiz3             = _fjsp_setzero_v2r8();
861
862         /* Start inner kernel loop */
863         for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
864         {
865
866             /* Get j neighbor index, and coordinate index */
867             jnrA             = jjnr[jidx];
868             jnrB             = jjnr[jidx+1];
869             j_coord_offsetA  = DIM*jnrA;
870             j_coord_offsetB  = DIM*jnrB;
871
872             /* load j atom coordinates */
873             gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
874                                               &jx0,&jy0,&jz0);
875
876             /* Calculate displacement vector */
877             dx00             = _fjsp_sub_v2r8(ix0,jx0);
878             dy00             = _fjsp_sub_v2r8(iy0,jy0);
879             dz00             = _fjsp_sub_v2r8(iz0,jz0);
880             dx10             = _fjsp_sub_v2r8(ix1,jx0);
881             dy10             = _fjsp_sub_v2r8(iy1,jy0);
882             dz10             = _fjsp_sub_v2r8(iz1,jz0);
883             dx20             = _fjsp_sub_v2r8(ix2,jx0);
884             dy20             = _fjsp_sub_v2r8(iy2,jy0);
885             dz20             = _fjsp_sub_v2r8(iz2,jz0);
886             dx30             = _fjsp_sub_v2r8(ix3,jx0);
887             dy30             = _fjsp_sub_v2r8(iy3,jy0);
888             dz30             = _fjsp_sub_v2r8(iz3,jz0);
889
890             /* Calculate squared distance and things based on it */
891             rsq00            = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
892             rsq10            = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
893             rsq20            = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
894             rsq30            = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
895
896             rinv10           = gmx_fjsp_invsqrt_v2r8(rsq10);
897             rinv20           = gmx_fjsp_invsqrt_v2r8(rsq20);
898             rinv30           = gmx_fjsp_invsqrt_v2r8(rsq30);
899
900             rinvsq00         = gmx_fjsp_inv_v2r8(rsq00);
901             rinvsq10         = _fjsp_mul_v2r8(rinv10,rinv10);
902             rinvsq20         = _fjsp_mul_v2r8(rinv20,rinv20);
903             rinvsq30         = _fjsp_mul_v2r8(rinv30,rinv30);
904
905             /* Load parameters for j particles */
906             jq0              = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
907             vdwjidx0A        = 2*vdwtype[jnrA+0];
908             vdwjidx0B        = 2*vdwtype[jnrB+0];
909
910             fjx0             = _fjsp_setzero_v2r8();
911             fjy0             = _fjsp_setzero_v2r8();
912             fjz0             = _fjsp_setzero_v2r8();
913
914             /**************************
915              * CALCULATE INTERACTIONS *
916              **************************/
917
918             if (gmx_fjsp_any_lt_v2r8(rsq00,rcutoff2))
919             {
920
921             /* Compute parameters for interactions between i and j atoms */
922             gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
923                                          vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
924
925             /* LENNARD-JONES DISPERSION/REPULSION */
926
927             rinvsix          = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
928             fvdw             = _fjsp_mul_v2r8(_fjsp_msub_v2r8(c12_00,rinvsix,c6_00),_fjsp_mul_v2r8(rinvsix,rinvsq00));
929
930             cutoff_mask      = _fjsp_cmplt_v2r8(rsq00,rcutoff2);
931
932             fscal            = fvdw;
933
934             fscal            = _fjsp_and_v2r8(fscal,cutoff_mask);
935
936             /* Update vectorial force */
937             fix0             = _fjsp_madd_v2r8(dx00,fscal,fix0);
938             fiy0             = _fjsp_madd_v2r8(dy00,fscal,fiy0);
939             fiz0             = _fjsp_madd_v2r8(dz00,fscal,fiz0);
940             
941             fjx0             = _fjsp_madd_v2r8(dx00,fscal,fjx0);
942             fjy0             = _fjsp_madd_v2r8(dy00,fscal,fjy0);
943             fjz0             = _fjsp_madd_v2r8(dz00,fscal,fjz0);
944
945             }
946
947             /**************************
948              * CALCULATE INTERACTIONS *
949              **************************/
950
951             if (gmx_fjsp_any_lt_v2r8(rsq10,rcutoff2))
952             {
953
954             r10              = _fjsp_mul_v2r8(rsq10,rinv10);
955
956             /* Compute parameters for interactions between i and j atoms */
957             qq10             = _fjsp_mul_v2r8(iq1,jq0);
958
959             /* EWALD ELECTROSTATICS */
960
961             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
962             ewrt             = _fjsp_mul_v2r8(r10,ewtabscale);
963             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
964             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
965             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
966
967             gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
968                                          &ewtabF,&ewtabFn);
969             felec            = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
970             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,rinv10),_fjsp_sub_v2r8(rinvsq10,felec));
971
972             cutoff_mask      = _fjsp_cmplt_v2r8(rsq10,rcutoff2);
973
974             fscal            = felec;
975
976             fscal            = _fjsp_and_v2r8(fscal,cutoff_mask);
977
978             /* Update vectorial force */
979             fix1             = _fjsp_madd_v2r8(dx10,fscal,fix1);
980             fiy1             = _fjsp_madd_v2r8(dy10,fscal,fiy1);
981             fiz1             = _fjsp_madd_v2r8(dz10,fscal,fiz1);
982             
983             fjx0             = _fjsp_madd_v2r8(dx10,fscal,fjx0);
984             fjy0             = _fjsp_madd_v2r8(dy10,fscal,fjy0);
985             fjz0             = _fjsp_madd_v2r8(dz10,fscal,fjz0);
986
987             }
988
989             /**************************
990              * CALCULATE INTERACTIONS *
991              **************************/
992
993             if (gmx_fjsp_any_lt_v2r8(rsq20,rcutoff2))
994             {
995
996             r20              = _fjsp_mul_v2r8(rsq20,rinv20);
997
998             /* Compute parameters for interactions between i and j atoms */
999             qq20             = _fjsp_mul_v2r8(iq2,jq0);
1000
1001             /* EWALD ELECTROSTATICS */
1002
1003             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1004             ewrt             = _fjsp_mul_v2r8(r20,ewtabscale);
1005             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
1006             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1007             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1008
1009             gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1010                                          &ewtabF,&ewtabFn);
1011             felec            = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1012             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,rinv20),_fjsp_sub_v2r8(rinvsq20,felec));
1013
1014             cutoff_mask      = _fjsp_cmplt_v2r8(rsq20,rcutoff2);
1015
1016             fscal            = felec;
1017
1018             fscal            = _fjsp_and_v2r8(fscal,cutoff_mask);
1019
1020             /* Update vectorial force */
1021             fix2             = _fjsp_madd_v2r8(dx20,fscal,fix2);
1022             fiy2             = _fjsp_madd_v2r8(dy20,fscal,fiy2);
1023             fiz2             = _fjsp_madd_v2r8(dz20,fscal,fiz2);
1024             
1025             fjx0             = _fjsp_madd_v2r8(dx20,fscal,fjx0);
1026             fjy0             = _fjsp_madd_v2r8(dy20,fscal,fjy0);
1027             fjz0             = _fjsp_madd_v2r8(dz20,fscal,fjz0);
1028
1029             }
1030
1031             /**************************
1032              * CALCULATE INTERACTIONS *
1033              **************************/
1034
1035             if (gmx_fjsp_any_lt_v2r8(rsq30,rcutoff2))
1036             {
1037
1038             r30              = _fjsp_mul_v2r8(rsq30,rinv30);
1039
1040             /* Compute parameters for interactions between i and j atoms */
1041             qq30             = _fjsp_mul_v2r8(iq3,jq0);
1042
1043             /* EWALD ELECTROSTATICS */
1044
1045             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1046             ewrt             = _fjsp_mul_v2r8(r30,ewtabscale);
1047             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
1048             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1049             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1050
1051             gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1052                                          &ewtabF,&ewtabFn);
1053             felec            = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1054             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq30,rinv30),_fjsp_sub_v2r8(rinvsq30,felec));
1055
1056             cutoff_mask      = _fjsp_cmplt_v2r8(rsq30,rcutoff2);
1057
1058             fscal            = felec;
1059
1060             fscal            = _fjsp_and_v2r8(fscal,cutoff_mask);
1061
1062             /* Update vectorial force */
1063             fix3             = _fjsp_madd_v2r8(dx30,fscal,fix3);
1064             fiy3             = _fjsp_madd_v2r8(dy30,fscal,fiy3);
1065             fiz3             = _fjsp_madd_v2r8(dz30,fscal,fiz3);
1066             
1067             fjx0             = _fjsp_madd_v2r8(dx30,fscal,fjx0);
1068             fjy0             = _fjsp_madd_v2r8(dy30,fscal,fjy0);
1069             fjz0             = _fjsp_madd_v2r8(dz30,fscal,fjz0);
1070
1071             }
1072
1073             gmx_fjsp_decrement_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0);
1074
1075             /* Inner loop uses 162 flops */
1076         }
1077
1078         if(jidx<j_index_end)
1079         {
1080
1081             jnrA             = jjnr[jidx];
1082             j_coord_offsetA  = DIM*jnrA;
1083
1084             /* load j atom coordinates */
1085             gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
1086                                               &jx0,&jy0,&jz0);
1087
1088             /* Calculate displacement vector */
1089             dx00             = _fjsp_sub_v2r8(ix0,jx0);
1090             dy00             = _fjsp_sub_v2r8(iy0,jy0);
1091             dz00             = _fjsp_sub_v2r8(iz0,jz0);
1092             dx10             = _fjsp_sub_v2r8(ix1,jx0);
1093             dy10             = _fjsp_sub_v2r8(iy1,jy0);
1094             dz10             = _fjsp_sub_v2r8(iz1,jz0);
1095             dx20             = _fjsp_sub_v2r8(ix2,jx0);
1096             dy20             = _fjsp_sub_v2r8(iy2,jy0);
1097             dz20             = _fjsp_sub_v2r8(iz2,jz0);
1098             dx30             = _fjsp_sub_v2r8(ix3,jx0);
1099             dy30             = _fjsp_sub_v2r8(iy3,jy0);
1100             dz30             = _fjsp_sub_v2r8(iz3,jz0);
1101
1102             /* Calculate squared distance and things based on it */
1103             rsq00            = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
1104             rsq10            = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
1105             rsq20            = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
1106             rsq30            = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
1107
1108             rinv10           = gmx_fjsp_invsqrt_v2r8(rsq10);
1109             rinv20           = gmx_fjsp_invsqrt_v2r8(rsq20);
1110             rinv30           = gmx_fjsp_invsqrt_v2r8(rsq30);
1111
1112             rinvsq00         = gmx_fjsp_inv_v2r8(rsq00);
1113             rinvsq10         = _fjsp_mul_v2r8(rinv10,rinv10);
1114             rinvsq20         = _fjsp_mul_v2r8(rinv20,rinv20);
1115             rinvsq30         = _fjsp_mul_v2r8(rinv30,rinv30);
1116
1117             /* Load parameters for j particles */
1118             jq0              = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
1119             vdwjidx0A        = 2*vdwtype[jnrA+0];
1120
1121             fjx0             = _fjsp_setzero_v2r8();
1122             fjy0             = _fjsp_setzero_v2r8();
1123             fjz0             = _fjsp_setzero_v2r8();
1124
1125             /**************************
1126              * CALCULATE INTERACTIONS *
1127              **************************/
1128
1129             if (gmx_fjsp_any_lt_v2r8(rsq00,rcutoff2))
1130             {
1131
1132             /* Compute parameters for interactions between i and j atoms */
1133             gmx_fjsp_load_1pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
1134
1135             /* LENNARD-JONES DISPERSION/REPULSION */
1136
1137             rinvsix          = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
1138             fvdw             = _fjsp_mul_v2r8(_fjsp_msub_v2r8(c12_00,rinvsix,c6_00),_fjsp_mul_v2r8(rinvsix,rinvsq00));
1139
1140             cutoff_mask      = _fjsp_cmplt_v2r8(rsq00,rcutoff2);
1141
1142             fscal            = fvdw;
1143
1144             fscal            = _fjsp_and_v2r8(fscal,cutoff_mask);
1145
1146             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1147
1148             /* Update vectorial force */
1149             fix0             = _fjsp_madd_v2r8(dx00,fscal,fix0);
1150             fiy0             = _fjsp_madd_v2r8(dy00,fscal,fiy0);
1151             fiz0             = _fjsp_madd_v2r8(dz00,fscal,fiz0);
1152             
1153             fjx0             = _fjsp_madd_v2r8(dx00,fscal,fjx0);
1154             fjy0             = _fjsp_madd_v2r8(dy00,fscal,fjy0);
1155             fjz0             = _fjsp_madd_v2r8(dz00,fscal,fjz0);
1156
1157             }
1158
1159             /**************************
1160              * CALCULATE INTERACTIONS *
1161              **************************/
1162
1163             if (gmx_fjsp_any_lt_v2r8(rsq10,rcutoff2))
1164             {
1165
1166             r10              = _fjsp_mul_v2r8(rsq10,rinv10);
1167
1168             /* Compute parameters for interactions between i and j atoms */
1169             qq10             = _fjsp_mul_v2r8(iq1,jq0);
1170
1171             /* EWALD ELECTROSTATICS */
1172
1173             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1174             ewrt             = _fjsp_mul_v2r8(r10,ewtabscale);
1175             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
1176             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1177             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1178
1179             gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
1180             felec            = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1181             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,rinv10),_fjsp_sub_v2r8(rinvsq10,felec));
1182
1183             cutoff_mask      = _fjsp_cmplt_v2r8(rsq10,rcutoff2);
1184
1185             fscal            = felec;
1186
1187             fscal            = _fjsp_and_v2r8(fscal,cutoff_mask);
1188
1189             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1190
1191             /* Update vectorial force */
1192             fix1             = _fjsp_madd_v2r8(dx10,fscal,fix1);
1193             fiy1             = _fjsp_madd_v2r8(dy10,fscal,fiy1);
1194             fiz1             = _fjsp_madd_v2r8(dz10,fscal,fiz1);
1195             
1196             fjx0             = _fjsp_madd_v2r8(dx10,fscal,fjx0);
1197             fjy0             = _fjsp_madd_v2r8(dy10,fscal,fjy0);
1198             fjz0             = _fjsp_madd_v2r8(dz10,fscal,fjz0);
1199
1200             }
1201
1202             /**************************
1203              * CALCULATE INTERACTIONS *
1204              **************************/
1205
1206             if (gmx_fjsp_any_lt_v2r8(rsq20,rcutoff2))
1207             {
1208
1209             r20              = _fjsp_mul_v2r8(rsq20,rinv20);
1210
1211             /* Compute parameters for interactions between i and j atoms */
1212             qq20             = _fjsp_mul_v2r8(iq2,jq0);
1213
1214             /* EWALD ELECTROSTATICS */
1215
1216             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1217             ewrt             = _fjsp_mul_v2r8(r20,ewtabscale);
1218             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
1219             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1220             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1221
1222             gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
1223             felec            = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1224             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,rinv20),_fjsp_sub_v2r8(rinvsq20,felec));
1225
1226             cutoff_mask      = _fjsp_cmplt_v2r8(rsq20,rcutoff2);
1227
1228             fscal            = felec;
1229
1230             fscal            = _fjsp_and_v2r8(fscal,cutoff_mask);
1231
1232             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1233
1234             /* Update vectorial force */
1235             fix2             = _fjsp_madd_v2r8(dx20,fscal,fix2);
1236             fiy2             = _fjsp_madd_v2r8(dy20,fscal,fiy2);
1237             fiz2             = _fjsp_madd_v2r8(dz20,fscal,fiz2);
1238             
1239             fjx0             = _fjsp_madd_v2r8(dx20,fscal,fjx0);
1240             fjy0             = _fjsp_madd_v2r8(dy20,fscal,fjy0);
1241             fjz0             = _fjsp_madd_v2r8(dz20,fscal,fjz0);
1242
1243             }
1244
1245             /**************************
1246              * CALCULATE INTERACTIONS *
1247              **************************/
1248
1249             if (gmx_fjsp_any_lt_v2r8(rsq30,rcutoff2))
1250             {
1251
1252             r30              = _fjsp_mul_v2r8(rsq30,rinv30);
1253
1254             /* Compute parameters for interactions between i and j atoms */
1255             qq30             = _fjsp_mul_v2r8(iq3,jq0);
1256
1257             /* EWALD ELECTROSTATICS */
1258
1259             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1260             ewrt             = _fjsp_mul_v2r8(r30,ewtabscale);
1261             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
1262             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1263             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1264
1265             gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
1266             felec            = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1267             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq30,rinv30),_fjsp_sub_v2r8(rinvsq30,felec));
1268
1269             cutoff_mask      = _fjsp_cmplt_v2r8(rsq30,rcutoff2);
1270
1271             fscal            = felec;
1272
1273             fscal            = _fjsp_and_v2r8(fscal,cutoff_mask);
1274
1275             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1276
1277             /* Update vectorial force */
1278             fix3             = _fjsp_madd_v2r8(dx30,fscal,fix3);
1279             fiy3             = _fjsp_madd_v2r8(dy30,fscal,fiy3);
1280             fiz3             = _fjsp_madd_v2r8(dz30,fscal,fiz3);
1281             
1282             fjx0             = _fjsp_madd_v2r8(dx30,fscal,fjx0);
1283             fjy0             = _fjsp_madd_v2r8(dy30,fscal,fjy0);
1284             fjz0             = _fjsp_madd_v2r8(dz30,fscal,fjz0);
1285
1286             }
1287
1288             gmx_fjsp_decrement_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0);
1289
1290             /* Inner loop uses 162 flops */
1291         }
1292
1293         /* End of innermost loop */
1294
1295         gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
1296                                               f+i_coord_offset,fshift+i_shift_offset);
1297
1298         /* Increment number of inner iterations */
1299         inneriter                  += j_index_end - j_index_start;
1300
1301         /* Outer loop uses 24 flops */
1302     }
1303
1304     /* Increment number of outer iterations */
1305     outeriter        += nri;
1306
1307     /* Update outer/inner flops */
1308
1309     inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4_F,outeriter*24 + inneriter*162);
1310 }