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