Remove all unnecessary HAVE_CONFIG_H
[alexxy/gromacs.git] / src / gromacs / gmxlib / nonbonded / nb_kernel_sparc64_hpc_ace_double / nb_kernel_ElecEw_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_ElecEw_VdwCSTab_GeomW4W4_VF_sparc64_hpc_ace_double
51  * Electrostatics interaction: Ewald
52  * VdW interaction:            CubicSplineTable
53  * Geometry:                   Water4-Water4
54  * Calculate force/pot:        PotentialAndForce
55  */
56 void
57 nb_kernel_ElecEw_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       ewtabscale,eweps,sh_ewald,ewrt,ewtabhalfspace,ewtabF,ewtabFn,ewtabD,ewtabV;
116     real             *ewtab;
117     _fjsp_v2r8       itab_tmp;
118     _fjsp_v2r8       dummy_mask,cutoff_mask;
119     _fjsp_v2r8       one     = gmx_fjsp_set1_v2r8(1.0);
120     _fjsp_v2r8       two     = gmx_fjsp_set1_v2r8(2.0);
121     union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
122
123     x                = xx[0];
124     f                = ff[0];
125
126     nri              = nlist->nri;
127     iinr             = nlist->iinr;
128     jindex           = nlist->jindex;
129     jjnr             = nlist->jjnr;
130     shiftidx         = nlist->shift;
131     gid              = nlist->gid;
132     shiftvec         = fr->shift_vec[0];
133     fshift           = fr->fshift[0];
134     facel            = gmx_fjsp_set1_v2r8(fr->epsfac);
135     charge           = mdatoms->chargeA;
136     nvdwtype         = fr->ntype;
137     vdwparam         = fr->nbfp;
138     vdwtype          = mdatoms->typeA;
139
140     vftab            = kernel_data->table_vdw->data;
141     vftabscale       = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
142
143     sh_ewald         = gmx_fjsp_set1_v2r8(fr->ic->sh_ewald);
144     ewtab            = fr->ic->tabq_coul_FDV0;
145     ewtabscale       = gmx_fjsp_set1_v2r8(fr->ic->tabq_scale);
146     ewtabhalfspace   = gmx_fjsp_set1_v2r8(0.5/fr->ic->tabq_scale);
147
148     /* Setup water-specific parameters */
149     inr              = nlist->iinr[0];
150     iq1              = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
151     iq2              = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
152     iq3              = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+3]));
153     vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
154
155     jq1              = gmx_fjsp_set1_v2r8(charge[inr+1]);
156     jq2              = gmx_fjsp_set1_v2r8(charge[inr+2]);
157     jq3              = gmx_fjsp_set1_v2r8(charge[inr+3]);
158     vdwjidx0A        = 2*vdwtype[inr+0];
159     c6_00            = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A]);
160     c12_00           = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A+1]);
161     qq11             = _fjsp_mul_v2r8(iq1,jq1);
162     qq12             = _fjsp_mul_v2r8(iq1,jq2);
163     qq13             = _fjsp_mul_v2r8(iq1,jq3);
164     qq21             = _fjsp_mul_v2r8(iq2,jq1);
165     qq22             = _fjsp_mul_v2r8(iq2,jq2);
166     qq23             = _fjsp_mul_v2r8(iq2,jq3);
167     qq31             = _fjsp_mul_v2r8(iq3,jq1);
168     qq32             = _fjsp_mul_v2r8(iq3,jq2);
169     qq33             = _fjsp_mul_v2r8(iq3,jq3);
170
171     /* Avoid stupid compiler warnings */
172     jnrA = jnrB = 0;
173     j_coord_offsetA = 0;
174     j_coord_offsetB = 0;
175
176     outeriter        = 0;
177     inneriter        = 0;
178
179     /* Start outer loop over neighborlists */
180     for(iidx=0; iidx<nri; iidx++)
181     {
182         /* Load shift vector for this list */
183         i_shift_offset   = DIM*shiftidx[iidx];
184
185         /* Load limits for loop over neighbors */
186         j_index_start    = jindex[iidx];
187         j_index_end      = jindex[iidx+1];
188
189         /* Get outer coordinate index */
190         inr              = iinr[iidx];
191         i_coord_offset   = DIM*inr;
192
193         /* Load i particle coords and add shift vector */
194         gmx_fjsp_load_shift_and_4rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
195                                                  &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
196
197         fix0             = _fjsp_setzero_v2r8();
198         fiy0             = _fjsp_setzero_v2r8();
199         fiz0             = _fjsp_setzero_v2r8();
200         fix1             = _fjsp_setzero_v2r8();
201         fiy1             = _fjsp_setzero_v2r8();
202         fiz1             = _fjsp_setzero_v2r8();
203         fix2             = _fjsp_setzero_v2r8();
204         fiy2             = _fjsp_setzero_v2r8();
205         fiz2             = _fjsp_setzero_v2r8();
206         fix3             = _fjsp_setzero_v2r8();
207         fiy3             = _fjsp_setzero_v2r8();
208         fiz3             = _fjsp_setzero_v2r8();
209
210         /* Reset potential sums */
211         velecsum         = _fjsp_setzero_v2r8();
212         vvdwsum          = _fjsp_setzero_v2r8();
213
214         /* Start inner kernel loop */
215         for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
216         {
217
218             /* Get j neighbor index, and coordinate index */
219             jnrA             = jjnr[jidx];
220             jnrB             = jjnr[jidx+1];
221             j_coord_offsetA  = DIM*jnrA;
222             j_coord_offsetB  = DIM*jnrB;
223
224             /* load j atom coordinates */
225             gmx_fjsp_load_4rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
226                                               &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,
227                                               &jy2,&jz2,&jx3,&jy3,&jz3);
228
229             /* Calculate displacement vector */
230             dx00             = _fjsp_sub_v2r8(ix0,jx0);
231             dy00             = _fjsp_sub_v2r8(iy0,jy0);
232             dz00             = _fjsp_sub_v2r8(iz0,jz0);
233             dx11             = _fjsp_sub_v2r8(ix1,jx1);
234             dy11             = _fjsp_sub_v2r8(iy1,jy1);
235             dz11             = _fjsp_sub_v2r8(iz1,jz1);
236             dx12             = _fjsp_sub_v2r8(ix1,jx2);
237             dy12             = _fjsp_sub_v2r8(iy1,jy2);
238             dz12             = _fjsp_sub_v2r8(iz1,jz2);
239             dx13             = _fjsp_sub_v2r8(ix1,jx3);
240             dy13             = _fjsp_sub_v2r8(iy1,jy3);
241             dz13             = _fjsp_sub_v2r8(iz1,jz3);
242             dx21             = _fjsp_sub_v2r8(ix2,jx1);
243             dy21             = _fjsp_sub_v2r8(iy2,jy1);
244             dz21             = _fjsp_sub_v2r8(iz2,jz1);
245             dx22             = _fjsp_sub_v2r8(ix2,jx2);
246             dy22             = _fjsp_sub_v2r8(iy2,jy2);
247             dz22             = _fjsp_sub_v2r8(iz2,jz2);
248             dx23             = _fjsp_sub_v2r8(ix2,jx3);
249             dy23             = _fjsp_sub_v2r8(iy2,jy3);
250             dz23             = _fjsp_sub_v2r8(iz2,jz3);
251             dx31             = _fjsp_sub_v2r8(ix3,jx1);
252             dy31             = _fjsp_sub_v2r8(iy3,jy1);
253             dz31             = _fjsp_sub_v2r8(iz3,jz1);
254             dx32             = _fjsp_sub_v2r8(ix3,jx2);
255             dy32             = _fjsp_sub_v2r8(iy3,jy2);
256             dz32             = _fjsp_sub_v2r8(iz3,jz2);
257             dx33             = _fjsp_sub_v2r8(ix3,jx3);
258             dy33             = _fjsp_sub_v2r8(iy3,jy3);
259             dz33             = _fjsp_sub_v2r8(iz3,jz3);
260
261             /* Calculate squared distance and things based on it */
262             rsq00            = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
263             rsq11            = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
264             rsq12            = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
265             rsq13            = gmx_fjsp_calc_rsq_v2r8(dx13,dy13,dz13);
266             rsq21            = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
267             rsq22            = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
268             rsq23            = gmx_fjsp_calc_rsq_v2r8(dx23,dy23,dz23);
269             rsq31            = gmx_fjsp_calc_rsq_v2r8(dx31,dy31,dz31);
270             rsq32            = gmx_fjsp_calc_rsq_v2r8(dx32,dy32,dz32);
271             rsq33            = gmx_fjsp_calc_rsq_v2r8(dx33,dy33,dz33);
272
273             rinv00           = gmx_fjsp_invsqrt_v2r8(rsq00);
274             rinv11           = gmx_fjsp_invsqrt_v2r8(rsq11);
275             rinv12           = gmx_fjsp_invsqrt_v2r8(rsq12);
276             rinv13           = gmx_fjsp_invsqrt_v2r8(rsq13);
277             rinv21           = gmx_fjsp_invsqrt_v2r8(rsq21);
278             rinv22           = gmx_fjsp_invsqrt_v2r8(rsq22);
279             rinv23           = gmx_fjsp_invsqrt_v2r8(rsq23);
280             rinv31           = gmx_fjsp_invsqrt_v2r8(rsq31);
281             rinv32           = gmx_fjsp_invsqrt_v2r8(rsq32);
282             rinv33           = gmx_fjsp_invsqrt_v2r8(rsq33);
283
284             rinvsq11         = _fjsp_mul_v2r8(rinv11,rinv11);
285             rinvsq12         = _fjsp_mul_v2r8(rinv12,rinv12);
286             rinvsq13         = _fjsp_mul_v2r8(rinv13,rinv13);
287             rinvsq21         = _fjsp_mul_v2r8(rinv21,rinv21);
288             rinvsq22         = _fjsp_mul_v2r8(rinv22,rinv22);
289             rinvsq23         = _fjsp_mul_v2r8(rinv23,rinv23);
290             rinvsq31         = _fjsp_mul_v2r8(rinv31,rinv31);
291             rinvsq32         = _fjsp_mul_v2r8(rinv32,rinv32);
292             rinvsq33         = _fjsp_mul_v2r8(rinv33,rinv33);
293
294             fjx0             = _fjsp_setzero_v2r8();
295             fjy0             = _fjsp_setzero_v2r8();
296             fjz0             = _fjsp_setzero_v2r8();
297             fjx1             = _fjsp_setzero_v2r8();
298             fjy1             = _fjsp_setzero_v2r8();
299             fjz1             = _fjsp_setzero_v2r8();
300             fjx2             = _fjsp_setzero_v2r8();
301             fjy2             = _fjsp_setzero_v2r8();
302             fjz2             = _fjsp_setzero_v2r8();
303             fjx3             = _fjsp_setzero_v2r8();
304             fjy3             = _fjsp_setzero_v2r8();
305             fjz3             = _fjsp_setzero_v2r8();
306
307             /**************************
308              * CALCULATE INTERACTIONS *
309              **************************/
310
311             r00              = _fjsp_mul_v2r8(rsq00,rinv00);
312
313             /* Calculate table index by multiplying r with table scale and truncate to integer */
314             rt               = _fjsp_mul_v2r8(r00,vftabscale);
315             itab_tmp         = _fjsp_dtox_v2r8(rt);
316             vfeps            = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
317             twovfeps         = _fjsp_add_v2r8(vfeps,vfeps);
318             _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
319
320             vfconv.i[0]     *= 8;
321             vfconv.i[1]     *= 8;
322
323             /* CUBIC SPLINE TABLE DISPERSION */
324             Y                = _fjsp_load_v2r8( vftab + vfconv.i[0] );
325             F                = _fjsp_load_v2r8( vftab + vfconv.i[1] );
326             GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
327             G                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
328             H                = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
329             GMX_FJSP_TRANSPOSE2_V2R8(G,H);
330             Fp               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
331             VV               = _fjsp_madd_v2r8(vfeps,Fp,Y);
332             vvdw6            = _fjsp_mul_v2r8(c6_00,VV);
333             FF               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
334             fvdw6            = _fjsp_mul_v2r8(c6_00,FF);
335
336             /* CUBIC SPLINE TABLE REPULSION */
337             Y                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
338             F                = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
339             GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
340             G                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
341             H                = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
342             GMX_FJSP_TRANSPOSE2_V2R8(G,H);
343             Fp               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
344             VV               = _fjsp_madd_v2r8(vfeps,Fp,Y);
345             vvdw12           = _fjsp_mul_v2r8(c12_00,VV);
346             FF               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
347             fvdw12           = _fjsp_mul_v2r8(c12_00,FF);
348             vvdw             = _fjsp_add_v2r8(vvdw12,vvdw6);
349             fvdw             = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
350
351             /* Update potential sum for this i atom from the interaction with this j atom. */
352             vvdwsum          = _fjsp_add_v2r8(vvdwsum,vvdw);
353
354             fscal            = fvdw;
355
356             /* Update vectorial force */
357             fix0             = _fjsp_madd_v2r8(dx00,fscal,fix0);
358             fiy0             = _fjsp_madd_v2r8(dy00,fscal,fiy0);
359             fiz0             = _fjsp_madd_v2r8(dz00,fscal,fiz0);
360             
361             fjx0             = _fjsp_madd_v2r8(dx00,fscal,fjx0);
362             fjy0             = _fjsp_madd_v2r8(dy00,fscal,fjy0);
363             fjz0             = _fjsp_madd_v2r8(dz00,fscal,fjz0);
364
365             /**************************
366              * CALCULATE INTERACTIONS *
367              **************************/
368
369             r11              = _fjsp_mul_v2r8(rsq11,rinv11);
370
371             /* EWALD ELECTROSTATICS */
372
373             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
374             ewrt             = _fjsp_mul_v2r8(r11,ewtabscale);
375             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
376             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
377             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
378
379             ewtabF           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
380             ewtabD           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
381             GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
382             ewtabV           = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
383             ewtabFn          = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
384             GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
385             felec            = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
386             velec            = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
387             velec            = _fjsp_mul_v2r8(qq11,_fjsp_sub_v2r8(rinv11,velec));
388             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq11,rinv11),_fjsp_sub_v2r8(rinvsq11,felec));
389
390             /* Update potential sum for this i atom from the interaction with this j atom. */
391             velecsum         = _fjsp_add_v2r8(velecsum,velec);
392
393             fscal            = felec;
394
395             /* Update vectorial force */
396             fix1             = _fjsp_madd_v2r8(dx11,fscal,fix1);
397             fiy1             = _fjsp_madd_v2r8(dy11,fscal,fiy1);
398             fiz1             = _fjsp_madd_v2r8(dz11,fscal,fiz1);
399             
400             fjx1             = _fjsp_madd_v2r8(dx11,fscal,fjx1);
401             fjy1             = _fjsp_madd_v2r8(dy11,fscal,fjy1);
402             fjz1             = _fjsp_madd_v2r8(dz11,fscal,fjz1);
403
404             /**************************
405              * CALCULATE INTERACTIONS *
406              **************************/
407
408             r12              = _fjsp_mul_v2r8(rsq12,rinv12);
409
410             /* EWALD ELECTROSTATICS */
411
412             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
413             ewrt             = _fjsp_mul_v2r8(r12,ewtabscale);
414             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
415             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
416             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
417
418             ewtabF           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
419             ewtabD           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
420             GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
421             ewtabV           = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
422             ewtabFn          = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
423             GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
424             felec            = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
425             velec            = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
426             velec            = _fjsp_mul_v2r8(qq12,_fjsp_sub_v2r8(rinv12,velec));
427             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq12,rinv12),_fjsp_sub_v2r8(rinvsq12,felec));
428
429             /* Update potential sum for this i atom from the interaction with this j atom. */
430             velecsum         = _fjsp_add_v2r8(velecsum,velec);
431
432             fscal            = felec;
433
434             /* Update vectorial force */
435             fix1             = _fjsp_madd_v2r8(dx12,fscal,fix1);
436             fiy1             = _fjsp_madd_v2r8(dy12,fscal,fiy1);
437             fiz1             = _fjsp_madd_v2r8(dz12,fscal,fiz1);
438             
439             fjx2             = _fjsp_madd_v2r8(dx12,fscal,fjx2);
440             fjy2             = _fjsp_madd_v2r8(dy12,fscal,fjy2);
441             fjz2             = _fjsp_madd_v2r8(dz12,fscal,fjz2);
442
443             /**************************
444              * CALCULATE INTERACTIONS *
445              **************************/
446
447             r13              = _fjsp_mul_v2r8(rsq13,rinv13);
448
449             /* EWALD ELECTROSTATICS */
450
451             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
452             ewrt             = _fjsp_mul_v2r8(r13,ewtabscale);
453             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
454             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
455             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
456
457             ewtabF           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
458             ewtabD           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
459             GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
460             ewtabV           = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
461             ewtabFn          = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
462             GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
463             felec            = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
464             velec            = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
465             velec            = _fjsp_mul_v2r8(qq13,_fjsp_sub_v2r8(rinv13,velec));
466             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq13,rinv13),_fjsp_sub_v2r8(rinvsq13,felec));
467
468             /* Update potential sum for this i atom from the interaction with this j atom. */
469             velecsum         = _fjsp_add_v2r8(velecsum,velec);
470
471             fscal            = felec;
472
473             /* Update vectorial force */
474             fix1             = _fjsp_madd_v2r8(dx13,fscal,fix1);
475             fiy1             = _fjsp_madd_v2r8(dy13,fscal,fiy1);
476             fiz1             = _fjsp_madd_v2r8(dz13,fscal,fiz1);
477             
478             fjx3             = _fjsp_madd_v2r8(dx13,fscal,fjx3);
479             fjy3             = _fjsp_madd_v2r8(dy13,fscal,fjy3);
480             fjz3             = _fjsp_madd_v2r8(dz13,fscal,fjz3);
481
482             /**************************
483              * CALCULATE INTERACTIONS *
484              **************************/
485
486             r21              = _fjsp_mul_v2r8(rsq21,rinv21);
487
488             /* EWALD ELECTROSTATICS */
489
490             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
491             ewrt             = _fjsp_mul_v2r8(r21,ewtabscale);
492             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
493             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
494             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
495
496             ewtabF           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
497             ewtabD           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
498             GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
499             ewtabV           = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
500             ewtabFn          = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
501             GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
502             felec            = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
503             velec            = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
504             velec            = _fjsp_mul_v2r8(qq21,_fjsp_sub_v2r8(rinv21,velec));
505             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq21,rinv21),_fjsp_sub_v2r8(rinvsq21,felec));
506
507             /* Update potential sum for this i atom from the interaction with this j atom. */
508             velecsum         = _fjsp_add_v2r8(velecsum,velec);
509
510             fscal            = felec;
511
512             /* Update vectorial force */
513             fix2             = _fjsp_madd_v2r8(dx21,fscal,fix2);
514             fiy2             = _fjsp_madd_v2r8(dy21,fscal,fiy2);
515             fiz2             = _fjsp_madd_v2r8(dz21,fscal,fiz2);
516             
517             fjx1             = _fjsp_madd_v2r8(dx21,fscal,fjx1);
518             fjy1             = _fjsp_madd_v2r8(dy21,fscal,fjy1);
519             fjz1             = _fjsp_madd_v2r8(dz21,fscal,fjz1);
520
521             /**************************
522              * CALCULATE INTERACTIONS *
523              **************************/
524
525             r22              = _fjsp_mul_v2r8(rsq22,rinv22);
526
527             /* EWALD ELECTROSTATICS */
528
529             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
530             ewrt             = _fjsp_mul_v2r8(r22,ewtabscale);
531             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
532             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
533             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
534
535             ewtabF           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
536             ewtabD           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
537             GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
538             ewtabV           = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
539             ewtabFn          = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
540             GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
541             felec            = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
542             velec            = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
543             velec            = _fjsp_mul_v2r8(qq22,_fjsp_sub_v2r8(rinv22,velec));
544             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq22,rinv22),_fjsp_sub_v2r8(rinvsq22,felec));
545
546             /* Update potential sum for this i atom from the interaction with this j atom. */
547             velecsum         = _fjsp_add_v2r8(velecsum,velec);
548
549             fscal            = felec;
550
551             /* Update vectorial force */
552             fix2             = _fjsp_madd_v2r8(dx22,fscal,fix2);
553             fiy2             = _fjsp_madd_v2r8(dy22,fscal,fiy2);
554             fiz2             = _fjsp_madd_v2r8(dz22,fscal,fiz2);
555             
556             fjx2             = _fjsp_madd_v2r8(dx22,fscal,fjx2);
557             fjy2             = _fjsp_madd_v2r8(dy22,fscal,fjy2);
558             fjz2             = _fjsp_madd_v2r8(dz22,fscal,fjz2);
559
560             /**************************
561              * CALCULATE INTERACTIONS *
562              **************************/
563
564             r23              = _fjsp_mul_v2r8(rsq23,rinv23);
565
566             /* EWALD ELECTROSTATICS */
567
568             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
569             ewrt             = _fjsp_mul_v2r8(r23,ewtabscale);
570             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
571             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
572             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
573
574             ewtabF           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
575             ewtabD           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
576             GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
577             ewtabV           = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
578             ewtabFn          = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
579             GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
580             felec            = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
581             velec            = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
582             velec            = _fjsp_mul_v2r8(qq23,_fjsp_sub_v2r8(rinv23,velec));
583             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq23,rinv23),_fjsp_sub_v2r8(rinvsq23,felec));
584
585             /* Update potential sum for this i atom from the interaction with this j atom. */
586             velecsum         = _fjsp_add_v2r8(velecsum,velec);
587
588             fscal            = felec;
589
590             /* Update vectorial force */
591             fix2             = _fjsp_madd_v2r8(dx23,fscal,fix2);
592             fiy2             = _fjsp_madd_v2r8(dy23,fscal,fiy2);
593             fiz2             = _fjsp_madd_v2r8(dz23,fscal,fiz2);
594             
595             fjx3             = _fjsp_madd_v2r8(dx23,fscal,fjx3);
596             fjy3             = _fjsp_madd_v2r8(dy23,fscal,fjy3);
597             fjz3             = _fjsp_madd_v2r8(dz23,fscal,fjz3);
598
599             /**************************
600              * CALCULATE INTERACTIONS *
601              **************************/
602
603             r31              = _fjsp_mul_v2r8(rsq31,rinv31);
604
605             /* EWALD ELECTROSTATICS */
606
607             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
608             ewrt             = _fjsp_mul_v2r8(r31,ewtabscale);
609             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
610             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
611             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
612
613             ewtabF           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
614             ewtabD           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
615             GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
616             ewtabV           = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
617             ewtabFn          = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
618             GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
619             felec            = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
620             velec            = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
621             velec            = _fjsp_mul_v2r8(qq31,_fjsp_sub_v2r8(rinv31,velec));
622             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq31,rinv31),_fjsp_sub_v2r8(rinvsq31,felec));
623
624             /* Update potential sum for this i atom from the interaction with this j atom. */
625             velecsum         = _fjsp_add_v2r8(velecsum,velec);
626
627             fscal            = felec;
628
629             /* Update vectorial force */
630             fix3             = _fjsp_madd_v2r8(dx31,fscal,fix3);
631             fiy3             = _fjsp_madd_v2r8(dy31,fscal,fiy3);
632             fiz3             = _fjsp_madd_v2r8(dz31,fscal,fiz3);
633             
634             fjx1             = _fjsp_madd_v2r8(dx31,fscal,fjx1);
635             fjy1             = _fjsp_madd_v2r8(dy31,fscal,fjy1);
636             fjz1             = _fjsp_madd_v2r8(dz31,fscal,fjz1);
637
638             /**************************
639              * CALCULATE INTERACTIONS *
640              **************************/
641
642             r32              = _fjsp_mul_v2r8(rsq32,rinv32);
643
644             /* EWALD ELECTROSTATICS */
645
646             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
647             ewrt             = _fjsp_mul_v2r8(r32,ewtabscale);
648             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
649             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
650             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
651
652             ewtabF           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
653             ewtabD           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
654             GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
655             ewtabV           = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
656             ewtabFn          = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
657             GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
658             felec            = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
659             velec            = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
660             velec            = _fjsp_mul_v2r8(qq32,_fjsp_sub_v2r8(rinv32,velec));
661             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq32,rinv32),_fjsp_sub_v2r8(rinvsq32,felec));
662
663             /* Update potential sum for this i atom from the interaction with this j atom. */
664             velecsum         = _fjsp_add_v2r8(velecsum,velec);
665
666             fscal            = felec;
667
668             /* Update vectorial force */
669             fix3             = _fjsp_madd_v2r8(dx32,fscal,fix3);
670             fiy3             = _fjsp_madd_v2r8(dy32,fscal,fiy3);
671             fiz3             = _fjsp_madd_v2r8(dz32,fscal,fiz3);
672             
673             fjx2             = _fjsp_madd_v2r8(dx32,fscal,fjx2);
674             fjy2             = _fjsp_madd_v2r8(dy32,fscal,fjy2);
675             fjz2             = _fjsp_madd_v2r8(dz32,fscal,fjz2);
676
677             /**************************
678              * CALCULATE INTERACTIONS *
679              **************************/
680
681             r33              = _fjsp_mul_v2r8(rsq33,rinv33);
682
683             /* EWALD ELECTROSTATICS */
684
685             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
686             ewrt             = _fjsp_mul_v2r8(r33,ewtabscale);
687             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
688             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
689             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
690
691             ewtabF           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
692             ewtabD           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
693             GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
694             ewtabV           = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
695             ewtabFn          = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
696             GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
697             felec            = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
698             velec            = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
699             velec            = _fjsp_mul_v2r8(qq33,_fjsp_sub_v2r8(rinv33,velec));
700             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq33,rinv33),_fjsp_sub_v2r8(rinvsq33,felec));
701
702             /* Update potential sum for this i atom from the interaction with this j atom. */
703             velecsum         = _fjsp_add_v2r8(velecsum,velec);
704
705             fscal            = felec;
706
707             /* Update vectorial force */
708             fix3             = _fjsp_madd_v2r8(dx33,fscal,fix3);
709             fiy3             = _fjsp_madd_v2r8(dy33,fscal,fiy3);
710             fiz3             = _fjsp_madd_v2r8(dz33,fscal,fiz3);
711             
712             fjx3             = _fjsp_madd_v2r8(dx33,fscal,fjx3);
713             fjy3             = _fjsp_madd_v2r8(dy33,fscal,fjy3);
714             fjz3             = _fjsp_madd_v2r8(dz33,fscal,fjz3);
715
716             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);
717
718             /* Inner loop uses 458 flops */
719         }
720
721         if(jidx<j_index_end)
722         {
723
724             jnrA             = jjnr[jidx];
725             j_coord_offsetA  = DIM*jnrA;
726
727             /* load j atom coordinates */
728             gmx_fjsp_load_4rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
729                                               &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,
730                                               &jy2,&jz2,&jx3,&jy3,&jz3);
731
732             /* Calculate displacement vector */
733             dx00             = _fjsp_sub_v2r8(ix0,jx0);
734             dy00             = _fjsp_sub_v2r8(iy0,jy0);
735             dz00             = _fjsp_sub_v2r8(iz0,jz0);
736             dx11             = _fjsp_sub_v2r8(ix1,jx1);
737             dy11             = _fjsp_sub_v2r8(iy1,jy1);
738             dz11             = _fjsp_sub_v2r8(iz1,jz1);
739             dx12             = _fjsp_sub_v2r8(ix1,jx2);
740             dy12             = _fjsp_sub_v2r8(iy1,jy2);
741             dz12             = _fjsp_sub_v2r8(iz1,jz2);
742             dx13             = _fjsp_sub_v2r8(ix1,jx3);
743             dy13             = _fjsp_sub_v2r8(iy1,jy3);
744             dz13             = _fjsp_sub_v2r8(iz1,jz3);
745             dx21             = _fjsp_sub_v2r8(ix2,jx1);
746             dy21             = _fjsp_sub_v2r8(iy2,jy1);
747             dz21             = _fjsp_sub_v2r8(iz2,jz1);
748             dx22             = _fjsp_sub_v2r8(ix2,jx2);
749             dy22             = _fjsp_sub_v2r8(iy2,jy2);
750             dz22             = _fjsp_sub_v2r8(iz2,jz2);
751             dx23             = _fjsp_sub_v2r8(ix2,jx3);
752             dy23             = _fjsp_sub_v2r8(iy2,jy3);
753             dz23             = _fjsp_sub_v2r8(iz2,jz3);
754             dx31             = _fjsp_sub_v2r8(ix3,jx1);
755             dy31             = _fjsp_sub_v2r8(iy3,jy1);
756             dz31             = _fjsp_sub_v2r8(iz3,jz1);
757             dx32             = _fjsp_sub_v2r8(ix3,jx2);
758             dy32             = _fjsp_sub_v2r8(iy3,jy2);
759             dz32             = _fjsp_sub_v2r8(iz3,jz2);
760             dx33             = _fjsp_sub_v2r8(ix3,jx3);
761             dy33             = _fjsp_sub_v2r8(iy3,jy3);
762             dz33             = _fjsp_sub_v2r8(iz3,jz3);
763
764             /* Calculate squared distance and things based on it */
765             rsq00            = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
766             rsq11            = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
767             rsq12            = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
768             rsq13            = gmx_fjsp_calc_rsq_v2r8(dx13,dy13,dz13);
769             rsq21            = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
770             rsq22            = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
771             rsq23            = gmx_fjsp_calc_rsq_v2r8(dx23,dy23,dz23);
772             rsq31            = gmx_fjsp_calc_rsq_v2r8(dx31,dy31,dz31);
773             rsq32            = gmx_fjsp_calc_rsq_v2r8(dx32,dy32,dz32);
774             rsq33            = gmx_fjsp_calc_rsq_v2r8(dx33,dy33,dz33);
775
776             rinv00           = gmx_fjsp_invsqrt_v2r8(rsq00);
777             rinv11           = gmx_fjsp_invsqrt_v2r8(rsq11);
778             rinv12           = gmx_fjsp_invsqrt_v2r8(rsq12);
779             rinv13           = gmx_fjsp_invsqrt_v2r8(rsq13);
780             rinv21           = gmx_fjsp_invsqrt_v2r8(rsq21);
781             rinv22           = gmx_fjsp_invsqrt_v2r8(rsq22);
782             rinv23           = gmx_fjsp_invsqrt_v2r8(rsq23);
783             rinv31           = gmx_fjsp_invsqrt_v2r8(rsq31);
784             rinv32           = gmx_fjsp_invsqrt_v2r8(rsq32);
785             rinv33           = gmx_fjsp_invsqrt_v2r8(rsq33);
786
787             rinvsq11         = _fjsp_mul_v2r8(rinv11,rinv11);
788             rinvsq12         = _fjsp_mul_v2r8(rinv12,rinv12);
789             rinvsq13         = _fjsp_mul_v2r8(rinv13,rinv13);
790             rinvsq21         = _fjsp_mul_v2r8(rinv21,rinv21);
791             rinvsq22         = _fjsp_mul_v2r8(rinv22,rinv22);
792             rinvsq23         = _fjsp_mul_v2r8(rinv23,rinv23);
793             rinvsq31         = _fjsp_mul_v2r8(rinv31,rinv31);
794             rinvsq32         = _fjsp_mul_v2r8(rinv32,rinv32);
795             rinvsq33         = _fjsp_mul_v2r8(rinv33,rinv33);
796
797             fjx0             = _fjsp_setzero_v2r8();
798             fjy0             = _fjsp_setzero_v2r8();
799             fjz0             = _fjsp_setzero_v2r8();
800             fjx1             = _fjsp_setzero_v2r8();
801             fjy1             = _fjsp_setzero_v2r8();
802             fjz1             = _fjsp_setzero_v2r8();
803             fjx2             = _fjsp_setzero_v2r8();
804             fjy2             = _fjsp_setzero_v2r8();
805             fjz2             = _fjsp_setzero_v2r8();
806             fjx3             = _fjsp_setzero_v2r8();
807             fjy3             = _fjsp_setzero_v2r8();
808             fjz3             = _fjsp_setzero_v2r8();
809
810             /**************************
811              * CALCULATE INTERACTIONS *
812              **************************/
813
814             r00              = _fjsp_mul_v2r8(rsq00,rinv00);
815
816             /* Calculate table index by multiplying r with table scale and truncate to integer */
817             rt               = _fjsp_mul_v2r8(r00,vftabscale);
818             itab_tmp         = _fjsp_dtox_v2r8(rt);
819             vfeps            = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
820             twovfeps         = _fjsp_add_v2r8(vfeps,vfeps);
821             _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
822
823             vfconv.i[0]     *= 8;
824             vfconv.i[1]     *= 8;
825
826             /* CUBIC SPLINE TABLE DISPERSION */
827             Y                = _fjsp_load_v2r8( vftab + vfconv.i[0] );
828             F                = _fjsp_setzero_v2r8();
829             GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
830             G                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
831             H                = _fjsp_setzero_v2r8();
832             GMX_FJSP_TRANSPOSE2_V2R8(G,H);
833             Fp               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
834             VV               = _fjsp_madd_v2r8(vfeps,Fp,Y);
835             vvdw6            = _fjsp_mul_v2r8(c6_00,VV);
836             FF               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
837             fvdw6            = _fjsp_mul_v2r8(c6_00,FF);
838
839             /* CUBIC SPLINE TABLE REPULSION */
840             Y                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
841             F                = _fjsp_setzero_v2r8();
842             GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
843             G                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
844             H                = _fjsp_setzero_v2r8();
845             GMX_FJSP_TRANSPOSE2_V2R8(G,H);
846             Fp               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
847             VV               = _fjsp_madd_v2r8(vfeps,Fp,Y);
848             vvdw12           = _fjsp_mul_v2r8(c12_00,VV);
849             FF               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
850             fvdw12           = _fjsp_mul_v2r8(c12_00,FF);
851             vvdw             = _fjsp_add_v2r8(vvdw12,vvdw6);
852             fvdw             = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
853
854             /* Update potential sum for this i atom from the interaction with this j atom. */
855             vvdw             = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
856             vvdwsum          = _fjsp_add_v2r8(vvdwsum,vvdw);
857
858             fscal            = fvdw;
859
860             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
861
862             /* Update vectorial force */
863             fix0             = _fjsp_madd_v2r8(dx00,fscal,fix0);
864             fiy0             = _fjsp_madd_v2r8(dy00,fscal,fiy0);
865             fiz0             = _fjsp_madd_v2r8(dz00,fscal,fiz0);
866             
867             fjx0             = _fjsp_madd_v2r8(dx00,fscal,fjx0);
868             fjy0             = _fjsp_madd_v2r8(dy00,fscal,fjy0);
869             fjz0             = _fjsp_madd_v2r8(dz00,fscal,fjz0);
870
871             /**************************
872              * CALCULATE INTERACTIONS *
873              **************************/
874
875             r11              = _fjsp_mul_v2r8(rsq11,rinv11);
876
877             /* EWALD ELECTROSTATICS */
878
879             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
880             ewrt             = _fjsp_mul_v2r8(r11,ewtabscale);
881             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
882             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
883             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
884
885             ewtabF           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
886             ewtabD           = _fjsp_setzero_v2r8();
887             GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
888             ewtabV           = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
889             ewtabFn          = _fjsp_setzero_v2r8();
890             GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
891             felec            = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
892             velec            = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
893             velec            = _fjsp_mul_v2r8(qq11,_fjsp_sub_v2r8(rinv11,velec));
894             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq11,rinv11),_fjsp_sub_v2r8(rinvsq11,felec));
895
896             /* Update potential sum for this i atom from the interaction with this j atom. */
897             velec            = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
898             velecsum         = _fjsp_add_v2r8(velecsum,velec);
899
900             fscal            = felec;
901
902             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
903
904             /* Update vectorial force */
905             fix1             = _fjsp_madd_v2r8(dx11,fscal,fix1);
906             fiy1             = _fjsp_madd_v2r8(dy11,fscal,fiy1);
907             fiz1             = _fjsp_madd_v2r8(dz11,fscal,fiz1);
908             
909             fjx1             = _fjsp_madd_v2r8(dx11,fscal,fjx1);
910             fjy1             = _fjsp_madd_v2r8(dy11,fscal,fjy1);
911             fjz1             = _fjsp_madd_v2r8(dz11,fscal,fjz1);
912
913             /**************************
914              * CALCULATE INTERACTIONS *
915              **************************/
916
917             r12              = _fjsp_mul_v2r8(rsq12,rinv12);
918
919             /* EWALD ELECTROSTATICS */
920
921             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
922             ewrt             = _fjsp_mul_v2r8(r12,ewtabscale);
923             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
924             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
925             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
926
927             ewtabF           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
928             ewtabD           = _fjsp_setzero_v2r8();
929             GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
930             ewtabV           = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
931             ewtabFn          = _fjsp_setzero_v2r8();
932             GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
933             felec            = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
934             velec            = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
935             velec            = _fjsp_mul_v2r8(qq12,_fjsp_sub_v2r8(rinv12,velec));
936             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq12,rinv12),_fjsp_sub_v2r8(rinvsq12,felec));
937
938             /* Update potential sum for this i atom from the interaction with this j atom. */
939             velec            = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
940             velecsum         = _fjsp_add_v2r8(velecsum,velec);
941
942             fscal            = felec;
943
944             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
945
946             /* Update vectorial force */
947             fix1             = _fjsp_madd_v2r8(dx12,fscal,fix1);
948             fiy1             = _fjsp_madd_v2r8(dy12,fscal,fiy1);
949             fiz1             = _fjsp_madd_v2r8(dz12,fscal,fiz1);
950             
951             fjx2             = _fjsp_madd_v2r8(dx12,fscal,fjx2);
952             fjy2             = _fjsp_madd_v2r8(dy12,fscal,fjy2);
953             fjz2             = _fjsp_madd_v2r8(dz12,fscal,fjz2);
954
955             /**************************
956              * CALCULATE INTERACTIONS *
957              **************************/
958
959             r13              = _fjsp_mul_v2r8(rsq13,rinv13);
960
961             /* EWALD ELECTROSTATICS */
962
963             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
964             ewrt             = _fjsp_mul_v2r8(r13,ewtabscale);
965             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
966             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
967             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
968
969             ewtabF           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
970             ewtabD           = _fjsp_setzero_v2r8();
971             GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
972             ewtabV           = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
973             ewtabFn          = _fjsp_setzero_v2r8();
974             GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
975             felec            = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
976             velec            = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
977             velec            = _fjsp_mul_v2r8(qq13,_fjsp_sub_v2r8(rinv13,velec));
978             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq13,rinv13),_fjsp_sub_v2r8(rinvsq13,felec));
979
980             /* Update potential sum for this i atom from the interaction with this j atom. */
981             velec            = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
982             velecsum         = _fjsp_add_v2r8(velecsum,velec);
983
984             fscal            = felec;
985
986             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
987
988             /* Update vectorial force */
989             fix1             = _fjsp_madd_v2r8(dx13,fscal,fix1);
990             fiy1             = _fjsp_madd_v2r8(dy13,fscal,fiy1);
991             fiz1             = _fjsp_madd_v2r8(dz13,fscal,fiz1);
992             
993             fjx3             = _fjsp_madd_v2r8(dx13,fscal,fjx3);
994             fjy3             = _fjsp_madd_v2r8(dy13,fscal,fjy3);
995             fjz3             = _fjsp_madd_v2r8(dz13,fscal,fjz3);
996
997             /**************************
998              * CALCULATE INTERACTIONS *
999              **************************/
1000
1001             r21              = _fjsp_mul_v2r8(rsq21,rinv21);
1002
1003             /* EWALD ELECTROSTATICS */
1004
1005             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1006             ewrt             = _fjsp_mul_v2r8(r21,ewtabscale);
1007             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
1008             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1009             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1010
1011             ewtabF           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
1012             ewtabD           = _fjsp_setzero_v2r8();
1013             GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
1014             ewtabV           = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
1015             ewtabFn          = _fjsp_setzero_v2r8();
1016             GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
1017             felec            = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
1018             velec            = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
1019             velec            = _fjsp_mul_v2r8(qq21,_fjsp_sub_v2r8(rinv21,velec));
1020             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq21,rinv21),_fjsp_sub_v2r8(rinvsq21,felec));
1021
1022             /* Update potential sum for this i atom from the interaction with this j atom. */
1023             velec            = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1024             velecsum         = _fjsp_add_v2r8(velecsum,velec);
1025
1026             fscal            = felec;
1027
1028             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1029
1030             /* Update vectorial force */
1031             fix2             = _fjsp_madd_v2r8(dx21,fscal,fix2);
1032             fiy2             = _fjsp_madd_v2r8(dy21,fscal,fiy2);
1033             fiz2             = _fjsp_madd_v2r8(dz21,fscal,fiz2);
1034             
1035             fjx1             = _fjsp_madd_v2r8(dx21,fscal,fjx1);
1036             fjy1             = _fjsp_madd_v2r8(dy21,fscal,fjy1);
1037             fjz1             = _fjsp_madd_v2r8(dz21,fscal,fjz1);
1038
1039             /**************************
1040              * CALCULATE INTERACTIONS *
1041              **************************/
1042
1043             r22              = _fjsp_mul_v2r8(rsq22,rinv22);
1044
1045             /* EWALD ELECTROSTATICS */
1046
1047             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1048             ewrt             = _fjsp_mul_v2r8(r22,ewtabscale);
1049             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
1050             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1051             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1052
1053             ewtabF           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
1054             ewtabD           = _fjsp_setzero_v2r8();
1055             GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
1056             ewtabV           = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
1057             ewtabFn          = _fjsp_setzero_v2r8();
1058             GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
1059             felec            = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
1060             velec            = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
1061             velec            = _fjsp_mul_v2r8(qq22,_fjsp_sub_v2r8(rinv22,velec));
1062             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq22,rinv22),_fjsp_sub_v2r8(rinvsq22,felec));
1063
1064             /* Update potential sum for this i atom from the interaction with this j atom. */
1065             velec            = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1066             velecsum         = _fjsp_add_v2r8(velecsum,velec);
1067
1068             fscal            = felec;
1069
1070             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1071
1072             /* Update vectorial force */
1073             fix2             = _fjsp_madd_v2r8(dx22,fscal,fix2);
1074             fiy2             = _fjsp_madd_v2r8(dy22,fscal,fiy2);
1075             fiz2             = _fjsp_madd_v2r8(dz22,fscal,fiz2);
1076             
1077             fjx2             = _fjsp_madd_v2r8(dx22,fscal,fjx2);
1078             fjy2             = _fjsp_madd_v2r8(dy22,fscal,fjy2);
1079             fjz2             = _fjsp_madd_v2r8(dz22,fscal,fjz2);
1080
1081             /**************************
1082              * CALCULATE INTERACTIONS *
1083              **************************/
1084
1085             r23              = _fjsp_mul_v2r8(rsq23,rinv23);
1086
1087             /* EWALD ELECTROSTATICS */
1088
1089             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1090             ewrt             = _fjsp_mul_v2r8(r23,ewtabscale);
1091             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
1092             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1093             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1094
1095             ewtabF           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
1096             ewtabD           = _fjsp_setzero_v2r8();
1097             GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
1098             ewtabV           = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
1099             ewtabFn          = _fjsp_setzero_v2r8();
1100             GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
1101             felec            = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
1102             velec            = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
1103             velec            = _fjsp_mul_v2r8(qq23,_fjsp_sub_v2r8(rinv23,velec));
1104             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq23,rinv23),_fjsp_sub_v2r8(rinvsq23,felec));
1105
1106             /* Update potential sum for this i atom from the interaction with this j atom. */
1107             velec            = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1108             velecsum         = _fjsp_add_v2r8(velecsum,velec);
1109
1110             fscal            = felec;
1111
1112             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1113
1114             /* Update vectorial force */
1115             fix2             = _fjsp_madd_v2r8(dx23,fscal,fix2);
1116             fiy2             = _fjsp_madd_v2r8(dy23,fscal,fiy2);
1117             fiz2             = _fjsp_madd_v2r8(dz23,fscal,fiz2);
1118             
1119             fjx3             = _fjsp_madd_v2r8(dx23,fscal,fjx3);
1120             fjy3             = _fjsp_madd_v2r8(dy23,fscal,fjy3);
1121             fjz3             = _fjsp_madd_v2r8(dz23,fscal,fjz3);
1122
1123             /**************************
1124              * CALCULATE INTERACTIONS *
1125              **************************/
1126
1127             r31              = _fjsp_mul_v2r8(rsq31,rinv31);
1128
1129             /* EWALD ELECTROSTATICS */
1130
1131             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1132             ewrt             = _fjsp_mul_v2r8(r31,ewtabscale);
1133             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
1134             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1135             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1136
1137             ewtabF           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
1138             ewtabD           = _fjsp_setzero_v2r8();
1139             GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
1140             ewtabV           = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
1141             ewtabFn          = _fjsp_setzero_v2r8();
1142             GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
1143             felec            = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
1144             velec            = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
1145             velec            = _fjsp_mul_v2r8(qq31,_fjsp_sub_v2r8(rinv31,velec));
1146             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq31,rinv31),_fjsp_sub_v2r8(rinvsq31,felec));
1147
1148             /* Update potential sum for this i atom from the interaction with this j atom. */
1149             velec            = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1150             velecsum         = _fjsp_add_v2r8(velecsum,velec);
1151
1152             fscal            = felec;
1153
1154             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1155
1156             /* Update vectorial force */
1157             fix3             = _fjsp_madd_v2r8(dx31,fscal,fix3);
1158             fiy3             = _fjsp_madd_v2r8(dy31,fscal,fiy3);
1159             fiz3             = _fjsp_madd_v2r8(dz31,fscal,fiz3);
1160             
1161             fjx1             = _fjsp_madd_v2r8(dx31,fscal,fjx1);
1162             fjy1             = _fjsp_madd_v2r8(dy31,fscal,fjy1);
1163             fjz1             = _fjsp_madd_v2r8(dz31,fscal,fjz1);
1164
1165             /**************************
1166              * CALCULATE INTERACTIONS *
1167              **************************/
1168
1169             r32              = _fjsp_mul_v2r8(rsq32,rinv32);
1170
1171             /* EWALD ELECTROSTATICS */
1172
1173             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1174             ewrt             = _fjsp_mul_v2r8(r32,ewtabscale);
1175             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
1176             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1177             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1178
1179             ewtabF           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
1180             ewtabD           = _fjsp_setzero_v2r8();
1181             GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
1182             ewtabV           = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
1183             ewtabFn          = _fjsp_setzero_v2r8();
1184             GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
1185             felec            = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
1186             velec            = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
1187             velec            = _fjsp_mul_v2r8(qq32,_fjsp_sub_v2r8(rinv32,velec));
1188             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq32,rinv32),_fjsp_sub_v2r8(rinvsq32,felec));
1189
1190             /* Update potential sum for this i atom from the interaction with this j atom. */
1191             velec            = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1192             velecsum         = _fjsp_add_v2r8(velecsum,velec);
1193
1194             fscal            = felec;
1195
1196             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1197
1198             /* Update vectorial force */
1199             fix3             = _fjsp_madd_v2r8(dx32,fscal,fix3);
1200             fiy3             = _fjsp_madd_v2r8(dy32,fscal,fiy3);
1201             fiz3             = _fjsp_madd_v2r8(dz32,fscal,fiz3);
1202             
1203             fjx2             = _fjsp_madd_v2r8(dx32,fscal,fjx2);
1204             fjy2             = _fjsp_madd_v2r8(dy32,fscal,fjy2);
1205             fjz2             = _fjsp_madd_v2r8(dz32,fscal,fjz2);
1206
1207             /**************************
1208              * CALCULATE INTERACTIONS *
1209              **************************/
1210
1211             r33              = _fjsp_mul_v2r8(rsq33,rinv33);
1212
1213             /* EWALD ELECTROSTATICS */
1214
1215             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1216             ewrt             = _fjsp_mul_v2r8(r33,ewtabscale);
1217             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
1218             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1219             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1220
1221             ewtabF           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
1222             ewtabD           = _fjsp_setzero_v2r8();
1223             GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
1224             ewtabV           = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
1225             ewtabFn          = _fjsp_setzero_v2r8();
1226             GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
1227             felec            = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
1228             velec            = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
1229             velec            = _fjsp_mul_v2r8(qq33,_fjsp_sub_v2r8(rinv33,velec));
1230             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq33,rinv33),_fjsp_sub_v2r8(rinvsq33,felec));
1231
1232             /* Update potential sum for this i atom from the interaction with this j atom. */
1233             velec            = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
1234             velecsum         = _fjsp_add_v2r8(velecsum,velec);
1235
1236             fscal            = felec;
1237
1238             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1239
1240             /* Update vectorial force */
1241             fix3             = _fjsp_madd_v2r8(dx33,fscal,fix3);
1242             fiy3             = _fjsp_madd_v2r8(dy33,fscal,fiy3);
1243             fiz3             = _fjsp_madd_v2r8(dz33,fscal,fiz3);
1244             
1245             fjx3             = _fjsp_madd_v2r8(dx33,fscal,fjx3);
1246             fjy3             = _fjsp_madd_v2r8(dy33,fscal,fjy3);
1247             fjz3             = _fjsp_madd_v2r8(dz33,fscal,fjz3);
1248
1249             gmx_fjsp_decrement_4rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2,fjx3,fjy3,fjz3);
1250
1251             /* Inner loop uses 458 flops */
1252         }
1253
1254         /* End of innermost loop */
1255
1256         gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
1257                                               f+i_coord_offset,fshift+i_shift_offset);
1258
1259         ggid                        = gid[iidx];
1260         /* Update potential energies */
1261         gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
1262         gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
1263
1264         /* Increment number of inner iterations */
1265         inneriter                  += j_index_end - j_index_start;
1266
1267         /* Outer loop uses 26 flops */
1268     }
1269
1270     /* Increment number of outer iterations */
1271     outeriter        += nri;
1272
1273     /* Update outer/inner flops */
1274
1275     inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4W4_VF,outeriter*26 + inneriter*458);
1276 }
1277 /*
1278  * Gromacs nonbonded kernel:   nb_kernel_ElecEw_VdwCSTab_GeomW4W4_F_sparc64_hpc_ace_double
1279  * Electrostatics interaction: Ewald
1280  * VdW interaction:            CubicSplineTable
1281  * Geometry:                   Water4-Water4
1282  * Calculate force/pot:        Force
1283  */
1284 void
1285 nb_kernel_ElecEw_VdwCSTab_GeomW4W4_F_sparc64_hpc_ace_double
1286                     (t_nblist                    * gmx_restrict       nlist,
1287                      rvec                        * gmx_restrict          xx,
1288                      rvec                        * gmx_restrict          ff,
1289                      t_forcerec                  * gmx_restrict          fr,
1290                      t_mdatoms                   * gmx_restrict     mdatoms,
1291                      nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
1292                      t_nrnb                      * gmx_restrict        nrnb)
1293 {
1294     /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
1295      * just 0 for non-waters.
1296      * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
1297      * jnr indices corresponding to data put in the four positions in the SIMD register.
1298      */
1299     int              i_shift_offset,i_coord_offset,outeriter,inneriter;
1300     int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
1301     int              jnrA,jnrB;
1302     int              j_coord_offsetA,j_coord_offsetB;
1303     int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
1304     real             rcutoff_scalar;
1305     real             *shiftvec,*fshift,*x,*f;
1306     _fjsp_v2r8       tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
1307     int              vdwioffset0;
1308     _fjsp_v2r8       ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
1309     int              vdwioffset1;
1310     _fjsp_v2r8       ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
1311     int              vdwioffset2;
1312     _fjsp_v2r8       ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
1313     int              vdwioffset3;
1314     _fjsp_v2r8       ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
1315     int              vdwjidx0A,vdwjidx0B;
1316     _fjsp_v2r8       jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
1317     int              vdwjidx1A,vdwjidx1B;
1318     _fjsp_v2r8       jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
1319     int              vdwjidx2A,vdwjidx2B;
1320     _fjsp_v2r8       jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
1321     int              vdwjidx3A,vdwjidx3B;
1322     _fjsp_v2r8       jx3,jy3,jz3,fjx3,fjy3,fjz3,jq3,isaj3;
1323     _fjsp_v2r8       dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
1324     _fjsp_v2r8       dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11;
1325     _fjsp_v2r8       dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12;
1326     _fjsp_v2r8       dx13,dy13,dz13,rsq13,rinv13,rinvsq13,r13,qq13,c6_13,c12_13;
1327     _fjsp_v2r8       dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21;
1328     _fjsp_v2r8       dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22;
1329     _fjsp_v2r8       dx23,dy23,dz23,rsq23,rinv23,rinvsq23,r23,qq23,c6_23,c12_23;
1330     _fjsp_v2r8       dx31,dy31,dz31,rsq31,rinv31,rinvsq31,r31,qq31,c6_31,c12_31;
1331     _fjsp_v2r8       dx32,dy32,dz32,rsq32,rinv32,rinvsq32,r32,qq32,c6_32,c12_32;
1332     _fjsp_v2r8       dx33,dy33,dz33,rsq33,rinv33,rinvsq33,r33,qq33,c6_33,c12_33;
1333     _fjsp_v2r8       velec,felec,velecsum,facel,crf,krf,krf2;
1334     real             *charge;
1335     int              nvdwtype;
1336     _fjsp_v2r8       rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
1337     int              *vdwtype;
1338     real             *vdwparam;
1339     _fjsp_v2r8       one_sixth   = gmx_fjsp_set1_v2r8(1.0/6.0);
1340     _fjsp_v2r8       one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
1341     _fjsp_v2r8       rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
1342     real             *vftab;
1343     _fjsp_v2r8       ewtabscale,eweps,sh_ewald,ewrt,ewtabhalfspace,ewtabF,ewtabFn,ewtabD,ewtabV;
1344     real             *ewtab;
1345     _fjsp_v2r8       itab_tmp;
1346     _fjsp_v2r8       dummy_mask,cutoff_mask;
1347     _fjsp_v2r8       one     = gmx_fjsp_set1_v2r8(1.0);
1348     _fjsp_v2r8       two     = gmx_fjsp_set1_v2r8(2.0);
1349     union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
1350
1351     x                = xx[0];
1352     f                = ff[0];
1353
1354     nri              = nlist->nri;
1355     iinr             = nlist->iinr;
1356     jindex           = nlist->jindex;
1357     jjnr             = nlist->jjnr;
1358     shiftidx         = nlist->shift;
1359     gid              = nlist->gid;
1360     shiftvec         = fr->shift_vec[0];
1361     fshift           = fr->fshift[0];
1362     facel            = gmx_fjsp_set1_v2r8(fr->epsfac);
1363     charge           = mdatoms->chargeA;
1364     nvdwtype         = fr->ntype;
1365     vdwparam         = fr->nbfp;
1366     vdwtype          = mdatoms->typeA;
1367
1368     vftab            = kernel_data->table_vdw->data;
1369     vftabscale       = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
1370
1371     sh_ewald         = gmx_fjsp_set1_v2r8(fr->ic->sh_ewald);
1372     ewtab            = fr->ic->tabq_coul_F;
1373     ewtabscale       = gmx_fjsp_set1_v2r8(fr->ic->tabq_scale);
1374     ewtabhalfspace   = gmx_fjsp_set1_v2r8(0.5/fr->ic->tabq_scale);
1375
1376     /* Setup water-specific parameters */
1377     inr              = nlist->iinr[0];
1378     iq1              = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
1379     iq2              = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
1380     iq3              = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+3]));
1381     vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
1382
1383     jq1              = gmx_fjsp_set1_v2r8(charge[inr+1]);
1384     jq2              = gmx_fjsp_set1_v2r8(charge[inr+2]);
1385     jq3              = gmx_fjsp_set1_v2r8(charge[inr+3]);
1386     vdwjidx0A        = 2*vdwtype[inr+0];
1387     c6_00            = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A]);
1388     c12_00           = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset0+vdwjidx0A+1]);
1389     qq11             = _fjsp_mul_v2r8(iq1,jq1);
1390     qq12             = _fjsp_mul_v2r8(iq1,jq2);
1391     qq13             = _fjsp_mul_v2r8(iq1,jq3);
1392     qq21             = _fjsp_mul_v2r8(iq2,jq1);
1393     qq22             = _fjsp_mul_v2r8(iq2,jq2);
1394     qq23             = _fjsp_mul_v2r8(iq2,jq3);
1395     qq31             = _fjsp_mul_v2r8(iq3,jq1);
1396     qq32             = _fjsp_mul_v2r8(iq3,jq2);
1397     qq33             = _fjsp_mul_v2r8(iq3,jq3);
1398
1399     /* Avoid stupid compiler warnings */
1400     jnrA = jnrB = 0;
1401     j_coord_offsetA = 0;
1402     j_coord_offsetB = 0;
1403
1404     outeriter        = 0;
1405     inneriter        = 0;
1406
1407     /* Start outer loop over neighborlists */
1408     for(iidx=0; iidx<nri; iidx++)
1409     {
1410         /* Load shift vector for this list */
1411         i_shift_offset   = DIM*shiftidx[iidx];
1412
1413         /* Load limits for loop over neighbors */
1414         j_index_start    = jindex[iidx];
1415         j_index_end      = jindex[iidx+1];
1416
1417         /* Get outer coordinate index */
1418         inr              = iinr[iidx];
1419         i_coord_offset   = DIM*inr;
1420
1421         /* Load i particle coords and add shift vector */
1422         gmx_fjsp_load_shift_and_4rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
1423                                                  &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
1424
1425         fix0             = _fjsp_setzero_v2r8();
1426         fiy0             = _fjsp_setzero_v2r8();
1427         fiz0             = _fjsp_setzero_v2r8();
1428         fix1             = _fjsp_setzero_v2r8();
1429         fiy1             = _fjsp_setzero_v2r8();
1430         fiz1             = _fjsp_setzero_v2r8();
1431         fix2             = _fjsp_setzero_v2r8();
1432         fiy2             = _fjsp_setzero_v2r8();
1433         fiz2             = _fjsp_setzero_v2r8();
1434         fix3             = _fjsp_setzero_v2r8();
1435         fiy3             = _fjsp_setzero_v2r8();
1436         fiz3             = _fjsp_setzero_v2r8();
1437
1438         /* Start inner kernel loop */
1439         for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
1440         {
1441
1442             /* Get j neighbor index, and coordinate index */
1443             jnrA             = jjnr[jidx];
1444             jnrB             = jjnr[jidx+1];
1445             j_coord_offsetA  = DIM*jnrA;
1446             j_coord_offsetB  = DIM*jnrB;
1447
1448             /* load j atom coordinates */
1449             gmx_fjsp_load_4rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
1450                                               &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,
1451                                               &jy2,&jz2,&jx3,&jy3,&jz3);
1452
1453             /* Calculate displacement vector */
1454             dx00             = _fjsp_sub_v2r8(ix0,jx0);
1455             dy00             = _fjsp_sub_v2r8(iy0,jy0);
1456             dz00             = _fjsp_sub_v2r8(iz0,jz0);
1457             dx11             = _fjsp_sub_v2r8(ix1,jx1);
1458             dy11             = _fjsp_sub_v2r8(iy1,jy1);
1459             dz11             = _fjsp_sub_v2r8(iz1,jz1);
1460             dx12             = _fjsp_sub_v2r8(ix1,jx2);
1461             dy12             = _fjsp_sub_v2r8(iy1,jy2);
1462             dz12             = _fjsp_sub_v2r8(iz1,jz2);
1463             dx13             = _fjsp_sub_v2r8(ix1,jx3);
1464             dy13             = _fjsp_sub_v2r8(iy1,jy3);
1465             dz13             = _fjsp_sub_v2r8(iz1,jz3);
1466             dx21             = _fjsp_sub_v2r8(ix2,jx1);
1467             dy21             = _fjsp_sub_v2r8(iy2,jy1);
1468             dz21             = _fjsp_sub_v2r8(iz2,jz1);
1469             dx22             = _fjsp_sub_v2r8(ix2,jx2);
1470             dy22             = _fjsp_sub_v2r8(iy2,jy2);
1471             dz22             = _fjsp_sub_v2r8(iz2,jz2);
1472             dx23             = _fjsp_sub_v2r8(ix2,jx3);
1473             dy23             = _fjsp_sub_v2r8(iy2,jy3);
1474             dz23             = _fjsp_sub_v2r8(iz2,jz3);
1475             dx31             = _fjsp_sub_v2r8(ix3,jx1);
1476             dy31             = _fjsp_sub_v2r8(iy3,jy1);
1477             dz31             = _fjsp_sub_v2r8(iz3,jz1);
1478             dx32             = _fjsp_sub_v2r8(ix3,jx2);
1479             dy32             = _fjsp_sub_v2r8(iy3,jy2);
1480             dz32             = _fjsp_sub_v2r8(iz3,jz2);
1481             dx33             = _fjsp_sub_v2r8(ix3,jx3);
1482             dy33             = _fjsp_sub_v2r8(iy3,jy3);
1483             dz33             = _fjsp_sub_v2r8(iz3,jz3);
1484
1485             /* Calculate squared distance and things based on it */
1486             rsq00            = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
1487             rsq11            = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
1488             rsq12            = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
1489             rsq13            = gmx_fjsp_calc_rsq_v2r8(dx13,dy13,dz13);
1490             rsq21            = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
1491             rsq22            = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
1492             rsq23            = gmx_fjsp_calc_rsq_v2r8(dx23,dy23,dz23);
1493             rsq31            = gmx_fjsp_calc_rsq_v2r8(dx31,dy31,dz31);
1494             rsq32            = gmx_fjsp_calc_rsq_v2r8(dx32,dy32,dz32);
1495             rsq33            = gmx_fjsp_calc_rsq_v2r8(dx33,dy33,dz33);
1496
1497             rinv00           = gmx_fjsp_invsqrt_v2r8(rsq00);
1498             rinv11           = gmx_fjsp_invsqrt_v2r8(rsq11);
1499             rinv12           = gmx_fjsp_invsqrt_v2r8(rsq12);
1500             rinv13           = gmx_fjsp_invsqrt_v2r8(rsq13);
1501             rinv21           = gmx_fjsp_invsqrt_v2r8(rsq21);
1502             rinv22           = gmx_fjsp_invsqrt_v2r8(rsq22);
1503             rinv23           = gmx_fjsp_invsqrt_v2r8(rsq23);
1504             rinv31           = gmx_fjsp_invsqrt_v2r8(rsq31);
1505             rinv32           = gmx_fjsp_invsqrt_v2r8(rsq32);
1506             rinv33           = gmx_fjsp_invsqrt_v2r8(rsq33);
1507
1508             rinvsq11         = _fjsp_mul_v2r8(rinv11,rinv11);
1509             rinvsq12         = _fjsp_mul_v2r8(rinv12,rinv12);
1510             rinvsq13         = _fjsp_mul_v2r8(rinv13,rinv13);
1511             rinvsq21         = _fjsp_mul_v2r8(rinv21,rinv21);
1512             rinvsq22         = _fjsp_mul_v2r8(rinv22,rinv22);
1513             rinvsq23         = _fjsp_mul_v2r8(rinv23,rinv23);
1514             rinvsq31         = _fjsp_mul_v2r8(rinv31,rinv31);
1515             rinvsq32         = _fjsp_mul_v2r8(rinv32,rinv32);
1516             rinvsq33         = _fjsp_mul_v2r8(rinv33,rinv33);
1517
1518             fjx0             = _fjsp_setzero_v2r8();
1519             fjy0             = _fjsp_setzero_v2r8();
1520             fjz0             = _fjsp_setzero_v2r8();
1521             fjx1             = _fjsp_setzero_v2r8();
1522             fjy1             = _fjsp_setzero_v2r8();
1523             fjz1             = _fjsp_setzero_v2r8();
1524             fjx2             = _fjsp_setzero_v2r8();
1525             fjy2             = _fjsp_setzero_v2r8();
1526             fjz2             = _fjsp_setzero_v2r8();
1527             fjx3             = _fjsp_setzero_v2r8();
1528             fjy3             = _fjsp_setzero_v2r8();
1529             fjz3             = _fjsp_setzero_v2r8();
1530
1531             /**************************
1532              * CALCULATE INTERACTIONS *
1533              **************************/
1534
1535             r00              = _fjsp_mul_v2r8(rsq00,rinv00);
1536
1537             /* Calculate table index by multiplying r with table scale and truncate to integer */
1538             rt               = _fjsp_mul_v2r8(r00,vftabscale);
1539             itab_tmp         = _fjsp_dtox_v2r8(rt);
1540             vfeps            = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1541             twovfeps         = _fjsp_add_v2r8(vfeps,vfeps);
1542             _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1543
1544             vfconv.i[0]     *= 8;
1545             vfconv.i[1]     *= 8;
1546
1547             /* CUBIC SPLINE TABLE DISPERSION */
1548             Y                = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1549             F                = _fjsp_load_v2r8( vftab + vfconv.i[1] );
1550             GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1551             G                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
1552             H                = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
1553             GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1554             Fp               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
1555             FF               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
1556             fvdw6            = _fjsp_mul_v2r8(c6_00,FF);
1557
1558             /* CUBIC SPLINE TABLE REPULSION */
1559             Y                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
1560             F                = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
1561             GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1562             G                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
1563             H                = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
1564             GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1565             Fp               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
1566             FF               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
1567             fvdw12           = _fjsp_mul_v2r8(c12_00,FF);
1568             fvdw             = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
1569
1570             fscal            = fvdw;
1571
1572             /* Update vectorial force */
1573             fix0             = _fjsp_madd_v2r8(dx00,fscal,fix0);
1574             fiy0             = _fjsp_madd_v2r8(dy00,fscal,fiy0);
1575             fiz0             = _fjsp_madd_v2r8(dz00,fscal,fiz0);
1576             
1577             fjx0             = _fjsp_madd_v2r8(dx00,fscal,fjx0);
1578             fjy0             = _fjsp_madd_v2r8(dy00,fscal,fjy0);
1579             fjz0             = _fjsp_madd_v2r8(dz00,fscal,fjz0);
1580
1581             /**************************
1582              * CALCULATE INTERACTIONS *
1583              **************************/
1584
1585             r11              = _fjsp_mul_v2r8(rsq11,rinv11);
1586
1587             /* EWALD ELECTROSTATICS */
1588
1589             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1590             ewrt             = _fjsp_mul_v2r8(r11,ewtabscale);
1591             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
1592             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1593             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1594
1595             gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1596                                          &ewtabF,&ewtabFn);
1597             felec            = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1598             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq11,rinv11),_fjsp_sub_v2r8(rinvsq11,felec));
1599
1600             fscal            = felec;
1601
1602             /* Update vectorial force */
1603             fix1             = _fjsp_madd_v2r8(dx11,fscal,fix1);
1604             fiy1             = _fjsp_madd_v2r8(dy11,fscal,fiy1);
1605             fiz1             = _fjsp_madd_v2r8(dz11,fscal,fiz1);
1606             
1607             fjx1             = _fjsp_madd_v2r8(dx11,fscal,fjx1);
1608             fjy1             = _fjsp_madd_v2r8(dy11,fscal,fjy1);
1609             fjz1             = _fjsp_madd_v2r8(dz11,fscal,fjz1);
1610
1611             /**************************
1612              * CALCULATE INTERACTIONS *
1613              **************************/
1614
1615             r12              = _fjsp_mul_v2r8(rsq12,rinv12);
1616
1617             /* EWALD ELECTROSTATICS */
1618
1619             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1620             ewrt             = _fjsp_mul_v2r8(r12,ewtabscale);
1621             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
1622             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1623             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1624
1625             gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1626                                          &ewtabF,&ewtabFn);
1627             felec            = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1628             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq12,rinv12),_fjsp_sub_v2r8(rinvsq12,felec));
1629
1630             fscal            = felec;
1631
1632             /* Update vectorial force */
1633             fix1             = _fjsp_madd_v2r8(dx12,fscal,fix1);
1634             fiy1             = _fjsp_madd_v2r8(dy12,fscal,fiy1);
1635             fiz1             = _fjsp_madd_v2r8(dz12,fscal,fiz1);
1636             
1637             fjx2             = _fjsp_madd_v2r8(dx12,fscal,fjx2);
1638             fjy2             = _fjsp_madd_v2r8(dy12,fscal,fjy2);
1639             fjz2             = _fjsp_madd_v2r8(dz12,fscal,fjz2);
1640
1641             /**************************
1642              * CALCULATE INTERACTIONS *
1643              **************************/
1644
1645             r13              = _fjsp_mul_v2r8(rsq13,rinv13);
1646
1647             /* EWALD ELECTROSTATICS */
1648
1649             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1650             ewrt             = _fjsp_mul_v2r8(r13,ewtabscale);
1651             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
1652             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1653             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1654
1655             gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1656                                          &ewtabF,&ewtabFn);
1657             felec            = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1658             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq13,rinv13),_fjsp_sub_v2r8(rinvsq13,felec));
1659
1660             fscal            = felec;
1661
1662             /* Update vectorial force */
1663             fix1             = _fjsp_madd_v2r8(dx13,fscal,fix1);
1664             fiy1             = _fjsp_madd_v2r8(dy13,fscal,fiy1);
1665             fiz1             = _fjsp_madd_v2r8(dz13,fscal,fiz1);
1666             
1667             fjx3             = _fjsp_madd_v2r8(dx13,fscal,fjx3);
1668             fjy3             = _fjsp_madd_v2r8(dy13,fscal,fjy3);
1669             fjz3             = _fjsp_madd_v2r8(dz13,fscal,fjz3);
1670
1671             /**************************
1672              * CALCULATE INTERACTIONS *
1673              **************************/
1674
1675             r21              = _fjsp_mul_v2r8(rsq21,rinv21);
1676
1677             /* EWALD ELECTROSTATICS */
1678
1679             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1680             ewrt             = _fjsp_mul_v2r8(r21,ewtabscale);
1681             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
1682             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1683             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1684
1685             gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1686                                          &ewtabF,&ewtabFn);
1687             felec            = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1688             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq21,rinv21),_fjsp_sub_v2r8(rinvsq21,felec));
1689
1690             fscal            = felec;
1691
1692             /* Update vectorial force */
1693             fix2             = _fjsp_madd_v2r8(dx21,fscal,fix2);
1694             fiy2             = _fjsp_madd_v2r8(dy21,fscal,fiy2);
1695             fiz2             = _fjsp_madd_v2r8(dz21,fscal,fiz2);
1696             
1697             fjx1             = _fjsp_madd_v2r8(dx21,fscal,fjx1);
1698             fjy1             = _fjsp_madd_v2r8(dy21,fscal,fjy1);
1699             fjz1             = _fjsp_madd_v2r8(dz21,fscal,fjz1);
1700
1701             /**************************
1702              * CALCULATE INTERACTIONS *
1703              **************************/
1704
1705             r22              = _fjsp_mul_v2r8(rsq22,rinv22);
1706
1707             /* EWALD ELECTROSTATICS */
1708
1709             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1710             ewrt             = _fjsp_mul_v2r8(r22,ewtabscale);
1711             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
1712             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1713             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1714
1715             gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1716                                          &ewtabF,&ewtabFn);
1717             felec            = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1718             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq22,rinv22),_fjsp_sub_v2r8(rinvsq22,felec));
1719
1720             fscal            = felec;
1721
1722             /* Update vectorial force */
1723             fix2             = _fjsp_madd_v2r8(dx22,fscal,fix2);
1724             fiy2             = _fjsp_madd_v2r8(dy22,fscal,fiy2);
1725             fiz2             = _fjsp_madd_v2r8(dz22,fscal,fiz2);
1726             
1727             fjx2             = _fjsp_madd_v2r8(dx22,fscal,fjx2);
1728             fjy2             = _fjsp_madd_v2r8(dy22,fscal,fjy2);
1729             fjz2             = _fjsp_madd_v2r8(dz22,fscal,fjz2);
1730
1731             /**************************
1732              * CALCULATE INTERACTIONS *
1733              **************************/
1734
1735             r23              = _fjsp_mul_v2r8(rsq23,rinv23);
1736
1737             /* EWALD ELECTROSTATICS */
1738
1739             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1740             ewrt             = _fjsp_mul_v2r8(r23,ewtabscale);
1741             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
1742             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1743             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1744
1745             gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1746                                          &ewtabF,&ewtabFn);
1747             felec            = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1748             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq23,rinv23),_fjsp_sub_v2r8(rinvsq23,felec));
1749
1750             fscal            = felec;
1751
1752             /* Update vectorial force */
1753             fix2             = _fjsp_madd_v2r8(dx23,fscal,fix2);
1754             fiy2             = _fjsp_madd_v2r8(dy23,fscal,fiy2);
1755             fiz2             = _fjsp_madd_v2r8(dz23,fscal,fiz2);
1756             
1757             fjx3             = _fjsp_madd_v2r8(dx23,fscal,fjx3);
1758             fjy3             = _fjsp_madd_v2r8(dy23,fscal,fjy3);
1759             fjz3             = _fjsp_madd_v2r8(dz23,fscal,fjz3);
1760
1761             /**************************
1762              * CALCULATE INTERACTIONS *
1763              **************************/
1764
1765             r31              = _fjsp_mul_v2r8(rsq31,rinv31);
1766
1767             /* EWALD ELECTROSTATICS */
1768
1769             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1770             ewrt             = _fjsp_mul_v2r8(r31,ewtabscale);
1771             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
1772             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1773             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1774
1775             gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1776                                          &ewtabF,&ewtabFn);
1777             felec            = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1778             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq31,rinv31),_fjsp_sub_v2r8(rinvsq31,felec));
1779
1780             fscal            = felec;
1781
1782             /* Update vectorial force */
1783             fix3             = _fjsp_madd_v2r8(dx31,fscal,fix3);
1784             fiy3             = _fjsp_madd_v2r8(dy31,fscal,fiy3);
1785             fiz3             = _fjsp_madd_v2r8(dz31,fscal,fiz3);
1786             
1787             fjx1             = _fjsp_madd_v2r8(dx31,fscal,fjx1);
1788             fjy1             = _fjsp_madd_v2r8(dy31,fscal,fjy1);
1789             fjz1             = _fjsp_madd_v2r8(dz31,fscal,fjz1);
1790
1791             /**************************
1792              * CALCULATE INTERACTIONS *
1793              **************************/
1794
1795             r32              = _fjsp_mul_v2r8(rsq32,rinv32);
1796
1797             /* EWALD ELECTROSTATICS */
1798
1799             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1800             ewrt             = _fjsp_mul_v2r8(r32,ewtabscale);
1801             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
1802             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1803             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1804
1805             gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1806                                          &ewtabF,&ewtabFn);
1807             felec            = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1808             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq32,rinv32),_fjsp_sub_v2r8(rinvsq32,felec));
1809
1810             fscal            = felec;
1811
1812             /* Update vectorial force */
1813             fix3             = _fjsp_madd_v2r8(dx32,fscal,fix3);
1814             fiy3             = _fjsp_madd_v2r8(dy32,fscal,fiy3);
1815             fiz3             = _fjsp_madd_v2r8(dz32,fscal,fiz3);
1816             
1817             fjx2             = _fjsp_madd_v2r8(dx32,fscal,fjx2);
1818             fjy2             = _fjsp_madd_v2r8(dy32,fscal,fjy2);
1819             fjz2             = _fjsp_madd_v2r8(dz32,fscal,fjz2);
1820
1821             /**************************
1822              * CALCULATE INTERACTIONS *
1823              **************************/
1824
1825             r33              = _fjsp_mul_v2r8(rsq33,rinv33);
1826
1827             /* EWALD ELECTROSTATICS */
1828
1829             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1830             ewrt             = _fjsp_mul_v2r8(r33,ewtabscale);
1831             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
1832             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
1833             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
1834
1835             gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
1836                                          &ewtabF,&ewtabFn);
1837             felec            = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
1838             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq33,rinv33),_fjsp_sub_v2r8(rinvsq33,felec));
1839
1840             fscal            = felec;
1841
1842             /* Update vectorial force */
1843             fix3             = _fjsp_madd_v2r8(dx33,fscal,fix3);
1844             fiy3             = _fjsp_madd_v2r8(dy33,fscal,fiy3);
1845             fiz3             = _fjsp_madd_v2r8(dz33,fscal,fiz3);
1846             
1847             fjx3             = _fjsp_madd_v2r8(dx33,fscal,fjx3);
1848             fjy3             = _fjsp_madd_v2r8(dy33,fscal,fjy3);
1849             fjz3             = _fjsp_madd_v2r8(dz33,fscal,fjz3);
1850
1851             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);
1852
1853             /* Inner loop uses 405 flops */
1854         }
1855
1856         if(jidx<j_index_end)
1857         {
1858
1859             jnrA             = jjnr[jidx];
1860             j_coord_offsetA  = DIM*jnrA;
1861
1862             /* load j atom coordinates */
1863             gmx_fjsp_load_4rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
1864                                               &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,
1865                                               &jy2,&jz2,&jx3,&jy3,&jz3);
1866
1867             /* Calculate displacement vector */
1868             dx00             = _fjsp_sub_v2r8(ix0,jx0);
1869             dy00             = _fjsp_sub_v2r8(iy0,jy0);
1870             dz00             = _fjsp_sub_v2r8(iz0,jz0);
1871             dx11             = _fjsp_sub_v2r8(ix1,jx1);
1872             dy11             = _fjsp_sub_v2r8(iy1,jy1);
1873             dz11             = _fjsp_sub_v2r8(iz1,jz1);
1874             dx12             = _fjsp_sub_v2r8(ix1,jx2);
1875             dy12             = _fjsp_sub_v2r8(iy1,jy2);
1876             dz12             = _fjsp_sub_v2r8(iz1,jz2);
1877             dx13             = _fjsp_sub_v2r8(ix1,jx3);
1878             dy13             = _fjsp_sub_v2r8(iy1,jy3);
1879             dz13             = _fjsp_sub_v2r8(iz1,jz3);
1880             dx21             = _fjsp_sub_v2r8(ix2,jx1);
1881             dy21             = _fjsp_sub_v2r8(iy2,jy1);
1882             dz21             = _fjsp_sub_v2r8(iz2,jz1);
1883             dx22             = _fjsp_sub_v2r8(ix2,jx2);
1884             dy22             = _fjsp_sub_v2r8(iy2,jy2);
1885             dz22             = _fjsp_sub_v2r8(iz2,jz2);
1886             dx23             = _fjsp_sub_v2r8(ix2,jx3);
1887             dy23             = _fjsp_sub_v2r8(iy2,jy3);
1888             dz23             = _fjsp_sub_v2r8(iz2,jz3);
1889             dx31             = _fjsp_sub_v2r8(ix3,jx1);
1890             dy31             = _fjsp_sub_v2r8(iy3,jy1);
1891             dz31             = _fjsp_sub_v2r8(iz3,jz1);
1892             dx32             = _fjsp_sub_v2r8(ix3,jx2);
1893             dy32             = _fjsp_sub_v2r8(iy3,jy2);
1894             dz32             = _fjsp_sub_v2r8(iz3,jz2);
1895             dx33             = _fjsp_sub_v2r8(ix3,jx3);
1896             dy33             = _fjsp_sub_v2r8(iy3,jy3);
1897             dz33             = _fjsp_sub_v2r8(iz3,jz3);
1898
1899             /* Calculate squared distance and things based on it */
1900             rsq00            = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
1901             rsq11            = gmx_fjsp_calc_rsq_v2r8(dx11,dy11,dz11);
1902             rsq12            = gmx_fjsp_calc_rsq_v2r8(dx12,dy12,dz12);
1903             rsq13            = gmx_fjsp_calc_rsq_v2r8(dx13,dy13,dz13);
1904             rsq21            = gmx_fjsp_calc_rsq_v2r8(dx21,dy21,dz21);
1905             rsq22            = gmx_fjsp_calc_rsq_v2r8(dx22,dy22,dz22);
1906             rsq23            = gmx_fjsp_calc_rsq_v2r8(dx23,dy23,dz23);
1907             rsq31            = gmx_fjsp_calc_rsq_v2r8(dx31,dy31,dz31);
1908             rsq32            = gmx_fjsp_calc_rsq_v2r8(dx32,dy32,dz32);
1909             rsq33            = gmx_fjsp_calc_rsq_v2r8(dx33,dy33,dz33);
1910
1911             rinv00           = gmx_fjsp_invsqrt_v2r8(rsq00);
1912             rinv11           = gmx_fjsp_invsqrt_v2r8(rsq11);
1913             rinv12           = gmx_fjsp_invsqrt_v2r8(rsq12);
1914             rinv13           = gmx_fjsp_invsqrt_v2r8(rsq13);
1915             rinv21           = gmx_fjsp_invsqrt_v2r8(rsq21);
1916             rinv22           = gmx_fjsp_invsqrt_v2r8(rsq22);
1917             rinv23           = gmx_fjsp_invsqrt_v2r8(rsq23);
1918             rinv31           = gmx_fjsp_invsqrt_v2r8(rsq31);
1919             rinv32           = gmx_fjsp_invsqrt_v2r8(rsq32);
1920             rinv33           = gmx_fjsp_invsqrt_v2r8(rsq33);
1921
1922             rinvsq11         = _fjsp_mul_v2r8(rinv11,rinv11);
1923             rinvsq12         = _fjsp_mul_v2r8(rinv12,rinv12);
1924             rinvsq13         = _fjsp_mul_v2r8(rinv13,rinv13);
1925             rinvsq21         = _fjsp_mul_v2r8(rinv21,rinv21);
1926             rinvsq22         = _fjsp_mul_v2r8(rinv22,rinv22);
1927             rinvsq23         = _fjsp_mul_v2r8(rinv23,rinv23);
1928             rinvsq31         = _fjsp_mul_v2r8(rinv31,rinv31);
1929             rinvsq32         = _fjsp_mul_v2r8(rinv32,rinv32);
1930             rinvsq33         = _fjsp_mul_v2r8(rinv33,rinv33);
1931
1932             fjx0             = _fjsp_setzero_v2r8();
1933             fjy0             = _fjsp_setzero_v2r8();
1934             fjz0             = _fjsp_setzero_v2r8();
1935             fjx1             = _fjsp_setzero_v2r8();
1936             fjy1             = _fjsp_setzero_v2r8();
1937             fjz1             = _fjsp_setzero_v2r8();
1938             fjx2             = _fjsp_setzero_v2r8();
1939             fjy2             = _fjsp_setzero_v2r8();
1940             fjz2             = _fjsp_setzero_v2r8();
1941             fjx3             = _fjsp_setzero_v2r8();
1942             fjy3             = _fjsp_setzero_v2r8();
1943             fjz3             = _fjsp_setzero_v2r8();
1944
1945             /**************************
1946              * CALCULATE INTERACTIONS *
1947              **************************/
1948
1949             r00              = _fjsp_mul_v2r8(rsq00,rinv00);
1950
1951             /* Calculate table index by multiplying r with table scale and truncate to integer */
1952             rt               = _fjsp_mul_v2r8(r00,vftabscale);
1953             itab_tmp         = _fjsp_dtox_v2r8(rt);
1954             vfeps            = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
1955             twovfeps         = _fjsp_add_v2r8(vfeps,vfeps);
1956             _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
1957
1958             vfconv.i[0]     *= 8;
1959             vfconv.i[1]     *= 8;
1960
1961             /* CUBIC SPLINE TABLE DISPERSION */
1962             Y                = _fjsp_load_v2r8( vftab + vfconv.i[0] );
1963             F                = _fjsp_setzero_v2r8();
1964             GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1965             G                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
1966             H                = _fjsp_setzero_v2r8();
1967             GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1968             Fp               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
1969             FF               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
1970             fvdw6            = _fjsp_mul_v2r8(c6_00,FF);
1971
1972             /* CUBIC SPLINE TABLE REPULSION */
1973             Y                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
1974             F                = _fjsp_setzero_v2r8();
1975             GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
1976             G                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
1977             H                = _fjsp_setzero_v2r8();
1978             GMX_FJSP_TRANSPOSE2_V2R8(G,H);
1979             Fp               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
1980             FF               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
1981             fvdw12           = _fjsp_mul_v2r8(c12_00,FF);
1982             fvdw             = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
1983
1984             fscal            = fvdw;
1985
1986             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
1987
1988             /* Update vectorial force */
1989             fix0             = _fjsp_madd_v2r8(dx00,fscal,fix0);
1990             fiy0             = _fjsp_madd_v2r8(dy00,fscal,fiy0);
1991             fiz0             = _fjsp_madd_v2r8(dz00,fscal,fiz0);
1992             
1993             fjx0             = _fjsp_madd_v2r8(dx00,fscal,fjx0);
1994             fjy0             = _fjsp_madd_v2r8(dy00,fscal,fjy0);
1995             fjz0             = _fjsp_madd_v2r8(dz00,fscal,fjz0);
1996
1997             /**************************
1998              * CALCULATE INTERACTIONS *
1999              **************************/
2000
2001             r11              = _fjsp_mul_v2r8(rsq11,rinv11);
2002
2003             /* EWALD ELECTROSTATICS */
2004
2005             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
2006             ewrt             = _fjsp_mul_v2r8(r11,ewtabscale);
2007             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
2008             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
2009             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
2010
2011             gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
2012             felec            = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
2013             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq11,rinv11),_fjsp_sub_v2r8(rinvsq11,felec));
2014
2015             fscal            = felec;
2016
2017             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2018
2019             /* Update vectorial force */
2020             fix1             = _fjsp_madd_v2r8(dx11,fscal,fix1);
2021             fiy1             = _fjsp_madd_v2r8(dy11,fscal,fiy1);
2022             fiz1             = _fjsp_madd_v2r8(dz11,fscal,fiz1);
2023             
2024             fjx1             = _fjsp_madd_v2r8(dx11,fscal,fjx1);
2025             fjy1             = _fjsp_madd_v2r8(dy11,fscal,fjy1);
2026             fjz1             = _fjsp_madd_v2r8(dz11,fscal,fjz1);
2027
2028             /**************************
2029              * CALCULATE INTERACTIONS *
2030              **************************/
2031
2032             r12              = _fjsp_mul_v2r8(rsq12,rinv12);
2033
2034             /* EWALD ELECTROSTATICS */
2035
2036             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
2037             ewrt             = _fjsp_mul_v2r8(r12,ewtabscale);
2038             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
2039             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
2040             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
2041
2042             gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
2043             felec            = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
2044             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq12,rinv12),_fjsp_sub_v2r8(rinvsq12,felec));
2045
2046             fscal            = felec;
2047
2048             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2049
2050             /* Update vectorial force */
2051             fix1             = _fjsp_madd_v2r8(dx12,fscal,fix1);
2052             fiy1             = _fjsp_madd_v2r8(dy12,fscal,fiy1);
2053             fiz1             = _fjsp_madd_v2r8(dz12,fscal,fiz1);
2054             
2055             fjx2             = _fjsp_madd_v2r8(dx12,fscal,fjx2);
2056             fjy2             = _fjsp_madd_v2r8(dy12,fscal,fjy2);
2057             fjz2             = _fjsp_madd_v2r8(dz12,fscal,fjz2);
2058
2059             /**************************
2060              * CALCULATE INTERACTIONS *
2061              **************************/
2062
2063             r13              = _fjsp_mul_v2r8(rsq13,rinv13);
2064
2065             /* EWALD ELECTROSTATICS */
2066
2067             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
2068             ewrt             = _fjsp_mul_v2r8(r13,ewtabscale);
2069             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
2070             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
2071             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
2072
2073             gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
2074             felec            = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
2075             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq13,rinv13),_fjsp_sub_v2r8(rinvsq13,felec));
2076
2077             fscal            = felec;
2078
2079             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2080
2081             /* Update vectorial force */
2082             fix1             = _fjsp_madd_v2r8(dx13,fscal,fix1);
2083             fiy1             = _fjsp_madd_v2r8(dy13,fscal,fiy1);
2084             fiz1             = _fjsp_madd_v2r8(dz13,fscal,fiz1);
2085             
2086             fjx3             = _fjsp_madd_v2r8(dx13,fscal,fjx3);
2087             fjy3             = _fjsp_madd_v2r8(dy13,fscal,fjy3);
2088             fjz3             = _fjsp_madd_v2r8(dz13,fscal,fjz3);
2089
2090             /**************************
2091              * CALCULATE INTERACTIONS *
2092              **************************/
2093
2094             r21              = _fjsp_mul_v2r8(rsq21,rinv21);
2095
2096             /* EWALD ELECTROSTATICS */
2097
2098             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
2099             ewrt             = _fjsp_mul_v2r8(r21,ewtabscale);
2100             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
2101             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
2102             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
2103
2104             gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
2105             felec            = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
2106             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq21,rinv21),_fjsp_sub_v2r8(rinvsq21,felec));
2107
2108             fscal            = felec;
2109
2110             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2111
2112             /* Update vectorial force */
2113             fix2             = _fjsp_madd_v2r8(dx21,fscal,fix2);
2114             fiy2             = _fjsp_madd_v2r8(dy21,fscal,fiy2);
2115             fiz2             = _fjsp_madd_v2r8(dz21,fscal,fiz2);
2116             
2117             fjx1             = _fjsp_madd_v2r8(dx21,fscal,fjx1);
2118             fjy1             = _fjsp_madd_v2r8(dy21,fscal,fjy1);
2119             fjz1             = _fjsp_madd_v2r8(dz21,fscal,fjz1);
2120
2121             /**************************
2122              * CALCULATE INTERACTIONS *
2123              **************************/
2124
2125             r22              = _fjsp_mul_v2r8(rsq22,rinv22);
2126
2127             /* EWALD ELECTROSTATICS */
2128
2129             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
2130             ewrt             = _fjsp_mul_v2r8(r22,ewtabscale);
2131             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
2132             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
2133             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
2134
2135             gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
2136             felec            = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
2137             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq22,rinv22),_fjsp_sub_v2r8(rinvsq22,felec));
2138
2139             fscal            = felec;
2140
2141             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2142
2143             /* Update vectorial force */
2144             fix2             = _fjsp_madd_v2r8(dx22,fscal,fix2);
2145             fiy2             = _fjsp_madd_v2r8(dy22,fscal,fiy2);
2146             fiz2             = _fjsp_madd_v2r8(dz22,fscal,fiz2);
2147             
2148             fjx2             = _fjsp_madd_v2r8(dx22,fscal,fjx2);
2149             fjy2             = _fjsp_madd_v2r8(dy22,fscal,fjy2);
2150             fjz2             = _fjsp_madd_v2r8(dz22,fscal,fjz2);
2151
2152             /**************************
2153              * CALCULATE INTERACTIONS *
2154              **************************/
2155
2156             r23              = _fjsp_mul_v2r8(rsq23,rinv23);
2157
2158             /* EWALD ELECTROSTATICS */
2159
2160             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
2161             ewrt             = _fjsp_mul_v2r8(r23,ewtabscale);
2162             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
2163             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
2164             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
2165
2166             gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
2167             felec            = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
2168             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq23,rinv23),_fjsp_sub_v2r8(rinvsq23,felec));
2169
2170             fscal            = felec;
2171
2172             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2173
2174             /* Update vectorial force */
2175             fix2             = _fjsp_madd_v2r8(dx23,fscal,fix2);
2176             fiy2             = _fjsp_madd_v2r8(dy23,fscal,fiy2);
2177             fiz2             = _fjsp_madd_v2r8(dz23,fscal,fiz2);
2178             
2179             fjx3             = _fjsp_madd_v2r8(dx23,fscal,fjx3);
2180             fjy3             = _fjsp_madd_v2r8(dy23,fscal,fjy3);
2181             fjz3             = _fjsp_madd_v2r8(dz23,fscal,fjz3);
2182
2183             /**************************
2184              * CALCULATE INTERACTIONS *
2185              **************************/
2186
2187             r31              = _fjsp_mul_v2r8(rsq31,rinv31);
2188
2189             /* EWALD ELECTROSTATICS */
2190
2191             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
2192             ewrt             = _fjsp_mul_v2r8(r31,ewtabscale);
2193             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
2194             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
2195             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
2196
2197             gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
2198             felec            = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
2199             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq31,rinv31),_fjsp_sub_v2r8(rinvsq31,felec));
2200
2201             fscal            = felec;
2202
2203             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2204
2205             /* Update vectorial force */
2206             fix3             = _fjsp_madd_v2r8(dx31,fscal,fix3);
2207             fiy3             = _fjsp_madd_v2r8(dy31,fscal,fiy3);
2208             fiz3             = _fjsp_madd_v2r8(dz31,fscal,fiz3);
2209             
2210             fjx1             = _fjsp_madd_v2r8(dx31,fscal,fjx1);
2211             fjy1             = _fjsp_madd_v2r8(dy31,fscal,fjy1);
2212             fjz1             = _fjsp_madd_v2r8(dz31,fscal,fjz1);
2213
2214             /**************************
2215              * CALCULATE INTERACTIONS *
2216              **************************/
2217
2218             r32              = _fjsp_mul_v2r8(rsq32,rinv32);
2219
2220             /* EWALD ELECTROSTATICS */
2221
2222             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
2223             ewrt             = _fjsp_mul_v2r8(r32,ewtabscale);
2224             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
2225             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
2226             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
2227
2228             gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
2229             felec            = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
2230             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq32,rinv32),_fjsp_sub_v2r8(rinvsq32,felec));
2231
2232             fscal            = felec;
2233
2234             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2235
2236             /* Update vectorial force */
2237             fix3             = _fjsp_madd_v2r8(dx32,fscal,fix3);
2238             fiy3             = _fjsp_madd_v2r8(dy32,fscal,fiy3);
2239             fiz3             = _fjsp_madd_v2r8(dz32,fscal,fiz3);
2240             
2241             fjx2             = _fjsp_madd_v2r8(dx32,fscal,fjx2);
2242             fjy2             = _fjsp_madd_v2r8(dy32,fscal,fjy2);
2243             fjz2             = _fjsp_madd_v2r8(dz32,fscal,fjz2);
2244
2245             /**************************
2246              * CALCULATE INTERACTIONS *
2247              **************************/
2248
2249             r33              = _fjsp_mul_v2r8(rsq33,rinv33);
2250
2251             /* EWALD ELECTROSTATICS */
2252
2253             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
2254             ewrt             = _fjsp_mul_v2r8(r33,ewtabscale);
2255             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
2256             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
2257             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
2258
2259             gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
2260             felec            = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
2261             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq33,rinv33),_fjsp_sub_v2r8(rinvsq33,felec));
2262
2263             fscal            = felec;
2264
2265             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
2266
2267             /* Update vectorial force */
2268             fix3             = _fjsp_madd_v2r8(dx33,fscal,fix3);
2269             fiy3             = _fjsp_madd_v2r8(dy33,fscal,fiy3);
2270             fiz3             = _fjsp_madd_v2r8(dz33,fscal,fiz3);
2271             
2272             fjx3             = _fjsp_madd_v2r8(dx33,fscal,fjx3);
2273             fjy3             = _fjsp_madd_v2r8(dy33,fscal,fjy3);
2274             fjz3             = _fjsp_madd_v2r8(dz33,fscal,fjz3);
2275
2276             gmx_fjsp_decrement_4rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2,fjx3,fjy3,fjz3);
2277
2278             /* Inner loop uses 405 flops */
2279         }
2280
2281         /* End of innermost loop */
2282
2283         gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
2284                                               f+i_coord_offset,fshift+i_shift_offset);
2285
2286         /* Increment number of inner iterations */
2287         inneriter                  += j_index_end - j_index_start;
2288
2289         /* Outer loop uses 24 flops */
2290     }
2291
2292     /* Increment number of outer iterations */
2293     outeriter        += nri;
2294
2295     /* Update outer/inner flops */
2296
2297     inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4W4_F,outeriter*24 + inneriter*405);
2298 }