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