Introduce gmxpre.h for truly global definitions
[alexxy/gromacs.git] / src / gromacs / gmxlib / nonbonded / nb_kernel_sparc64_hpc_ace_double / nb_kernel_ElecNone_VdwLJSh_GeomP1P1_sparc64_hpc_ace_double.c
1 /*
2  * This file is part of the GROMACS molecular simulation package.
3  *
4  * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
5  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6  * and including many others, as listed in the AUTHORS file in the
7  * top-level source directory and at http://www.gromacs.org.
8  *
9  * GROMACS is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public License
11  * as published by the Free Software Foundation; either version 2.1
12  * of the License, or (at your option) any later version.
13  *
14  * GROMACS is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with GROMACS; if not, see
21  * http://www.gnu.org/licenses, or write to the Free Software Foundation,
22  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
23  *
24  * If you want to redistribute modifications to GROMACS, please
25  * consider that scientific software is very special. Version
26  * control is crucial - bugs must be traceable. We will be happy to
27  * consider code for inclusion in the official distribution, but
28  * derived work must not be called official GROMACS. Details are found
29  * in the README & COPYING files - if they are missing, get the
30  * official version at http://www.gromacs.org.
31  *
32  * To help us fund GROMACS development, we humbly ask that you cite
33  * the research papers on the package. Check out http://www.gromacs.org.
34  */
35 /*
36  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
37  */
38 #include "gmxpre.h"
39
40 #include "config.h"
41
42 #include <math.h>
43
44 #include "../nb_kernel.h"
45 #include "gromacs/legacyheaders/types/simple.h"
46 #include "gromacs/math/vec.h"
47 #include "gromacs/legacyheaders/nrnb.h"
48
49 #include "kernelutil_sparc64_hpc_ace_double.h"
50
51 /*
52  * Gromacs nonbonded kernel:   nb_kernel_ElecNone_VdwLJSh_GeomP1P1_VF_sparc64_hpc_ace_double
53  * Electrostatics interaction: None
54  * VdW interaction:            LennardJones
55  * Geometry:                   Particle-Particle
56  * Calculate force/pot:        PotentialAndForce
57  */
58 void
59 nb_kernel_ElecNone_VdwLJSh_GeomP1P1_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              vdwjidx0A,vdwjidx0B;
84     _fjsp_v2r8       jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
85     _fjsp_v2r8       dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
86     int              nvdwtype;
87     _fjsp_v2r8       rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
88     int              *vdwtype;
89     real             *vdwparam;
90     _fjsp_v2r8       one_sixth   = gmx_fjsp_set1_v2r8(1.0/6.0);
91     _fjsp_v2r8       one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
92     _fjsp_v2r8       itab_tmp;
93     _fjsp_v2r8       dummy_mask,cutoff_mask;
94     _fjsp_v2r8       one     = gmx_fjsp_set1_v2r8(1.0);
95     _fjsp_v2r8       two     = gmx_fjsp_set1_v2r8(2.0);
96     union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
97
98     x                = xx[0];
99     f                = ff[0];
100
101     nri              = nlist->nri;
102     iinr             = nlist->iinr;
103     jindex           = nlist->jindex;
104     jjnr             = nlist->jjnr;
105     shiftidx         = nlist->shift;
106     gid              = nlist->gid;
107     shiftvec         = fr->shift_vec[0];
108     fshift           = fr->fshift[0];
109     nvdwtype         = fr->ntype;
110     vdwparam         = fr->nbfp;
111     vdwtype          = mdatoms->typeA;
112
113     rcutoff_scalar   = fr->rvdw;
114     rcutoff          = gmx_fjsp_set1_v2r8(rcutoff_scalar);
115     rcutoff2         = _fjsp_mul_v2r8(rcutoff,rcutoff);
116
117     sh_vdw_invrcut6  = gmx_fjsp_set1_v2r8(fr->ic->sh_invrc6);
118     rvdw             = gmx_fjsp_set1_v2r8(fr->rvdw);
119
120     /* Avoid stupid compiler warnings */
121     jnrA = jnrB = 0;
122     j_coord_offsetA = 0;
123     j_coord_offsetB = 0;
124
125     outeriter        = 0;
126     inneriter        = 0;
127
128     /* Start outer loop over neighborlists */
129     for(iidx=0; iidx<nri; iidx++)
130     {
131         /* Load shift vector for this list */
132         i_shift_offset   = DIM*shiftidx[iidx];
133
134         /* Load limits for loop over neighbors */
135         j_index_start    = jindex[iidx];
136         j_index_end      = jindex[iidx+1];
137
138         /* Get outer coordinate index */
139         inr              = iinr[iidx];
140         i_coord_offset   = DIM*inr;
141
142         /* Load i particle coords and add shift vector */
143         gmx_fjsp_load_shift_and_1rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
144
145         fix0             = _fjsp_setzero_v2r8();
146         fiy0             = _fjsp_setzero_v2r8();
147         fiz0             = _fjsp_setzero_v2r8();
148
149         /* Load parameters for i particles */
150         vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
151
152         /* Reset potential sums */
153         vvdwsum          = _fjsp_setzero_v2r8();
154
155         /* Start inner kernel loop */
156         for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
157         {
158
159             /* Get j neighbor index, and coordinate index */
160             jnrA             = jjnr[jidx];
161             jnrB             = jjnr[jidx+1];
162             j_coord_offsetA  = DIM*jnrA;
163             j_coord_offsetB  = DIM*jnrB;
164
165             /* load j atom coordinates */
166             gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
167                                               &jx0,&jy0,&jz0);
168
169             /* Calculate displacement vector */
170             dx00             = _fjsp_sub_v2r8(ix0,jx0);
171             dy00             = _fjsp_sub_v2r8(iy0,jy0);
172             dz00             = _fjsp_sub_v2r8(iz0,jz0);
173
174             /* Calculate squared distance and things based on it */
175             rsq00            = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
176
177             rinvsq00         = gmx_fjsp_inv_v2r8(rsq00);
178
179             /* Load parameters for j particles */
180             vdwjidx0A        = 2*vdwtype[jnrA+0];
181             vdwjidx0B        = 2*vdwtype[jnrB+0];
182
183             /**************************
184              * CALCULATE INTERACTIONS *
185              **************************/
186
187             if (gmx_fjsp_any_lt_v2r8(rsq00,rcutoff2))
188             {
189
190             /* Compute parameters for interactions between i and j atoms */
191             gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
192                                          vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
193
194             /* LENNARD-JONES DISPERSION/REPULSION */
195
196             rinvsix          = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
197             vvdw6            = _fjsp_mul_v2r8(c6_00,rinvsix);
198             vvdw12           = _fjsp_mul_v2r8(c12_00,_fjsp_mul_v2r8(rinvsix,rinvsix));
199             vvdw             = _fjsp_msub_v2r8(_fjsp_nmsub_v2r8(c12_00,_fjsp_mul_v2r8(sh_vdw_invrcut6,sh_vdw_invrcut6),vvdw12),one_twelfth,
200                                            _fjsp_mul_v2r8(_fjsp_nmsub_v2r8( c6_00,sh_vdw_invrcut6,vvdw6),one_sixth));
201             fvdw             = _fjsp_mul_v2r8(_fjsp_sub_v2r8(vvdw12,vvdw6),rinvsq00);
202
203             cutoff_mask      = _fjsp_cmplt_v2r8(rsq00,rcutoff2);
204
205             /* Update potential sum for this i atom from the interaction with this j atom. */
206             vvdw             = _fjsp_and_v2r8(vvdw,cutoff_mask);
207             vvdwsum          = _fjsp_add_v2r8(vvdwsum,vvdw);
208
209             fscal            = fvdw;
210
211             fscal            = _fjsp_and_v2r8(fscal,cutoff_mask);
212
213             /* Update vectorial force */
214             fix0             = _fjsp_madd_v2r8(dx00,fscal,fix0);
215             fiy0             = _fjsp_madd_v2r8(dy00,fscal,fiy0);
216             fiz0             = _fjsp_madd_v2r8(dz00,fscal,fiz0);
217             
218             gmx_fjsp_decrement_fma_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fscal,dx00,dy00,dz00);
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_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
233                                               &jx0,&jy0,&jz0);
234
235             /* Calculate displacement vector */
236             dx00             = _fjsp_sub_v2r8(ix0,jx0);
237             dy00             = _fjsp_sub_v2r8(iy0,jy0);
238             dz00             = _fjsp_sub_v2r8(iz0,jz0);
239
240             /* Calculate squared distance and things based on it */
241             rsq00            = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
242
243             rinvsq00         = gmx_fjsp_inv_v2r8(rsq00);
244
245             /* Load parameters for j particles */
246             vdwjidx0A        = 2*vdwtype[jnrA+0];
247
248             /**************************
249              * CALCULATE INTERACTIONS *
250              **************************/
251
252             if (gmx_fjsp_any_lt_v2r8(rsq00,rcutoff2))
253             {
254
255             /* Compute parameters for interactions between i and j atoms */
256             gmx_fjsp_load_1pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
257
258             /* LENNARD-JONES DISPERSION/REPULSION */
259
260             rinvsix          = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
261             vvdw6            = _fjsp_mul_v2r8(c6_00,rinvsix);
262             vvdw12           = _fjsp_mul_v2r8(c12_00,_fjsp_mul_v2r8(rinvsix,rinvsix));
263             vvdw             = _fjsp_msub_v2r8(_fjsp_nmsub_v2r8(c12_00,_fjsp_mul_v2r8(sh_vdw_invrcut6,sh_vdw_invrcut6),vvdw12),one_twelfth,
264                                            _fjsp_mul_v2r8(_fjsp_nmsub_v2r8( c6_00,sh_vdw_invrcut6,vvdw6),one_sixth));
265             fvdw             = _fjsp_mul_v2r8(_fjsp_sub_v2r8(vvdw12,vvdw6),rinvsq00);
266
267             cutoff_mask      = _fjsp_cmplt_v2r8(rsq00,rcutoff2);
268
269             /* Update potential sum for this i atom from the interaction with this j atom. */
270             vvdw             = _fjsp_and_v2r8(vvdw,cutoff_mask);
271             vvdw             = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
272             vvdwsum          = _fjsp_add_v2r8(vvdwsum,vvdw);
273
274             fscal            = fvdw;
275
276             fscal            = _fjsp_and_v2r8(fscal,cutoff_mask);
277
278             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
279
280             /* Update vectorial force */
281             fix0             = _fjsp_madd_v2r8(dx00,fscal,fix0);
282             fiy0             = _fjsp_madd_v2r8(dy00,fscal,fiy0);
283             fiz0             = _fjsp_madd_v2r8(dz00,fscal,fiz0);
284             
285             gmx_fjsp_decrement_fma_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fscal,dx00,dy00,dz00);
286
287             }
288
289             /* Inner loop uses 44 flops */
290         }
291
292         /* End of innermost loop */
293
294         gmx_fjsp_update_iforce_1atom_swizzle_v2r8(fix0,fiy0,fiz0,
295                                               f+i_coord_offset,fshift+i_shift_offset);
296
297         ggid                        = gid[iidx];
298         /* Update potential energies */
299         gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
300
301         /* Increment number of inner iterations */
302         inneriter                  += j_index_end - j_index_start;
303
304         /* Outer loop uses 7 flops */
305     }
306
307     /* Increment number of outer iterations */
308     outeriter        += nri;
309
310     /* Update outer/inner flops */
311
312     inc_nrnb(nrnb,eNR_NBKERNEL_VDW_VF,outeriter*7 + inneriter*44);
313 }
314 /*
315  * Gromacs nonbonded kernel:   nb_kernel_ElecNone_VdwLJSh_GeomP1P1_F_sparc64_hpc_ace_double
316  * Electrostatics interaction: None
317  * VdW interaction:            LennardJones
318  * Geometry:                   Particle-Particle
319  * Calculate force/pot:        Force
320  */
321 void
322 nb_kernel_ElecNone_VdwLJSh_GeomP1P1_F_sparc64_hpc_ace_double
323                     (t_nblist                    * gmx_restrict       nlist,
324                      rvec                        * gmx_restrict          xx,
325                      rvec                        * gmx_restrict          ff,
326                      t_forcerec                  * gmx_restrict          fr,
327                      t_mdatoms                   * gmx_restrict     mdatoms,
328                      nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
329                      t_nrnb                      * gmx_restrict        nrnb)
330 {
331     /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
332      * just 0 for non-waters.
333      * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
334      * jnr indices corresponding to data put in the four positions in the SIMD register.
335      */
336     int              i_shift_offset,i_coord_offset,outeriter,inneriter;
337     int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
338     int              jnrA,jnrB;
339     int              j_coord_offsetA,j_coord_offsetB;
340     int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
341     real             rcutoff_scalar;
342     real             *shiftvec,*fshift,*x,*f;
343     _fjsp_v2r8       tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
344     int              vdwioffset0;
345     _fjsp_v2r8       ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
346     int              vdwjidx0A,vdwjidx0B;
347     _fjsp_v2r8       jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
348     _fjsp_v2r8       dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
349     int              nvdwtype;
350     _fjsp_v2r8       rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
351     int              *vdwtype;
352     real             *vdwparam;
353     _fjsp_v2r8       one_sixth   = gmx_fjsp_set1_v2r8(1.0/6.0);
354     _fjsp_v2r8       one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
355     _fjsp_v2r8       itab_tmp;
356     _fjsp_v2r8       dummy_mask,cutoff_mask;
357     _fjsp_v2r8       one     = gmx_fjsp_set1_v2r8(1.0);
358     _fjsp_v2r8       two     = gmx_fjsp_set1_v2r8(2.0);
359     union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
360
361     x                = xx[0];
362     f                = ff[0];
363
364     nri              = nlist->nri;
365     iinr             = nlist->iinr;
366     jindex           = nlist->jindex;
367     jjnr             = nlist->jjnr;
368     shiftidx         = nlist->shift;
369     gid              = nlist->gid;
370     shiftvec         = fr->shift_vec[0];
371     fshift           = fr->fshift[0];
372     nvdwtype         = fr->ntype;
373     vdwparam         = fr->nbfp;
374     vdwtype          = mdatoms->typeA;
375
376     rcutoff_scalar   = fr->rvdw;
377     rcutoff          = gmx_fjsp_set1_v2r8(rcutoff_scalar);
378     rcutoff2         = _fjsp_mul_v2r8(rcutoff,rcutoff);
379
380     sh_vdw_invrcut6  = gmx_fjsp_set1_v2r8(fr->ic->sh_invrc6);
381     rvdw             = gmx_fjsp_set1_v2r8(fr->rvdw);
382
383     /* Avoid stupid compiler warnings */
384     jnrA = jnrB = 0;
385     j_coord_offsetA = 0;
386     j_coord_offsetB = 0;
387
388     outeriter        = 0;
389     inneriter        = 0;
390
391     /* Start outer loop over neighborlists */
392     for(iidx=0; iidx<nri; iidx++)
393     {
394         /* Load shift vector for this list */
395         i_shift_offset   = DIM*shiftidx[iidx];
396
397         /* Load limits for loop over neighbors */
398         j_index_start    = jindex[iidx];
399         j_index_end      = jindex[iidx+1];
400
401         /* Get outer coordinate index */
402         inr              = iinr[iidx];
403         i_coord_offset   = DIM*inr;
404
405         /* Load i particle coords and add shift vector */
406         gmx_fjsp_load_shift_and_1rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
407
408         fix0             = _fjsp_setzero_v2r8();
409         fiy0             = _fjsp_setzero_v2r8();
410         fiz0             = _fjsp_setzero_v2r8();
411
412         /* Load parameters for i particles */
413         vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
414
415         /* Start inner kernel loop */
416         for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
417         {
418
419             /* Get j neighbor index, and coordinate index */
420             jnrA             = jjnr[jidx];
421             jnrB             = jjnr[jidx+1];
422             j_coord_offsetA  = DIM*jnrA;
423             j_coord_offsetB  = DIM*jnrB;
424
425             /* load j atom coordinates */
426             gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
427                                               &jx0,&jy0,&jz0);
428
429             /* Calculate displacement vector */
430             dx00             = _fjsp_sub_v2r8(ix0,jx0);
431             dy00             = _fjsp_sub_v2r8(iy0,jy0);
432             dz00             = _fjsp_sub_v2r8(iz0,jz0);
433
434             /* Calculate squared distance and things based on it */
435             rsq00            = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
436
437             rinvsq00         = gmx_fjsp_inv_v2r8(rsq00);
438
439             /* Load parameters for j particles */
440             vdwjidx0A        = 2*vdwtype[jnrA+0];
441             vdwjidx0B        = 2*vdwtype[jnrB+0];
442
443             /**************************
444              * CALCULATE INTERACTIONS *
445              **************************/
446
447             if (gmx_fjsp_any_lt_v2r8(rsq00,rcutoff2))
448             {
449
450             /* Compute parameters for interactions between i and j atoms */
451             gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
452                                          vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
453
454             /* LENNARD-JONES DISPERSION/REPULSION */
455
456             rinvsix          = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
457             fvdw             = _fjsp_mul_v2r8(_fjsp_msub_v2r8(c12_00,rinvsix,c6_00),_fjsp_mul_v2r8(rinvsix,rinvsq00));
458
459             cutoff_mask      = _fjsp_cmplt_v2r8(rsq00,rcutoff2);
460
461             fscal            = fvdw;
462
463             fscal            = _fjsp_and_v2r8(fscal,cutoff_mask);
464
465             /* Update vectorial force */
466             fix0             = _fjsp_madd_v2r8(dx00,fscal,fix0);
467             fiy0             = _fjsp_madd_v2r8(dy00,fscal,fiy0);
468             fiz0             = _fjsp_madd_v2r8(dz00,fscal,fiz0);
469             
470             gmx_fjsp_decrement_fma_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fscal,dx00,dy00,dz00);
471
472             }
473
474             /* Inner loop uses 33 flops */
475         }
476
477         if(jidx<j_index_end)
478         {
479
480             jnrA             = jjnr[jidx];
481             j_coord_offsetA  = DIM*jnrA;
482
483             /* load j atom coordinates */
484             gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
485                                               &jx0,&jy0,&jz0);
486
487             /* Calculate displacement vector */
488             dx00             = _fjsp_sub_v2r8(ix0,jx0);
489             dy00             = _fjsp_sub_v2r8(iy0,jy0);
490             dz00             = _fjsp_sub_v2r8(iz0,jz0);
491
492             /* Calculate squared distance and things based on it */
493             rsq00            = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
494
495             rinvsq00         = gmx_fjsp_inv_v2r8(rsq00);
496
497             /* Load parameters for j particles */
498             vdwjidx0A        = 2*vdwtype[jnrA+0];
499
500             /**************************
501              * CALCULATE INTERACTIONS *
502              **************************/
503
504             if (gmx_fjsp_any_lt_v2r8(rsq00,rcutoff2))
505             {
506
507             /* Compute parameters for interactions between i and j atoms */
508             gmx_fjsp_load_1pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
509
510             /* LENNARD-JONES DISPERSION/REPULSION */
511
512             rinvsix          = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
513             fvdw             = _fjsp_mul_v2r8(_fjsp_msub_v2r8(c12_00,rinvsix,c6_00),_fjsp_mul_v2r8(rinvsix,rinvsq00));
514
515             cutoff_mask      = _fjsp_cmplt_v2r8(rsq00,rcutoff2);
516
517             fscal            = fvdw;
518
519             fscal            = _fjsp_and_v2r8(fscal,cutoff_mask);
520
521             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
522
523             /* Update vectorial force */
524             fix0             = _fjsp_madd_v2r8(dx00,fscal,fix0);
525             fiy0             = _fjsp_madd_v2r8(dy00,fscal,fiy0);
526             fiz0             = _fjsp_madd_v2r8(dz00,fscal,fiz0);
527             
528             gmx_fjsp_decrement_fma_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fscal,dx00,dy00,dz00);
529
530             }
531
532             /* Inner loop uses 33 flops */
533         }
534
535         /* End of innermost loop */
536
537         gmx_fjsp_update_iforce_1atom_swizzle_v2r8(fix0,fiy0,fiz0,
538                                               f+i_coord_offset,fshift+i_shift_offset);
539
540         /* Increment number of inner iterations */
541         inneriter                  += j_index_end - j_index_start;
542
543         /* Outer loop uses 6 flops */
544     }
545
546     /* Increment number of outer iterations */
547     outeriter        += nri;
548
549     /* Update outer/inner flops */
550
551     inc_nrnb(nrnb,eNR_NBKERNEL_VDW_F,outeriter*6 + inneriter*33);
552 }