2 * This file is part of the GROMACS molecular simulation package.
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.
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.
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.
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.
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.
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.
36 * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
44 #include "../nb_kernel.h"
45 #include "gromacs/legacyheaders/types/simple.h"
46 #include "gromacs/math/vec.h"
47 #include "gromacs/legacyheaders/nrnb.h"
49 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
50 #include "kernelutil_x86_avx_128_fma_single.h"
53 * Gromacs nonbonded kernel: nb_kernel_ElecEw_VdwNone_GeomP1P1_VF_avx_128_fma_single
54 * Electrostatics interaction: Ewald
55 * VdW interaction: None
56 * Geometry: Particle-Particle
57 * Calculate force/pot: PotentialAndForce
60 nb_kernel_ElecEw_VdwNone_GeomP1P1_VF_avx_128_fma_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 * gmx_restrict kernel_data,
67 t_nrnb * gmx_restrict nrnb)
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 AVX_128, e.g. for the four different
72 * jnr indices corresponding to data put in the four positions in the SIMD register.
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;
81 real *shiftvec,*fshift,*x,*f;
82 real *fjptrA,*fjptrB,*fjptrC,*fjptrD;
84 __m128 fscal,rcutoff,rcutoff2,jidxall;
86 __m128 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
87 int vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
88 __m128 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
89 __m128 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
90 __m128 velec,felec,velecsum,facel,crf,krf,krf2;
93 __m128 ewtabscale,eweps,twoeweps,sh_ewald,ewrt,ewtabhalfspace,ewtabF,ewtabFn,ewtabD,ewtabV;
94 __m128 beta,beta2,beta3,zeta2,pmecorrF,pmecorrV,rinv3;
96 __m128 dummy_mask,cutoff_mask;
97 __m128 signbit = _mm_castsi128_ps( _mm_set1_epi32(0x80000000) );
98 __m128 one = _mm_set1_ps(1.0);
99 __m128 two = _mm_set1_ps(2.0);
105 jindex = nlist->jindex;
107 shiftidx = nlist->shift;
109 shiftvec = fr->shift_vec[0];
110 fshift = fr->fshift[0];
111 facel = _mm_set1_ps(fr->epsfac);
112 charge = mdatoms->chargeA;
114 sh_ewald = _mm_set1_ps(fr->ic->sh_ewald);
115 beta = _mm_set1_ps(fr->ic->ewaldcoeff_q);
116 beta2 = _mm_mul_ps(beta,beta);
117 beta3 = _mm_mul_ps(beta,beta2);
118 ewtab = fr->ic->tabq_coul_FDV0;
119 ewtabscale = _mm_set1_ps(fr->ic->tabq_scale);
120 ewtabhalfspace = _mm_set1_ps(0.5/fr->ic->tabq_scale);
122 /* Avoid stupid compiler warnings */
123 jnrA = jnrB = jnrC = jnrD = 0;
132 for(iidx=0;iidx<4*DIM;iidx++)
137 /* Start outer loop over neighborlists */
138 for(iidx=0; iidx<nri; iidx++)
140 /* Load shift vector for this list */
141 i_shift_offset = DIM*shiftidx[iidx];
143 /* Load limits for loop over neighbors */
144 j_index_start = jindex[iidx];
145 j_index_end = jindex[iidx+1];
147 /* Get outer coordinate index */
149 i_coord_offset = DIM*inr;
151 /* Load i particle coords and add shift vector */
152 gmx_mm_load_shift_and_1rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
154 fix0 = _mm_setzero_ps();
155 fiy0 = _mm_setzero_ps();
156 fiz0 = _mm_setzero_ps();
158 /* Load parameters for i particles */
159 iq0 = _mm_mul_ps(facel,_mm_load1_ps(charge+inr+0));
161 /* Reset potential sums */
162 velecsum = _mm_setzero_ps();
164 /* Start inner kernel loop */
165 for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
168 /* Get j neighbor index, and coordinate index */
173 j_coord_offsetA = DIM*jnrA;
174 j_coord_offsetB = DIM*jnrB;
175 j_coord_offsetC = DIM*jnrC;
176 j_coord_offsetD = DIM*jnrD;
178 /* load j atom coordinates */
179 gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
180 x+j_coord_offsetC,x+j_coord_offsetD,
183 /* Calculate displacement vector */
184 dx00 = _mm_sub_ps(ix0,jx0);
185 dy00 = _mm_sub_ps(iy0,jy0);
186 dz00 = _mm_sub_ps(iz0,jz0);
188 /* Calculate squared distance and things based on it */
189 rsq00 = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
191 rinv00 = gmx_mm_invsqrt_ps(rsq00);
193 rinvsq00 = _mm_mul_ps(rinv00,rinv00);
195 /* Load parameters for j particles */
196 jq0 = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
197 charge+jnrC+0,charge+jnrD+0);
199 /**************************
200 * CALCULATE INTERACTIONS *
201 **************************/
203 r00 = _mm_mul_ps(rsq00,rinv00);
205 /* Compute parameters for interactions between i and j atoms */
206 qq00 = _mm_mul_ps(iq0,jq0);
208 /* EWALD ELECTROSTATICS */
210 /* Analytical PME correction */
211 zeta2 = _mm_mul_ps(beta2,rsq00);
212 rinv3 = _mm_mul_ps(rinvsq00,rinv00);
213 pmecorrF = gmx_mm_pmecorrF_ps(zeta2);
214 felec = _mm_macc_ps(pmecorrF,beta3,rinv3);
215 felec = _mm_mul_ps(qq00,felec);
216 pmecorrV = gmx_mm_pmecorrV_ps(zeta2);
217 velec = _mm_nmacc_ps(pmecorrV,beta,rinv00);
218 velec = _mm_mul_ps(qq00,velec);
220 /* Update potential sum for this i atom from the interaction with this j atom. */
221 velecsum = _mm_add_ps(velecsum,velec);
225 /* Update vectorial force */
226 fix0 = _mm_macc_ps(dx00,fscal,fix0);
227 fiy0 = _mm_macc_ps(dy00,fscal,fiy0);
228 fiz0 = _mm_macc_ps(dz00,fscal,fiz0);
230 fjptrA = f+j_coord_offsetA;
231 fjptrB = f+j_coord_offsetB;
232 fjptrC = f+j_coord_offsetC;
233 fjptrD = f+j_coord_offsetD;
234 gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,
235 _mm_mul_ps(dx00,fscal),
236 _mm_mul_ps(dy00,fscal),
237 _mm_mul_ps(dz00,fscal));
239 /* Inner loop uses 29 flops */
245 /* Get j neighbor index, and coordinate index */
246 jnrlistA = jjnr[jidx];
247 jnrlistB = jjnr[jidx+1];
248 jnrlistC = jjnr[jidx+2];
249 jnrlistD = jjnr[jidx+3];
250 /* Sign of each element will be negative for non-real atoms.
251 * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
252 * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
254 dummy_mask = gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
255 jnrA = (jnrlistA>=0) ? jnrlistA : 0;
256 jnrB = (jnrlistB>=0) ? jnrlistB : 0;
257 jnrC = (jnrlistC>=0) ? jnrlistC : 0;
258 jnrD = (jnrlistD>=0) ? jnrlistD : 0;
259 j_coord_offsetA = DIM*jnrA;
260 j_coord_offsetB = DIM*jnrB;
261 j_coord_offsetC = DIM*jnrC;
262 j_coord_offsetD = DIM*jnrD;
264 /* load j atom coordinates */
265 gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
266 x+j_coord_offsetC,x+j_coord_offsetD,
269 /* Calculate displacement vector */
270 dx00 = _mm_sub_ps(ix0,jx0);
271 dy00 = _mm_sub_ps(iy0,jy0);
272 dz00 = _mm_sub_ps(iz0,jz0);
274 /* Calculate squared distance and things based on it */
275 rsq00 = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
277 rinv00 = gmx_mm_invsqrt_ps(rsq00);
279 rinvsq00 = _mm_mul_ps(rinv00,rinv00);
281 /* Load parameters for j particles */
282 jq0 = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
283 charge+jnrC+0,charge+jnrD+0);
285 /**************************
286 * CALCULATE INTERACTIONS *
287 **************************/
289 r00 = _mm_mul_ps(rsq00,rinv00);
290 r00 = _mm_andnot_ps(dummy_mask,r00);
292 /* Compute parameters for interactions between i and j atoms */
293 qq00 = _mm_mul_ps(iq0,jq0);
295 /* EWALD ELECTROSTATICS */
297 /* Analytical PME correction */
298 zeta2 = _mm_mul_ps(beta2,rsq00);
299 rinv3 = _mm_mul_ps(rinvsq00,rinv00);
300 pmecorrF = gmx_mm_pmecorrF_ps(zeta2);
301 felec = _mm_macc_ps(pmecorrF,beta3,rinv3);
302 felec = _mm_mul_ps(qq00,felec);
303 pmecorrV = gmx_mm_pmecorrV_ps(zeta2);
304 velec = _mm_nmacc_ps(pmecorrV,beta,rinv00);
305 velec = _mm_mul_ps(qq00,velec);
307 /* Update potential sum for this i atom from the interaction with this j atom. */
308 velec = _mm_andnot_ps(dummy_mask,velec);
309 velecsum = _mm_add_ps(velecsum,velec);
313 fscal = _mm_andnot_ps(dummy_mask,fscal);
315 /* Update vectorial force */
316 fix0 = _mm_macc_ps(dx00,fscal,fix0);
317 fiy0 = _mm_macc_ps(dy00,fscal,fiy0);
318 fiz0 = _mm_macc_ps(dz00,fscal,fiz0);
320 fjptrA = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
321 fjptrB = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
322 fjptrC = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
323 fjptrD = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
324 gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,
325 _mm_mul_ps(dx00,fscal),
326 _mm_mul_ps(dy00,fscal),
327 _mm_mul_ps(dz00,fscal));
329 /* Inner loop uses 30 flops */
332 /* End of innermost loop */
334 gmx_mm_update_iforce_1atom_swizzle_ps(fix0,fiy0,fiz0,
335 f+i_coord_offset,fshift+i_shift_offset);
338 /* Update potential energies */
339 gmx_mm_update_1pot_ps(velecsum,kernel_data->energygrp_elec+ggid);
341 /* Increment number of inner iterations */
342 inneriter += j_index_end - j_index_start;
344 /* Outer loop uses 8 flops */
347 /* Increment number of outer iterations */
350 /* Update outer/inner flops */
352 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VF,outeriter*8 + inneriter*30);
355 * Gromacs nonbonded kernel: nb_kernel_ElecEw_VdwNone_GeomP1P1_F_avx_128_fma_single
356 * Electrostatics interaction: Ewald
357 * VdW interaction: None
358 * Geometry: Particle-Particle
359 * Calculate force/pot: Force
362 nb_kernel_ElecEw_VdwNone_GeomP1P1_F_avx_128_fma_single
363 (t_nblist * gmx_restrict nlist,
364 rvec * gmx_restrict xx,
365 rvec * gmx_restrict ff,
366 t_forcerec * gmx_restrict fr,
367 t_mdatoms * gmx_restrict mdatoms,
368 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
369 t_nrnb * gmx_restrict nrnb)
371 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
372 * just 0 for non-waters.
373 * Suffixes A,B,C,D refer to j loop unrolling done with AVX_128, e.g. for the four different
374 * jnr indices corresponding to data put in the four positions in the SIMD register.
376 int i_shift_offset,i_coord_offset,outeriter,inneriter;
377 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
378 int jnrA,jnrB,jnrC,jnrD;
379 int jnrlistA,jnrlistB,jnrlistC,jnrlistD;
380 int j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
381 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
383 real *shiftvec,*fshift,*x,*f;
384 real *fjptrA,*fjptrB,*fjptrC,*fjptrD;
386 __m128 fscal,rcutoff,rcutoff2,jidxall;
388 __m128 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
389 int vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
390 __m128 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
391 __m128 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
392 __m128 velec,felec,velecsum,facel,crf,krf,krf2;
395 __m128 ewtabscale,eweps,twoeweps,sh_ewald,ewrt,ewtabhalfspace,ewtabF,ewtabFn,ewtabD,ewtabV;
396 __m128 beta,beta2,beta3,zeta2,pmecorrF,pmecorrV,rinv3;
398 __m128 dummy_mask,cutoff_mask;
399 __m128 signbit = _mm_castsi128_ps( _mm_set1_epi32(0x80000000) );
400 __m128 one = _mm_set1_ps(1.0);
401 __m128 two = _mm_set1_ps(2.0);
407 jindex = nlist->jindex;
409 shiftidx = nlist->shift;
411 shiftvec = fr->shift_vec[0];
412 fshift = fr->fshift[0];
413 facel = _mm_set1_ps(fr->epsfac);
414 charge = mdatoms->chargeA;
416 sh_ewald = _mm_set1_ps(fr->ic->sh_ewald);
417 beta = _mm_set1_ps(fr->ic->ewaldcoeff_q);
418 beta2 = _mm_mul_ps(beta,beta);
419 beta3 = _mm_mul_ps(beta,beta2);
420 ewtab = fr->ic->tabq_coul_F;
421 ewtabscale = _mm_set1_ps(fr->ic->tabq_scale);
422 ewtabhalfspace = _mm_set1_ps(0.5/fr->ic->tabq_scale);
424 /* Avoid stupid compiler warnings */
425 jnrA = jnrB = jnrC = jnrD = 0;
434 for(iidx=0;iidx<4*DIM;iidx++)
439 /* Start outer loop over neighborlists */
440 for(iidx=0; iidx<nri; iidx++)
442 /* Load shift vector for this list */
443 i_shift_offset = DIM*shiftidx[iidx];
445 /* Load limits for loop over neighbors */
446 j_index_start = jindex[iidx];
447 j_index_end = jindex[iidx+1];
449 /* Get outer coordinate index */
451 i_coord_offset = DIM*inr;
453 /* Load i particle coords and add shift vector */
454 gmx_mm_load_shift_and_1rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
456 fix0 = _mm_setzero_ps();
457 fiy0 = _mm_setzero_ps();
458 fiz0 = _mm_setzero_ps();
460 /* Load parameters for i particles */
461 iq0 = _mm_mul_ps(facel,_mm_load1_ps(charge+inr+0));
463 /* Start inner kernel loop */
464 for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
467 /* Get j neighbor index, and coordinate index */
472 j_coord_offsetA = DIM*jnrA;
473 j_coord_offsetB = DIM*jnrB;
474 j_coord_offsetC = DIM*jnrC;
475 j_coord_offsetD = DIM*jnrD;
477 /* load j atom coordinates */
478 gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
479 x+j_coord_offsetC,x+j_coord_offsetD,
482 /* Calculate displacement vector */
483 dx00 = _mm_sub_ps(ix0,jx0);
484 dy00 = _mm_sub_ps(iy0,jy0);
485 dz00 = _mm_sub_ps(iz0,jz0);
487 /* Calculate squared distance and things based on it */
488 rsq00 = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
490 rinv00 = gmx_mm_invsqrt_ps(rsq00);
492 rinvsq00 = _mm_mul_ps(rinv00,rinv00);
494 /* Load parameters for j particles */
495 jq0 = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
496 charge+jnrC+0,charge+jnrD+0);
498 /**************************
499 * CALCULATE INTERACTIONS *
500 **************************/
502 r00 = _mm_mul_ps(rsq00,rinv00);
504 /* Compute parameters for interactions between i and j atoms */
505 qq00 = _mm_mul_ps(iq0,jq0);
507 /* EWALD ELECTROSTATICS */
509 /* Analytical PME correction */
510 zeta2 = _mm_mul_ps(beta2,rsq00);
511 rinv3 = _mm_mul_ps(rinvsq00,rinv00);
512 pmecorrF = gmx_mm_pmecorrF_ps(zeta2);
513 felec = _mm_macc_ps(pmecorrF,beta3,rinv3);
514 felec = _mm_mul_ps(qq00,felec);
518 /* Update vectorial force */
519 fix0 = _mm_macc_ps(dx00,fscal,fix0);
520 fiy0 = _mm_macc_ps(dy00,fscal,fiy0);
521 fiz0 = _mm_macc_ps(dz00,fscal,fiz0);
523 fjptrA = f+j_coord_offsetA;
524 fjptrB = f+j_coord_offsetB;
525 fjptrC = f+j_coord_offsetC;
526 fjptrD = f+j_coord_offsetD;
527 gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,
528 _mm_mul_ps(dx00,fscal),
529 _mm_mul_ps(dy00,fscal),
530 _mm_mul_ps(dz00,fscal));
532 /* Inner loop uses 28 flops */
538 /* Get j neighbor index, and coordinate index */
539 jnrlistA = jjnr[jidx];
540 jnrlistB = jjnr[jidx+1];
541 jnrlistC = jjnr[jidx+2];
542 jnrlistD = jjnr[jidx+3];
543 /* Sign of each element will be negative for non-real atoms.
544 * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
545 * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
547 dummy_mask = gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
548 jnrA = (jnrlistA>=0) ? jnrlistA : 0;
549 jnrB = (jnrlistB>=0) ? jnrlistB : 0;
550 jnrC = (jnrlistC>=0) ? jnrlistC : 0;
551 jnrD = (jnrlistD>=0) ? jnrlistD : 0;
552 j_coord_offsetA = DIM*jnrA;
553 j_coord_offsetB = DIM*jnrB;
554 j_coord_offsetC = DIM*jnrC;
555 j_coord_offsetD = DIM*jnrD;
557 /* load j atom coordinates */
558 gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
559 x+j_coord_offsetC,x+j_coord_offsetD,
562 /* Calculate displacement vector */
563 dx00 = _mm_sub_ps(ix0,jx0);
564 dy00 = _mm_sub_ps(iy0,jy0);
565 dz00 = _mm_sub_ps(iz0,jz0);
567 /* Calculate squared distance and things based on it */
568 rsq00 = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
570 rinv00 = gmx_mm_invsqrt_ps(rsq00);
572 rinvsq00 = _mm_mul_ps(rinv00,rinv00);
574 /* Load parameters for j particles */
575 jq0 = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
576 charge+jnrC+0,charge+jnrD+0);
578 /**************************
579 * CALCULATE INTERACTIONS *
580 **************************/
582 r00 = _mm_mul_ps(rsq00,rinv00);
583 r00 = _mm_andnot_ps(dummy_mask,r00);
585 /* Compute parameters for interactions between i and j atoms */
586 qq00 = _mm_mul_ps(iq0,jq0);
588 /* EWALD ELECTROSTATICS */
590 /* Analytical PME correction */
591 zeta2 = _mm_mul_ps(beta2,rsq00);
592 rinv3 = _mm_mul_ps(rinvsq00,rinv00);
593 pmecorrF = gmx_mm_pmecorrF_ps(zeta2);
594 felec = _mm_macc_ps(pmecorrF,beta3,rinv3);
595 felec = _mm_mul_ps(qq00,felec);
599 fscal = _mm_andnot_ps(dummy_mask,fscal);
601 /* Update vectorial force */
602 fix0 = _mm_macc_ps(dx00,fscal,fix0);
603 fiy0 = _mm_macc_ps(dy00,fscal,fiy0);
604 fiz0 = _mm_macc_ps(dz00,fscal,fiz0);
606 fjptrA = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
607 fjptrB = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
608 fjptrC = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
609 fjptrD = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
610 gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,
611 _mm_mul_ps(dx00,fscal),
612 _mm_mul_ps(dy00,fscal),
613 _mm_mul_ps(dz00,fscal));
615 /* Inner loop uses 29 flops */
618 /* End of innermost loop */
620 gmx_mm_update_iforce_1atom_swizzle_ps(fix0,fiy0,fiz0,
621 f+i_coord_offset,fshift+i_shift_offset);
623 /* Increment number of inner iterations */
624 inneriter += j_index_end - j_index_start;
626 /* Outer loop uses 7 flops */
629 /* Increment number of outer iterations */
632 /* Update outer/inner flops */
634 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_F,outeriter*7 + inneriter*29);