Remove all unnecessary HAVE_CONFIG_H
[alexxy/gromacs.git] / src / gromacs / gmxlib / nonbonded / nb_kernel_sparc64_hpc_ace_double / nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_sparc64_hpc_ace_double.c
1 /*
2  * This file is part of the GROMACS molecular simulation package.
3  *
4  * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
5  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6  * and including many others, as listed in the AUTHORS file in the
7  * top-level source directory and at http://www.gromacs.org.
8  *
9  * GROMACS is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public License
11  * as published by the Free Software Foundation; either version 2.1
12  * of the License, or (at your option) any later version.
13  *
14  * GROMACS is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with GROMACS; if not, see
21  * http://www.gnu.org/licenses, or write to the Free Software Foundation,
22  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
23  *
24  * If you want to redistribute modifications to GROMACS, please
25  * consider that scientific software is very special. Version
26  * control is crucial - bugs must be traceable. We will be happy to
27  * consider code for inclusion in the official distribution, but
28  * derived work must not be called official GROMACS. Details are found
29  * in the README & COPYING files - if they are missing, get the
30  * official version at http://www.gromacs.org.
31  *
32  * To help us fund GROMACS development, we humbly ask that you cite
33  * the research papers on the package. Check out http://www.gromacs.org.
34  */
35 /*
36  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
37  */
38 #include "config.h"
39
40 #include <math.h>
41
42 #include "../nb_kernel.h"
43 #include "types/simple.h"
44 #include "gromacs/math/vec.h"
45 #include "nrnb.h"
46
47 #include "kernelutil_sparc64_hpc_ace_double.h"
48
49 /*
50  * Gromacs nonbonded kernel:   nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sparc64_hpc_ace_double
51  * Electrostatics interaction: Coulomb
52  * VdW interaction:            CubicSplineTable
53  * Geometry:                   Water4-Water4
54  * Calculate force/pot:        PotentialAndForce
55  */
56 void
57 nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sparc64_hpc_ace_double
58                     (t_nblist                    * gmx_restrict       nlist,
59                      rvec                        * gmx_restrict          xx,
60                      rvec                        * gmx_restrict          ff,
61                      t_forcerec                  * gmx_restrict          fr,
62                      t_mdatoms                   * gmx_restrict     mdatoms,
63                      nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
64                      t_nrnb                      * gmx_restrict        nrnb)
65 {
66     /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
67      * just 0 for non-waters.
68      * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
69      * jnr indices corresponding to data put in the four positions in the SIMD register.
70      */
71     int              i_shift_offset,i_coord_offset,outeriter,inneriter;
72     int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
73     int              jnrA,jnrB;
74     int              j_coord_offsetA,j_coord_offsetB;
75     int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
76     real             rcutoff_scalar;
77     real             *shiftvec,*fshift,*x,*f;
78     _fjsp_v2r8       tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
79     int              vdwioffset0;
80     _fjsp_v2r8       ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
81     int              vdwioffset1;
82     _fjsp_v2r8       ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
83     int              vdwioffset2;
84     _fjsp_v2r8       ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
85     int              vdwioffset3;
86     _fjsp_v2r8       ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
87     int              vdwjidx0A,vdwjidx0B;
88     _fjsp_v2r8       jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
89     int              vdwjidx1A,vdwjidx1B;
90     _fjsp_v2r8       jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
91     int              vdwjidx2A,vdwjidx2B;
92     _fjsp_v2r8       jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
93     int              vdwjidx3A,vdwjidx3B;
94     _fjsp_v2r8       jx3,jy3,jz3,fjx3,fjy3,fjz3,jq3,isaj3;
95     _fjsp_v2r8       dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
96     _fjsp_v2r8       dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11;
97     _fjsp_v2r8       dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12;
98     _fjsp_v2r8       dx13,dy13,dz13,rsq13,rinv13,rinvsq13,r13,qq13,c6_13,c12_13;
99     _fjsp_v2r8       dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21;
100     _fjsp_v2r8       dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22;
101     _fjsp_v2r8       dx23,dy23,dz23,rsq23,rinv23,rinvsq23,r23,qq23,c6_23,c12_23;
102     _fjsp_v2r8       dx31,dy31,dz31,rsq31,rinv31,rinvsq31,r31,qq31,c6_31,c12_31;
103     _fjsp_v2r8       dx32,dy32,dz32,rsq32,rinv32,rinvsq32,r32,qq32,c6_32,c12_32;
104     _fjsp_v2r8       dx33,dy33,dz33,rsq33,rinv33,rinvsq33,r33,qq33,c6_33,c12_33;
105     _fjsp_v2r8       velec,felec,velecsum,facel,crf,krf,krf2;
106     real             *charge;
107     int              nvdwtype;
108     _fjsp_v2r8       rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
109     int              *vdwtype;
110     real             *vdwparam;
111     _fjsp_v2r8       one_sixth   = gmx_fjsp_set1_v2r8(1.0/6.0);
112     _fjsp_v2r8       one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
113     _fjsp_v2r8       rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
114     real             *vftab;
115     _fjsp_v2r8       itab_tmp;
116     _fjsp_v2r8       dummy_mask,cutoff_mask;
117     _fjsp_v2r8       one     = gmx_fjsp_set1_v2r8(1.0);
118     _fjsp_v2r8       two     = gmx_fjsp_set1_v2r8(2.0);
119     union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
120
121     x                = xx[0];
122     f                = ff[0];
123
124     nri              = nlist->nri;
125     iinr             = nlist->iinr;
126     jindex           = nlist->jindex;
127     jjnr             = nlist->jjnr;
128     shiftidx         = nlist->shift;
129     gid              = nlist->gid;
130     shiftvec         = fr->shift_vec[0];
131     fshift           = fr->fshift[0];
132     facel            = gmx_fjsp_set1_v2r8(fr->epsfac);
133     charge           = mdatoms->chargeA;
134     nvdwtype         = fr->ntype;
135     vdwparam         = fr->nbfp;
136     vdwtype          = mdatoms->typeA;
137
138     vftab            = kernel_data->table_vdw->data;
139     vftabscale       = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
140
141     /* Setup water-specific parameters */
142     inr              = nlist->iinr[0];
143     iq1              = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
144     iq2              = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
145     iq3              = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+3]));
146     vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
147
148     jq1              = gmx_fjsp_set1_v2r8(charge[inr+1]);
149     jq2              = gmx_fjsp_set1_v2r8(charge[inr+2]);
150     jq3              = gmx_fjsp_set1_v2r8(charge[inr+3]);
151     vdwjidx0A        = 2*vdwtype[inr+0];
152     c6_00            = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A]);
153     c12_00           = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A+1]);
154     qq11             = _fjsp_mul_v2r8(iq1,jq1);
155     qq12             = _fjsp_mul_v2r8(iq1,jq2);
156     qq13             = _fjsp_mul_v2r8(iq1,jq3);
157     qq21             = _fjsp_mul_v2r8(iq2,jq1);
158     qq22             = _fjsp_mul_v2r8(iq2,jq2);
159     qq23             = _fjsp_mul_v2r8(iq2,jq3);
160     qq31             = _fjsp_mul_v2r8(iq3,jq1);
161     qq32             = _fjsp_mul_v2r8(iq3,jq2);
162     qq33             = _fjsp_mul_v2r8(iq3,jq3);
163
164     /* Avoid stupid compiler warnings */
165     jnrA = jnrB = 0;
166     j_coord_offsetA = 0;
167     j_coord_offsetB = 0;
168
169     outeriter        = 0;
170     inneriter        = 0;
171
172     /* Start outer loop over neighborlists */
173     for(iidx=0; iidx<nri; iidx++)
174     {
175         /* Load shift vector for this list */
176         i_shift_offset   = DIM*shiftidx[iidx];
177
178         /* Load limits for loop over neighbors */
179         j_index_start    = jindex[iidx];
180         j_index_end      = jindex[iidx+1];
181
182         /* Get outer coordinate index */
183         inr              = iinr[iidx];
184         i_coord_offset   = DIM*inr;
185
186         /* Load i particle coords and add shift vector */
187         gmx_fjsp_load_shift_and_4rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
188                                                  &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
189
190         fix0             = _fjsp_setzero_v2r8();
191         fiy0             = _fjsp_setzero_v2r8();
192         fiz0             = _fjsp_setzero_v2r8();
193         fix1             = _fjsp_setzero_v2r8();
194         fiy1             = _fjsp_setzero_v2r8();
195         fiz1             = _fjsp_setzero_v2r8();
196         fix2             = _fjsp_setzero_v2r8();
197         fiy2             = _fjsp_setzero_v2r8();
198         fiz2             = _fjsp_setzero_v2r8();
199         fix3             = _fjsp_setzero_v2r8();
200         fiy3             = _fjsp_setzero_v2r8();
201         fiz3             = _fjsp_setzero_v2r8();
202
203         /* Reset potential sums */
204         velecsum         = _fjsp_setzero_v2r8();
205         vvdwsum          = _fjsp_setzero_v2r8();
206
207         /* Start inner kernel loop */
208         for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
209         {
210
211             /* Get j neighbor index, and coordinate index */
212             jnrA             = jjnr[jidx];
213             jnrB             = jjnr[jidx+1];
214             j_coord_offsetA  = DIM*jnrA;
215             j_coord_offsetB  = DIM*jnrB;
216
217             /* load j atom coordinates */
218             gmx_fjsp_load_4rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
219                                               &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,
220                                               &jy2,&jz2,&jx3,&jy3,&jz3);
221
222             /* Calculate displacement vector */
223             dx00             = _fjsp_sub_v2r8(ix0,jx0);
224             dy00             = _fjsp_sub_v2r8(iy0,jy0);
225             dz00             = _fjsp_sub_v2r8(iz0,jz0);
226             dx11             = _fjsp_sub_v2r8(ix1,jx1);
227             dy11             = _fjsp_sub_v2r8(iy1,jy1);
228             dz11             = _fjsp_sub_v2r8(iz1,jz1);
229             dx12             = _fjsp_sub_v2r8(ix1,jx2);
230             dy12             = _fjsp_sub_v2r8(iy1,jy2);
231             dz12             = _fjsp_sub_v2r8(iz1,jz2);
232             dx13             = _fjsp_sub_v2r8(ix1,jx3);
233             dy13             = _fjsp_sub_v2r8(iy1,jy3);
234             dz13             = _fjsp_sub_v2r8(iz1,jz3);
235             dx21             = _fjsp_sub_v2r8(ix2,jx1);
236             dy21             = _fjsp_sub_v2r8(iy2,jy1);
237             dz21             = _fjsp_sub_v2r8(iz2,jz1);
238             dx22             = _fjsp_sub_v2r8(ix2,jx2);
239             dy22             = _fjsp_sub_v2r8(iy2,jy2);
240             dz22             = _fjsp_sub_v2r8(iz2,jz2);
241             dx23             = _fjsp_sub_v2r8(ix2,jx3);
242             dy23             = _fjsp_sub_v2r8(iy2,jy3);
243             dz23             = _fjsp_sub_v2r8(iz2,jz3);
244             dx31             = _fjsp_sub_v2r8(ix3,jx1);
245             dy31             = _fjsp_sub_v2r8(iy3,jy1);
246             dz31             = _fjsp_sub_v2r8(iz3,jz1);
247             dx32             = _fjsp_sub_v2r8(ix3,jx2);
248             dy32             = _fjsp_sub_v2r8(iy3,jy2);
249             dz32             = _fjsp_sub_v2r8(iz3,jz2);
250             dx33             = _fjsp_sub_v2r8(ix3,jx3);
251             dy33             = _fjsp_sub_v2r8(iy3,jy3);
252             dz33             = _fjsp_sub_v2r8(iz3,jz3);
253
254             /* Calculate squared distance and things based on it */
255             rsq00            = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
256             rsq11            = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
257             rsq12            = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
258             rsq13            = gmx_fjsp_calc_rsq_v2r8(dx13,dy13,dz13);
259             rsq21            = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
260             rsq22            = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
261             rsq23            = gmx_fjsp_calc_rsq_v2r8(dx23,dy23,dz23);
262             rsq31            = gmx_fjsp_calc_rsq_v2r8(dx31,dy31,dz31);
263             rsq32            = gmx_fjsp_calc_rsq_v2r8(dx32,dy32,dz32);
264             rsq33            = gmx_fjsp_calc_rsq_v2r8(dx33,dy33,dz33);
265
266             rinv00           = gmx_fjsp_invsqrt_v2r8(rsq00);
267             rinv11           = gmx_fjsp_invsqrt_v2r8(rsq11);
268             rinv12           = gmx_fjsp_invsqrt_v2r8(rsq12);
269             rinv13           = gmx_fjsp_invsqrt_v2r8(rsq13);
270             rinv21           = gmx_fjsp_invsqrt_v2r8(rsq21);
271             rinv22           = gmx_fjsp_invsqrt_v2r8(rsq22);
272             rinv23           = gmx_fjsp_invsqrt_v2r8(rsq23);
273             rinv31           = gmx_fjsp_invsqrt_v2r8(rsq31);
274             rinv32           = gmx_fjsp_invsqrt_v2r8(rsq32);
275             rinv33           = gmx_fjsp_invsqrt_v2r8(rsq33);
276
277             rinvsq11         = _fjsp_mul_v2r8(rinv11,rinv11);
278             rinvsq12         = _fjsp_mul_v2r8(rinv12,rinv12);
279             rinvsq13         = _fjsp_mul_v2r8(rinv13,rinv13);
280             rinvsq21         = _fjsp_mul_v2r8(rinv21,rinv21);
281             rinvsq22         = _fjsp_mul_v2r8(rinv22,rinv22);
282             rinvsq23         = _fjsp_mul_v2r8(rinv23,rinv23);
283             rinvsq31         = _fjsp_mul_v2r8(rinv31,rinv31);
284             rinvsq32         = _fjsp_mul_v2r8(rinv32,rinv32);
285             rinvsq33         = _fjsp_mul_v2r8(rinv33,rinv33);
286
287             fjx0             = _fjsp_setzero_v2r8();
288             fjy0             = _fjsp_setzero_v2r8();
289             fjz0             = _fjsp_setzero_v2r8();
290             fjx1             = _fjsp_setzero_v2r8();
291             fjy1             = _fjsp_setzero_v2r8();
292             fjz1             = _fjsp_setzero_v2r8();
293             fjx2             = _fjsp_setzero_v2r8();
294             fjy2             = _fjsp_setzero_v2r8();
295             fjz2             = _fjsp_setzero_v2r8();
296             fjx3             = _fjsp_setzero_v2r8();
297             fjy3             = _fjsp_setzero_v2r8();
298             fjz3             = _fjsp_setzero_v2r8();
299
300             /**************************
301              * CALCULATE INTERACTIONS *
302              **************************/
303
304             r00              = _fjsp_mul_v2r8(rsq00,rinv00);
305
306             /* Calculate table index by multiplying r with table scale and truncate to integer */
307             rt               = _fjsp_mul_v2r8(r00,vftabscale);
308             itab_tmp         = _fjsp_dtox_v2r8(rt);
309             vfeps            = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
310             twovfeps         = _fjsp_add_v2r8(vfeps,vfeps);
311             _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
312
313             vfconv.i[0]     *= 8;
314             vfconv.i[1]     *= 8;
315
316             /* CUBIC SPLINE TABLE DISPERSION */
317             Y                = _fjsp_load_v2r8( vftab + vfconv.i[0] );
318             F                = _fjsp_load_v2r8( vftab + vfconv.i[1] );
319             GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
320             G                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
321             H                = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
322             GMX_FJSP_TRANSPOSE2_V2R8(G,H);
323             Fp               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
324             VV               = _fjsp_madd_v2r8(vfeps,Fp,Y);
325             vvdw6            = _fjsp_mul_v2r8(c6_00,VV);
326             FF               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
327             fvdw6            = _fjsp_mul_v2r8(c6_00,FF);
328
329             /* CUBIC SPLINE TABLE REPULSION */
330             Y                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
331             F                = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
332             GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
333             G                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
334             H                = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
335             GMX_FJSP_TRANSPOSE2_V2R8(G,H);
336             Fp               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
337             VV               = _fjsp_madd_v2r8(vfeps,Fp,Y);
338             vvdw12           = _fjsp_mul_v2r8(c12_00,VV);
339             FF               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
340             fvdw12           = _fjsp_mul_v2r8(c12_00,FF);
341             vvdw             = _fjsp_add_v2r8(vvdw12,vvdw6);
342             fvdw             = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
343
344             /* Update potential sum for this i atom from the interaction with this j atom. */
345             vvdwsum          = _fjsp_add_v2r8(vvdwsum,vvdw);
346
347             fscal            = fvdw;
348
349             /* Update vectorial force */
350             fix0             = _fjsp_madd_v2r8(dx00,fscal,fix0);
351             fiy0             = _fjsp_madd_v2r8(dy00,fscal,fiy0);
352             fiz0             = _fjsp_madd_v2r8(dz00,fscal,fiz0);
353             
354             fjx0             = _fjsp_madd_v2r8(dx00,fscal,fjx0);
355             fjy0             = _fjsp_madd_v2r8(dy00,fscal,fjy0);
356             fjz0             = _fjsp_madd_v2r8(dz00,fscal,fjz0);
357
358             /**************************
359              * CALCULATE INTERACTIONS *
360              **************************/
361
362             /* COULOMB ELECTROSTATICS */
363             velec            = _fjsp_mul_v2r8(qq11,rinv11);
364             felec            = _fjsp_mul_v2r8(velec,rinvsq11);
365
366             /* Update potential sum for this i atom from the interaction with this j atom. */
367             velecsum         = _fjsp_add_v2r8(velecsum,velec);
368
369             fscal            = felec;
370
371             /* Update vectorial force */
372             fix1             = _fjsp_madd_v2r8(dx11,fscal,fix1);
373             fiy1             = _fjsp_madd_v2r8(dy11,fscal,fiy1);
374             fiz1             = _fjsp_madd_v2r8(dz11,fscal,fiz1);
375             
376             fjx1             = _fjsp_madd_v2r8(dx11,fscal,fjx1);
377             fjy1             = _fjsp_madd_v2r8(dy11,fscal,fjy1);
378             fjz1             = _fjsp_madd_v2r8(dz11,fscal,fjz1);
379
380             /**************************
381              * CALCULATE INTERACTIONS *
382              **************************/
383
384             /* COULOMB ELECTROSTATICS */
385             velec            = _fjsp_mul_v2r8(qq12,rinv12);
386             felec            = _fjsp_mul_v2r8(velec,rinvsq12);
387
388             /* Update potential sum for this i atom from the interaction with this j atom. */
389             velecsum         = _fjsp_add_v2r8(velecsum,velec);
390
391             fscal            = felec;
392
393             /* Update vectorial force */
394             fix1             = _fjsp_madd_v2r8(dx12,fscal,fix1);
395             fiy1             = _fjsp_madd_v2r8(dy12,fscal,fiy1);
396             fiz1             = _fjsp_madd_v2r8(dz12,fscal,fiz1);
397             
398             fjx2             = _fjsp_madd_v2r8(dx12,fscal,fjx2);
399             fjy2             = _fjsp_madd_v2r8(dy12,fscal,fjy2);
400             fjz2             = _fjsp_madd_v2r8(dz12,fscal,fjz2);
401
402             /**************************
403              * CALCULATE INTERACTIONS *
404              **************************/
405
406             /* COULOMB ELECTROSTATICS */
407             velec            = _fjsp_mul_v2r8(qq13,rinv13);
408             felec            = _fjsp_mul_v2r8(velec,rinvsq13);
409
410             /* Update potential sum for this i atom from the interaction with this j atom. */
411             velecsum         = _fjsp_add_v2r8(velecsum,velec);
412
413             fscal            = felec;
414
415             /* Update vectorial force */
416             fix1             = _fjsp_madd_v2r8(dx13,fscal,fix1);
417             fiy1             = _fjsp_madd_v2r8(dy13,fscal,fiy1);
418             fiz1             = _fjsp_madd_v2r8(dz13,fscal,fiz1);
419             
420             fjx3             = _fjsp_madd_v2r8(dx13,fscal,fjx3);
421             fjy3             = _fjsp_madd_v2r8(dy13,fscal,fjy3);
422             fjz3             = _fjsp_madd_v2r8(dz13,fscal,fjz3);
423
424             /**************************
425              * CALCULATE INTERACTIONS *
426              **************************/
427
428             /* COULOMB ELECTROSTATICS */
429             velec            = _fjsp_mul_v2r8(qq21,rinv21);
430             felec            = _fjsp_mul_v2r8(velec,rinvsq21);
431
432             /* Update potential sum for this i atom from the interaction with this j atom. */
433             velecsum         = _fjsp_add_v2r8(velecsum,velec);
434
435             fscal            = felec;
436
437             /* Update vectorial force */
438             fix2             = _fjsp_madd_v2r8(dx21,fscal,fix2);
439             fiy2             = _fjsp_madd_v2r8(dy21,fscal,fiy2);
440             fiz2             = _fjsp_madd_v2r8(dz21,fscal,fiz2);
441             
442             fjx1             = _fjsp_madd_v2r8(dx21,fscal,fjx1);
443             fjy1             = _fjsp_madd_v2r8(dy21,fscal,fjy1);
444             fjz1             = _fjsp_madd_v2r8(dz21,fscal,fjz1);
445
446             /**************************
447              * CALCULATE INTERACTIONS *
448              **************************/
449
450             /* COULOMB ELECTROSTATICS */
451             velec            = _fjsp_mul_v2r8(qq22,rinv22);
452             felec            = _fjsp_mul_v2r8(velec,rinvsq22);
453
454             /* Update potential sum for this i atom from the interaction with this j atom. */
455             velecsum         = _fjsp_add_v2r8(velecsum,velec);
456
457             fscal            = felec;
458
459             /* Update vectorial force */
460             fix2             = _fjsp_madd_v2r8(dx22,fscal,fix2);
461             fiy2             = _fjsp_madd_v2r8(dy22,fscal,fiy2);
462             fiz2             = _fjsp_madd_v2r8(dz22,fscal,fiz2);
463             
464             fjx2             = _fjsp_madd_v2r8(dx22,fscal,fjx2);
465             fjy2             = _fjsp_madd_v2r8(dy22,fscal,fjy2);
466             fjz2             = _fjsp_madd_v2r8(dz22,fscal,fjz2);
467
468             /**************************
469              * CALCULATE INTERACTIONS *
470              **************************/
471
472             /* COULOMB ELECTROSTATICS */
473             velec            = _fjsp_mul_v2r8(qq23,rinv23);
474             felec            = _fjsp_mul_v2r8(velec,rinvsq23);
475
476             /* Update potential sum for this i atom from the interaction with this j atom. */
477             velecsum         = _fjsp_add_v2r8(velecsum,velec);
478
479             fscal            = felec;
480
481             /* Update vectorial force */
482             fix2             = _fjsp_madd_v2r8(dx23,fscal,fix2);
483             fiy2             = _fjsp_madd_v2r8(dy23,fscal,fiy2);
484             fiz2             = _fjsp_madd_v2r8(dz23,fscal,fiz2);
485             
486             fjx3             = _fjsp_madd_v2r8(dx23,fscal,fjx3);
487             fjy3             = _fjsp_madd_v2r8(dy23,fscal,fjy3);
488             fjz3             = _fjsp_madd_v2r8(dz23,fscal,fjz3);
489
490             /**************************
491              * CALCULATE INTERACTIONS *
492              **************************/
493
494             /* COULOMB ELECTROSTATICS */
495             velec            = _fjsp_mul_v2r8(qq31,rinv31);
496             felec            = _fjsp_mul_v2r8(velec,rinvsq31);
497
498             /* Update potential sum for this i atom from the interaction with this j atom. */
499             velecsum         = _fjsp_add_v2r8(velecsum,velec);
500
501             fscal            = felec;
502
503             /* Update vectorial force */
504             fix3             = _fjsp_madd_v2r8(dx31,fscal,fix3);
505             fiy3             = _fjsp_madd_v2r8(dy31,fscal,fiy3);
506             fiz3             = _fjsp_madd_v2r8(dz31,fscal,fiz3);
507             
508             fjx1             = _fjsp_madd_v2r8(dx31,fscal,fjx1);
509             fjy1             = _fjsp_madd_v2r8(dy31,fscal,fjy1);
510             fjz1             = _fjsp_madd_v2r8(dz31,fscal,fjz1);
511
512             /**************************
513              * CALCULATE INTERACTIONS *
514              **************************/
515
516             /* COULOMB ELECTROSTATICS */
517             velec            = _fjsp_mul_v2r8(qq32,rinv32);
518             felec            = _fjsp_mul_v2r8(velec,rinvsq32);
519
520             /* Update potential sum for this i atom from the interaction with this j atom. */
521             velecsum         = _fjsp_add_v2r8(velecsum,velec);
522
523             fscal            = felec;
524
525             /* Update vectorial force */
526             fix3             = _fjsp_madd_v2r8(dx32,fscal,fix3);
527             fiy3             = _fjsp_madd_v2r8(dy32,fscal,fiy3);
528             fiz3             = _fjsp_madd_v2r8(dz32,fscal,fiz3);
529             
530             fjx2             = _fjsp_madd_v2r8(dx32,fscal,fjx2);
531             fjy2             = _fjsp_madd_v2r8(dy32,fscal,fjy2);
532             fjz2             = _fjsp_madd_v2r8(dz32,fscal,fjz2);
533
534             /**************************
535              * CALCULATE INTERACTIONS *
536              **************************/
537
538             /* COULOMB ELECTROSTATICS */
539             velec            = _fjsp_mul_v2r8(qq33,rinv33);
540             felec            = _fjsp_mul_v2r8(velec,rinvsq33);
541
542             /* Update potential sum for this i atom from the interaction with this j atom. */
543             velecsum         = _fjsp_add_v2r8(velecsum,velec);
544
545             fscal            = felec;
546
547             /* Update vectorial force */
548             fix3             = _fjsp_madd_v2r8(dx33,fscal,fix3);
549             fiy3             = _fjsp_madd_v2r8(dy33,fscal,fiy3);
550             fiz3             = _fjsp_madd_v2r8(dz33,fscal,fiz3);
551             
552             fjx3             = _fjsp_madd_v2r8(dx33,fscal,fjx3);
553             fjy3             = _fjsp_madd_v2r8(dy33,fscal,fjy3);
554             fjz3             = _fjsp_madd_v2r8(dz33,fscal,fjz3);
555
556             gmx_fjsp_decrement_4rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2,fjx3,fjy3,fjz3);
557
558             /* Inner loop uses 341 flops */
559         }
560
561         if(jidx<j_index_end)
562         {
563
564             jnrA             = jjnr[jidx];
565             j_coord_offsetA  = DIM*jnrA;
566
567             /* load j atom coordinates */
568             gmx_fjsp_load_4rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
569                                               &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,
570                                               &jy2,&jz2,&jx3,&jy3,&jz3);
571
572             /* Calculate displacement vector */
573             dx00             = _fjsp_sub_v2r8(ix0,jx0);
574             dy00             = _fjsp_sub_v2r8(iy0,jy0);
575             dz00             = _fjsp_sub_v2r8(iz0,jz0);
576             dx11             = _fjsp_sub_v2r8(ix1,jx1);
577             dy11             = _fjsp_sub_v2r8(iy1,jy1);
578             dz11             = _fjsp_sub_v2r8(iz1,jz1);
579             dx12             = _fjsp_sub_v2r8(ix1,jx2);
580             dy12             = _fjsp_sub_v2r8(iy1,jy2);
581             dz12             = _fjsp_sub_v2r8(iz1,jz2);
582             dx13             = _fjsp_sub_v2r8(ix1,jx3);
583             dy13             = _fjsp_sub_v2r8(iy1,jy3);
584             dz13             = _fjsp_sub_v2r8(iz1,jz3);
585             dx21             = _fjsp_sub_v2r8(ix2,jx1);
586             dy21             = _fjsp_sub_v2r8(iy2,jy1);
587             dz21             = _fjsp_sub_v2r8(iz2,jz1);
588             dx22             = _fjsp_sub_v2r8(ix2,jx2);
589             dy22             = _fjsp_sub_v2r8(iy2,jy2);
590             dz22             = _fjsp_sub_v2r8(iz2,jz2);
591             dx23             = _fjsp_sub_v2r8(ix2,jx3);
592             dy23             = _fjsp_sub_v2r8(iy2,jy3);
593             dz23             = _fjsp_sub_v2r8(iz2,jz3);
594             dx31             = _fjsp_sub_v2r8(ix3,jx1);
595             dy31             = _fjsp_sub_v2r8(iy3,jy1);
596             dz31             = _fjsp_sub_v2r8(iz3,jz1);
597             dx32             = _fjsp_sub_v2r8(ix3,jx2);
598             dy32             = _fjsp_sub_v2r8(iy3,jy2);
599             dz32             = _fjsp_sub_v2r8(iz3,jz2);
600             dx33             = _fjsp_sub_v2r8(ix3,jx3);
601             dy33             = _fjsp_sub_v2r8(iy3,jy3);
602             dz33             = _fjsp_sub_v2r8(iz3,jz3);
603
604             /* Calculate squared distance and things based on it */
605             rsq00            = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
606             rsq11            = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
607             rsq12            = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
608             rsq13            = gmx_fjsp_calc_rsq_v2r8(dx13,dy13,dz13);
609             rsq21            = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
610             rsq22            = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
611             rsq23            = gmx_fjsp_calc_rsq_v2r8(dx23,dy23,dz23);
612             rsq31            = gmx_fjsp_calc_rsq_v2r8(dx31,dy31,dz31);
613             rsq32            = gmx_fjsp_calc_rsq_v2r8(dx32,dy32,dz32);
614             rsq33            = gmx_fjsp_calc_rsq_v2r8(dx33,dy33,dz33);
615
616             rinv00           = gmx_fjsp_invsqrt_v2r8(rsq00);
617             rinv11           = gmx_fjsp_invsqrt_v2r8(rsq11);
618             rinv12           = gmx_fjsp_invsqrt_v2r8(rsq12);
619             rinv13           = gmx_fjsp_invsqrt_v2r8(rsq13);
620             rinv21           = gmx_fjsp_invsqrt_v2r8(rsq21);
621             rinv22           = gmx_fjsp_invsqrt_v2r8(rsq22);
622             rinv23           = gmx_fjsp_invsqrt_v2r8(rsq23);
623             rinv31           = gmx_fjsp_invsqrt_v2r8(rsq31);
624             rinv32           = gmx_fjsp_invsqrt_v2r8(rsq32);
625             rinv33           = gmx_fjsp_invsqrt_v2r8(rsq33);
626
627             rinvsq11         = _fjsp_mul_v2r8(rinv11,rinv11);
628             rinvsq12         = _fjsp_mul_v2r8(rinv12,rinv12);
629             rinvsq13         = _fjsp_mul_v2r8(rinv13,rinv13);
630             rinvsq21         = _fjsp_mul_v2r8(rinv21,rinv21);
631             rinvsq22         = _fjsp_mul_v2r8(rinv22,rinv22);
632             rinvsq23         = _fjsp_mul_v2r8(rinv23,rinv23);
633             rinvsq31         = _fjsp_mul_v2r8(rinv31,rinv31);
634             rinvsq32         = _fjsp_mul_v2r8(rinv32,rinv32);
635             rinvsq33         = _fjsp_mul_v2r8(rinv33,rinv33);
636
637             fjx0             = _fjsp_setzero_v2r8();
638             fjy0             = _fjsp_setzero_v2r8();
639             fjz0             = _fjsp_setzero_v2r8();
640             fjx1             = _fjsp_setzero_v2r8();
641             fjy1             = _fjsp_setzero_v2r8();
642             fjz1             = _fjsp_setzero_v2r8();
643             fjx2             = _fjsp_setzero_v2r8();
644             fjy2             = _fjsp_setzero_v2r8();
645             fjz2             = _fjsp_setzero_v2r8();
646             fjx3             = _fjsp_setzero_v2r8();
647             fjy3             = _fjsp_setzero_v2r8();
648             fjz3             = _fjsp_setzero_v2r8();
649
650             /**************************
651              * CALCULATE INTERACTIONS *
652              **************************/
653
654             r00              = _fjsp_mul_v2r8(rsq00,rinv00);
655
656             /* Calculate table index by multiplying r with table scale and truncate to integer */
657             rt               = _fjsp_mul_v2r8(r00,vftabscale);
658             itab_tmp         = _fjsp_dtox_v2r8(rt);
659             vfeps            = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
660             twovfeps         = _fjsp_add_v2r8(vfeps,vfeps);
661             _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
662
663             vfconv.i[0]     *= 8;
664             vfconv.i[1]     *= 8;
665
666             /* CUBIC SPLINE TABLE DISPERSION */
667             Y                = _fjsp_load_v2r8( vftab + vfconv.i[0] );
668             F                = _fjsp_setzero_v2r8();
669             GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
670             G                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
671             H                = _fjsp_setzero_v2r8();
672             GMX_FJSP_TRANSPOSE2_V2R8(G,H);
673             Fp               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
674             VV               = _fjsp_madd_v2r8(vfeps,Fp,Y);
675             vvdw6            = _fjsp_mul_v2r8(c6_00,VV);
676             FF               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
677             fvdw6            = _fjsp_mul_v2r8(c6_00,FF);
678
679             /* CUBIC SPLINE TABLE REPULSION */
680             Y                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
681             F                = _fjsp_setzero_v2r8();
682             GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
683             G                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
684             H                = _fjsp_setzero_v2r8();
685             GMX_FJSP_TRANSPOSE2_V2R8(G,H);
686             Fp               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
687             VV               = _fjsp_madd_v2r8(vfeps,Fp,Y);
688             vvdw12           = _fjsp_mul_v2r8(c12_00,VV);
689             FF               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
690             fvdw12           = _fjsp_mul_v2r8(c12_00,FF);
691             vvdw             = _fjsp_add_v2r8(vvdw12,vvdw6);
692             fvdw             = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
693
694             /* Update potential sum for this i atom from the interaction with this j atom. */
695             vvdw             = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
696             vvdwsum          = _fjsp_add_v2r8(vvdwsum,vvdw);
697
698             fscal            = fvdw;
699
700             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
701
702             /* Update vectorial force */
703             fix0             = _fjsp_madd_v2r8(dx00,fscal,fix0);
704             fiy0             = _fjsp_madd_v2r8(dy00,fscal,fiy0);
705             fiz0             = _fjsp_madd_v2r8(dz00,fscal,fiz0);
706             
707             fjx0             = _fjsp_madd_v2r8(dx00,fscal,fjx0);
708             fjy0             = _fjsp_madd_v2r8(dy00,fscal,fjy0);
709             fjz0             = _fjsp_madd_v2r8(dz00,fscal,fjz0);
710
711             /**************************
712              * CALCULATE INTERACTIONS *
713              **************************/
714
715             /* COULOMB ELECTROSTATICS */
716             velec            = _fjsp_mul_v2r8(qq11,rinv11);
717             felec            = _fjsp_mul_v2r8(velec,rinvsq11);
718
719             /* Update potential sum for this i atom from the interaction with this j atom. */
720             velec            = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
721             velecsum         = _fjsp_add_v2r8(velecsum,velec);
722
723             fscal            = felec;
724
725             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
726
727             /* Update vectorial force */
728             fix1             = _fjsp_madd_v2r8(dx11,fscal,fix1);
729             fiy1             = _fjsp_madd_v2r8(dy11,fscal,fiy1);
730             fiz1             = _fjsp_madd_v2r8(dz11,fscal,fiz1);
731             
732             fjx1             = _fjsp_madd_v2r8(dx11,fscal,fjx1);
733             fjy1             = _fjsp_madd_v2r8(dy11,fscal,fjy1);
734             fjz1             = _fjsp_madd_v2r8(dz11,fscal,fjz1);
735
736             /**************************
737              * CALCULATE INTERACTIONS *
738              **************************/
739
740             /* COULOMB ELECTROSTATICS */
741             velec            = _fjsp_mul_v2r8(qq12,rinv12);
742             felec            = _fjsp_mul_v2r8(velec,rinvsq12);
743
744             /* Update potential sum for this i atom from the interaction with this j atom. */
745             velec            = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
746             velecsum         = _fjsp_add_v2r8(velecsum,velec);
747
748             fscal            = felec;
749
750             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
751
752             /* Update vectorial force */
753             fix1             = _fjsp_madd_v2r8(dx12,fscal,fix1);
754             fiy1             = _fjsp_madd_v2r8(dy12,fscal,fiy1);
755             fiz1             = _fjsp_madd_v2r8(dz12,fscal,fiz1);
756             
757             fjx2             = _fjsp_madd_v2r8(dx12,fscal,fjx2);
758             fjy2             = _fjsp_madd_v2r8(dy12,fscal,fjy2);
759             fjz2             = _fjsp_madd_v2r8(dz12,fscal,fjz2);
760
761             /**************************
762              * CALCULATE INTERACTIONS *
763              **************************/
764
765             /* COULOMB ELECTROSTATICS */
766             velec            = _fjsp_mul_v2r8(qq13,rinv13);
767             felec            = _fjsp_mul_v2r8(velec,rinvsq13);
768
769             /* Update potential sum for this i atom from the interaction with this j atom. */
770             velec            = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
771             velecsum         = _fjsp_add_v2r8(velecsum,velec);
772
773             fscal            = felec;
774
775             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
776
777             /* Update vectorial force */
778             fix1             = _fjsp_madd_v2r8(dx13,fscal,fix1);
779             fiy1             = _fjsp_madd_v2r8(dy13,fscal,fiy1);
780             fiz1             = _fjsp_madd_v2r8(dz13,fscal,fiz1);
781             
782             fjx3             = _fjsp_madd_v2r8(dx13,fscal,fjx3);
783             fjy3             = _fjsp_madd_v2r8(dy13,fscal,fjy3);
784             fjz3             = _fjsp_madd_v2r8(dz13,fscal,fjz3);
785
786             /**************************
787              * CALCULATE INTERACTIONS *
788              **************************/
789
790             /* COULOMB ELECTROSTATICS */
791             velec            = _fjsp_mul_v2r8(qq21,rinv21);
792             felec            = _fjsp_mul_v2r8(velec,rinvsq21);
793
794             /* Update potential sum for this i atom from the interaction with this j atom. */
795             velec            = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
796             velecsum         = _fjsp_add_v2r8(velecsum,velec);
797
798             fscal            = felec;
799
800             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
801
802             /* Update vectorial force */
803             fix2             = _fjsp_madd_v2r8(dx21,fscal,fix2);
804             fiy2             = _fjsp_madd_v2r8(dy21,fscal,fiy2);
805             fiz2             = _fjsp_madd_v2r8(dz21,fscal,fiz2);
806             
807             fjx1             = _fjsp_madd_v2r8(dx21,fscal,fjx1);
808             fjy1             = _fjsp_madd_v2r8(dy21,fscal,fjy1);
809             fjz1             = _fjsp_madd_v2r8(dz21,fscal,fjz1);
810
811             /**************************
812              * CALCULATE INTERACTIONS *
813              **************************/
814
815             /* COULOMB ELECTROSTATICS */
816             velec            = _fjsp_mul_v2r8(qq22,rinv22);
817             felec            = _fjsp_mul_v2r8(velec,rinvsq22);
818
819             /* Update potential sum for this i atom from the interaction with this j atom. */
820             velec            = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
821             velecsum         = _fjsp_add_v2r8(velecsum,velec);
822
823             fscal            = felec;
824
825             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
826
827             /* Update vectorial force */
828             fix2             = _fjsp_madd_v2r8(dx22,fscal,fix2);
829             fiy2             = _fjsp_madd_v2r8(dy22,fscal,fiy2);
830             fiz2             = _fjsp_madd_v2r8(dz22,fscal,fiz2);
831             
832             fjx2             = _fjsp_madd_v2r8(dx22,fscal,fjx2);
833             fjy2             = _fjsp_madd_v2r8(dy22,fscal,fjy2);
834             fjz2             = _fjsp_madd_v2r8(dz22,fscal,fjz2);
835
836             /**************************
837              * CALCULATE INTERACTIONS *
838              **************************/
839
840             /* COULOMB ELECTROSTATICS */
841             velec            = _fjsp_mul_v2r8(qq23,rinv23);
842             felec            = _fjsp_mul_v2r8(velec,rinvsq23);
843
844             /* Update potential sum for this i atom from the interaction with this j atom. */
845             velec            = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
846             velecsum         = _fjsp_add_v2r8(velecsum,velec);
847
848             fscal            = felec;
849
850             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
851
852             /* Update vectorial force */
853             fix2             = _fjsp_madd_v2r8(dx23,fscal,fix2);
854             fiy2             = _fjsp_madd_v2r8(dy23,fscal,fiy2);
855             fiz2             = _fjsp_madd_v2r8(dz23,fscal,fiz2);
856             
857             fjx3             = _fjsp_madd_v2r8(dx23,fscal,fjx3);
858             fjy3             = _fjsp_madd_v2r8(dy23,fscal,fjy3);
859             fjz3             = _fjsp_madd_v2r8(dz23,fscal,fjz3);
860
861             /**************************
862              * CALCULATE INTERACTIONS *
863              **************************/
864
865             /* COULOMB ELECTROSTATICS */
866             velec            = _fjsp_mul_v2r8(qq31,rinv31);
867             felec            = _fjsp_mul_v2r8(velec,rinvsq31);
868
869             /* Update potential sum for this i atom from the interaction with this j atom. */
870             velec            = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
871             velecsum         = _fjsp_add_v2r8(velecsum,velec);
872
873             fscal            = felec;
874
875             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
876
877             /* Update vectorial force */
878             fix3             = _fjsp_madd_v2r8(dx31,fscal,fix3);
879             fiy3             = _fjsp_madd_v2r8(dy31,fscal,fiy3);
880             fiz3             = _fjsp_madd_v2r8(dz31,fscal,fiz3);
881             
882             fjx1             = _fjsp_madd_v2r8(dx31,fscal,fjx1);
883             fjy1             = _fjsp_madd_v2r8(dy31,fscal,fjy1);
884             fjz1             = _fjsp_madd_v2r8(dz31,fscal,fjz1);
885
886             /**************************
887              * CALCULATE INTERACTIONS *
888              **************************/
889
890             /* COULOMB ELECTROSTATICS */
891             velec            = _fjsp_mul_v2r8(qq32,rinv32);
892             felec            = _fjsp_mul_v2r8(velec,rinvsq32);
893
894             /* Update potential sum for this i atom from the interaction with this j atom. */
895             velec            = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
896             velecsum         = _fjsp_add_v2r8(velecsum,velec);
897
898             fscal            = felec;
899
900             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
901
902             /* Update vectorial force */
903             fix3             = _fjsp_madd_v2r8(dx32,fscal,fix3);
904             fiy3             = _fjsp_madd_v2r8(dy32,fscal,fiy3);
905             fiz3             = _fjsp_madd_v2r8(dz32,fscal,fiz3);
906             
907             fjx2             = _fjsp_madd_v2r8(dx32,fscal,fjx2);
908             fjy2             = _fjsp_madd_v2r8(dy32,fscal,fjy2);
909             fjz2             = _fjsp_madd_v2r8(dz32,fscal,fjz2);
910
911             /**************************
912              * CALCULATE INTERACTIONS *
913              **************************/
914
915             /* COULOMB ELECTROSTATICS */
916             velec            = _fjsp_mul_v2r8(qq33,rinv33);
917             felec            = _fjsp_mul_v2r8(velec,rinvsq33);
918
919             /* Update potential sum for this i atom from the interaction with this j atom. */
920             velec            = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
921             velecsum         = _fjsp_add_v2r8(velecsum,velec);
922
923             fscal            = felec;
924
925             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
926
927             /* Update vectorial force */
928             fix3             = _fjsp_madd_v2r8(dx33,fscal,fix3);
929             fiy3             = _fjsp_madd_v2r8(dy33,fscal,fiy3);
930             fiz3             = _fjsp_madd_v2r8(dz33,fscal,fiz3);
931             
932             fjx3             = _fjsp_madd_v2r8(dx33,fscal,fjx3);
933             fjy3             = _fjsp_madd_v2r8(dy33,fscal,fjy3);
934             fjz3             = _fjsp_madd_v2r8(dz33,fscal,fjz3);
935
936             gmx_fjsp_decrement_4rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2,fjx3,fjy3,fjz3);
937
938             /* Inner loop uses 341 flops */
939         }
940
941         /* End of innermost loop */
942
943         gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
944                                               f+i_coord_offset,fshift+i_shift_offset);
945
946         ggid                        = gid[iidx];
947         /* Update potential energies */
948         gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
949         gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
950
951         /* Increment number of inner iterations */
952         inneriter                  += j_index_end - j_index_start;
953
954         /* Outer loop uses 26 flops */
955     }
956
957     /* Increment number of outer iterations */
958     outeriter        += nri;
959
960     /* Update outer/inner flops */
961
962     inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4W4_VF,outeriter*26 + inneriter*341);
963 }
964 /*
965  * Gromacs nonbonded kernel:   nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sparc64_hpc_ace_double
966  * Electrostatics interaction: Coulomb
967  * VdW interaction:            CubicSplineTable
968  * Geometry:                   Water4-Water4
969  * Calculate force/pot:        Force
970  */
971 void
972 nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sparc64_hpc_ace_double
973                     (t_nblist                    * gmx_restrict       nlist,
974                      rvec                        * gmx_restrict          xx,
975                      rvec                        * gmx_restrict          ff,
976                      t_forcerec                  * gmx_restrict          fr,
977                      t_mdatoms                   * gmx_restrict     mdatoms,
978                      nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
979                      t_nrnb                      * gmx_restrict        nrnb)
980 {
981     /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
982      * just 0 for non-waters.
983      * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
984      * jnr indices corresponding to data put in the four positions in the SIMD register.
985      */
986     int              i_shift_offset,i_coord_offset,outeriter,inneriter;
987     int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
988     int              jnrA,jnrB;
989     int              j_coord_offsetA,j_coord_offsetB;
990     int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
991     real             rcutoff_scalar;
992     real             *shiftvec,*fshift,*x,*f;
993     _fjsp_v2r8       tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
994     int              vdwioffset0;
995     _fjsp_v2r8       ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
996     int              vdwioffset1;
997     _fjsp_v2r8       ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
998     int              vdwioffset2;
999     _fjsp_v2r8       ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
1000     int              vdwioffset3;
1001     _fjsp_v2r8       ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
1002     int              vdwjidx0A,vdwjidx0B;
1003     _fjsp_v2r8       jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
1004     int              vdwjidx1A,vdwjidx1B;
1005     _fjsp_v2r8       jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
1006     int              vdwjidx2A,vdwjidx2B;
1007     _fjsp_v2r8       jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
1008     int              vdwjidx3A,vdwjidx3B;
1009     _fjsp_v2r8       jx3,jy3,jz3,fjx3,fjy3,fjz3,jq3,isaj3;
1010     _fjsp_v2r8       dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
1011     _fjsp_v2r8       dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11;
1012     _fjsp_v2r8       dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12;
1013     _fjsp_v2r8       dx13,dy13,dz13,rsq13,rinv13,rinvsq13,r13,qq13,c6_13,c12_13;
1014     _fjsp_v2r8       dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21;
1015     _fjsp_v2r8       dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22;
1016     _fjsp_v2r8       dx23,dy23,dz23,rsq23,rinv23,rinvsq23,r23,qq23,c6_23,c12_23;
1017     _fjsp_v2r8       dx31,dy31,dz31,rsq31,rinv31,rinvsq31,r31,qq31,c6_31,c12_31;
1018     _fjsp_v2r8       dx32,dy32,dz32,rsq32,rinv32,rinvsq32,r32,qq32,c6_32,c12_32;
1019     _fjsp_v2r8       dx33,dy33,dz33,rsq33,rinv33,rinvsq33,r33,qq33,c6_33,c12_33;
1020     _fjsp_v2r8       velec,felec,velecsum,facel,crf,krf,krf2;
1021     real             *charge;
1022     int              nvdwtype;
1023     _fjsp_v2r8       rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
1024     int              *vdwtype;
1025     real             *vdwparam;
1026     _fjsp_v2r8       one_sixth   = gmx_fjsp_set1_v2r8(1.0/6.0);
1027     _fjsp_v2r8       one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
1028     _fjsp_v2r8       rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
1029     real             *vftab;
1030     _fjsp_v2r8       itab_tmp;
1031     _fjsp_v2r8       dummy_mask,cutoff_mask;
1032     _fjsp_v2r8       one     = gmx_fjsp_set1_v2r8(1.0);
1033     _fjsp_v2r8       two     = gmx_fjsp_set1_v2r8(2.0);
1034     union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
1035
1036     x                = xx[0];
1037     f                = ff[0];
1038
1039     nri              = nlist->nri;
1040     iinr             = nlist->iinr;
1041     jindex           = nlist->jindex;
1042     jjnr             = nlist->jjnr;
1043     shiftidx         = nlist->shift;
1044     gid              = nlist->gid;
1045     shiftvec         = fr->shift_vec[0];
1046     fshift           = fr->fshift[0];
1047     facel            = gmx_fjsp_set1_v2r8(fr->epsfac);
1048     charge           = mdatoms->chargeA;
1049     nvdwtype         = fr->ntype;
1050     vdwparam         = fr->nbfp;
1051     vdwtype          = mdatoms->typeA;
1052
1053     vftab            = kernel_data->table_vdw->data;
1054     vftabscale       = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
1055
1056     /* Setup water-specific parameters */
1057     inr              = nlist->iinr[0];
1058     iq1              = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
1059     iq2              = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
1060     iq3              = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+3]));
1061     vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
1062
1063     jq1              = gmx_fjsp_set1_v2r8(charge[inr+1]);
1064     jq2              = gmx_fjsp_set1_v2r8(charge[inr+2]);
1065     jq3              = gmx_fjsp_set1_v2r8(charge[inr+3]);
1066     vdwjidx0A        = 2*vdwtype[inr+0];
1067     c6_00            = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A]);
1068     c12_00           = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A+1]);
1069     qq11             = _fjsp_mul_v2r8(iq1,jq1);
1070     qq12             = _fjsp_mul_v2r8(iq1,jq2);
1071     qq13             = _fjsp_mul_v2r8(iq1,jq3);
1072     qq21             = _fjsp_mul_v2r8(iq2,jq1);
1073     qq22             = _fjsp_mul_v2r8(iq2,jq2);
1074     qq23             = _fjsp_mul_v2r8(iq2,jq3);
1075     qq31             = _fjsp_mul_v2r8(iq3,jq1);
1076     qq32             = _fjsp_mul_v2r8(iq3,jq2);
1077     qq33             = _fjsp_mul_v2r8(iq3,jq3);
1078
1079     /* Avoid stupid compiler warnings */
1080     jnrA = jnrB = 0;
1081     j_coord_offsetA = 0;
1082     j_coord_offsetB = 0;
1083
1084     outeriter        = 0;
1085     inneriter        = 0;
1086
1087     /* Start outer loop over neighborlists */
1088     for(iidx=0; iidx<nri; iidx++)
1089     {
1090         /* Load shift vector for this list */
1091         i_shift_offset   = DIM*shiftidx[iidx];
1092
1093         /* Load limits for loop over neighbors */
1094         j_index_start    = jindex[iidx];
1095         j_index_end      = jindex[iidx+1];
1096
1097         /* Get outer coordinate index */
1098         inr              = iinr[iidx];
1099         i_coord_offset   = DIM*inr;
1100
1101         /* Load i particle coords and add shift vector */
1102         gmx_fjsp_load_shift_and_4rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
1103                                                  &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
1104
1105         fix0             = _fjsp_setzero_v2r8();
1106         fiy0             = _fjsp_setzero_v2r8();
1107         fiz0             = _fjsp_setzero_v2r8();
1108         fix1             = _fjsp_setzero_v2r8();
1109         fiy1             = _fjsp_setzero_v2r8();
1110         fiz1             = _fjsp_setzero_v2r8();
1111         fix2             = _fjsp_setzero_v2r8();
1112         fiy2             = _fjsp_setzero_v2r8();
1113         fiz2             = _fjsp_setzero_v2r8();
1114         fix3             = _fjsp_setzero_v2r8();
1115         fiy3             = _fjsp_setzero_v2r8();
1116         fiz3             = _fjsp_setzero_v2r8();
1117
1118         /* Start inner kernel loop */
1119         for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
1120         {
1121
1122             /* Get j neighbor index, and coordinate index */
1123             jnrA             = jjnr[jidx];
1124             jnrB             = jjnr[jidx+1];
1125             j_coord_offsetA  = DIM*jnrA;
1126             j_coord_offsetB  = DIM*jnrB;
1127
1128             /* load j atom coordinates */
1129             gmx_fjsp_load_4rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
1130                                               &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,
1131                                               &jy2,&jz2,&jx3,&jy3,&jz3);
1132
1133             /* Calculate displacement vector */
1134             dx00             = _fjsp_sub_v2r8(ix0,jx0);
1135             dy00             = _fjsp_sub_v2r8(iy0,jy0);
1136             dz00             = _fjsp_sub_v2r8(iz0,jz0);
1137             dx11             = _fjsp_sub_v2r8(ix1,jx1);
1138             dy11             = _fjsp_sub_v2r8(iy1,jy1);
1139             dz11             = _fjsp_sub_v2r8(iz1,jz1);
1140             dx12             = _fjsp_sub_v2r8(ix1,jx2);
1141             dy12             = _fjsp_sub_v2r8(iy1,jy2);
1142             dz12             = _fjsp_sub_v2r8(iz1,jz2);
1143             dx13             = _fjsp_sub_v2r8(ix1,jx3);
1144             dy13             = _fjsp_sub_v2r8(iy1,jy3);
1145             dz13             = _fjsp_sub_v2r8(iz1,jz3);
1146             dx21             = _fjsp_sub_v2r8(ix2,jx1);
1147             dy21             = _fjsp_sub_v2r8(iy2,jy1);
1148             dz21             = _fjsp_sub_v2r8(iz2,jz1);
1149             dx22             = _fjsp_sub_v2r8(ix2,jx2);
1150             dy22             = _fjsp_sub_v2r8(iy2,jy2);
1151             dz22             = _fjsp_sub_v2r8(iz2,jz2);
1152             dx23             = _fjsp_sub_v2r8(ix2,jx3);
1153             dy23             = _fjsp_sub_v2r8(iy2,jy3);
1154             dz23             = _fjsp_sub_v2r8(iz2,jz3);
1155             dx31             = _fjsp_sub_v2r8(ix3,jx1);
1156             dy31             = _fjsp_sub_v2r8(iy3,jy1);
1157             dz31             = _fjsp_sub_v2r8(iz3,jz1);
1158             dx32             = _fjsp_sub_v2r8(ix3,jx2);
1159             dy32             = _fjsp_sub_v2r8(iy3,jy2);
1160             dz32             = _fjsp_sub_v2r8(iz3,jz2);
1161             dx33             = _fjsp_sub_v2r8(ix3,jx3);
1162             dy33             = _fjsp_sub_v2r8(iy3,jy3);
1163             dz33             = _fjsp_sub_v2r8(iz3,jz3);
1164
1165             /* Calculate squared distance and things based on it */
1166             rsq00            = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
1167             rsq11            = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
1168             rsq12            = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
1169             rsq13            = gmx_fjsp_calc_rsq_v2r8(dx13,dy13,dz13);
1170             rsq21            = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
1171             rsq22            = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
1172             rsq23            = gmx_fjsp_calc_rsq_v2r8(dx23,dy23,dz23);
1173             rsq31            = gmx_fjsp_calc_rsq_v2r8(dx31,dy31,dz31);
1174             rsq32            = gmx_fjsp_calc_rsq_v2r8(dx32,dy32,dz32);
1175             rsq33            = gmx_fjsp_calc_rsq_v2r8(dx33,dy33,dz33);
1176
1177             rinv00           = gmx_fjsp_invsqrt_v2r8(rsq00);
1178             rinv11           = gmx_fjsp_invsqrt_v2r8(rsq11);
1179             rinv12           = gmx_fjsp_invsqrt_v2r8(rsq12);
1180             rinv13           = gmx_fjsp_invsqrt_v2r8(rsq13);
1181             rinv21           = gmx_fjsp_invsqrt_v2r8(rsq21);
1182             rinv22           = gmx_fjsp_invsqrt_v2r8(rsq22);
1183             rinv23           = gmx_fjsp_invsqrt_v2r8(rsq23);
1184             rinv31           = gmx_fjsp_invsqrt_v2r8(rsq31);
1185             rinv32           = gmx_fjsp_invsqrt_v2r8(rsq32);
1186             rinv33           = gmx_fjsp_invsqrt_v2r8(rsq33);
1187
1188             rinvsq11         = _fjsp_mul_v2r8(rinv11,rinv11);
1189             rinvsq12         = _fjsp_mul_v2r8(rinv12,rinv12);
1190             rinvsq13         = _fjsp_mul_v2r8(rinv13,rinv13);
1191             rinvsq21         = _fjsp_mul_v2r8(rinv21,rinv21);
1192             rinvsq22         = _fjsp_mul_v2r8(rinv22,rinv22);
1193             rinvsq23         = _fjsp_mul_v2r8(rinv23,rinv23);
1194             rinvsq31         = _fjsp_mul_v2r8(rinv31,rinv31);
1195             rinvsq32         = _fjsp_mul_v2r8(rinv32,rinv32);
1196             rinvsq33         = _fjsp_mul_v2r8(rinv33,rinv33);
1197
1198             fjx0             = _fjsp_setzero_v2r8();
1199             fjy0             = _fjsp_setzero_v2r8();
1200             fjz0             = _fjsp_setzero_v2r8();
1201             fjx1             = _fjsp_setzero_v2r8();
1202             fjy1             = _fjsp_setzero_v2r8();
1203             fjz1             = _fjsp_setzero_v2r8();
1204             fjx2             = _fjsp_setzero_v2r8();
1205             fjy2             = _fjsp_setzero_v2r8();
1206             fjz2             = _fjsp_setzero_v2r8();
1207             fjx3             = _fjsp_setzero_v2r8();
1208             fjy3             = _fjsp_setzero_v2r8();
1209             fjz3             = _fjsp_setzero_v2r8();
1210
1211             /**************************
1212              * CALCULATE INTERACTIONS *
1213              **************************/
1214
1215             r00              = _fjsp_mul_v2r8(rsq00,rinv00);
1216
1217             /* Calculate table index by multiplying r with table scale and truncate to integer */
1218             rt               = _fjsp_mul_v2r8(r00,vftabscale);
1219             itab_tmp         = _fjsp_dtox_v2r8(rt);
1220             vfeps            = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1221             twovfeps         = _fjsp_add_v2r8(vfeps,vfeps);
1222             _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1223
1224             vfconv.i[0]     *= 8;
1225             vfconv.i[1]     *= 8;
1226
1227             /* CUBIC SPLINE TABLE DISPERSION */
1228             Y                = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1229             F                = _fjsp_load_v2r8( vftab + vfconv.i[1] );
1230             GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1231             G                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
1232             H                = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
1233             GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1234             Fp               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
1235             FF               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
1236             fvdw6            = _fjsp_mul_v2r8(c6_00,FF);
1237
1238             /* CUBIC SPLINE TABLE REPULSION */
1239             Y                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
1240             F                = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
1241             GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1242             G                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
1243             H                = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
1244             GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1245             Fp               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
1246             FF               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
1247             fvdw12           = _fjsp_mul_v2r8(c12_00,FF);
1248             fvdw             = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
1249
1250             fscal            = fvdw;
1251
1252             /* Update vectorial force */
1253             fix0             = _fjsp_madd_v2r8(dx00,fscal,fix0);
1254             fiy0             = _fjsp_madd_v2r8(dy00,fscal,fiy0);
1255             fiz0             = _fjsp_madd_v2r8(dz00,fscal,fiz0);
1256             
1257             fjx0             = _fjsp_madd_v2r8(dx00,fscal,fjx0);
1258             fjy0             = _fjsp_madd_v2r8(dy00,fscal,fjy0);
1259             fjz0             = _fjsp_madd_v2r8(dz00,fscal,fjz0);
1260
1261             /**************************
1262              * CALCULATE INTERACTIONS *
1263              **************************/
1264
1265             /* COULOMB ELECTROSTATICS */
1266             velec            = _fjsp_mul_v2r8(qq11,rinv11);
1267             felec            = _fjsp_mul_v2r8(velec,rinvsq11);
1268
1269             fscal            = felec;
1270
1271             /* Update vectorial force */
1272             fix1             = _fjsp_madd_v2r8(dx11,fscal,fix1);
1273             fiy1             = _fjsp_madd_v2r8(dy11,fscal,fiy1);
1274             fiz1             = _fjsp_madd_v2r8(dz11,fscal,fiz1);
1275             
1276             fjx1             = _fjsp_madd_v2r8(dx11,fscal,fjx1);
1277             fjy1             = _fjsp_madd_v2r8(dy11,fscal,fjy1);
1278             fjz1             = _fjsp_madd_v2r8(dz11,fscal,fjz1);
1279
1280             /**************************
1281              * CALCULATE INTERACTIONS *
1282              **************************/
1283
1284             /* COULOMB ELECTROSTATICS */
1285             velec            = _fjsp_mul_v2r8(qq12,rinv12);
1286             felec            = _fjsp_mul_v2r8(velec,rinvsq12);
1287
1288             fscal            = felec;
1289
1290             /* Update vectorial force */
1291             fix1             = _fjsp_madd_v2r8(dx12,fscal,fix1);
1292             fiy1             = _fjsp_madd_v2r8(dy12,fscal,fiy1);
1293             fiz1             = _fjsp_madd_v2r8(dz12,fscal,fiz1);
1294             
1295             fjx2             = _fjsp_madd_v2r8(dx12,fscal,fjx2);
1296             fjy2             = _fjsp_madd_v2r8(dy12,fscal,fjy2);
1297             fjz2             = _fjsp_madd_v2r8(dz12,fscal,fjz2);
1298
1299             /**************************
1300              * CALCULATE INTERACTIONS *
1301              **************************/
1302
1303             /* COULOMB ELECTROSTATICS */
1304             velec            = _fjsp_mul_v2r8(qq13,rinv13);
1305             felec            = _fjsp_mul_v2r8(velec,rinvsq13);
1306
1307             fscal            = felec;
1308
1309             /* Update vectorial force */
1310             fix1             = _fjsp_madd_v2r8(dx13,fscal,fix1);
1311             fiy1             = _fjsp_madd_v2r8(dy13,fscal,fiy1);
1312             fiz1             = _fjsp_madd_v2r8(dz13,fscal,fiz1);
1313             
1314             fjx3             = _fjsp_madd_v2r8(dx13,fscal,fjx3);
1315             fjy3             = _fjsp_madd_v2r8(dy13,fscal,fjy3);
1316             fjz3             = _fjsp_madd_v2r8(dz13,fscal,fjz3);
1317
1318             /**************************
1319              * CALCULATE INTERACTIONS *
1320              **************************/
1321
1322             /* COULOMB ELECTROSTATICS */
1323             velec            = _fjsp_mul_v2r8(qq21,rinv21);
1324             felec            = _fjsp_mul_v2r8(velec,rinvsq21);
1325
1326             fscal            = felec;
1327
1328             /* Update vectorial force */
1329             fix2             = _fjsp_madd_v2r8(dx21,fscal,fix2);
1330             fiy2             = _fjsp_madd_v2r8(dy21,fscal,fiy2);
1331             fiz2             = _fjsp_madd_v2r8(dz21,fscal,fiz2);
1332             
1333             fjx1             = _fjsp_madd_v2r8(dx21,fscal,fjx1);
1334             fjy1             = _fjsp_madd_v2r8(dy21,fscal,fjy1);
1335             fjz1             = _fjsp_madd_v2r8(dz21,fscal,fjz1);
1336
1337             /**************************
1338              * CALCULATE INTERACTIONS *
1339              **************************/
1340
1341             /* COULOMB ELECTROSTATICS */
1342             velec            = _fjsp_mul_v2r8(qq22,rinv22);
1343             felec            = _fjsp_mul_v2r8(velec,rinvsq22);
1344
1345             fscal            = felec;
1346
1347             /* Update vectorial force */
1348             fix2             = _fjsp_madd_v2r8(dx22,fscal,fix2);
1349             fiy2             = _fjsp_madd_v2r8(dy22,fscal,fiy2);
1350             fiz2             = _fjsp_madd_v2r8(dz22,fscal,fiz2);
1351             
1352             fjx2             = _fjsp_madd_v2r8(dx22,fscal,fjx2);
1353             fjy2             = _fjsp_madd_v2r8(dy22,fscal,fjy2);
1354             fjz2             = _fjsp_madd_v2r8(dz22,fscal,fjz2);
1355
1356             /**************************
1357              * CALCULATE INTERACTIONS *
1358              **************************/
1359
1360             /* COULOMB ELECTROSTATICS */
1361             velec            = _fjsp_mul_v2r8(qq23,rinv23);
1362             felec            = _fjsp_mul_v2r8(velec,rinvsq23);
1363
1364             fscal            = felec;
1365
1366             /* Update vectorial force */
1367             fix2             = _fjsp_madd_v2r8(dx23,fscal,fix2);
1368             fiy2             = _fjsp_madd_v2r8(dy23,fscal,fiy2);
1369             fiz2             = _fjsp_madd_v2r8(dz23,fscal,fiz2);
1370             
1371             fjx3             = _fjsp_madd_v2r8(dx23,fscal,fjx3);
1372             fjy3             = _fjsp_madd_v2r8(dy23,fscal,fjy3);
1373             fjz3             = _fjsp_madd_v2r8(dz23,fscal,fjz3);
1374
1375             /**************************
1376              * CALCULATE INTERACTIONS *
1377              **************************/
1378
1379             /* COULOMB ELECTROSTATICS */
1380             velec            = _fjsp_mul_v2r8(qq31,rinv31);
1381             felec            = _fjsp_mul_v2r8(velec,rinvsq31);
1382
1383             fscal            = felec;
1384
1385             /* Update vectorial force */
1386             fix3             = _fjsp_madd_v2r8(dx31,fscal,fix3);
1387             fiy3             = _fjsp_madd_v2r8(dy31,fscal,fiy3);
1388             fiz3             = _fjsp_madd_v2r8(dz31,fscal,fiz3);
1389             
1390             fjx1             = _fjsp_madd_v2r8(dx31,fscal,fjx1);
1391             fjy1             = _fjsp_madd_v2r8(dy31,fscal,fjy1);
1392             fjz1             = _fjsp_madd_v2r8(dz31,fscal,fjz1);
1393
1394             /**************************
1395              * CALCULATE INTERACTIONS *
1396              **************************/
1397
1398             /* COULOMB ELECTROSTATICS */
1399             velec            = _fjsp_mul_v2r8(qq32,rinv32);
1400             felec            = _fjsp_mul_v2r8(velec,rinvsq32);
1401
1402             fscal            = felec;
1403
1404             /* Update vectorial force */
1405             fix3             = _fjsp_madd_v2r8(dx32,fscal,fix3);
1406             fiy3             = _fjsp_madd_v2r8(dy32,fscal,fiy3);
1407             fiz3             = _fjsp_madd_v2r8(dz32,fscal,fiz3);
1408             
1409             fjx2             = _fjsp_madd_v2r8(dx32,fscal,fjx2);
1410             fjy2             = _fjsp_madd_v2r8(dy32,fscal,fjy2);
1411             fjz2             = _fjsp_madd_v2r8(dz32,fscal,fjz2);
1412
1413             /**************************
1414              * CALCULATE INTERACTIONS *
1415              **************************/
1416
1417             /* COULOMB ELECTROSTATICS */
1418             velec            = _fjsp_mul_v2r8(qq33,rinv33);
1419             felec            = _fjsp_mul_v2r8(velec,rinvsq33);
1420
1421             fscal            = felec;
1422
1423             /* Update vectorial force */
1424             fix3             = _fjsp_madd_v2r8(dx33,fscal,fix3);
1425             fiy3             = _fjsp_madd_v2r8(dy33,fscal,fiy3);
1426             fiz3             = _fjsp_madd_v2r8(dz33,fscal,fiz3);
1427             
1428             fjx3             = _fjsp_madd_v2r8(dx33,fscal,fjx3);
1429             fjy3             = _fjsp_madd_v2r8(dy33,fscal,fjy3);
1430             fjz3             = _fjsp_madd_v2r8(dz33,fscal,fjz3);
1431
1432             gmx_fjsp_decrement_4rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2,fjx3,fjy3,fjz3);
1433
1434             /* Inner loop uses 324 flops */
1435         }
1436
1437         if(jidx<j_index_end)
1438         {
1439
1440             jnrA             = jjnr[jidx];
1441             j_coord_offsetA  = DIM*jnrA;
1442
1443             /* load j atom coordinates */
1444             gmx_fjsp_load_4rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
1445                                               &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,
1446                                               &jy2,&jz2,&jx3,&jy3,&jz3);
1447
1448             /* Calculate displacement vector */
1449             dx00             = _fjsp_sub_v2r8(ix0,jx0);
1450             dy00             = _fjsp_sub_v2r8(iy0,jy0);
1451             dz00             = _fjsp_sub_v2r8(iz0,jz0);
1452             dx11             = _fjsp_sub_v2r8(ix1,jx1);
1453             dy11             = _fjsp_sub_v2r8(iy1,jy1);
1454             dz11             = _fjsp_sub_v2r8(iz1,jz1);
1455             dx12             = _fjsp_sub_v2r8(ix1,jx2);
1456             dy12             = _fjsp_sub_v2r8(iy1,jy2);
1457             dz12             = _fjsp_sub_v2r8(iz1,jz2);
1458             dx13             = _fjsp_sub_v2r8(ix1,jx3);
1459             dy13             = _fjsp_sub_v2r8(iy1,jy3);
1460             dz13             = _fjsp_sub_v2r8(iz1,jz3);
1461             dx21             = _fjsp_sub_v2r8(ix2,jx1);
1462             dy21             = _fjsp_sub_v2r8(iy2,jy1);
1463             dz21             = _fjsp_sub_v2r8(iz2,jz1);
1464             dx22             = _fjsp_sub_v2r8(ix2,jx2);
1465             dy22             = _fjsp_sub_v2r8(iy2,jy2);
1466             dz22             = _fjsp_sub_v2r8(iz2,jz2);
1467             dx23             = _fjsp_sub_v2r8(ix2,jx3);
1468             dy23             = _fjsp_sub_v2r8(iy2,jy3);
1469             dz23             = _fjsp_sub_v2r8(iz2,jz3);
1470             dx31             = _fjsp_sub_v2r8(ix3,jx1);
1471             dy31             = _fjsp_sub_v2r8(iy3,jy1);
1472             dz31             = _fjsp_sub_v2r8(iz3,jz1);
1473             dx32             = _fjsp_sub_v2r8(ix3,jx2);
1474             dy32             = _fjsp_sub_v2r8(iy3,jy2);
1475             dz32             = _fjsp_sub_v2r8(iz3,jz2);
1476             dx33             = _fjsp_sub_v2r8(ix3,jx3);
1477             dy33             = _fjsp_sub_v2r8(iy3,jy3);
1478             dz33             = _fjsp_sub_v2r8(iz3,jz3);
1479
1480             /* Calculate squared distance and things based on it */
1481             rsq00            = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
1482             rsq11            = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
1483             rsq12            = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
1484             rsq13            = gmx_fjsp_calc_rsq_v2r8(dx13,dy13,dz13);
1485             rsq21            = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
1486             rsq22            = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
1487             rsq23            = gmx_fjsp_calc_rsq_v2r8(dx23,dy23,dz23);
1488             rsq31            = gmx_fjsp_calc_rsq_v2r8(dx31,dy31,dz31);
1489             rsq32            = gmx_fjsp_calc_rsq_v2r8(dx32,dy32,dz32);
1490             rsq33            = gmx_fjsp_calc_rsq_v2r8(dx33,dy33,dz33);
1491
1492             rinv00           = gmx_fjsp_invsqrt_v2r8(rsq00);
1493             rinv11           = gmx_fjsp_invsqrt_v2r8(rsq11);
1494             rinv12           = gmx_fjsp_invsqrt_v2r8(rsq12);
1495             rinv13           = gmx_fjsp_invsqrt_v2r8(rsq13);
1496             rinv21           = gmx_fjsp_invsqrt_v2r8(rsq21);
1497             rinv22           = gmx_fjsp_invsqrt_v2r8(rsq22);
1498             rinv23           = gmx_fjsp_invsqrt_v2r8(rsq23);
1499             rinv31           = gmx_fjsp_invsqrt_v2r8(rsq31);
1500             rinv32           = gmx_fjsp_invsqrt_v2r8(rsq32);
1501             rinv33           = gmx_fjsp_invsqrt_v2r8(rsq33);
1502
1503             rinvsq11         = _fjsp_mul_v2r8(rinv11,rinv11);
1504             rinvsq12         = _fjsp_mul_v2r8(rinv12,rinv12);
1505             rinvsq13         = _fjsp_mul_v2r8(rinv13,rinv13);
1506             rinvsq21         = _fjsp_mul_v2r8(rinv21,rinv21);
1507             rinvsq22         = _fjsp_mul_v2r8(rinv22,rinv22);
1508             rinvsq23         = _fjsp_mul_v2r8(rinv23,rinv23);
1509             rinvsq31         = _fjsp_mul_v2r8(rinv31,rinv31);
1510             rinvsq32         = _fjsp_mul_v2r8(rinv32,rinv32);
1511             rinvsq33         = _fjsp_mul_v2r8(rinv33,rinv33);
1512
1513             fjx0             = _fjsp_setzero_v2r8();
1514             fjy0             = _fjsp_setzero_v2r8();
1515             fjz0             = _fjsp_setzero_v2r8();
1516             fjx1             = _fjsp_setzero_v2r8();
1517             fjy1             = _fjsp_setzero_v2r8();
1518             fjz1             = _fjsp_setzero_v2r8();
1519             fjx2             = _fjsp_setzero_v2r8();
1520             fjy2             = _fjsp_setzero_v2r8();
1521             fjz2             = _fjsp_setzero_v2r8();
1522             fjx3             = _fjsp_setzero_v2r8();
1523             fjy3             = _fjsp_setzero_v2r8();
1524             fjz3             = _fjsp_setzero_v2r8();
1525
1526             /**************************
1527              * CALCULATE INTERACTIONS *
1528              **************************/
1529
1530             r00              = _fjsp_mul_v2r8(rsq00,rinv00);
1531
1532             /* Calculate table index by multiplying r with table scale and truncate to integer */
1533             rt               = _fjsp_mul_v2r8(r00,vftabscale);
1534             itab_tmp         = _fjsp_dtox_v2r8(rt);
1535             vfeps            = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1536             twovfeps         = _fjsp_add_v2r8(vfeps,vfeps);
1537             _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1538
1539             vfconv.i[0]     *= 8;
1540             vfconv.i[1]     *= 8;
1541
1542             /* CUBIC SPLINE TABLE DISPERSION */
1543             Y                = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1544             F                = _fjsp_setzero_v2r8();
1545             GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1546             G                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
1547             H                = _fjsp_setzero_v2r8();
1548             GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1549             Fp               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
1550             FF               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
1551             fvdw6            = _fjsp_mul_v2r8(c6_00,FF);
1552
1553             /* CUBIC SPLINE TABLE REPULSION */
1554             Y                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
1555             F                = _fjsp_setzero_v2r8();
1556             GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1557             G                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
1558             H                = _fjsp_setzero_v2r8();
1559             GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1560             Fp               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
1561             FF               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
1562             fvdw12           = _fjsp_mul_v2r8(c12_00,FF);
1563             fvdw             = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
1564
1565             fscal            = fvdw;
1566
1567             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1568
1569             /* Update vectorial force */
1570             fix0             = _fjsp_madd_v2r8(dx00,fscal,fix0);
1571             fiy0             = _fjsp_madd_v2r8(dy00,fscal,fiy0);
1572             fiz0             = _fjsp_madd_v2r8(dz00,fscal,fiz0);
1573             
1574             fjx0             = _fjsp_madd_v2r8(dx00,fscal,fjx0);
1575             fjy0             = _fjsp_madd_v2r8(dy00,fscal,fjy0);
1576             fjz0             = _fjsp_madd_v2r8(dz00,fscal,fjz0);
1577
1578             /**************************
1579              * CALCULATE INTERACTIONS *
1580              **************************/
1581
1582             /* COULOMB ELECTROSTATICS */
1583             velec            = _fjsp_mul_v2r8(qq11,rinv11);
1584             felec            = _fjsp_mul_v2r8(velec,rinvsq11);
1585
1586             fscal            = felec;
1587
1588             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1589
1590             /* Update vectorial force */
1591             fix1             = _fjsp_madd_v2r8(dx11,fscal,fix1);
1592             fiy1             = _fjsp_madd_v2r8(dy11,fscal,fiy1);
1593             fiz1             = _fjsp_madd_v2r8(dz11,fscal,fiz1);
1594             
1595             fjx1             = _fjsp_madd_v2r8(dx11,fscal,fjx1);
1596             fjy1             = _fjsp_madd_v2r8(dy11,fscal,fjy1);
1597             fjz1             = _fjsp_madd_v2r8(dz11,fscal,fjz1);
1598
1599             /**************************
1600              * CALCULATE INTERACTIONS *
1601              **************************/
1602
1603             /* COULOMB ELECTROSTATICS */
1604             velec            = _fjsp_mul_v2r8(qq12,rinv12);
1605             felec            = _fjsp_mul_v2r8(velec,rinvsq12);
1606
1607             fscal            = felec;
1608
1609             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1610
1611             /* Update vectorial force */
1612             fix1             = _fjsp_madd_v2r8(dx12,fscal,fix1);
1613             fiy1             = _fjsp_madd_v2r8(dy12,fscal,fiy1);
1614             fiz1             = _fjsp_madd_v2r8(dz12,fscal,fiz1);
1615             
1616             fjx2             = _fjsp_madd_v2r8(dx12,fscal,fjx2);
1617             fjy2             = _fjsp_madd_v2r8(dy12,fscal,fjy2);
1618             fjz2             = _fjsp_madd_v2r8(dz12,fscal,fjz2);
1619
1620             /**************************
1621              * CALCULATE INTERACTIONS *
1622              **************************/
1623
1624             /* COULOMB ELECTROSTATICS */
1625             velec            = _fjsp_mul_v2r8(qq13,rinv13);
1626             felec            = _fjsp_mul_v2r8(velec,rinvsq13);
1627
1628             fscal            = felec;
1629
1630             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1631
1632             /* Update vectorial force */
1633             fix1             = _fjsp_madd_v2r8(dx13,fscal,fix1);
1634             fiy1             = _fjsp_madd_v2r8(dy13,fscal,fiy1);
1635             fiz1             = _fjsp_madd_v2r8(dz13,fscal,fiz1);
1636             
1637             fjx3             = _fjsp_madd_v2r8(dx13,fscal,fjx3);
1638             fjy3             = _fjsp_madd_v2r8(dy13,fscal,fjy3);
1639             fjz3             = _fjsp_madd_v2r8(dz13,fscal,fjz3);
1640
1641             /**************************
1642              * CALCULATE INTERACTIONS *
1643              **************************/
1644
1645             /* COULOMB ELECTROSTATICS */
1646             velec            = _fjsp_mul_v2r8(qq21,rinv21);
1647             felec            = _fjsp_mul_v2r8(velec,rinvsq21);
1648
1649             fscal            = felec;
1650
1651             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1652
1653             /* Update vectorial force */
1654             fix2             = _fjsp_madd_v2r8(dx21,fscal,fix2);
1655             fiy2             = _fjsp_madd_v2r8(dy21,fscal,fiy2);
1656             fiz2             = _fjsp_madd_v2r8(dz21,fscal,fiz2);
1657             
1658             fjx1             = _fjsp_madd_v2r8(dx21,fscal,fjx1);
1659             fjy1             = _fjsp_madd_v2r8(dy21,fscal,fjy1);
1660             fjz1             = _fjsp_madd_v2r8(dz21,fscal,fjz1);
1661
1662             /**************************
1663              * CALCULATE INTERACTIONS *
1664              **************************/
1665
1666             /* COULOMB ELECTROSTATICS */
1667             velec            = _fjsp_mul_v2r8(qq22,rinv22);
1668             felec            = _fjsp_mul_v2r8(velec,rinvsq22);
1669
1670             fscal            = felec;
1671
1672             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1673
1674             /* Update vectorial force */
1675             fix2             = _fjsp_madd_v2r8(dx22,fscal,fix2);
1676             fiy2             = _fjsp_madd_v2r8(dy22,fscal,fiy2);
1677             fiz2             = _fjsp_madd_v2r8(dz22,fscal,fiz2);
1678             
1679             fjx2             = _fjsp_madd_v2r8(dx22,fscal,fjx2);
1680             fjy2             = _fjsp_madd_v2r8(dy22,fscal,fjy2);
1681             fjz2             = _fjsp_madd_v2r8(dz22,fscal,fjz2);
1682
1683             /**************************
1684              * CALCULATE INTERACTIONS *
1685              **************************/
1686
1687             /* COULOMB ELECTROSTATICS */
1688             velec            = _fjsp_mul_v2r8(qq23,rinv23);
1689             felec            = _fjsp_mul_v2r8(velec,rinvsq23);
1690
1691             fscal            = felec;
1692
1693             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1694
1695             /* Update vectorial force */
1696             fix2             = _fjsp_madd_v2r8(dx23,fscal,fix2);
1697             fiy2             = _fjsp_madd_v2r8(dy23,fscal,fiy2);
1698             fiz2             = _fjsp_madd_v2r8(dz23,fscal,fiz2);
1699             
1700             fjx3             = _fjsp_madd_v2r8(dx23,fscal,fjx3);
1701             fjy3             = _fjsp_madd_v2r8(dy23,fscal,fjy3);
1702             fjz3             = _fjsp_madd_v2r8(dz23,fscal,fjz3);
1703
1704             /**************************
1705              * CALCULATE INTERACTIONS *
1706              **************************/
1707
1708             /* COULOMB ELECTROSTATICS */
1709             velec            = _fjsp_mul_v2r8(qq31,rinv31);
1710             felec            = _fjsp_mul_v2r8(velec,rinvsq31);
1711
1712             fscal            = felec;
1713
1714             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1715
1716             /* Update vectorial force */
1717             fix3             = _fjsp_madd_v2r8(dx31,fscal,fix3);
1718             fiy3             = _fjsp_madd_v2r8(dy31,fscal,fiy3);
1719             fiz3             = _fjsp_madd_v2r8(dz31,fscal,fiz3);
1720             
1721             fjx1             = _fjsp_madd_v2r8(dx31,fscal,fjx1);
1722             fjy1             = _fjsp_madd_v2r8(dy31,fscal,fjy1);
1723             fjz1             = _fjsp_madd_v2r8(dz31,fscal,fjz1);
1724
1725             /**************************
1726              * CALCULATE INTERACTIONS *
1727              **************************/
1728
1729             /* COULOMB ELECTROSTATICS */
1730             velec            = _fjsp_mul_v2r8(qq32,rinv32);
1731             felec            = _fjsp_mul_v2r8(velec,rinvsq32);
1732
1733             fscal            = felec;
1734
1735             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1736
1737             /* Update vectorial force */
1738             fix3             = _fjsp_madd_v2r8(dx32,fscal,fix3);
1739             fiy3             = _fjsp_madd_v2r8(dy32,fscal,fiy3);
1740             fiz3             = _fjsp_madd_v2r8(dz32,fscal,fiz3);
1741             
1742             fjx2             = _fjsp_madd_v2r8(dx32,fscal,fjx2);
1743             fjy2             = _fjsp_madd_v2r8(dy32,fscal,fjy2);
1744             fjz2             = _fjsp_madd_v2r8(dz32,fscal,fjz2);
1745
1746             /**************************
1747              * CALCULATE INTERACTIONS *
1748              **************************/
1749
1750             /* COULOMB ELECTROSTATICS */
1751             velec            = _fjsp_mul_v2r8(qq33,rinv33);
1752             felec            = _fjsp_mul_v2r8(velec,rinvsq33);
1753
1754             fscal            = felec;
1755
1756             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1757
1758             /* Update vectorial force */
1759             fix3             = _fjsp_madd_v2r8(dx33,fscal,fix3);
1760             fiy3             = _fjsp_madd_v2r8(dy33,fscal,fiy3);
1761             fiz3             = _fjsp_madd_v2r8(dz33,fscal,fiz3);
1762             
1763             fjx3             = _fjsp_madd_v2r8(dx33,fscal,fjx3);
1764             fjy3             = _fjsp_madd_v2r8(dy33,fscal,fjy3);
1765             fjz3             = _fjsp_madd_v2r8(dz33,fscal,fjz3);
1766
1767             gmx_fjsp_decrement_4rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2,fjx3,fjy3,fjz3);
1768
1769             /* Inner loop uses 324 flops */
1770         }
1771
1772         /* End of innermost loop */
1773
1774         gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
1775                                               f+i_coord_offset,fshift+i_shift_offset);
1776
1777         /* Increment number of inner iterations */
1778         inneriter                  += j_index_end - j_index_start;
1779
1780         /* Outer loop uses 24 flops */
1781     }
1782
1783     /* Increment number of outer iterations */
1784     outeriter        += nri;
1785
1786     /* Update outer/inner flops */
1787
1788     inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4W4_F,outeriter*24 + inneriter*324);
1789 }