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