Bug Summary

File:gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRFCut_VdwCSTab_GeomW3P1_sse4_1_single.c
Location:line 110, column 22
Description:Value stored to 'one' during its initialization is never read

Annotated Source Code

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 sse4_1_single kernel generator.
37 */
38#ifdef HAVE_CONFIG_H1
39#include <config.h>
40#endif
41
42#include <math.h>
43
44#include "../nb_kernel.h"
45#include "types/simple.h"
46#include "gromacs/math/vec.h"
47#include "nrnb.h"
48
49#include "gromacs/simd/math_x86_sse4_1_single.h"
50#include "kernelutil_x86_sse4_1_single.h"
51
52/*
53 * Gromacs nonbonded kernel: nb_kernel_ElecRFCut_VdwCSTab_GeomW3P1_VF_sse4_1_single
54 * Electrostatics interaction: ReactionField
55 * VdW interaction: CubicSplineTable
56 * Geometry: Water3-Particle
57 * Calculate force/pot: PotentialAndForce
58 */
59void
60nb_kernel_ElecRFCut_VdwCSTab_GeomW3P1_VF_sse4_1_single
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__attribute__ ((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,C,D refer to j loop unrolling done with SSE, e.g. for the four 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,jnrC,jnrD;
77 int jnrlistA,jnrlistB,jnrlistC,jnrlistD;
78 int j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
79 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
80 real rcutoff_scalar;
81 real *shiftvec,*fshift,*x,*f;
82 real *fjptrA,*fjptrB,*fjptrC,*fjptrD;
83 real scratch[4*DIM3];
84 __m128 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
85 int vdwioffset0;
86 __m128 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
87 int vdwioffset1;
88 __m128 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
89 int vdwioffset2;
90 __m128 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
91 int vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
92 __m128 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
93 __m128 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
94 __m128 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
95 __m128 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
96 __m128 velec,felec,velecsum,facel,crf,krf,krf2;
97 real *charge;
98 int nvdwtype;
99 __m128 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
100 int *vdwtype;
101 real *vdwparam;
102 __m128 one_sixth = _mm_set1_ps(1.0/6.0);
103 __m128 one_twelfth = _mm_set1_ps(1.0/12.0);
104 __m128i vfitab;
105 __m128i ifour = _mm_set1_epi32(4);
106 __m128 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
107 real *vftab;
108 __m128 dummy_mask,cutoff_mask;
109 __m128 signbit = _mm_castsi128_ps( _mm_set1_epi32(0x80000000) );
110 __m128 one = _mm_set1_ps(1.0);
Value stored to 'one' during its initialization is never read
111 __m128 two = _mm_set1_ps(2.0);
112 x = xx[0];
113 f = ff[0];
114
115 nri = nlist->nri;
116 iinr = nlist->iinr;
117 jindex = nlist->jindex;
118 jjnr = nlist->jjnr;
119 shiftidx = nlist->shift;
120 gid = nlist->gid;
121 shiftvec = fr->shift_vec[0];
122 fshift = fr->fshift[0];
123 facel = _mm_set1_ps(fr->epsfac);
124 charge = mdatoms->chargeA;
125 krf = _mm_set1_ps(fr->ic->k_rf);
126 krf2 = _mm_set1_ps(fr->ic->k_rf*2.0);
127 crf = _mm_set1_ps(fr->ic->c_rf);
128 nvdwtype = fr->ntype;
129 vdwparam = fr->nbfp;
130 vdwtype = mdatoms->typeA;
131
132 vftab = kernel_data->table_vdw->data;
133 vftabscale = _mm_set1_ps(kernel_data->table_vdw->scale);
134
135 /* Setup water-specific parameters */
136 inr = nlist->iinr[0];
137 iq0 = _mm_mul_ps(facel,_mm_set1_ps(charge[inr+0]));
138 iq1 = _mm_mul_ps(facel,_mm_set1_ps(charge[inr+1]));
139 iq2 = _mm_mul_ps(facel,_mm_set1_ps(charge[inr+2]));
140 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
141
142 /* When we use explicit cutoffs the value must be identical for elec and VdW, so use elec as an arbitrary choice */
143 rcutoff_scalar = fr->rcoulomb;
144 rcutoff = _mm_set1_ps(rcutoff_scalar);
145 rcutoff2 = _mm_mul_ps(rcutoff,rcutoff);
146
147 /* Avoid stupid compiler warnings */
148 jnrA = jnrB = jnrC = jnrD = 0;
149 j_coord_offsetA = 0;
150 j_coord_offsetB = 0;
151 j_coord_offsetC = 0;
152 j_coord_offsetD = 0;
153
154 outeriter = 0;
155 inneriter = 0;
156
157 for(iidx=0;iidx<4*DIM3;iidx++)
158 {
159 scratch[iidx] = 0.0;
160 }
161
162 /* Start outer loop over neighborlists */
163 for(iidx=0; iidx<nri; iidx++)
164 {
165 /* Load shift vector for this list */
166 i_shift_offset = DIM3*shiftidx[iidx];
167
168 /* Load limits for loop over neighbors */
169 j_index_start = jindex[iidx];
170 j_index_end = jindex[iidx+1];
171
172 /* Get outer coordinate index */
173 inr = iinr[iidx];
174 i_coord_offset = DIM3*inr;
175
176 /* Load i particle coords and add shift vector */
177 gmx_mm_load_shift_and_3rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,
178 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2);
179
180 fix0 = _mm_setzero_ps();
181 fiy0 = _mm_setzero_ps();
182 fiz0 = _mm_setzero_ps();
183 fix1 = _mm_setzero_ps();
184 fiy1 = _mm_setzero_ps();
185 fiz1 = _mm_setzero_ps();
186 fix2 = _mm_setzero_ps();
187 fiy2 = _mm_setzero_ps();
188 fiz2 = _mm_setzero_ps();
189
190 /* Reset potential sums */
191 velecsum = _mm_setzero_ps();
192 vvdwsum = _mm_setzero_ps();
193
194 /* Start inner kernel loop */
195 for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
196 {
197
198 /* Get j neighbor index, and coordinate index */
199 jnrA = jjnr[jidx];
200 jnrB = jjnr[jidx+1];
201 jnrC = jjnr[jidx+2];
202 jnrD = jjnr[jidx+3];
203 j_coord_offsetA = DIM3*jnrA;
204 j_coord_offsetB = DIM3*jnrB;
205 j_coord_offsetC = DIM3*jnrC;
206 j_coord_offsetD = DIM3*jnrD;
207
208 /* load j atom coordinates */
209 gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
210 x+j_coord_offsetC,x+j_coord_offsetD,
211 &jx0,&jy0,&jz0);
212
213 /* Calculate displacement vector */
214 dx00 = _mm_sub_ps(ix0,jx0);
215 dy00 = _mm_sub_ps(iy0,jy0);
216 dz00 = _mm_sub_ps(iz0,jz0);
217 dx10 = _mm_sub_ps(ix1,jx0);
218 dy10 = _mm_sub_ps(iy1,jy0);
219 dz10 = _mm_sub_ps(iz1,jz0);
220 dx20 = _mm_sub_ps(ix2,jx0);
221 dy20 = _mm_sub_ps(iy2,jy0);
222 dz20 = _mm_sub_ps(iz2,jz0);
223
224 /* Calculate squared distance and things based on it */
225 rsq00 = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
226 rsq10 = gmx_mm_calc_rsq_ps(dx10,dy10,dz10);
227 rsq20 = gmx_mm_calc_rsq_ps(dx20,dy20,dz20);
228
229 rinv00 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq00);
230 rinv10 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq10);
231 rinv20 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq20);
232
233 rinvsq00 = _mm_mul_ps(rinv00,rinv00);
234 rinvsq10 = _mm_mul_ps(rinv10,rinv10);
235 rinvsq20 = _mm_mul_ps(rinv20,rinv20);
236
237 /* Load parameters for j particles */
238 jq0 = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
239 charge+jnrC+0,charge+jnrD+0);
240 vdwjidx0A = 2*vdwtype[jnrA+0];
241 vdwjidx0B = 2*vdwtype[jnrB+0];
242 vdwjidx0C = 2*vdwtype[jnrC+0];
243 vdwjidx0D = 2*vdwtype[jnrD+0];
244
245 fjx0 = _mm_setzero_ps();
246 fjy0 = _mm_setzero_ps();
247 fjz0 = _mm_setzero_ps();
248
249 /**************************
250 * CALCULATE INTERACTIONS *
251 **************************/
252
253 if (gmx_mm_any_lt(rsq00,rcutoff2))
254 {
255
256 r00 = _mm_mul_ps(rsq00,rinv00);
257
258 /* Compute parameters for interactions between i and j atoms */
259 qq00 = _mm_mul_ps(iq0,jq0);
260 gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
261 vdwparam+vdwioffset0+vdwjidx0B,
262 vdwparam+vdwioffset0+vdwjidx0C,
263 vdwparam+vdwioffset0+vdwjidx0D,
264 &c6_00,&c12_00);
265
266 /* Calculate table index by multiplying r with table scale and truncate to integer */
267 rt = _mm_mul_ps(r00,vftabscale);
268 vfitab = _mm_cvttps_epi32(rt);
269 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
270 vfitab = _mm_slli_epi32(vfitab,3);
271
272 /* REACTION-FIELD ELECTROSTATICS */
273 velec = _mm_mul_ps(qq00,_mm_sub_ps(_mm_add_ps(rinv00,_mm_mul_ps(krf,rsq00)),crf));
274 felec = _mm_mul_ps(qq00,_mm_sub_ps(_mm_mul_ps(rinv00,rinvsq00),krf2));
275
276 /* CUBIC SPLINE TABLE DISPERSION */
277 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
278 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
279 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
280 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
281 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
282 Heps = _mm_mul_ps(vfeps,H);
283 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
284 VV = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
285 vvdw6 = _mm_mul_ps(c6_00,VV);
286 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
287 fvdw6 = _mm_mul_ps(c6_00,FF);
288
289 /* CUBIC SPLINE TABLE REPULSION */
290 vfitab = _mm_add_epi32(vfitab,ifour);
291 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
292 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
293 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
294 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
295 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
296 Heps = _mm_mul_ps(vfeps,H);
297 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
298 VV = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
299 vvdw12 = _mm_mul_ps(c12_00,VV);
300 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
301 fvdw12 = _mm_mul_ps(c12_00,FF);
302 vvdw = _mm_add_ps(vvdw12,vvdw6);
303 fvdw = _mm_xor_ps(signbit,_mm_mul_ps(_mm_add_ps(fvdw6,fvdw12),_mm_mul_ps(vftabscale,rinv00)));
304
305 cutoff_mask = _mm_cmplt_ps(rsq00,rcutoff2);
306
307 /* Update potential sum for this i atom from the interaction with this j atom. */
308 velec = _mm_and_ps(velec,cutoff_mask);
309 velecsum = _mm_add_ps(velecsum,velec);
310 vvdw = _mm_and_ps(vvdw,cutoff_mask);
311 vvdwsum = _mm_add_ps(vvdwsum,vvdw);
312
313 fscal = _mm_add_ps(felec,fvdw);
314
315 fscal = _mm_and_ps(fscal,cutoff_mask);
316
317 /* Calculate temporary vectorial force */
318 tx = _mm_mul_ps(fscal,dx00);
319 ty = _mm_mul_ps(fscal,dy00);
320 tz = _mm_mul_ps(fscal,dz00);
321
322 /* Update vectorial force */
323 fix0 = _mm_add_ps(fix0,tx);
324 fiy0 = _mm_add_ps(fiy0,ty);
325 fiz0 = _mm_add_ps(fiz0,tz);
326
327 fjx0 = _mm_add_ps(fjx0,tx);
328 fjy0 = _mm_add_ps(fjy0,ty);
329 fjz0 = _mm_add_ps(fjz0,tz);
330
331 }
332
333 /**************************
334 * CALCULATE INTERACTIONS *
335 **************************/
336
337 if (gmx_mm_any_lt(rsq10,rcutoff2))
338 {
339
340 /* Compute parameters for interactions between i and j atoms */
341 qq10 = _mm_mul_ps(iq1,jq0);
342
343 /* REACTION-FIELD ELECTROSTATICS */
344 velec = _mm_mul_ps(qq10,_mm_sub_ps(_mm_add_ps(rinv10,_mm_mul_ps(krf,rsq10)),crf));
345 felec = _mm_mul_ps(qq10,_mm_sub_ps(_mm_mul_ps(rinv10,rinvsq10),krf2));
346
347 cutoff_mask = _mm_cmplt_ps(rsq10,rcutoff2);
348
349 /* Update potential sum for this i atom from the interaction with this j atom. */
350 velec = _mm_and_ps(velec,cutoff_mask);
351 velecsum = _mm_add_ps(velecsum,velec);
352
353 fscal = felec;
354
355 fscal = _mm_and_ps(fscal,cutoff_mask);
356
357 /* Calculate temporary vectorial force */
358 tx = _mm_mul_ps(fscal,dx10);
359 ty = _mm_mul_ps(fscal,dy10);
360 tz = _mm_mul_ps(fscal,dz10);
361
362 /* Update vectorial force */
363 fix1 = _mm_add_ps(fix1,tx);
364 fiy1 = _mm_add_ps(fiy1,ty);
365 fiz1 = _mm_add_ps(fiz1,tz);
366
367 fjx0 = _mm_add_ps(fjx0,tx);
368 fjy0 = _mm_add_ps(fjy0,ty);
369 fjz0 = _mm_add_ps(fjz0,tz);
370
371 }
372
373 /**************************
374 * CALCULATE INTERACTIONS *
375 **************************/
376
377 if (gmx_mm_any_lt(rsq20,rcutoff2))
378 {
379
380 /* Compute parameters for interactions between i and j atoms */
381 qq20 = _mm_mul_ps(iq2,jq0);
382
383 /* REACTION-FIELD ELECTROSTATICS */
384 velec = _mm_mul_ps(qq20,_mm_sub_ps(_mm_add_ps(rinv20,_mm_mul_ps(krf,rsq20)),crf));
385 felec = _mm_mul_ps(qq20,_mm_sub_ps(_mm_mul_ps(rinv20,rinvsq20),krf2));
386
387 cutoff_mask = _mm_cmplt_ps(rsq20,rcutoff2);
388
389 /* Update potential sum for this i atom from the interaction with this j atom. */
390 velec = _mm_and_ps(velec,cutoff_mask);
391 velecsum = _mm_add_ps(velecsum,velec);
392
393 fscal = felec;
394
395 fscal = _mm_and_ps(fscal,cutoff_mask);
396
397 /* Calculate temporary vectorial force */
398 tx = _mm_mul_ps(fscal,dx20);
399 ty = _mm_mul_ps(fscal,dy20);
400 tz = _mm_mul_ps(fscal,dz20);
401
402 /* Update vectorial force */
403 fix2 = _mm_add_ps(fix2,tx);
404 fiy2 = _mm_add_ps(fiy2,ty);
405 fiz2 = _mm_add_ps(fiz2,tz);
406
407 fjx0 = _mm_add_ps(fjx0,tx);
408 fjy0 = _mm_add_ps(fjy0,ty);
409 fjz0 = _mm_add_ps(fjz0,tz);
410
411 }
412
413 fjptrA = f+j_coord_offsetA;
414 fjptrB = f+j_coord_offsetB;
415 fjptrC = f+j_coord_offsetC;
416 fjptrD = f+j_coord_offsetD;
417
418 gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjx0,fjy0,fjz0);
419
420 /* Inner loop uses 144 flops */
421 }
422
423 if(jidx<j_index_end)
424 {
425
426 /* Get j neighbor index, and coordinate index */
427 jnrlistA = jjnr[jidx];
428 jnrlistB = jjnr[jidx+1];
429 jnrlistC = jjnr[jidx+2];
430 jnrlistD = jjnr[jidx+3];
431 /* Sign of each element will be negative for non-real atoms.
432 * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
433 * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
434 */
435 dummy_mask = gmx_mm_castsi128_ps_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
436 jnrA = (jnrlistA>=0) ? jnrlistA : 0;
437 jnrB = (jnrlistB>=0) ? jnrlistB : 0;
438 jnrC = (jnrlistC>=0) ? jnrlistC : 0;
439 jnrD = (jnrlistD>=0) ? jnrlistD : 0;
440 j_coord_offsetA = DIM3*jnrA;
441 j_coord_offsetB = DIM3*jnrB;
442 j_coord_offsetC = DIM3*jnrC;
443 j_coord_offsetD = DIM3*jnrD;
444
445 /* load j atom coordinates */
446 gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
447 x+j_coord_offsetC,x+j_coord_offsetD,
448 &jx0,&jy0,&jz0);
449
450 /* Calculate displacement vector */
451 dx00 = _mm_sub_ps(ix0,jx0);
452 dy00 = _mm_sub_ps(iy0,jy0);
453 dz00 = _mm_sub_ps(iz0,jz0);
454 dx10 = _mm_sub_ps(ix1,jx0);
455 dy10 = _mm_sub_ps(iy1,jy0);
456 dz10 = _mm_sub_ps(iz1,jz0);
457 dx20 = _mm_sub_ps(ix2,jx0);
458 dy20 = _mm_sub_ps(iy2,jy0);
459 dz20 = _mm_sub_ps(iz2,jz0);
460
461 /* Calculate squared distance and things based on it */
462 rsq00 = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
463 rsq10 = gmx_mm_calc_rsq_ps(dx10,dy10,dz10);
464 rsq20 = gmx_mm_calc_rsq_ps(dx20,dy20,dz20);
465
466 rinv00 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq00);
467 rinv10 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq10);
468 rinv20 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq20);
469
470 rinvsq00 = _mm_mul_ps(rinv00,rinv00);
471 rinvsq10 = _mm_mul_ps(rinv10,rinv10);
472 rinvsq20 = _mm_mul_ps(rinv20,rinv20);
473
474 /* Load parameters for j particles */
475 jq0 = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
476 charge+jnrC+0,charge+jnrD+0);
477 vdwjidx0A = 2*vdwtype[jnrA+0];
478 vdwjidx0B = 2*vdwtype[jnrB+0];
479 vdwjidx0C = 2*vdwtype[jnrC+0];
480 vdwjidx0D = 2*vdwtype[jnrD+0];
481
482 fjx0 = _mm_setzero_ps();
483 fjy0 = _mm_setzero_ps();
484 fjz0 = _mm_setzero_ps();
485
486 /**************************
487 * CALCULATE INTERACTIONS *
488 **************************/
489
490 if (gmx_mm_any_lt(rsq00,rcutoff2))
491 {
492
493 r00 = _mm_mul_ps(rsq00,rinv00);
494 r00 = _mm_andnot_ps(dummy_mask,r00);
495
496 /* Compute parameters for interactions between i and j atoms */
497 qq00 = _mm_mul_ps(iq0,jq0);
498 gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
499 vdwparam+vdwioffset0+vdwjidx0B,
500 vdwparam+vdwioffset0+vdwjidx0C,
501 vdwparam+vdwioffset0+vdwjidx0D,
502 &c6_00,&c12_00);
503
504 /* Calculate table index by multiplying r with table scale and truncate to integer */
505 rt = _mm_mul_ps(r00,vftabscale);
506 vfitab = _mm_cvttps_epi32(rt);
507 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
508 vfitab = _mm_slli_epi32(vfitab,3);
509
510 /* REACTION-FIELD ELECTROSTATICS */
511 velec = _mm_mul_ps(qq00,_mm_sub_ps(_mm_add_ps(rinv00,_mm_mul_ps(krf,rsq00)),crf));
512 felec = _mm_mul_ps(qq00,_mm_sub_ps(_mm_mul_ps(rinv00,rinvsq00),krf2));
513
514 /* CUBIC SPLINE TABLE DISPERSION */
515 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
516 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
517 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
518 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
519 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
520 Heps = _mm_mul_ps(vfeps,H);
521 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
522 VV = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
523 vvdw6 = _mm_mul_ps(c6_00,VV);
524 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
525 fvdw6 = _mm_mul_ps(c6_00,FF);
526
527 /* CUBIC SPLINE TABLE REPULSION */
528 vfitab = _mm_add_epi32(vfitab,ifour);
529 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
530 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
531 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
532 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
533 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
534 Heps = _mm_mul_ps(vfeps,H);
535 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
536 VV = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
537 vvdw12 = _mm_mul_ps(c12_00,VV);
538 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
539 fvdw12 = _mm_mul_ps(c12_00,FF);
540 vvdw = _mm_add_ps(vvdw12,vvdw6);
541 fvdw = _mm_xor_ps(signbit,_mm_mul_ps(_mm_add_ps(fvdw6,fvdw12),_mm_mul_ps(vftabscale,rinv00)));
542
543 cutoff_mask = _mm_cmplt_ps(rsq00,rcutoff2);
544
545 /* Update potential sum for this i atom from the interaction with this j atom. */
546 velec = _mm_and_ps(velec,cutoff_mask);
547 velec = _mm_andnot_ps(dummy_mask,velec);
548 velecsum = _mm_add_ps(velecsum,velec);
549 vvdw = _mm_and_ps(vvdw,cutoff_mask);
550 vvdw = _mm_andnot_ps(dummy_mask,vvdw);
551 vvdwsum = _mm_add_ps(vvdwsum,vvdw);
552
553 fscal = _mm_add_ps(felec,fvdw);
554
555 fscal = _mm_and_ps(fscal,cutoff_mask);
556
557 fscal = _mm_andnot_ps(dummy_mask,fscal);
558
559 /* Calculate temporary vectorial force */
560 tx = _mm_mul_ps(fscal,dx00);
561 ty = _mm_mul_ps(fscal,dy00);
562 tz = _mm_mul_ps(fscal,dz00);
563
564 /* Update vectorial force */
565 fix0 = _mm_add_ps(fix0,tx);
566 fiy0 = _mm_add_ps(fiy0,ty);
567 fiz0 = _mm_add_ps(fiz0,tz);
568
569 fjx0 = _mm_add_ps(fjx0,tx);
570 fjy0 = _mm_add_ps(fjy0,ty);
571 fjz0 = _mm_add_ps(fjz0,tz);
572
573 }
574
575 /**************************
576 * CALCULATE INTERACTIONS *
577 **************************/
578
579 if (gmx_mm_any_lt(rsq10,rcutoff2))
580 {
581
582 /* Compute parameters for interactions between i and j atoms */
583 qq10 = _mm_mul_ps(iq1,jq0);
584
585 /* REACTION-FIELD ELECTROSTATICS */
586 velec = _mm_mul_ps(qq10,_mm_sub_ps(_mm_add_ps(rinv10,_mm_mul_ps(krf,rsq10)),crf));
587 felec = _mm_mul_ps(qq10,_mm_sub_ps(_mm_mul_ps(rinv10,rinvsq10),krf2));
588
589 cutoff_mask = _mm_cmplt_ps(rsq10,rcutoff2);
590
591 /* Update potential sum for this i atom from the interaction with this j atom. */
592 velec = _mm_and_ps(velec,cutoff_mask);
593 velec = _mm_andnot_ps(dummy_mask,velec);
594 velecsum = _mm_add_ps(velecsum,velec);
595
596 fscal = felec;
597
598 fscal = _mm_and_ps(fscal,cutoff_mask);
599
600 fscal = _mm_andnot_ps(dummy_mask,fscal);
601
602 /* Calculate temporary vectorial force */
603 tx = _mm_mul_ps(fscal,dx10);
604 ty = _mm_mul_ps(fscal,dy10);
605 tz = _mm_mul_ps(fscal,dz10);
606
607 /* Update vectorial force */
608 fix1 = _mm_add_ps(fix1,tx);
609 fiy1 = _mm_add_ps(fiy1,ty);
610 fiz1 = _mm_add_ps(fiz1,tz);
611
612 fjx0 = _mm_add_ps(fjx0,tx);
613 fjy0 = _mm_add_ps(fjy0,ty);
614 fjz0 = _mm_add_ps(fjz0,tz);
615
616 }
617
618 /**************************
619 * CALCULATE INTERACTIONS *
620 **************************/
621
622 if (gmx_mm_any_lt(rsq20,rcutoff2))
623 {
624
625 /* Compute parameters for interactions between i and j atoms */
626 qq20 = _mm_mul_ps(iq2,jq0);
627
628 /* REACTION-FIELD ELECTROSTATICS */
629 velec = _mm_mul_ps(qq20,_mm_sub_ps(_mm_add_ps(rinv20,_mm_mul_ps(krf,rsq20)),crf));
630 felec = _mm_mul_ps(qq20,_mm_sub_ps(_mm_mul_ps(rinv20,rinvsq20),krf2));
631
632 cutoff_mask = _mm_cmplt_ps(rsq20,rcutoff2);
633
634 /* Update potential sum for this i atom from the interaction with this j atom. */
635 velec = _mm_and_ps(velec,cutoff_mask);
636 velec = _mm_andnot_ps(dummy_mask,velec);
637 velecsum = _mm_add_ps(velecsum,velec);
638
639 fscal = felec;
640
641 fscal = _mm_and_ps(fscal,cutoff_mask);
642
643 fscal = _mm_andnot_ps(dummy_mask,fscal);
644
645 /* Calculate temporary vectorial force */
646 tx = _mm_mul_ps(fscal,dx20);
647 ty = _mm_mul_ps(fscal,dy20);
648 tz = _mm_mul_ps(fscal,dz20);
649
650 /* Update vectorial force */
651 fix2 = _mm_add_ps(fix2,tx);
652 fiy2 = _mm_add_ps(fiy2,ty);
653 fiz2 = _mm_add_ps(fiz2,tz);
654
655 fjx0 = _mm_add_ps(fjx0,tx);
656 fjy0 = _mm_add_ps(fjy0,ty);
657 fjz0 = _mm_add_ps(fjz0,tz);
658
659 }
660
661 fjptrA = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
662 fjptrB = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
663 fjptrC = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
664 fjptrD = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
665
666 gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjx0,fjy0,fjz0);
667
668 /* Inner loop uses 145 flops */
669 }
670
671 /* End of innermost loop */
672
673 gmx_mm_update_iforce_3atom_swizzle_ps(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,
674 f+i_coord_offset,fshift+i_shift_offset);
675
676 ggid = gid[iidx];
677 /* Update potential energies */
678 gmx_mm_update_1pot_ps(velecsum,kernel_data->energygrp_elec+ggid);
679 gmx_mm_update_1pot_ps(vvdwsum,kernel_data->energygrp_vdw+ggid);
680
681 /* Increment number of inner iterations */
682 inneriter += j_index_end - j_index_start;
683
684 /* Outer loop uses 20 flops */
685 }
686
687 /* Increment number of outer iterations */
688 outeriter += nri;
689
690 /* Update outer/inner flops */
691
692 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3_VF,outeriter*20 + inneriter*145)(nrnb)->n[eNR_NBKERNEL_ELEC_VDW_W3_VF] += outeriter*20 + inneriter
*145
;
693}
694/*
695 * Gromacs nonbonded kernel: nb_kernel_ElecRFCut_VdwCSTab_GeomW3P1_F_sse4_1_single
696 * Electrostatics interaction: ReactionField
697 * VdW interaction: CubicSplineTable
698 * Geometry: Water3-Particle
699 * Calculate force/pot: Force
700 */
701void
702nb_kernel_ElecRFCut_VdwCSTab_GeomW3P1_F_sse4_1_single
703 (t_nblist * gmx_restrict nlist,
704 rvec * gmx_restrict xx,
705 rvec * gmx_restrict ff,
706 t_forcerec * gmx_restrict fr,
707 t_mdatoms * gmx_restrict mdatoms,
708 nb_kernel_data_t gmx_unused__attribute__ ((unused)) * gmx_restrict kernel_data,
709 t_nrnb * gmx_restrict nrnb)
710{
711 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
712 * just 0 for non-waters.
713 * Suffixes A,B,C,D refer to j loop unrolling done with SSE, e.g. for the four different
714 * jnr indices corresponding to data put in the four positions in the SIMD register.
715 */
716 int i_shift_offset,i_coord_offset,outeriter,inneriter;
717 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
718 int jnrA,jnrB,jnrC,jnrD;
719 int jnrlistA,jnrlistB,jnrlistC,jnrlistD;
720 int j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
721 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
722 real rcutoff_scalar;
723 real *shiftvec,*fshift,*x,*f;
724 real *fjptrA,*fjptrB,*fjptrC,*fjptrD;
725 real scratch[4*DIM3];
726 __m128 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
727 int vdwioffset0;
728 __m128 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
729 int vdwioffset1;
730 __m128 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
731 int vdwioffset2;
732 __m128 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
733 int vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
734 __m128 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
735 __m128 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
736 __m128 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
737 __m128 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
738 __m128 velec,felec,velecsum,facel,crf,krf,krf2;
739 real *charge;
740 int nvdwtype;
741 __m128 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
742 int *vdwtype;
743 real *vdwparam;
744 __m128 one_sixth = _mm_set1_ps(1.0/6.0);
745 __m128 one_twelfth = _mm_set1_ps(1.0/12.0);
746 __m128i vfitab;
747 __m128i ifour = _mm_set1_epi32(4);
748 __m128 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
749 real *vftab;
750 __m128 dummy_mask,cutoff_mask;
751 __m128 signbit = _mm_castsi128_ps( _mm_set1_epi32(0x80000000) );
752 __m128 one = _mm_set1_ps(1.0);
753 __m128 two = _mm_set1_ps(2.0);
754 x = xx[0];
755 f = ff[0];
756
757 nri = nlist->nri;
758 iinr = nlist->iinr;
759 jindex = nlist->jindex;
760 jjnr = nlist->jjnr;
761 shiftidx = nlist->shift;
762 gid = nlist->gid;
763 shiftvec = fr->shift_vec[0];
764 fshift = fr->fshift[0];
765 facel = _mm_set1_ps(fr->epsfac);
766 charge = mdatoms->chargeA;
767 krf = _mm_set1_ps(fr->ic->k_rf);
768 krf2 = _mm_set1_ps(fr->ic->k_rf*2.0);
769 crf = _mm_set1_ps(fr->ic->c_rf);
770 nvdwtype = fr->ntype;
771 vdwparam = fr->nbfp;
772 vdwtype = mdatoms->typeA;
773
774 vftab = kernel_data->table_vdw->data;
775 vftabscale = _mm_set1_ps(kernel_data->table_vdw->scale);
776
777 /* Setup water-specific parameters */
778 inr = nlist->iinr[0];
779 iq0 = _mm_mul_ps(facel,_mm_set1_ps(charge[inr+0]));
780 iq1 = _mm_mul_ps(facel,_mm_set1_ps(charge[inr+1]));
781 iq2 = _mm_mul_ps(facel,_mm_set1_ps(charge[inr+2]));
782 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
783
784 /* When we use explicit cutoffs the value must be identical for elec and VdW, so use elec as an arbitrary choice */
785 rcutoff_scalar = fr->rcoulomb;
786 rcutoff = _mm_set1_ps(rcutoff_scalar);
787 rcutoff2 = _mm_mul_ps(rcutoff,rcutoff);
788
789 /* Avoid stupid compiler warnings */
790 jnrA = jnrB = jnrC = jnrD = 0;
791 j_coord_offsetA = 0;
792 j_coord_offsetB = 0;
793 j_coord_offsetC = 0;
794 j_coord_offsetD = 0;
795
796 outeriter = 0;
797 inneriter = 0;
798
799 for(iidx=0;iidx<4*DIM3;iidx++)
800 {
801 scratch[iidx] = 0.0;
802 }
803
804 /* Start outer loop over neighborlists */
805 for(iidx=0; iidx<nri; iidx++)
806 {
807 /* Load shift vector for this list */
808 i_shift_offset = DIM3*shiftidx[iidx];
809
810 /* Load limits for loop over neighbors */
811 j_index_start = jindex[iidx];
812 j_index_end = jindex[iidx+1];
813
814 /* Get outer coordinate index */
815 inr = iinr[iidx];
816 i_coord_offset = DIM3*inr;
817
818 /* Load i particle coords and add shift vector */
819 gmx_mm_load_shift_and_3rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,
820 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2);
821
822 fix0 = _mm_setzero_ps();
823 fiy0 = _mm_setzero_ps();
824 fiz0 = _mm_setzero_ps();
825 fix1 = _mm_setzero_ps();
826 fiy1 = _mm_setzero_ps();
827 fiz1 = _mm_setzero_ps();
828 fix2 = _mm_setzero_ps();
829 fiy2 = _mm_setzero_ps();
830 fiz2 = _mm_setzero_ps();
831
832 /* Start inner kernel loop */
833 for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
834 {
835
836 /* Get j neighbor index, and coordinate index */
837 jnrA = jjnr[jidx];
838 jnrB = jjnr[jidx+1];
839 jnrC = jjnr[jidx+2];
840 jnrD = jjnr[jidx+3];
841 j_coord_offsetA = DIM3*jnrA;
842 j_coord_offsetB = DIM3*jnrB;
843 j_coord_offsetC = DIM3*jnrC;
844 j_coord_offsetD = DIM3*jnrD;
845
846 /* load j atom coordinates */
847 gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
848 x+j_coord_offsetC,x+j_coord_offsetD,
849 &jx0,&jy0,&jz0);
850
851 /* Calculate displacement vector */
852 dx00 = _mm_sub_ps(ix0,jx0);
853 dy00 = _mm_sub_ps(iy0,jy0);
854 dz00 = _mm_sub_ps(iz0,jz0);
855 dx10 = _mm_sub_ps(ix1,jx0);
856 dy10 = _mm_sub_ps(iy1,jy0);
857 dz10 = _mm_sub_ps(iz1,jz0);
858 dx20 = _mm_sub_ps(ix2,jx0);
859 dy20 = _mm_sub_ps(iy2,jy0);
860 dz20 = _mm_sub_ps(iz2,jz0);
861
862 /* Calculate squared distance and things based on it */
863 rsq00 = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
864 rsq10 = gmx_mm_calc_rsq_ps(dx10,dy10,dz10);
865 rsq20 = gmx_mm_calc_rsq_ps(dx20,dy20,dz20);
866
867 rinv00 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq00);
868 rinv10 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq10);
869 rinv20 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq20);
870
871 rinvsq00 = _mm_mul_ps(rinv00,rinv00);
872 rinvsq10 = _mm_mul_ps(rinv10,rinv10);
873 rinvsq20 = _mm_mul_ps(rinv20,rinv20);
874
875 /* Load parameters for j particles */
876 jq0 = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
877 charge+jnrC+0,charge+jnrD+0);
878 vdwjidx0A = 2*vdwtype[jnrA+0];
879 vdwjidx0B = 2*vdwtype[jnrB+0];
880 vdwjidx0C = 2*vdwtype[jnrC+0];
881 vdwjidx0D = 2*vdwtype[jnrD+0];
882
883 fjx0 = _mm_setzero_ps();
884 fjy0 = _mm_setzero_ps();
885 fjz0 = _mm_setzero_ps();
886
887 /**************************
888 * CALCULATE INTERACTIONS *
889 **************************/
890
891 if (gmx_mm_any_lt(rsq00,rcutoff2))
892 {
893
894 r00 = _mm_mul_ps(rsq00,rinv00);
895
896 /* Compute parameters for interactions between i and j atoms */
897 qq00 = _mm_mul_ps(iq0,jq0);
898 gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
899 vdwparam+vdwioffset0+vdwjidx0B,
900 vdwparam+vdwioffset0+vdwjidx0C,
901 vdwparam+vdwioffset0+vdwjidx0D,
902 &c6_00,&c12_00);
903
904 /* Calculate table index by multiplying r with table scale and truncate to integer */
905 rt = _mm_mul_ps(r00,vftabscale);
906 vfitab = _mm_cvttps_epi32(rt);
907 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
908 vfitab = _mm_slli_epi32(vfitab,3);
909
910 /* REACTION-FIELD ELECTROSTATICS */
911 felec = _mm_mul_ps(qq00,_mm_sub_ps(_mm_mul_ps(rinv00,rinvsq00),krf2));
912
913 /* CUBIC SPLINE TABLE DISPERSION */
914 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
915 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
916 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
917 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
918 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
919 Heps = _mm_mul_ps(vfeps,H);
920 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
921 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
922 fvdw6 = _mm_mul_ps(c6_00,FF);
923
924 /* CUBIC SPLINE TABLE REPULSION */
925 vfitab = _mm_add_epi32(vfitab,ifour);
926 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
927 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
928 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
929 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
930 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
931 Heps = _mm_mul_ps(vfeps,H);
932 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
933 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
934 fvdw12 = _mm_mul_ps(c12_00,FF);
935 fvdw = _mm_xor_ps(signbit,_mm_mul_ps(_mm_add_ps(fvdw6,fvdw12),_mm_mul_ps(vftabscale,rinv00)));
936
937 cutoff_mask = _mm_cmplt_ps(rsq00,rcutoff2);
938
939 fscal = _mm_add_ps(felec,fvdw);
940
941 fscal = _mm_and_ps(fscal,cutoff_mask);
942
943 /* Calculate temporary vectorial force */
944 tx = _mm_mul_ps(fscal,dx00);
945 ty = _mm_mul_ps(fscal,dy00);
946 tz = _mm_mul_ps(fscal,dz00);
947
948 /* Update vectorial force */
949 fix0 = _mm_add_ps(fix0,tx);
950 fiy0 = _mm_add_ps(fiy0,ty);
951 fiz0 = _mm_add_ps(fiz0,tz);
952
953 fjx0 = _mm_add_ps(fjx0,tx);
954 fjy0 = _mm_add_ps(fjy0,ty);
955 fjz0 = _mm_add_ps(fjz0,tz);
956
957 }
958
959 /**************************
960 * CALCULATE INTERACTIONS *
961 **************************/
962
963 if (gmx_mm_any_lt(rsq10,rcutoff2))
964 {
965
966 /* Compute parameters for interactions between i and j atoms */
967 qq10 = _mm_mul_ps(iq1,jq0);
968
969 /* REACTION-FIELD ELECTROSTATICS */
970 felec = _mm_mul_ps(qq10,_mm_sub_ps(_mm_mul_ps(rinv10,rinvsq10),krf2));
971
972 cutoff_mask = _mm_cmplt_ps(rsq10,rcutoff2);
973
974 fscal = felec;
975
976 fscal = _mm_and_ps(fscal,cutoff_mask);
977
978 /* Calculate temporary vectorial force */
979 tx = _mm_mul_ps(fscal,dx10);
980 ty = _mm_mul_ps(fscal,dy10);
981 tz = _mm_mul_ps(fscal,dz10);
982
983 /* Update vectorial force */
984 fix1 = _mm_add_ps(fix1,tx);
985 fiy1 = _mm_add_ps(fiy1,ty);
986 fiz1 = _mm_add_ps(fiz1,tz);
987
988 fjx0 = _mm_add_ps(fjx0,tx);
989 fjy0 = _mm_add_ps(fjy0,ty);
990 fjz0 = _mm_add_ps(fjz0,tz);
991
992 }
993
994 /**************************
995 * CALCULATE INTERACTIONS *
996 **************************/
997
998 if (gmx_mm_any_lt(rsq20,rcutoff2))
999 {
1000
1001 /* Compute parameters for interactions between i and j atoms */
1002 qq20 = _mm_mul_ps(iq2,jq0);
1003
1004 /* REACTION-FIELD ELECTROSTATICS */
1005 felec = _mm_mul_ps(qq20,_mm_sub_ps(_mm_mul_ps(rinv20,rinvsq20),krf2));
1006
1007 cutoff_mask = _mm_cmplt_ps(rsq20,rcutoff2);
1008
1009 fscal = felec;
1010
1011 fscal = _mm_and_ps(fscal,cutoff_mask);
1012
1013 /* Calculate temporary vectorial force */
1014 tx = _mm_mul_ps(fscal,dx20);
1015 ty = _mm_mul_ps(fscal,dy20);
1016 tz = _mm_mul_ps(fscal,dz20);
1017
1018 /* Update vectorial force */
1019 fix2 = _mm_add_ps(fix2,tx);
1020 fiy2 = _mm_add_ps(fiy2,ty);
1021 fiz2 = _mm_add_ps(fiz2,tz);
1022
1023 fjx0 = _mm_add_ps(fjx0,tx);
1024 fjy0 = _mm_add_ps(fjy0,ty);
1025 fjz0 = _mm_add_ps(fjz0,tz);
1026
1027 }
1028
1029 fjptrA = f+j_coord_offsetA;
1030 fjptrB = f+j_coord_offsetB;
1031 fjptrC = f+j_coord_offsetC;
1032 fjptrD = f+j_coord_offsetD;
1033
1034 gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjx0,fjy0,fjz0);
1035
1036 /* Inner loop uses 117 flops */
1037 }
1038
1039 if(jidx<j_index_end)
1040 {
1041
1042 /* Get j neighbor index, and coordinate index */
1043 jnrlistA = jjnr[jidx];
1044 jnrlistB = jjnr[jidx+1];
1045 jnrlistC = jjnr[jidx+2];
1046 jnrlistD = jjnr[jidx+3];
1047 /* Sign of each element will be negative for non-real atoms.
1048 * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
1049 * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
1050 */
1051 dummy_mask = gmx_mm_castsi128_ps_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
1052 jnrA = (jnrlistA>=0) ? jnrlistA : 0;
1053 jnrB = (jnrlistB>=0) ? jnrlistB : 0;
1054 jnrC = (jnrlistC>=0) ? jnrlistC : 0;
1055 jnrD = (jnrlistD>=0) ? jnrlistD : 0;
1056 j_coord_offsetA = DIM3*jnrA;
1057 j_coord_offsetB = DIM3*jnrB;
1058 j_coord_offsetC = DIM3*jnrC;
1059 j_coord_offsetD = DIM3*jnrD;
1060
1061 /* load j atom coordinates */
1062 gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
1063 x+j_coord_offsetC,x+j_coord_offsetD,
1064 &jx0,&jy0,&jz0);
1065
1066 /* Calculate displacement vector */
1067 dx00 = _mm_sub_ps(ix0,jx0);
1068 dy00 = _mm_sub_ps(iy0,jy0);
1069 dz00 = _mm_sub_ps(iz0,jz0);
1070 dx10 = _mm_sub_ps(ix1,jx0);
1071 dy10 = _mm_sub_ps(iy1,jy0);
1072 dz10 = _mm_sub_ps(iz1,jz0);
1073 dx20 = _mm_sub_ps(ix2,jx0);
1074 dy20 = _mm_sub_ps(iy2,jy0);
1075 dz20 = _mm_sub_ps(iz2,jz0);
1076
1077 /* Calculate squared distance and things based on it */
1078 rsq00 = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
1079 rsq10 = gmx_mm_calc_rsq_ps(dx10,dy10,dz10);
1080 rsq20 = gmx_mm_calc_rsq_ps(dx20,dy20,dz20);
1081
1082 rinv00 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq00);
1083 rinv10 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq10);
1084 rinv20 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq20);
1085
1086 rinvsq00 = _mm_mul_ps(rinv00,rinv00);
1087 rinvsq10 = _mm_mul_ps(rinv10,rinv10);
1088 rinvsq20 = _mm_mul_ps(rinv20,rinv20);
1089
1090 /* Load parameters for j particles */
1091 jq0 = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
1092 charge+jnrC+0,charge+jnrD+0);
1093 vdwjidx0A = 2*vdwtype[jnrA+0];
1094 vdwjidx0B = 2*vdwtype[jnrB+0];
1095 vdwjidx0C = 2*vdwtype[jnrC+0];
1096 vdwjidx0D = 2*vdwtype[jnrD+0];
1097
1098 fjx0 = _mm_setzero_ps();
1099 fjy0 = _mm_setzero_ps();
1100 fjz0 = _mm_setzero_ps();
1101
1102 /**************************
1103 * CALCULATE INTERACTIONS *
1104 **************************/
1105
1106 if (gmx_mm_any_lt(rsq00,rcutoff2))
1107 {
1108
1109 r00 = _mm_mul_ps(rsq00,rinv00);
1110 r00 = _mm_andnot_ps(dummy_mask,r00);
1111
1112 /* Compute parameters for interactions between i and j atoms */
1113 qq00 = _mm_mul_ps(iq0,jq0);
1114 gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
1115 vdwparam+vdwioffset0+vdwjidx0B,
1116 vdwparam+vdwioffset0+vdwjidx0C,
1117 vdwparam+vdwioffset0+vdwjidx0D,
1118 &c6_00,&c12_00);
1119
1120 /* Calculate table index by multiplying r with table scale and truncate to integer */
1121 rt = _mm_mul_ps(r00,vftabscale);
1122 vfitab = _mm_cvttps_epi32(rt);
1123 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
1124 vfitab = _mm_slli_epi32(vfitab,3);
1125
1126 /* REACTION-FIELD ELECTROSTATICS */
1127 felec = _mm_mul_ps(qq00,_mm_sub_ps(_mm_mul_ps(rinv00,rinvsq00),krf2));
1128
1129 /* CUBIC SPLINE TABLE DISPERSION */
1130 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
1131 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
1132 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
1133 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
1134 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
1135 Heps = _mm_mul_ps(vfeps,H);
1136 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
1137 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
1138 fvdw6 = _mm_mul_ps(c6_00,FF);
1139
1140 /* CUBIC SPLINE TABLE REPULSION */
1141 vfitab = _mm_add_epi32(vfitab,ifour);
1142 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
1143 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
1144 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
1145 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
1146 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
1147 Heps = _mm_mul_ps(vfeps,H);
1148 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
1149 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
1150 fvdw12 = _mm_mul_ps(c12_00,FF);
1151 fvdw = _mm_xor_ps(signbit,_mm_mul_ps(_mm_add_ps(fvdw6,fvdw12),_mm_mul_ps(vftabscale,rinv00)));
1152
1153 cutoff_mask = _mm_cmplt_ps(rsq00,rcutoff2);
1154
1155 fscal = _mm_add_ps(felec,fvdw);
1156
1157 fscal = _mm_and_ps(fscal,cutoff_mask);
1158
1159 fscal = _mm_andnot_ps(dummy_mask,fscal);
1160
1161 /* Calculate temporary vectorial force */
1162 tx = _mm_mul_ps(fscal,dx00);
1163 ty = _mm_mul_ps(fscal,dy00);
1164 tz = _mm_mul_ps(fscal,dz00);
1165
1166 /* Update vectorial force */
1167 fix0 = _mm_add_ps(fix0,tx);
1168 fiy0 = _mm_add_ps(fiy0,ty);
1169 fiz0 = _mm_add_ps(fiz0,tz);
1170
1171 fjx0 = _mm_add_ps(fjx0,tx);
1172 fjy0 = _mm_add_ps(fjy0,ty);
1173 fjz0 = _mm_add_ps(fjz0,tz);
1174
1175 }
1176
1177 /**************************
1178 * CALCULATE INTERACTIONS *
1179 **************************/
1180
1181 if (gmx_mm_any_lt(rsq10,rcutoff2))
1182 {
1183
1184 /* Compute parameters for interactions between i and j atoms */
1185 qq10 = _mm_mul_ps(iq1,jq0);
1186
1187 /* REACTION-FIELD ELECTROSTATICS */
1188 felec = _mm_mul_ps(qq10,_mm_sub_ps(_mm_mul_ps(rinv10,rinvsq10),krf2));
1189
1190 cutoff_mask = _mm_cmplt_ps(rsq10,rcutoff2);
1191
1192 fscal = felec;
1193
1194 fscal = _mm_and_ps(fscal,cutoff_mask);
1195
1196 fscal = _mm_andnot_ps(dummy_mask,fscal);
1197
1198 /* Calculate temporary vectorial force */
1199 tx = _mm_mul_ps(fscal,dx10);
1200 ty = _mm_mul_ps(fscal,dy10);
1201 tz = _mm_mul_ps(fscal,dz10);
1202
1203 /* Update vectorial force */
1204 fix1 = _mm_add_ps(fix1,tx);
1205 fiy1 = _mm_add_ps(fiy1,ty);
1206 fiz1 = _mm_add_ps(fiz1,tz);
1207
1208 fjx0 = _mm_add_ps(fjx0,tx);
1209 fjy0 = _mm_add_ps(fjy0,ty);
1210 fjz0 = _mm_add_ps(fjz0,tz);
1211
1212 }
1213
1214 /**************************
1215 * CALCULATE INTERACTIONS *
1216 **************************/
1217
1218 if (gmx_mm_any_lt(rsq20,rcutoff2))
1219 {
1220
1221 /* Compute parameters for interactions between i and j atoms */
1222 qq20 = _mm_mul_ps(iq2,jq0);
1223
1224 /* REACTION-FIELD ELECTROSTATICS */
1225 felec = _mm_mul_ps(qq20,_mm_sub_ps(_mm_mul_ps(rinv20,rinvsq20),krf2));
1226
1227 cutoff_mask = _mm_cmplt_ps(rsq20,rcutoff2);
1228
1229 fscal = felec;
1230
1231 fscal = _mm_and_ps(fscal,cutoff_mask);
1232
1233 fscal = _mm_andnot_ps(dummy_mask,fscal);
1234
1235 /* Calculate temporary vectorial force */
1236 tx = _mm_mul_ps(fscal,dx20);
1237 ty = _mm_mul_ps(fscal,dy20);
1238 tz = _mm_mul_ps(fscal,dz20);
1239
1240 /* Update vectorial force */
1241 fix2 = _mm_add_ps(fix2,tx);
1242 fiy2 = _mm_add_ps(fiy2,ty);
1243 fiz2 = _mm_add_ps(fiz2,tz);
1244
1245 fjx0 = _mm_add_ps(fjx0,tx);
1246 fjy0 = _mm_add_ps(fjy0,ty);
1247 fjz0 = _mm_add_ps(fjz0,tz);
1248
1249 }
1250
1251 fjptrA = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
1252 fjptrB = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
1253 fjptrC = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
1254 fjptrD = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
1255
1256 gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjx0,fjy0,fjz0);
1257
1258 /* Inner loop uses 118 flops */
1259 }
1260
1261 /* End of innermost loop */
1262
1263 gmx_mm_update_iforce_3atom_swizzle_ps(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,
1264 f+i_coord_offset,fshift+i_shift_offset);
1265
1266 /* Increment number of inner iterations */
1267 inneriter += j_index_end - j_index_start;
1268
1269 /* Outer loop uses 18 flops */
1270 }
1271
1272 /* Increment number of outer iterations */
1273 outeriter += nri;
1274
1275 /* Update outer/inner flops */
1276
1277 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3_F,outeriter*18 + inneriter*118)(nrnb)->n[eNR_NBKERNEL_ELEC_VDW_W3_F] += outeriter*18 + inneriter
*118
;
1278}