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