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