Remove no-inline-max-size and suppress remark
[alexxy/gromacs.git] / src / gromacs / gmxlib / nonbonded / nb_kernel_sse4_1_double / nb_kernel_ElecNone_VdwLJSh_GeomP1P1_sse4_1_double.c
1 /*
2  * This file is part of the GROMACS molecular simulation package.
3  *
4  * Copyright (c) 2012,2013, 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 sse4_1_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 "vec.h"
47 #include "nrnb.h"
48
49 #include "gromacs/simd/math_x86_sse4_1_double.h"
50 #include "kernelutil_x86_sse4_1_double.h"
51
52 /*
53  * Gromacs nonbonded kernel:   nb_kernel_ElecNone_VdwLJSh_GeomP1P1_VF_sse4_1_double
54  * Electrostatics interaction: None
55  * VdW interaction:            LennardJones
56  * Geometry:                   Particle-Particle
57  * Calculate force/pot:        PotentialAndForce
58  */
59 void
60 nb_kernel_ElecNone_VdwLJSh_GeomP1P1_VF_sse4_1_double
61                     (t_nblist                    * gmx_restrict       nlist,
62                      rvec                        * gmx_restrict          xx,
63                      rvec                        * gmx_restrict          ff,
64                      t_forcerec                  * gmx_restrict          fr,
65                      t_mdatoms                   * gmx_restrict     mdatoms,
66                      nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
67                      t_nrnb                      * gmx_restrict        nrnb)
68 {
69     /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
70      * just 0 for non-waters.
71      * Suffixes A,B refer to j loop unrolling done with SSE double precision, e.g. for the two different
72      * jnr indices corresponding to data put in the four positions in the SIMD register.
73      */
74     int              i_shift_offset,i_coord_offset,outeriter,inneriter;
75     int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
76     int              jnrA,jnrB;
77     int              j_coord_offsetA,j_coord_offsetB;
78     int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
79     real             rcutoff_scalar;
80     real             *shiftvec,*fshift,*x,*f;
81     __m128d          tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
82     int              vdwioffset0;
83     __m128d          ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
84     int              vdwjidx0A,vdwjidx0B;
85     __m128d          jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
86     __m128d          dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
87     int              nvdwtype;
88     __m128d          rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
89     int              *vdwtype;
90     real             *vdwparam;
91     __m128d          one_sixth   = _mm_set1_pd(1.0/6.0);
92     __m128d          one_twelfth = _mm_set1_pd(1.0/12.0);
93     __m128d          dummy_mask,cutoff_mask;
94     __m128d          signbit   = gmx_mm_castsi128_pd( _mm_set_epi32(0x80000000,0x00000000,0x80000000,0x00000000) );
95     __m128d          one     = _mm_set1_pd(1.0);
96     __m128d          two     = _mm_set1_pd(2.0);
97     x                = xx[0];
98     f                = ff[0];
99
100     nri              = nlist->nri;
101     iinr             = nlist->iinr;
102     jindex           = nlist->jindex;
103     jjnr             = nlist->jjnr;
104     shiftidx         = nlist->shift;
105     gid              = nlist->gid;
106     shiftvec         = fr->shift_vec[0];
107     fshift           = fr->fshift[0];
108     nvdwtype         = fr->ntype;
109     vdwparam         = fr->nbfp;
110     vdwtype          = mdatoms->typeA;
111
112     rcutoff_scalar   = fr->rvdw;
113     rcutoff          = _mm_set1_pd(rcutoff_scalar);
114     rcutoff2         = _mm_mul_pd(rcutoff,rcutoff);
115
116     sh_vdw_invrcut6  = _mm_set1_pd(fr->ic->sh_invrc6);
117     rvdw             = _mm_set1_pd(fr->rvdw);
118
119     /* Avoid stupid compiler warnings */
120     jnrA = jnrB = 0;
121     j_coord_offsetA = 0;
122     j_coord_offsetB = 0;
123
124     outeriter        = 0;
125     inneriter        = 0;
126
127     /* Start outer loop over neighborlists */
128     for(iidx=0; iidx<nri; iidx++)
129     {
130         /* Load shift vector for this list */
131         i_shift_offset   = DIM*shiftidx[iidx];
132
133         /* Load limits for loop over neighbors */
134         j_index_start    = jindex[iidx];
135         j_index_end      = jindex[iidx+1];
136
137         /* Get outer coordinate index */
138         inr              = iinr[iidx];
139         i_coord_offset   = DIM*inr;
140
141         /* Load i particle coords and add shift vector */
142         gmx_mm_load_shift_and_1rvec_broadcast_pd(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
143
144         fix0             = _mm_setzero_pd();
145         fiy0             = _mm_setzero_pd();
146         fiz0             = _mm_setzero_pd();
147
148         /* Load parameters for i particles */
149         vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
150
151         /* Reset potential sums */
152         vvdwsum          = _mm_setzero_pd();
153
154         /* Start inner kernel loop */
155         for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
156         {
157
158             /* Get j neighbor index, and coordinate index */
159             jnrA             = jjnr[jidx];
160             jnrB             = jjnr[jidx+1];
161             j_coord_offsetA  = DIM*jnrA;
162             j_coord_offsetB  = DIM*jnrB;
163
164             /* load j atom coordinates */
165             gmx_mm_load_1rvec_2ptr_swizzle_pd(x+j_coord_offsetA,x+j_coord_offsetB,
166                                               &jx0,&jy0,&jz0);
167
168             /* Calculate displacement vector */
169             dx00             = _mm_sub_pd(ix0,jx0);
170             dy00             = _mm_sub_pd(iy0,jy0);
171             dz00             = _mm_sub_pd(iz0,jz0);
172
173             /* Calculate squared distance and things based on it */
174             rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
175
176             rinvsq00         = gmx_mm_inv_pd(rsq00);
177
178             /* Load parameters for j particles */
179             vdwjidx0A        = 2*vdwtype[jnrA+0];
180             vdwjidx0B        = 2*vdwtype[jnrB+0];
181
182             /**************************
183              * CALCULATE INTERACTIONS *
184              **************************/
185
186             if (gmx_mm_any_lt(rsq00,rcutoff2))
187             {
188
189             /* Compute parameters for interactions between i and j atoms */
190             gmx_mm_load_2pair_swizzle_pd(vdwparam+vdwioffset0+vdwjidx0A,
191                                          vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
192
193             /* LENNARD-JONES DISPERSION/REPULSION */
194
195             rinvsix          = _mm_mul_pd(_mm_mul_pd(rinvsq00,rinvsq00),rinvsq00);
196             vvdw6            = _mm_mul_pd(c6_00,rinvsix);
197             vvdw12           = _mm_mul_pd(c12_00,_mm_mul_pd(rinvsix,rinvsix));
198             vvdw             = _mm_sub_pd(_mm_mul_pd( _mm_sub_pd(vvdw12 , _mm_mul_pd(c12_00,_mm_mul_pd(sh_vdw_invrcut6,sh_vdw_invrcut6))), one_twelfth) ,
199                                           _mm_mul_pd( _mm_sub_pd(vvdw6,_mm_mul_pd(c6_00,sh_vdw_invrcut6)),one_sixth));
200             fvdw             = _mm_mul_pd(_mm_sub_pd(vvdw12,vvdw6),rinvsq00);
201
202             cutoff_mask      = _mm_cmplt_pd(rsq00,rcutoff2);
203
204             /* Update potential sum for this i atom from the interaction with this j atom. */
205             vvdw             = _mm_and_pd(vvdw,cutoff_mask);
206             vvdwsum          = _mm_add_pd(vvdwsum,vvdw);
207
208             fscal            = fvdw;
209
210             fscal            = _mm_and_pd(fscal,cutoff_mask);
211
212             /* Calculate temporary vectorial force */
213             tx               = _mm_mul_pd(fscal,dx00);
214             ty               = _mm_mul_pd(fscal,dy00);
215             tz               = _mm_mul_pd(fscal,dz00);
216
217             /* Update vectorial force */
218             fix0             = _mm_add_pd(fix0,tx);
219             fiy0             = _mm_add_pd(fiy0,ty);
220             fiz0             = _mm_add_pd(fiz0,tz);
221
222             gmx_mm_decrement_1rvec_2ptr_swizzle_pd(f+j_coord_offsetA,f+j_coord_offsetB,tx,ty,tz);
223
224             }
225
226             /* Inner loop uses 41 flops */
227         }
228
229         if(jidx<j_index_end)
230         {
231
232             jnrA             = jjnr[jidx];
233             j_coord_offsetA  = DIM*jnrA;
234
235             /* load j atom coordinates */
236             gmx_mm_load_1rvec_1ptr_swizzle_pd(x+j_coord_offsetA,
237                                               &jx0,&jy0,&jz0);
238
239             /* Calculate displacement vector */
240             dx00             = _mm_sub_pd(ix0,jx0);
241             dy00             = _mm_sub_pd(iy0,jy0);
242             dz00             = _mm_sub_pd(iz0,jz0);
243
244             /* Calculate squared distance and things based on it */
245             rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
246
247             rinvsq00         = gmx_mm_inv_pd(rsq00);
248
249             /* Load parameters for j particles */
250             vdwjidx0A        = 2*vdwtype[jnrA+0];
251
252             /**************************
253              * CALCULATE INTERACTIONS *
254              **************************/
255
256             if (gmx_mm_any_lt(rsq00,rcutoff2))
257             {
258
259             /* Compute parameters for interactions between i and j atoms */
260             gmx_mm_load_1pair_swizzle_pd(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
261
262             /* LENNARD-JONES DISPERSION/REPULSION */
263
264             rinvsix          = _mm_mul_pd(_mm_mul_pd(rinvsq00,rinvsq00),rinvsq00);
265             vvdw6            = _mm_mul_pd(c6_00,rinvsix);
266             vvdw12           = _mm_mul_pd(c12_00,_mm_mul_pd(rinvsix,rinvsix));
267             vvdw             = _mm_sub_pd(_mm_mul_pd( _mm_sub_pd(vvdw12 , _mm_mul_pd(c12_00,_mm_mul_pd(sh_vdw_invrcut6,sh_vdw_invrcut6))), one_twelfth) ,
268                                           _mm_mul_pd( _mm_sub_pd(vvdw6,_mm_mul_pd(c6_00,sh_vdw_invrcut6)),one_sixth));
269             fvdw             = _mm_mul_pd(_mm_sub_pd(vvdw12,vvdw6),rinvsq00);
270
271             cutoff_mask      = _mm_cmplt_pd(rsq00,rcutoff2);
272
273             /* Update potential sum for this i atom from the interaction with this j atom. */
274             vvdw             = _mm_and_pd(vvdw,cutoff_mask);
275             vvdw             = _mm_unpacklo_pd(vvdw,_mm_setzero_pd());
276             vvdwsum          = _mm_add_pd(vvdwsum,vvdw);
277
278             fscal            = fvdw;
279
280             fscal            = _mm_and_pd(fscal,cutoff_mask);
281
282             fscal            = _mm_unpacklo_pd(fscal,_mm_setzero_pd());
283
284             /* Calculate temporary vectorial force */
285             tx               = _mm_mul_pd(fscal,dx00);
286             ty               = _mm_mul_pd(fscal,dy00);
287             tz               = _mm_mul_pd(fscal,dz00);
288
289             /* Update vectorial force */
290             fix0             = _mm_add_pd(fix0,tx);
291             fiy0             = _mm_add_pd(fiy0,ty);
292             fiz0             = _mm_add_pd(fiz0,tz);
293
294             gmx_mm_decrement_1rvec_1ptr_swizzle_pd(f+j_coord_offsetA,tx,ty,tz);
295
296             }
297
298             /* Inner loop uses 41 flops */
299         }
300
301         /* End of innermost loop */
302
303         gmx_mm_update_iforce_1atom_swizzle_pd(fix0,fiy0,fiz0,
304                                               f+i_coord_offset,fshift+i_shift_offset);
305
306         ggid                        = gid[iidx];
307         /* Update potential energies */
308         gmx_mm_update_1pot_pd(vvdwsum,kernel_data->energygrp_vdw+ggid);
309
310         /* Increment number of inner iterations */
311         inneriter                  += j_index_end - j_index_start;
312
313         /* Outer loop uses 7 flops */
314     }
315
316     /* Increment number of outer iterations */
317     outeriter        += nri;
318
319     /* Update outer/inner flops */
320
321     inc_nrnb(nrnb,eNR_NBKERNEL_VDW_VF,outeriter*7 + inneriter*41);
322 }
323 /*
324  * Gromacs nonbonded kernel:   nb_kernel_ElecNone_VdwLJSh_GeomP1P1_F_sse4_1_double
325  * Electrostatics interaction: None
326  * VdW interaction:            LennardJones
327  * Geometry:                   Particle-Particle
328  * Calculate force/pot:        Force
329  */
330 void
331 nb_kernel_ElecNone_VdwLJSh_GeomP1P1_F_sse4_1_double
332                     (t_nblist                    * gmx_restrict       nlist,
333                      rvec                        * gmx_restrict          xx,
334                      rvec                        * gmx_restrict          ff,
335                      t_forcerec                  * gmx_restrict          fr,
336                      t_mdatoms                   * gmx_restrict     mdatoms,
337                      nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
338                      t_nrnb                      * gmx_restrict        nrnb)
339 {
340     /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
341      * just 0 for non-waters.
342      * Suffixes A,B refer to j loop unrolling done with SSE double precision, e.g. for the two different
343      * jnr indices corresponding to data put in the four positions in the SIMD register.
344      */
345     int              i_shift_offset,i_coord_offset,outeriter,inneriter;
346     int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
347     int              jnrA,jnrB;
348     int              j_coord_offsetA,j_coord_offsetB;
349     int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
350     real             rcutoff_scalar;
351     real             *shiftvec,*fshift,*x,*f;
352     __m128d          tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
353     int              vdwioffset0;
354     __m128d          ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
355     int              vdwjidx0A,vdwjidx0B;
356     __m128d          jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
357     __m128d          dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
358     int              nvdwtype;
359     __m128d          rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
360     int              *vdwtype;
361     real             *vdwparam;
362     __m128d          one_sixth   = _mm_set1_pd(1.0/6.0);
363     __m128d          one_twelfth = _mm_set1_pd(1.0/12.0);
364     __m128d          dummy_mask,cutoff_mask;
365     __m128d          signbit   = gmx_mm_castsi128_pd( _mm_set_epi32(0x80000000,0x00000000,0x80000000,0x00000000) );
366     __m128d          one     = _mm_set1_pd(1.0);
367     __m128d          two     = _mm_set1_pd(2.0);
368     x                = xx[0];
369     f                = ff[0];
370
371     nri              = nlist->nri;
372     iinr             = nlist->iinr;
373     jindex           = nlist->jindex;
374     jjnr             = nlist->jjnr;
375     shiftidx         = nlist->shift;
376     gid              = nlist->gid;
377     shiftvec         = fr->shift_vec[0];
378     fshift           = fr->fshift[0];
379     nvdwtype         = fr->ntype;
380     vdwparam         = fr->nbfp;
381     vdwtype          = mdatoms->typeA;
382
383     rcutoff_scalar   = fr->rvdw;
384     rcutoff          = _mm_set1_pd(rcutoff_scalar);
385     rcutoff2         = _mm_mul_pd(rcutoff,rcutoff);
386
387     sh_vdw_invrcut6  = _mm_set1_pd(fr->ic->sh_invrc6);
388     rvdw             = _mm_set1_pd(fr->rvdw);
389
390     /* Avoid stupid compiler warnings */
391     jnrA = jnrB = 0;
392     j_coord_offsetA = 0;
393     j_coord_offsetB = 0;
394
395     outeriter        = 0;
396     inneriter        = 0;
397
398     /* Start outer loop over neighborlists */
399     for(iidx=0; iidx<nri; iidx++)
400     {
401         /* Load shift vector for this list */
402         i_shift_offset   = DIM*shiftidx[iidx];
403
404         /* Load limits for loop over neighbors */
405         j_index_start    = jindex[iidx];
406         j_index_end      = jindex[iidx+1];
407
408         /* Get outer coordinate index */
409         inr              = iinr[iidx];
410         i_coord_offset   = DIM*inr;
411
412         /* Load i particle coords and add shift vector */
413         gmx_mm_load_shift_and_1rvec_broadcast_pd(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
414
415         fix0             = _mm_setzero_pd();
416         fiy0             = _mm_setzero_pd();
417         fiz0             = _mm_setzero_pd();
418
419         /* Load parameters for i particles */
420         vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
421
422         /* Start inner kernel loop */
423         for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
424         {
425
426             /* Get j neighbor index, and coordinate index */
427             jnrA             = jjnr[jidx];
428             jnrB             = jjnr[jidx+1];
429             j_coord_offsetA  = DIM*jnrA;
430             j_coord_offsetB  = DIM*jnrB;
431
432             /* load j atom coordinates */
433             gmx_mm_load_1rvec_2ptr_swizzle_pd(x+j_coord_offsetA,x+j_coord_offsetB,
434                                               &jx0,&jy0,&jz0);
435
436             /* Calculate displacement vector */
437             dx00             = _mm_sub_pd(ix0,jx0);
438             dy00             = _mm_sub_pd(iy0,jy0);
439             dz00             = _mm_sub_pd(iz0,jz0);
440
441             /* Calculate squared distance and things based on it */
442             rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
443
444             rinvsq00         = gmx_mm_inv_pd(rsq00);
445
446             /* Load parameters for j particles */
447             vdwjidx0A        = 2*vdwtype[jnrA+0];
448             vdwjidx0B        = 2*vdwtype[jnrB+0];
449
450             /**************************
451              * CALCULATE INTERACTIONS *
452              **************************/
453
454             if (gmx_mm_any_lt(rsq00,rcutoff2))
455             {
456
457             /* Compute parameters for interactions between i and j atoms */
458             gmx_mm_load_2pair_swizzle_pd(vdwparam+vdwioffset0+vdwjidx0A,
459                                          vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
460
461             /* LENNARD-JONES DISPERSION/REPULSION */
462
463             rinvsix          = _mm_mul_pd(_mm_mul_pd(rinvsq00,rinvsq00),rinvsq00);
464             fvdw             = _mm_mul_pd(_mm_sub_pd(_mm_mul_pd(c12_00,rinvsix),c6_00),_mm_mul_pd(rinvsix,rinvsq00));
465
466             cutoff_mask      = _mm_cmplt_pd(rsq00,rcutoff2);
467
468             fscal            = fvdw;
469
470             fscal            = _mm_and_pd(fscal,cutoff_mask);
471
472             /* Calculate temporary vectorial force */
473             tx               = _mm_mul_pd(fscal,dx00);
474             ty               = _mm_mul_pd(fscal,dy00);
475             tz               = _mm_mul_pd(fscal,dz00);
476
477             /* Update vectorial force */
478             fix0             = _mm_add_pd(fix0,tx);
479             fiy0             = _mm_add_pd(fiy0,ty);
480             fiz0             = _mm_add_pd(fiz0,tz);
481
482             gmx_mm_decrement_1rvec_2ptr_swizzle_pd(f+j_coord_offsetA,f+j_coord_offsetB,tx,ty,tz);
483
484             }
485
486             /* Inner loop uses 30 flops */
487         }
488
489         if(jidx<j_index_end)
490         {
491
492             jnrA             = jjnr[jidx];
493             j_coord_offsetA  = DIM*jnrA;
494
495             /* load j atom coordinates */
496             gmx_mm_load_1rvec_1ptr_swizzle_pd(x+j_coord_offsetA,
497                                               &jx0,&jy0,&jz0);
498
499             /* Calculate displacement vector */
500             dx00             = _mm_sub_pd(ix0,jx0);
501             dy00             = _mm_sub_pd(iy0,jy0);
502             dz00             = _mm_sub_pd(iz0,jz0);
503
504             /* Calculate squared distance and things based on it */
505             rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
506
507             rinvsq00         = gmx_mm_inv_pd(rsq00);
508
509             /* Load parameters for j particles */
510             vdwjidx0A        = 2*vdwtype[jnrA+0];
511
512             /**************************
513              * CALCULATE INTERACTIONS *
514              **************************/
515
516             if (gmx_mm_any_lt(rsq00,rcutoff2))
517             {
518
519             /* Compute parameters for interactions between i and j atoms */
520             gmx_mm_load_1pair_swizzle_pd(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
521
522             /* LENNARD-JONES DISPERSION/REPULSION */
523
524             rinvsix          = _mm_mul_pd(_mm_mul_pd(rinvsq00,rinvsq00),rinvsq00);
525             fvdw             = _mm_mul_pd(_mm_sub_pd(_mm_mul_pd(c12_00,rinvsix),c6_00),_mm_mul_pd(rinvsix,rinvsq00));
526
527             cutoff_mask      = _mm_cmplt_pd(rsq00,rcutoff2);
528
529             fscal            = fvdw;
530
531             fscal            = _mm_and_pd(fscal,cutoff_mask);
532
533             fscal            = _mm_unpacklo_pd(fscal,_mm_setzero_pd());
534
535             /* Calculate temporary vectorial force */
536             tx               = _mm_mul_pd(fscal,dx00);
537             ty               = _mm_mul_pd(fscal,dy00);
538             tz               = _mm_mul_pd(fscal,dz00);
539
540             /* Update vectorial force */
541             fix0             = _mm_add_pd(fix0,tx);
542             fiy0             = _mm_add_pd(fiy0,ty);
543             fiz0             = _mm_add_pd(fiz0,tz);
544
545             gmx_mm_decrement_1rvec_1ptr_swizzle_pd(f+j_coord_offsetA,tx,ty,tz);
546
547             }
548
549             /* Inner loop uses 30 flops */
550         }
551
552         /* End of innermost loop */
553
554         gmx_mm_update_iforce_1atom_swizzle_pd(fix0,fiy0,fiz0,
555                                               f+i_coord_offset,fshift+i_shift_offset);
556
557         /* Increment number of inner iterations */
558         inneriter                  += j_index_end - j_index_start;
559
560         /* Outer loop uses 6 flops */
561     }
562
563     /* Increment number of outer iterations */
564     outeriter        += nri;
565
566     /* Update outer/inner flops */
567
568     inc_nrnb(nrnb,eNR_NBKERNEL_VDW_F,outeriter*6 + inneriter*30);
569 }