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