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