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