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