File: | gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecCoul_VdwLJ_GeomW3W3_sse4_1_single.c |
Location: | line 1077, column 5 |
Description: | Value stored to 'j_coord_offsetB' is never read |
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_ElecCoul_VdwLJ_GeomW3W3_VF_sse4_1_single |
54 | * Electrostatics interaction: Coulomb |
55 | * VdW interaction: LennardJones |
56 | * Geometry: Water3-Water3 |
57 | * Calculate force/pot: PotentialAndForce |
58 | */ |
59 | void |
60 | nb_kernel_ElecCoul_VdwLJ_GeomW3W3_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 | int vdwjidx1A,vdwjidx1B,vdwjidx1C,vdwjidx1D; |
94 | __m128 jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1; |
95 | int vdwjidx2A,vdwjidx2B,vdwjidx2C,vdwjidx2D; |
96 | __m128 jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2; |
97 | __m128 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00; |
98 | __m128 dx01,dy01,dz01,rsq01,rinv01,rinvsq01,r01,qq01,c6_01,c12_01; |
99 | __m128 dx02,dy02,dz02,rsq02,rinv02,rinvsq02,r02,qq02,c6_02,c12_02; |
100 | __m128 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10; |
101 | __m128 dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11; |
102 | __m128 dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12; |
103 | __m128 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20; |
104 | __m128 dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21; |
105 | __m128 dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22; |
106 | __m128 velec,felec,velecsum,facel,crf,krf,krf2; |
107 | real *charge; |
108 | int nvdwtype; |
109 | __m128 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6; |
110 | int *vdwtype; |
111 | real *vdwparam; |
112 | __m128 one_sixth = _mm_set1_ps(1.0/6.0); |
113 | __m128 one_twelfth = _mm_set1_ps(1.0/12.0); |
114 | __m128 dummy_mask,cutoff_mask; |
115 | __m128 signbit = _mm_castsi128_ps( _mm_set1_epi32(0x80000000) ); |
116 | __m128 one = _mm_set1_ps(1.0); |
117 | __m128 two = _mm_set1_ps(2.0); |
118 | x = xx[0]; |
119 | f = ff[0]; |
120 | |
121 | nri = nlist->nri; |
122 | iinr = nlist->iinr; |
123 | jindex = nlist->jindex; |
124 | jjnr = nlist->jjnr; |
125 | shiftidx = nlist->shift; |
126 | gid = nlist->gid; |
127 | shiftvec = fr->shift_vec[0]; |
128 | fshift = fr->fshift[0]; |
129 | facel = _mm_set1_ps(fr->epsfac); |
130 | charge = mdatoms->chargeA; |
131 | nvdwtype = fr->ntype; |
132 | vdwparam = fr->nbfp; |
133 | vdwtype = mdatoms->typeA; |
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 | jq0 = _mm_set1_ps(charge[inr+0]); |
143 | jq1 = _mm_set1_ps(charge[inr+1]); |
144 | jq2 = _mm_set1_ps(charge[inr+2]); |
145 | vdwjidx0A = 2*vdwtype[inr+0]; |
146 | qq00 = _mm_mul_ps(iq0,jq0); |
147 | c6_00 = _mm_set1_ps(vdwparam[vdwioffset0+vdwjidx0A]); |
148 | c12_00 = _mm_set1_ps(vdwparam[vdwioffset0+vdwjidx0A+1]); |
149 | qq01 = _mm_mul_ps(iq0,jq1); |
150 | qq02 = _mm_mul_ps(iq0,jq2); |
151 | qq10 = _mm_mul_ps(iq1,jq0); |
152 | qq11 = _mm_mul_ps(iq1,jq1); |
153 | qq12 = _mm_mul_ps(iq1,jq2); |
154 | qq20 = _mm_mul_ps(iq2,jq0); |
155 | qq21 = _mm_mul_ps(iq2,jq1); |
156 | qq22 = _mm_mul_ps(iq2,jq2); |
157 | |
158 | /* Avoid stupid compiler warnings */ |
159 | jnrA = jnrB = jnrC = jnrD = 0; |
160 | j_coord_offsetA = 0; |
161 | j_coord_offsetB = 0; |
162 | j_coord_offsetC = 0; |
163 | j_coord_offsetD = 0; |
164 | |
165 | outeriter = 0; |
166 | inneriter = 0; |
167 | |
168 | for(iidx=0;iidx<4*DIM3;iidx++) |
169 | { |
170 | scratch[iidx] = 0.0; |
171 | } |
172 | |
173 | /* Start outer loop over neighborlists */ |
174 | for(iidx=0; iidx<nri; iidx++) |
175 | { |
176 | /* Load shift vector for this list */ |
177 | i_shift_offset = DIM3*shiftidx[iidx]; |
178 | |
179 | /* Load limits for loop over neighbors */ |
180 | j_index_start = jindex[iidx]; |
181 | j_index_end = jindex[iidx+1]; |
182 | |
183 | /* Get outer coordinate index */ |
184 | inr = iinr[iidx]; |
185 | i_coord_offset = DIM3*inr; |
186 | |
187 | /* Load i particle coords and add shift vector */ |
188 | gmx_mm_load_shift_and_3rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset, |
189 | &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2); |
190 | |
191 | fix0 = _mm_setzero_ps(); |
192 | fiy0 = _mm_setzero_ps(); |
193 | fiz0 = _mm_setzero_ps(); |
194 | fix1 = _mm_setzero_ps(); |
195 | fiy1 = _mm_setzero_ps(); |
196 | fiz1 = _mm_setzero_ps(); |
197 | fix2 = _mm_setzero_ps(); |
198 | fiy2 = _mm_setzero_ps(); |
199 | fiz2 = _mm_setzero_ps(); |
200 | |
201 | /* Reset potential sums */ |
202 | velecsum = _mm_setzero_ps(); |
203 | vvdwsum = _mm_setzero_ps(); |
204 | |
205 | /* Start inner kernel loop */ |
206 | for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4) |
207 | { |
208 | |
209 | /* Get j neighbor index, and coordinate index */ |
210 | jnrA = jjnr[jidx]; |
211 | jnrB = jjnr[jidx+1]; |
212 | jnrC = jjnr[jidx+2]; |
213 | jnrD = jjnr[jidx+3]; |
214 | j_coord_offsetA = DIM3*jnrA; |
215 | j_coord_offsetB = DIM3*jnrB; |
216 | j_coord_offsetC = DIM3*jnrC; |
217 | j_coord_offsetD = DIM3*jnrD; |
218 | |
219 | /* load j atom coordinates */ |
220 | gmx_mm_load_3rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB, |
221 | x+j_coord_offsetC,x+j_coord_offsetD, |
222 | &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,&jy2,&jz2); |
223 | |
224 | /* Calculate displacement vector */ |
225 | dx00 = _mm_sub_ps(ix0,jx0); |
226 | dy00 = _mm_sub_ps(iy0,jy0); |
227 | dz00 = _mm_sub_ps(iz0,jz0); |
228 | dx01 = _mm_sub_ps(ix0,jx1); |
229 | dy01 = _mm_sub_ps(iy0,jy1); |
230 | dz01 = _mm_sub_ps(iz0,jz1); |
231 | dx02 = _mm_sub_ps(ix0,jx2); |
232 | dy02 = _mm_sub_ps(iy0,jy2); |
233 | dz02 = _mm_sub_ps(iz0,jz2); |
234 | dx10 = _mm_sub_ps(ix1,jx0); |
235 | dy10 = _mm_sub_ps(iy1,jy0); |
236 | dz10 = _mm_sub_ps(iz1,jz0); |
237 | dx11 = _mm_sub_ps(ix1,jx1); |
238 | dy11 = _mm_sub_ps(iy1,jy1); |
239 | dz11 = _mm_sub_ps(iz1,jz1); |
240 | dx12 = _mm_sub_ps(ix1,jx2); |
241 | dy12 = _mm_sub_ps(iy1,jy2); |
242 | dz12 = _mm_sub_ps(iz1,jz2); |
243 | dx20 = _mm_sub_ps(ix2,jx0); |
244 | dy20 = _mm_sub_ps(iy2,jy0); |
245 | dz20 = _mm_sub_ps(iz2,jz0); |
246 | dx21 = _mm_sub_ps(ix2,jx1); |
247 | dy21 = _mm_sub_ps(iy2,jy1); |
248 | dz21 = _mm_sub_ps(iz2,jz1); |
249 | dx22 = _mm_sub_ps(ix2,jx2); |
250 | dy22 = _mm_sub_ps(iy2,jy2); |
251 | dz22 = _mm_sub_ps(iz2,jz2); |
252 | |
253 | /* Calculate squared distance and things based on it */ |
254 | rsq00 = gmx_mm_calc_rsq_ps(dx00,dy00,dz00); |
255 | rsq01 = gmx_mm_calc_rsq_ps(dx01,dy01,dz01); |
256 | rsq02 = gmx_mm_calc_rsq_ps(dx02,dy02,dz02); |
257 | rsq10 = gmx_mm_calc_rsq_ps(dx10,dy10,dz10); |
258 | rsq11 = gmx_mm_calc_rsq_ps(dx11,dy11,dz11); |
259 | rsq12 = gmx_mm_calc_rsq_ps(dx12,dy12,dz12); |
260 | rsq20 = gmx_mm_calc_rsq_ps(dx20,dy20,dz20); |
261 | rsq21 = gmx_mm_calc_rsq_ps(dx21,dy21,dz21); |
262 | rsq22 = gmx_mm_calc_rsq_ps(dx22,dy22,dz22); |
263 | |
264 | rinv00 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq00); |
265 | rinv01 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq01); |
266 | rinv02 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq02); |
267 | rinv10 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq10); |
268 | rinv11 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq11); |
269 | rinv12 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq12); |
270 | rinv20 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq20); |
271 | rinv21 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq21); |
272 | rinv22 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq22); |
273 | |
274 | rinvsq00 = _mm_mul_ps(rinv00,rinv00); |
275 | rinvsq01 = _mm_mul_ps(rinv01,rinv01); |
276 | rinvsq02 = _mm_mul_ps(rinv02,rinv02); |
277 | rinvsq10 = _mm_mul_ps(rinv10,rinv10); |
278 | rinvsq11 = _mm_mul_ps(rinv11,rinv11); |
279 | rinvsq12 = _mm_mul_ps(rinv12,rinv12); |
280 | rinvsq20 = _mm_mul_ps(rinv20,rinv20); |
281 | rinvsq21 = _mm_mul_ps(rinv21,rinv21); |
282 | rinvsq22 = _mm_mul_ps(rinv22,rinv22); |
283 | |
284 | fjx0 = _mm_setzero_ps(); |
285 | fjy0 = _mm_setzero_ps(); |
286 | fjz0 = _mm_setzero_ps(); |
287 | fjx1 = _mm_setzero_ps(); |
288 | fjy1 = _mm_setzero_ps(); |
289 | fjz1 = _mm_setzero_ps(); |
290 | fjx2 = _mm_setzero_ps(); |
291 | fjy2 = _mm_setzero_ps(); |
292 | fjz2 = _mm_setzero_ps(); |
293 | |
294 | /************************** |
295 | * CALCULATE INTERACTIONS * |
296 | **************************/ |
297 | |
298 | /* COULOMB ELECTROSTATICS */ |
299 | velec = _mm_mul_ps(qq00,rinv00); |
300 | felec = _mm_mul_ps(velec,rinvsq00); |
301 | |
302 | /* LENNARD-JONES DISPERSION/REPULSION */ |
303 | |
304 | rinvsix = _mm_mul_ps(_mm_mul_ps(rinvsq00,rinvsq00),rinvsq00); |
305 | vvdw6 = _mm_mul_ps(c6_00,rinvsix); |
306 | vvdw12 = _mm_mul_ps(c12_00,_mm_mul_ps(rinvsix,rinvsix)); |
307 | vvdw = _mm_sub_ps( _mm_mul_ps(vvdw12,one_twelfth) , _mm_mul_ps(vvdw6,one_sixth) ); |
308 | fvdw = _mm_mul_ps(_mm_sub_ps(vvdw12,vvdw6),rinvsq00); |
309 | |
310 | /* Update potential sum for this i atom from the interaction with this j atom. */ |
311 | velecsum = _mm_add_ps(velecsum,velec); |
312 | vvdwsum = _mm_add_ps(vvdwsum,vvdw); |
313 | |
314 | fscal = _mm_add_ps(felec,fvdw); |
315 | |
316 | /* Calculate temporary vectorial force */ |
317 | tx = _mm_mul_ps(fscal,dx00); |
318 | ty = _mm_mul_ps(fscal,dy00); |
319 | tz = _mm_mul_ps(fscal,dz00); |
320 | |
321 | /* Update vectorial force */ |
322 | fix0 = _mm_add_ps(fix0,tx); |
323 | fiy0 = _mm_add_ps(fiy0,ty); |
324 | fiz0 = _mm_add_ps(fiz0,tz); |
325 | |
326 | fjx0 = _mm_add_ps(fjx0,tx); |
327 | fjy0 = _mm_add_ps(fjy0,ty); |
328 | fjz0 = _mm_add_ps(fjz0,tz); |
329 | |
330 | /************************** |
331 | * CALCULATE INTERACTIONS * |
332 | **************************/ |
333 | |
334 | /* COULOMB ELECTROSTATICS */ |
335 | velec = _mm_mul_ps(qq01,rinv01); |
336 | felec = _mm_mul_ps(velec,rinvsq01); |
337 | |
338 | /* Update potential sum for this i atom from the interaction with this j atom. */ |
339 | velecsum = _mm_add_ps(velecsum,velec); |
340 | |
341 | fscal = felec; |
342 | |
343 | /* Calculate temporary vectorial force */ |
344 | tx = _mm_mul_ps(fscal,dx01); |
345 | ty = _mm_mul_ps(fscal,dy01); |
346 | tz = _mm_mul_ps(fscal,dz01); |
347 | |
348 | /* Update vectorial force */ |
349 | fix0 = _mm_add_ps(fix0,tx); |
350 | fiy0 = _mm_add_ps(fiy0,ty); |
351 | fiz0 = _mm_add_ps(fiz0,tz); |
352 | |
353 | fjx1 = _mm_add_ps(fjx1,tx); |
354 | fjy1 = _mm_add_ps(fjy1,ty); |
355 | fjz1 = _mm_add_ps(fjz1,tz); |
356 | |
357 | /************************** |
358 | * CALCULATE INTERACTIONS * |
359 | **************************/ |
360 | |
361 | /* COULOMB ELECTROSTATICS */ |
362 | velec = _mm_mul_ps(qq02,rinv02); |
363 | felec = _mm_mul_ps(velec,rinvsq02); |
364 | |
365 | /* Update potential sum for this i atom from the interaction with this j atom. */ |
366 | velecsum = _mm_add_ps(velecsum,velec); |
367 | |
368 | fscal = felec; |
369 | |
370 | /* Calculate temporary vectorial force */ |
371 | tx = _mm_mul_ps(fscal,dx02); |
372 | ty = _mm_mul_ps(fscal,dy02); |
373 | tz = _mm_mul_ps(fscal,dz02); |
374 | |
375 | /* Update vectorial force */ |
376 | fix0 = _mm_add_ps(fix0,tx); |
377 | fiy0 = _mm_add_ps(fiy0,ty); |
378 | fiz0 = _mm_add_ps(fiz0,tz); |
379 | |
380 | fjx2 = _mm_add_ps(fjx2,tx); |
381 | fjy2 = _mm_add_ps(fjy2,ty); |
382 | fjz2 = _mm_add_ps(fjz2,tz); |
383 | |
384 | /************************** |
385 | * CALCULATE INTERACTIONS * |
386 | **************************/ |
387 | |
388 | /* COULOMB ELECTROSTATICS */ |
389 | velec = _mm_mul_ps(qq10,rinv10); |
390 | felec = _mm_mul_ps(velec,rinvsq10); |
391 | |
392 | /* Update potential sum for this i atom from the interaction with this j atom. */ |
393 | velecsum = _mm_add_ps(velecsum,velec); |
394 | |
395 | fscal = felec; |
396 | |
397 | /* Calculate temporary vectorial force */ |
398 | tx = _mm_mul_ps(fscal,dx10); |
399 | ty = _mm_mul_ps(fscal,dy10); |
400 | tz = _mm_mul_ps(fscal,dz10); |
401 | |
402 | /* Update vectorial force */ |
403 | fix1 = _mm_add_ps(fix1,tx); |
404 | fiy1 = _mm_add_ps(fiy1,ty); |
405 | fiz1 = _mm_add_ps(fiz1,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 | * CALCULATE INTERACTIONS * |
413 | **************************/ |
414 | |
415 | /* COULOMB ELECTROSTATICS */ |
416 | velec = _mm_mul_ps(qq11,rinv11); |
417 | felec = _mm_mul_ps(velec,rinvsq11); |
418 | |
419 | /* Update potential sum for this i atom from the interaction with this j atom. */ |
420 | velecsum = _mm_add_ps(velecsum,velec); |
421 | |
422 | fscal = felec; |
423 | |
424 | /* Calculate temporary vectorial force */ |
425 | tx = _mm_mul_ps(fscal,dx11); |
426 | ty = _mm_mul_ps(fscal,dy11); |
427 | tz = _mm_mul_ps(fscal,dz11); |
428 | |
429 | /* Update vectorial force */ |
430 | fix1 = _mm_add_ps(fix1,tx); |
431 | fiy1 = _mm_add_ps(fiy1,ty); |
432 | fiz1 = _mm_add_ps(fiz1,tz); |
433 | |
434 | fjx1 = _mm_add_ps(fjx1,tx); |
435 | fjy1 = _mm_add_ps(fjy1,ty); |
436 | fjz1 = _mm_add_ps(fjz1,tz); |
437 | |
438 | /************************** |
439 | * CALCULATE INTERACTIONS * |
440 | **************************/ |
441 | |
442 | /* COULOMB ELECTROSTATICS */ |
443 | velec = _mm_mul_ps(qq12,rinv12); |
444 | felec = _mm_mul_ps(velec,rinvsq12); |
445 | |
446 | /* Update potential sum for this i atom from the interaction with this j atom. */ |
447 | velecsum = _mm_add_ps(velecsum,velec); |
448 | |
449 | fscal = felec; |
450 | |
451 | /* Calculate temporary vectorial force */ |
452 | tx = _mm_mul_ps(fscal,dx12); |
453 | ty = _mm_mul_ps(fscal,dy12); |
454 | tz = _mm_mul_ps(fscal,dz12); |
455 | |
456 | /* Update vectorial force */ |
457 | fix1 = _mm_add_ps(fix1,tx); |
458 | fiy1 = _mm_add_ps(fiy1,ty); |
459 | fiz1 = _mm_add_ps(fiz1,tz); |
460 | |
461 | fjx2 = _mm_add_ps(fjx2,tx); |
462 | fjy2 = _mm_add_ps(fjy2,ty); |
463 | fjz2 = _mm_add_ps(fjz2,tz); |
464 | |
465 | /************************** |
466 | * CALCULATE INTERACTIONS * |
467 | **************************/ |
468 | |
469 | /* COULOMB ELECTROSTATICS */ |
470 | velec = _mm_mul_ps(qq20,rinv20); |
471 | felec = _mm_mul_ps(velec,rinvsq20); |
472 | |
473 | /* Update potential sum for this i atom from the interaction with this j atom. */ |
474 | velecsum = _mm_add_ps(velecsum,velec); |
475 | |
476 | fscal = felec; |
477 | |
478 | /* Calculate temporary vectorial force */ |
479 | tx = _mm_mul_ps(fscal,dx20); |
480 | ty = _mm_mul_ps(fscal,dy20); |
481 | tz = _mm_mul_ps(fscal,dz20); |
482 | |
483 | /* Update vectorial force */ |
484 | fix2 = _mm_add_ps(fix2,tx); |
485 | fiy2 = _mm_add_ps(fiy2,ty); |
486 | fiz2 = _mm_add_ps(fiz2,tz); |
487 | |
488 | fjx0 = _mm_add_ps(fjx0,tx); |
489 | fjy0 = _mm_add_ps(fjy0,ty); |
490 | fjz0 = _mm_add_ps(fjz0,tz); |
491 | |
492 | /************************** |
493 | * CALCULATE INTERACTIONS * |
494 | **************************/ |
495 | |
496 | /* COULOMB ELECTROSTATICS */ |
497 | velec = _mm_mul_ps(qq21,rinv21); |
498 | felec = _mm_mul_ps(velec,rinvsq21); |
499 | |
500 | /* Update potential sum for this i atom from the interaction with this j atom. */ |
501 | velecsum = _mm_add_ps(velecsum,velec); |
502 | |
503 | fscal = felec; |
504 | |
505 | /* Calculate temporary vectorial force */ |
506 | tx = _mm_mul_ps(fscal,dx21); |
507 | ty = _mm_mul_ps(fscal,dy21); |
508 | tz = _mm_mul_ps(fscal,dz21); |
509 | |
510 | /* Update vectorial force */ |
511 | fix2 = _mm_add_ps(fix2,tx); |
512 | fiy2 = _mm_add_ps(fiy2,ty); |
513 | fiz2 = _mm_add_ps(fiz2,tz); |
514 | |
515 | fjx1 = _mm_add_ps(fjx1,tx); |
516 | fjy1 = _mm_add_ps(fjy1,ty); |
517 | fjz1 = _mm_add_ps(fjz1,tz); |
518 | |
519 | /************************** |
520 | * CALCULATE INTERACTIONS * |
521 | **************************/ |
522 | |
523 | /* COULOMB ELECTROSTATICS */ |
524 | velec = _mm_mul_ps(qq22,rinv22); |
525 | felec = _mm_mul_ps(velec,rinvsq22); |
526 | |
527 | /* Update potential sum for this i atom from the interaction with this j atom. */ |
528 | velecsum = _mm_add_ps(velecsum,velec); |
529 | |
530 | fscal = felec; |
531 | |
532 | /* Calculate temporary vectorial force */ |
533 | tx = _mm_mul_ps(fscal,dx22); |
534 | ty = _mm_mul_ps(fscal,dy22); |
535 | tz = _mm_mul_ps(fscal,dz22); |
536 | |
537 | /* Update vectorial force */ |
538 | fix2 = _mm_add_ps(fix2,tx); |
539 | fiy2 = _mm_add_ps(fiy2,ty); |
540 | fiz2 = _mm_add_ps(fiz2,tz); |
541 | |
542 | fjx2 = _mm_add_ps(fjx2,tx); |
543 | fjy2 = _mm_add_ps(fjy2,ty); |
544 | fjz2 = _mm_add_ps(fjz2,tz); |
545 | |
546 | fjptrA = f+j_coord_offsetA; |
547 | fjptrB = f+j_coord_offsetB; |
548 | fjptrC = f+j_coord_offsetC; |
549 | fjptrD = f+j_coord_offsetD; |
550 | |
551 | gmx_mm_decrement_3rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD, |
552 | fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2); |
553 | |
554 | /* Inner loop uses 264 flops */ |
555 | } |
556 | |
557 | if(jidx<j_index_end) |
558 | { |
559 | |
560 | /* Get j neighbor index, and coordinate index */ |
561 | jnrlistA = jjnr[jidx]; |
562 | jnrlistB = jjnr[jidx+1]; |
563 | jnrlistC = jjnr[jidx+2]; |
564 | jnrlistD = jjnr[jidx+3]; |
565 | /* Sign of each element will be negative for non-real atoms. |
566 | * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones, |
567 | * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries. |
568 | */ |
569 | dummy_mask = gmx_mm_castsi128_ps_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128())); |
570 | jnrA = (jnrlistA>=0) ? jnrlistA : 0; |
571 | jnrB = (jnrlistB>=0) ? jnrlistB : 0; |
572 | jnrC = (jnrlistC>=0) ? jnrlistC : 0; |
573 | jnrD = (jnrlistD>=0) ? jnrlistD : 0; |
574 | j_coord_offsetA = DIM3*jnrA; |
575 | j_coord_offsetB = DIM3*jnrB; |
576 | j_coord_offsetC = DIM3*jnrC; |
577 | j_coord_offsetD = DIM3*jnrD; |
578 | |
579 | /* load j atom coordinates */ |
580 | gmx_mm_load_3rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB, |
581 | x+j_coord_offsetC,x+j_coord_offsetD, |
582 | &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,&jy2,&jz2); |
583 | |
584 | /* Calculate displacement vector */ |
585 | dx00 = _mm_sub_ps(ix0,jx0); |
586 | dy00 = _mm_sub_ps(iy0,jy0); |
587 | dz00 = _mm_sub_ps(iz0,jz0); |
588 | dx01 = _mm_sub_ps(ix0,jx1); |
589 | dy01 = _mm_sub_ps(iy0,jy1); |
590 | dz01 = _mm_sub_ps(iz0,jz1); |
591 | dx02 = _mm_sub_ps(ix0,jx2); |
592 | dy02 = _mm_sub_ps(iy0,jy2); |
593 | dz02 = _mm_sub_ps(iz0,jz2); |
594 | dx10 = _mm_sub_ps(ix1,jx0); |
595 | dy10 = _mm_sub_ps(iy1,jy0); |
596 | dz10 = _mm_sub_ps(iz1,jz0); |
597 | dx11 = _mm_sub_ps(ix1,jx1); |
598 | dy11 = _mm_sub_ps(iy1,jy1); |
599 | dz11 = _mm_sub_ps(iz1,jz1); |
600 | dx12 = _mm_sub_ps(ix1,jx2); |
601 | dy12 = _mm_sub_ps(iy1,jy2); |
602 | dz12 = _mm_sub_ps(iz1,jz2); |
603 | dx20 = _mm_sub_ps(ix2,jx0); |
604 | dy20 = _mm_sub_ps(iy2,jy0); |
605 | dz20 = _mm_sub_ps(iz2,jz0); |
606 | dx21 = _mm_sub_ps(ix2,jx1); |
607 | dy21 = _mm_sub_ps(iy2,jy1); |
608 | dz21 = _mm_sub_ps(iz2,jz1); |
609 | dx22 = _mm_sub_ps(ix2,jx2); |
610 | dy22 = _mm_sub_ps(iy2,jy2); |
611 | dz22 = _mm_sub_ps(iz2,jz2); |
612 | |
613 | /* Calculate squared distance and things based on it */ |
614 | rsq00 = gmx_mm_calc_rsq_ps(dx00,dy00,dz00); |
615 | rsq01 = gmx_mm_calc_rsq_ps(dx01,dy01,dz01); |
616 | rsq02 = gmx_mm_calc_rsq_ps(dx02,dy02,dz02); |
617 | rsq10 = gmx_mm_calc_rsq_ps(dx10,dy10,dz10); |
618 | rsq11 = gmx_mm_calc_rsq_ps(dx11,dy11,dz11); |
619 | rsq12 = gmx_mm_calc_rsq_ps(dx12,dy12,dz12); |
620 | rsq20 = gmx_mm_calc_rsq_ps(dx20,dy20,dz20); |
621 | rsq21 = gmx_mm_calc_rsq_ps(dx21,dy21,dz21); |
622 | rsq22 = gmx_mm_calc_rsq_ps(dx22,dy22,dz22); |
623 | |
624 | rinv00 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq00); |
625 | rinv01 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq01); |
626 | rinv02 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq02); |
627 | rinv10 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq10); |
628 | rinv11 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq11); |
629 | rinv12 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq12); |
630 | rinv20 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq20); |
631 | rinv21 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq21); |
632 | rinv22 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq22); |
633 | |
634 | rinvsq00 = _mm_mul_ps(rinv00,rinv00); |
635 | rinvsq01 = _mm_mul_ps(rinv01,rinv01); |
636 | rinvsq02 = _mm_mul_ps(rinv02,rinv02); |
637 | rinvsq10 = _mm_mul_ps(rinv10,rinv10); |
638 | rinvsq11 = _mm_mul_ps(rinv11,rinv11); |
639 | rinvsq12 = _mm_mul_ps(rinv12,rinv12); |
640 | rinvsq20 = _mm_mul_ps(rinv20,rinv20); |
641 | rinvsq21 = _mm_mul_ps(rinv21,rinv21); |
642 | rinvsq22 = _mm_mul_ps(rinv22,rinv22); |
643 | |
644 | fjx0 = _mm_setzero_ps(); |
645 | fjy0 = _mm_setzero_ps(); |
646 | fjz0 = _mm_setzero_ps(); |
647 | fjx1 = _mm_setzero_ps(); |
648 | fjy1 = _mm_setzero_ps(); |
649 | fjz1 = _mm_setzero_ps(); |
650 | fjx2 = _mm_setzero_ps(); |
651 | fjy2 = _mm_setzero_ps(); |
652 | fjz2 = _mm_setzero_ps(); |
653 | |
654 | /************************** |
655 | * CALCULATE INTERACTIONS * |
656 | **************************/ |
657 | |
658 | /* COULOMB ELECTROSTATICS */ |
659 | velec = _mm_mul_ps(qq00,rinv00); |
660 | felec = _mm_mul_ps(velec,rinvsq00); |
661 | |
662 | /* LENNARD-JONES DISPERSION/REPULSION */ |
663 | |
664 | rinvsix = _mm_mul_ps(_mm_mul_ps(rinvsq00,rinvsq00),rinvsq00); |
665 | vvdw6 = _mm_mul_ps(c6_00,rinvsix); |
666 | vvdw12 = _mm_mul_ps(c12_00,_mm_mul_ps(rinvsix,rinvsix)); |
667 | vvdw = _mm_sub_ps( _mm_mul_ps(vvdw12,one_twelfth) , _mm_mul_ps(vvdw6,one_sixth) ); |
668 | fvdw = _mm_mul_ps(_mm_sub_ps(vvdw12,vvdw6),rinvsq00); |
669 | |
670 | /* Update potential sum for this i atom from the interaction with this j atom. */ |
671 | velec = _mm_andnot_ps(dummy_mask,velec); |
672 | velecsum = _mm_add_ps(velecsum,velec); |
673 | vvdw = _mm_andnot_ps(dummy_mask,vvdw); |
674 | vvdwsum = _mm_add_ps(vvdwsum,vvdw); |
675 | |
676 | fscal = _mm_add_ps(felec,fvdw); |
677 | |
678 | fscal = _mm_andnot_ps(dummy_mask,fscal); |
679 | |
680 | /* Calculate temporary vectorial force */ |
681 | tx = _mm_mul_ps(fscal,dx00); |
682 | ty = _mm_mul_ps(fscal,dy00); |
683 | tz = _mm_mul_ps(fscal,dz00); |
684 | |
685 | /* Update vectorial force */ |
686 | fix0 = _mm_add_ps(fix0,tx); |
687 | fiy0 = _mm_add_ps(fiy0,ty); |
688 | fiz0 = _mm_add_ps(fiz0,tz); |
689 | |
690 | fjx0 = _mm_add_ps(fjx0,tx); |
691 | fjy0 = _mm_add_ps(fjy0,ty); |
692 | fjz0 = _mm_add_ps(fjz0,tz); |
693 | |
694 | /************************** |
695 | * CALCULATE INTERACTIONS * |
696 | **************************/ |
697 | |
698 | /* COULOMB ELECTROSTATICS */ |
699 | velec = _mm_mul_ps(qq01,rinv01); |
700 | felec = _mm_mul_ps(velec,rinvsq01); |
701 | |
702 | /* Update potential sum for this i atom from the interaction with this j atom. */ |
703 | velec = _mm_andnot_ps(dummy_mask,velec); |
704 | velecsum = _mm_add_ps(velecsum,velec); |
705 | |
706 | fscal = felec; |
707 | |
708 | fscal = _mm_andnot_ps(dummy_mask,fscal); |
709 | |
710 | /* Calculate temporary vectorial force */ |
711 | tx = _mm_mul_ps(fscal,dx01); |
712 | ty = _mm_mul_ps(fscal,dy01); |
713 | tz = _mm_mul_ps(fscal,dz01); |
714 | |
715 | /* Update vectorial force */ |
716 | fix0 = _mm_add_ps(fix0,tx); |
717 | fiy0 = _mm_add_ps(fiy0,ty); |
718 | fiz0 = _mm_add_ps(fiz0,tz); |
719 | |
720 | fjx1 = _mm_add_ps(fjx1,tx); |
721 | fjy1 = _mm_add_ps(fjy1,ty); |
722 | fjz1 = _mm_add_ps(fjz1,tz); |
723 | |
724 | /************************** |
725 | * CALCULATE INTERACTIONS * |
726 | **************************/ |
727 | |
728 | /* COULOMB ELECTROSTATICS */ |
729 | velec = _mm_mul_ps(qq02,rinv02); |
730 | felec = _mm_mul_ps(velec,rinvsq02); |
731 | |
732 | /* Update potential sum for this i atom from the interaction with this j atom. */ |
733 | velec = _mm_andnot_ps(dummy_mask,velec); |
734 | velecsum = _mm_add_ps(velecsum,velec); |
735 | |
736 | fscal = felec; |
737 | |
738 | fscal = _mm_andnot_ps(dummy_mask,fscal); |
739 | |
740 | /* Calculate temporary vectorial force */ |
741 | tx = _mm_mul_ps(fscal,dx02); |
742 | ty = _mm_mul_ps(fscal,dy02); |
743 | tz = _mm_mul_ps(fscal,dz02); |
744 | |
745 | /* Update vectorial force */ |
746 | fix0 = _mm_add_ps(fix0,tx); |
747 | fiy0 = _mm_add_ps(fiy0,ty); |
748 | fiz0 = _mm_add_ps(fiz0,tz); |
749 | |
750 | fjx2 = _mm_add_ps(fjx2,tx); |
751 | fjy2 = _mm_add_ps(fjy2,ty); |
752 | fjz2 = _mm_add_ps(fjz2,tz); |
753 | |
754 | /************************** |
755 | * CALCULATE INTERACTIONS * |
756 | **************************/ |
757 | |
758 | /* COULOMB ELECTROSTATICS */ |
759 | velec = _mm_mul_ps(qq10,rinv10); |
760 | felec = _mm_mul_ps(velec,rinvsq10); |
761 | |
762 | /* Update potential sum for this i atom from the interaction with this j atom. */ |
763 | velec = _mm_andnot_ps(dummy_mask,velec); |
764 | velecsum = _mm_add_ps(velecsum,velec); |
765 | |
766 | fscal = felec; |
767 | |
768 | fscal = _mm_andnot_ps(dummy_mask,fscal); |
769 | |
770 | /* Calculate temporary vectorial force */ |
771 | tx = _mm_mul_ps(fscal,dx10); |
772 | ty = _mm_mul_ps(fscal,dy10); |
773 | tz = _mm_mul_ps(fscal,dz10); |
774 | |
775 | /* Update vectorial force */ |
776 | fix1 = _mm_add_ps(fix1,tx); |
777 | fiy1 = _mm_add_ps(fiy1,ty); |
778 | fiz1 = _mm_add_ps(fiz1,tz); |
779 | |
780 | fjx0 = _mm_add_ps(fjx0,tx); |
781 | fjy0 = _mm_add_ps(fjy0,ty); |
782 | fjz0 = _mm_add_ps(fjz0,tz); |
783 | |
784 | /************************** |
785 | * CALCULATE INTERACTIONS * |
786 | **************************/ |
787 | |
788 | /* COULOMB ELECTROSTATICS */ |
789 | velec = _mm_mul_ps(qq11,rinv11); |
790 | felec = _mm_mul_ps(velec,rinvsq11); |
791 | |
792 | /* Update potential sum for this i atom from the interaction with this j atom. */ |
793 | velec = _mm_andnot_ps(dummy_mask,velec); |
794 | velecsum = _mm_add_ps(velecsum,velec); |
795 | |
796 | fscal = felec; |
797 | |
798 | fscal = _mm_andnot_ps(dummy_mask,fscal); |
799 | |
800 | /* Calculate temporary vectorial force */ |
801 | tx = _mm_mul_ps(fscal,dx11); |
802 | ty = _mm_mul_ps(fscal,dy11); |
803 | tz = _mm_mul_ps(fscal,dz11); |
804 | |
805 | /* Update vectorial force */ |
806 | fix1 = _mm_add_ps(fix1,tx); |
807 | fiy1 = _mm_add_ps(fiy1,ty); |
808 | fiz1 = _mm_add_ps(fiz1,tz); |
809 | |
810 | fjx1 = _mm_add_ps(fjx1,tx); |
811 | fjy1 = _mm_add_ps(fjy1,ty); |
812 | fjz1 = _mm_add_ps(fjz1,tz); |
813 | |
814 | /************************** |
815 | * CALCULATE INTERACTIONS * |
816 | **************************/ |
817 | |
818 | /* COULOMB ELECTROSTATICS */ |
819 | velec = _mm_mul_ps(qq12,rinv12); |
820 | felec = _mm_mul_ps(velec,rinvsq12); |
821 | |
822 | /* Update potential sum for this i atom from the interaction with this j atom. */ |
823 | velec = _mm_andnot_ps(dummy_mask,velec); |
824 | velecsum = _mm_add_ps(velecsum,velec); |
825 | |
826 | fscal = felec; |
827 | |
828 | fscal = _mm_andnot_ps(dummy_mask,fscal); |
829 | |
830 | /* Calculate temporary vectorial force */ |
831 | tx = _mm_mul_ps(fscal,dx12); |
832 | ty = _mm_mul_ps(fscal,dy12); |
833 | tz = _mm_mul_ps(fscal,dz12); |
834 | |
835 | /* Update vectorial force */ |
836 | fix1 = _mm_add_ps(fix1,tx); |
837 | fiy1 = _mm_add_ps(fiy1,ty); |
838 | fiz1 = _mm_add_ps(fiz1,tz); |
839 | |
840 | fjx2 = _mm_add_ps(fjx2,tx); |
841 | fjy2 = _mm_add_ps(fjy2,ty); |
842 | fjz2 = _mm_add_ps(fjz2,tz); |
843 | |
844 | /************************** |
845 | * CALCULATE INTERACTIONS * |
846 | **************************/ |
847 | |
848 | /* COULOMB ELECTROSTATICS */ |
849 | velec = _mm_mul_ps(qq20,rinv20); |
850 | felec = _mm_mul_ps(velec,rinvsq20); |
851 | |
852 | /* Update potential sum for this i atom from the interaction with this j atom. */ |
853 | velec = _mm_andnot_ps(dummy_mask,velec); |
854 | velecsum = _mm_add_ps(velecsum,velec); |
855 | |
856 | fscal = felec; |
857 | |
858 | fscal = _mm_andnot_ps(dummy_mask,fscal); |
859 | |
860 | /* Calculate temporary vectorial force */ |
861 | tx = _mm_mul_ps(fscal,dx20); |
862 | ty = _mm_mul_ps(fscal,dy20); |
863 | tz = _mm_mul_ps(fscal,dz20); |
864 | |
865 | /* Update vectorial force */ |
866 | fix2 = _mm_add_ps(fix2,tx); |
867 | fiy2 = _mm_add_ps(fiy2,ty); |
868 | fiz2 = _mm_add_ps(fiz2,tz); |
869 | |
870 | fjx0 = _mm_add_ps(fjx0,tx); |
871 | fjy0 = _mm_add_ps(fjy0,ty); |
872 | fjz0 = _mm_add_ps(fjz0,tz); |
873 | |
874 | /************************** |
875 | * CALCULATE INTERACTIONS * |
876 | **************************/ |
877 | |
878 | /* COULOMB ELECTROSTATICS */ |
879 | velec = _mm_mul_ps(qq21,rinv21); |
880 | felec = _mm_mul_ps(velec,rinvsq21); |
881 | |
882 | /* Update potential sum for this i atom from the interaction with this j atom. */ |
883 | velec = _mm_andnot_ps(dummy_mask,velec); |
884 | velecsum = _mm_add_ps(velecsum,velec); |
885 | |
886 | fscal = felec; |
887 | |
888 | fscal = _mm_andnot_ps(dummy_mask,fscal); |
889 | |
890 | /* Calculate temporary vectorial force */ |
891 | tx = _mm_mul_ps(fscal,dx21); |
892 | ty = _mm_mul_ps(fscal,dy21); |
893 | tz = _mm_mul_ps(fscal,dz21); |
894 | |
895 | /* Update vectorial force */ |
896 | fix2 = _mm_add_ps(fix2,tx); |
897 | fiy2 = _mm_add_ps(fiy2,ty); |
898 | fiz2 = _mm_add_ps(fiz2,tz); |
899 | |
900 | fjx1 = _mm_add_ps(fjx1,tx); |
901 | fjy1 = _mm_add_ps(fjy1,ty); |
902 | fjz1 = _mm_add_ps(fjz1,tz); |
903 | |
904 | /************************** |
905 | * CALCULATE INTERACTIONS * |
906 | **************************/ |
907 | |
908 | /* COULOMB ELECTROSTATICS */ |
909 | velec = _mm_mul_ps(qq22,rinv22); |
910 | felec = _mm_mul_ps(velec,rinvsq22); |
911 | |
912 | /* Update potential sum for this i atom from the interaction with this j atom. */ |
913 | velec = _mm_andnot_ps(dummy_mask,velec); |
914 | velecsum = _mm_add_ps(velecsum,velec); |
915 | |
916 | fscal = felec; |
917 | |
918 | fscal = _mm_andnot_ps(dummy_mask,fscal); |
919 | |
920 | /* Calculate temporary vectorial force */ |
921 | tx = _mm_mul_ps(fscal,dx22); |
922 | ty = _mm_mul_ps(fscal,dy22); |
923 | tz = _mm_mul_ps(fscal,dz22); |
924 | |
925 | /* Update vectorial force */ |
926 | fix2 = _mm_add_ps(fix2,tx); |
927 | fiy2 = _mm_add_ps(fiy2,ty); |
928 | fiz2 = _mm_add_ps(fiz2,tz); |
929 | |
930 | fjx2 = _mm_add_ps(fjx2,tx); |
931 | fjy2 = _mm_add_ps(fjy2,ty); |
932 | fjz2 = _mm_add_ps(fjz2,tz); |
933 | |
934 | fjptrA = (jnrlistA>=0) ? f+j_coord_offsetA : scratch; |
935 | fjptrB = (jnrlistB>=0) ? f+j_coord_offsetB : scratch; |
936 | fjptrC = (jnrlistC>=0) ? f+j_coord_offsetC : scratch; |
937 | fjptrD = (jnrlistD>=0) ? f+j_coord_offsetD : scratch; |
938 | |
939 | gmx_mm_decrement_3rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD, |
940 | fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2); |
941 | |
942 | /* Inner loop uses 264 flops */ |
943 | } |
944 | |
945 | /* End of innermost loop */ |
946 | |
947 | gmx_mm_update_iforce_3atom_swizzle_ps(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2, |
948 | f+i_coord_offset,fshift+i_shift_offset); |
949 | |
950 | ggid = gid[iidx]; |
951 | /* Update potential energies */ |
952 | gmx_mm_update_1pot_ps(velecsum,kernel_data->energygrp_elec+ggid); |
953 | gmx_mm_update_1pot_ps(vvdwsum,kernel_data->energygrp_vdw+ggid); |
954 | |
955 | /* Increment number of inner iterations */ |
956 | inneriter += j_index_end - j_index_start; |
957 | |
958 | /* Outer loop uses 20 flops */ |
959 | } |
960 | |
961 | /* Increment number of outer iterations */ |
962 | outeriter += nri; |
963 | |
964 | /* Update outer/inner flops */ |
965 | |
966 | inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3W3_VF,outeriter*20 + inneriter*264)(nrnb)->n[eNR_NBKERNEL_ELEC_VDW_W3W3_VF] += outeriter*20 + inneriter*264; |
967 | } |
968 | /* |
969 | * Gromacs nonbonded kernel: nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sse4_1_single |
970 | * Electrostatics interaction: Coulomb |
971 | * VdW interaction: LennardJones |
972 | * Geometry: Water3-Water3 |
973 | * Calculate force/pot: Force |
974 | */ |
975 | void |
976 | nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sse4_1_single |
977 | (t_nblist * gmx_restrict nlist, |
978 | rvec * gmx_restrict xx, |
979 | rvec * gmx_restrict ff, |
980 | t_forcerec * gmx_restrict fr, |
981 | t_mdatoms * gmx_restrict mdatoms, |
982 | nb_kernel_data_t gmx_unused__attribute__ ((unused)) * gmx_restrict kernel_data, |
983 | t_nrnb * gmx_restrict nrnb) |
984 | { |
985 | /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or |
986 | * just 0 for non-waters. |
987 | * Suffixes A,B,C,D refer to j loop unrolling done with SSE, e.g. for the four different |
988 | * jnr indices corresponding to data put in the four positions in the SIMD register. |
989 | */ |
990 | int i_shift_offset,i_coord_offset,outeriter,inneriter; |
991 | int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx; |
992 | int jnrA,jnrB,jnrC,jnrD; |
993 | int jnrlistA,jnrlistB,jnrlistC,jnrlistD; |
994 | int j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD; |
995 | int *iinr,*jindex,*jjnr,*shiftidx,*gid; |
996 | real rcutoff_scalar; |
997 | real *shiftvec,*fshift,*x,*f; |
998 | real *fjptrA,*fjptrB,*fjptrC,*fjptrD; |
999 | real scratch[4*DIM3]; |
1000 | __m128 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall; |
1001 | int vdwioffset0; |
1002 | __m128 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0; |
1003 | int vdwioffset1; |
1004 | __m128 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1; |
1005 | int vdwioffset2; |
1006 | __m128 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2; |
1007 | int vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D; |
1008 | __m128 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0; |
1009 | int vdwjidx1A,vdwjidx1B,vdwjidx1C,vdwjidx1D; |
1010 | __m128 jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1; |
1011 | int vdwjidx2A,vdwjidx2B,vdwjidx2C,vdwjidx2D; |
1012 | __m128 jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2; |
1013 | __m128 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00; |
1014 | __m128 dx01,dy01,dz01,rsq01,rinv01,rinvsq01,r01,qq01,c6_01,c12_01; |
1015 | __m128 dx02,dy02,dz02,rsq02,rinv02,rinvsq02,r02,qq02,c6_02,c12_02; |
1016 | __m128 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10; |
1017 | __m128 dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11; |
1018 | __m128 dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12; |
1019 | __m128 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20; |
1020 | __m128 dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21; |
1021 | __m128 dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22; |
1022 | __m128 velec,felec,velecsum,facel,crf,krf,krf2; |
1023 | real *charge; |
1024 | int nvdwtype; |
1025 | __m128 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6; |
1026 | int *vdwtype; |
1027 | real *vdwparam; |
1028 | __m128 one_sixth = _mm_set1_ps(1.0/6.0); |
1029 | __m128 one_twelfth = _mm_set1_ps(1.0/12.0); |
1030 | __m128 dummy_mask,cutoff_mask; |
1031 | __m128 signbit = _mm_castsi128_ps( _mm_set1_epi32(0x80000000) ); |
1032 | __m128 one = _mm_set1_ps(1.0); |
1033 | __m128 two = _mm_set1_ps(2.0); |
1034 | x = xx[0]; |
1035 | f = ff[0]; |
1036 | |
1037 | nri = nlist->nri; |
1038 | iinr = nlist->iinr; |
1039 | jindex = nlist->jindex; |
1040 | jjnr = nlist->jjnr; |
1041 | shiftidx = nlist->shift; |
1042 | gid = nlist->gid; |
1043 | shiftvec = fr->shift_vec[0]; |
1044 | fshift = fr->fshift[0]; |
1045 | facel = _mm_set1_ps(fr->epsfac); |
1046 | charge = mdatoms->chargeA; |
1047 | nvdwtype = fr->ntype; |
1048 | vdwparam = fr->nbfp; |
1049 | vdwtype = mdatoms->typeA; |
1050 | |
1051 | /* Setup water-specific parameters */ |
1052 | inr = nlist->iinr[0]; |
1053 | iq0 = _mm_mul_ps(facel,_mm_set1_ps(charge[inr+0])); |
1054 | iq1 = _mm_mul_ps(facel,_mm_set1_ps(charge[inr+1])); |
1055 | iq2 = _mm_mul_ps(facel,_mm_set1_ps(charge[inr+2])); |
1056 | vdwioffset0 = 2*nvdwtype*vdwtype[inr+0]; |
1057 | |
1058 | jq0 = _mm_set1_ps(charge[inr+0]); |
1059 | jq1 = _mm_set1_ps(charge[inr+1]); |
1060 | jq2 = _mm_set1_ps(charge[inr+2]); |
1061 | vdwjidx0A = 2*vdwtype[inr+0]; |
1062 | qq00 = _mm_mul_ps(iq0,jq0); |
1063 | c6_00 = _mm_set1_ps(vdwparam[vdwioffset0+vdwjidx0A]); |
1064 | c12_00 = _mm_set1_ps(vdwparam[vdwioffset0+vdwjidx0A+1]); |
1065 | qq01 = _mm_mul_ps(iq0,jq1); |
1066 | qq02 = _mm_mul_ps(iq0,jq2); |
1067 | qq10 = _mm_mul_ps(iq1,jq0); |
1068 | qq11 = _mm_mul_ps(iq1,jq1); |
1069 | qq12 = _mm_mul_ps(iq1,jq2); |
1070 | qq20 = _mm_mul_ps(iq2,jq0); |
1071 | qq21 = _mm_mul_ps(iq2,jq1); |
1072 | qq22 = _mm_mul_ps(iq2,jq2); |
1073 | |
1074 | /* Avoid stupid compiler warnings */ |
1075 | jnrA = jnrB = jnrC = jnrD = 0; |
1076 | j_coord_offsetA = 0; |
1077 | j_coord_offsetB = 0; |
Value stored to 'j_coord_offsetB' is never read | |
1078 | j_coord_offsetC = 0; |
1079 | j_coord_offsetD = 0; |
1080 | |
1081 | outeriter = 0; |
1082 | inneriter = 0; |
1083 | |
1084 | for(iidx=0;iidx<4*DIM3;iidx++) |
1085 | { |
1086 | scratch[iidx] = 0.0; |
1087 | } |
1088 | |
1089 | /* Start outer loop over neighborlists */ |
1090 | for(iidx=0; iidx<nri; iidx++) |
1091 | { |
1092 | /* Load shift vector for this list */ |
1093 | i_shift_offset = DIM3*shiftidx[iidx]; |
1094 | |
1095 | /* Load limits for loop over neighbors */ |
1096 | j_index_start = jindex[iidx]; |
1097 | j_index_end = jindex[iidx+1]; |
1098 | |
1099 | /* Get outer coordinate index */ |
1100 | inr = iinr[iidx]; |
1101 | i_coord_offset = DIM3*inr; |
1102 | |
1103 | /* Load i particle coords and add shift vector */ |
1104 | gmx_mm_load_shift_and_3rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset, |
1105 | &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2); |
1106 | |
1107 | fix0 = _mm_setzero_ps(); |
1108 | fiy0 = _mm_setzero_ps(); |
1109 | fiz0 = _mm_setzero_ps(); |
1110 | fix1 = _mm_setzero_ps(); |
1111 | fiy1 = _mm_setzero_ps(); |
1112 | fiz1 = _mm_setzero_ps(); |
1113 | fix2 = _mm_setzero_ps(); |
1114 | fiy2 = _mm_setzero_ps(); |
1115 | fiz2 = _mm_setzero_ps(); |
1116 | |
1117 | /* Start inner kernel loop */ |
1118 | for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4) |
1119 | { |
1120 | |
1121 | /* Get j neighbor index, and coordinate index */ |
1122 | jnrA = jjnr[jidx]; |
1123 | jnrB = jjnr[jidx+1]; |
1124 | jnrC = jjnr[jidx+2]; |
1125 | jnrD = jjnr[jidx+3]; |
1126 | j_coord_offsetA = DIM3*jnrA; |
1127 | j_coord_offsetB = DIM3*jnrB; |
1128 | j_coord_offsetC = DIM3*jnrC; |
1129 | j_coord_offsetD = DIM3*jnrD; |
1130 | |
1131 | /* load j atom coordinates */ |
1132 | gmx_mm_load_3rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB, |
1133 | x+j_coord_offsetC,x+j_coord_offsetD, |
1134 | &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,&jy2,&jz2); |
1135 | |
1136 | /* Calculate displacement vector */ |
1137 | dx00 = _mm_sub_ps(ix0,jx0); |
1138 | dy00 = _mm_sub_ps(iy0,jy0); |
1139 | dz00 = _mm_sub_ps(iz0,jz0); |
1140 | dx01 = _mm_sub_ps(ix0,jx1); |
1141 | dy01 = _mm_sub_ps(iy0,jy1); |
1142 | dz01 = _mm_sub_ps(iz0,jz1); |
1143 | dx02 = _mm_sub_ps(ix0,jx2); |
1144 | dy02 = _mm_sub_ps(iy0,jy2); |
1145 | dz02 = _mm_sub_ps(iz0,jz2); |
1146 | dx10 = _mm_sub_ps(ix1,jx0); |
1147 | dy10 = _mm_sub_ps(iy1,jy0); |
1148 | dz10 = _mm_sub_ps(iz1,jz0); |
1149 | dx11 = _mm_sub_ps(ix1,jx1); |
1150 | dy11 = _mm_sub_ps(iy1,jy1); |
1151 | dz11 = _mm_sub_ps(iz1,jz1); |
1152 | dx12 = _mm_sub_ps(ix1,jx2); |
1153 | dy12 = _mm_sub_ps(iy1,jy2); |
1154 | dz12 = _mm_sub_ps(iz1,jz2); |
1155 | dx20 = _mm_sub_ps(ix2,jx0); |
1156 | dy20 = _mm_sub_ps(iy2,jy0); |
1157 | dz20 = _mm_sub_ps(iz2,jz0); |
1158 | dx21 = _mm_sub_ps(ix2,jx1); |
1159 | dy21 = _mm_sub_ps(iy2,jy1); |
1160 | dz21 = _mm_sub_ps(iz2,jz1); |
1161 | dx22 = _mm_sub_ps(ix2,jx2); |
1162 | dy22 = _mm_sub_ps(iy2,jy2); |
1163 | dz22 = _mm_sub_ps(iz2,jz2); |
1164 | |
1165 | /* Calculate squared distance and things based on it */ |
1166 | rsq00 = gmx_mm_calc_rsq_ps(dx00,dy00,dz00); |
1167 | rsq01 = gmx_mm_calc_rsq_ps(dx01,dy01,dz01); |
1168 | rsq02 = gmx_mm_calc_rsq_ps(dx02,dy02,dz02); |
1169 | rsq10 = gmx_mm_calc_rsq_ps(dx10,dy10,dz10); |
1170 | rsq11 = gmx_mm_calc_rsq_ps(dx11,dy11,dz11); |
1171 | rsq12 = gmx_mm_calc_rsq_ps(dx12,dy12,dz12); |
1172 | rsq20 = gmx_mm_calc_rsq_ps(dx20,dy20,dz20); |
1173 | rsq21 = gmx_mm_calc_rsq_ps(dx21,dy21,dz21); |
1174 | rsq22 = gmx_mm_calc_rsq_ps(dx22,dy22,dz22); |
1175 | |
1176 | rinv00 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq00); |
1177 | rinv01 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq01); |
1178 | rinv02 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq02); |
1179 | rinv10 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq10); |
1180 | rinv11 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq11); |
1181 | rinv12 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq12); |
1182 | rinv20 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq20); |
1183 | rinv21 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq21); |
1184 | rinv22 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq22); |
1185 | |
1186 | rinvsq00 = _mm_mul_ps(rinv00,rinv00); |
1187 | rinvsq01 = _mm_mul_ps(rinv01,rinv01); |
1188 | rinvsq02 = _mm_mul_ps(rinv02,rinv02); |
1189 | rinvsq10 = _mm_mul_ps(rinv10,rinv10); |
1190 | rinvsq11 = _mm_mul_ps(rinv11,rinv11); |
1191 | rinvsq12 = _mm_mul_ps(rinv12,rinv12); |
1192 | rinvsq20 = _mm_mul_ps(rinv20,rinv20); |
1193 | rinvsq21 = _mm_mul_ps(rinv21,rinv21); |
1194 | rinvsq22 = _mm_mul_ps(rinv22,rinv22); |
1195 | |
1196 | fjx0 = _mm_setzero_ps(); |
1197 | fjy0 = _mm_setzero_ps(); |
1198 | fjz0 = _mm_setzero_ps(); |
1199 | fjx1 = _mm_setzero_ps(); |
1200 | fjy1 = _mm_setzero_ps(); |
1201 | fjz1 = _mm_setzero_ps(); |
1202 | fjx2 = _mm_setzero_ps(); |
1203 | fjy2 = _mm_setzero_ps(); |
1204 | fjz2 = _mm_setzero_ps(); |
1205 | |
1206 | /************************** |
1207 | * CALCULATE INTERACTIONS * |
1208 | **************************/ |
1209 | |
1210 | /* COULOMB ELECTROSTATICS */ |
1211 | velec = _mm_mul_ps(qq00,rinv00); |
1212 | felec = _mm_mul_ps(velec,rinvsq00); |
1213 | |
1214 | /* LENNARD-JONES DISPERSION/REPULSION */ |
1215 | |
1216 | rinvsix = _mm_mul_ps(_mm_mul_ps(rinvsq00,rinvsq00),rinvsq00); |
1217 | fvdw = _mm_mul_ps(_mm_sub_ps(_mm_mul_ps(c12_00,rinvsix),c6_00),_mm_mul_ps(rinvsix,rinvsq00)); |
1218 | |
1219 | fscal = _mm_add_ps(felec,fvdw); |
1220 | |
1221 | /* Calculate temporary vectorial force */ |
1222 | tx = _mm_mul_ps(fscal,dx00); |
1223 | ty = _mm_mul_ps(fscal,dy00); |
1224 | tz = _mm_mul_ps(fscal,dz00); |
1225 | |
1226 | /* Update vectorial force */ |
1227 | fix0 = _mm_add_ps(fix0,tx); |
1228 | fiy0 = _mm_add_ps(fiy0,ty); |
1229 | fiz0 = _mm_add_ps(fiz0,tz); |
1230 | |
1231 | fjx0 = _mm_add_ps(fjx0,tx); |
1232 | fjy0 = _mm_add_ps(fjy0,ty); |
1233 | fjz0 = _mm_add_ps(fjz0,tz); |
1234 | |
1235 | /************************** |
1236 | * CALCULATE INTERACTIONS * |
1237 | **************************/ |
1238 | |
1239 | /* COULOMB ELECTROSTATICS */ |
1240 | velec = _mm_mul_ps(qq01,rinv01); |
1241 | felec = _mm_mul_ps(velec,rinvsq01); |
1242 | |
1243 | fscal = felec; |
1244 | |
1245 | /* Calculate temporary vectorial force */ |
1246 | tx = _mm_mul_ps(fscal,dx01); |
1247 | ty = _mm_mul_ps(fscal,dy01); |
1248 | tz = _mm_mul_ps(fscal,dz01); |
1249 | |
1250 | /* Update vectorial force */ |
1251 | fix0 = _mm_add_ps(fix0,tx); |
1252 | fiy0 = _mm_add_ps(fiy0,ty); |
1253 | fiz0 = _mm_add_ps(fiz0,tz); |
1254 | |
1255 | fjx1 = _mm_add_ps(fjx1,tx); |
1256 | fjy1 = _mm_add_ps(fjy1,ty); |
1257 | fjz1 = _mm_add_ps(fjz1,tz); |
1258 | |
1259 | /************************** |
1260 | * CALCULATE INTERACTIONS * |
1261 | **************************/ |
1262 | |
1263 | /* COULOMB ELECTROSTATICS */ |
1264 | velec = _mm_mul_ps(qq02,rinv02); |
1265 | felec = _mm_mul_ps(velec,rinvsq02); |
1266 | |
1267 | fscal = felec; |
1268 | |
1269 | /* Calculate temporary vectorial force */ |
1270 | tx = _mm_mul_ps(fscal,dx02); |
1271 | ty = _mm_mul_ps(fscal,dy02); |
1272 | tz = _mm_mul_ps(fscal,dz02); |
1273 | |
1274 | /* Update vectorial force */ |
1275 | fix0 = _mm_add_ps(fix0,tx); |
1276 | fiy0 = _mm_add_ps(fiy0,ty); |
1277 | fiz0 = _mm_add_ps(fiz0,tz); |
1278 | |
1279 | fjx2 = _mm_add_ps(fjx2,tx); |
1280 | fjy2 = _mm_add_ps(fjy2,ty); |
1281 | fjz2 = _mm_add_ps(fjz2,tz); |
1282 | |
1283 | /************************** |
1284 | * CALCULATE INTERACTIONS * |
1285 | **************************/ |
1286 | |
1287 | /* COULOMB ELECTROSTATICS */ |
1288 | velec = _mm_mul_ps(qq10,rinv10); |
1289 | felec = _mm_mul_ps(velec,rinvsq10); |
1290 | |
1291 | fscal = felec; |
1292 | |
1293 | /* Calculate temporary vectorial force */ |
1294 | tx = _mm_mul_ps(fscal,dx10); |
1295 | ty = _mm_mul_ps(fscal,dy10); |
1296 | tz = _mm_mul_ps(fscal,dz10); |
1297 | |
1298 | /* Update vectorial force */ |
1299 | fix1 = _mm_add_ps(fix1,tx); |
1300 | fiy1 = _mm_add_ps(fiy1,ty); |
1301 | fiz1 = _mm_add_ps(fiz1,tz); |
1302 | |
1303 | fjx0 = _mm_add_ps(fjx0,tx); |
1304 | fjy0 = _mm_add_ps(fjy0,ty); |
1305 | fjz0 = _mm_add_ps(fjz0,tz); |
1306 | |
1307 | /************************** |
1308 | * CALCULATE INTERACTIONS * |
1309 | **************************/ |
1310 | |
1311 | /* COULOMB ELECTROSTATICS */ |
1312 | velec = _mm_mul_ps(qq11,rinv11); |
1313 | felec = _mm_mul_ps(velec,rinvsq11); |
1314 | |
1315 | fscal = felec; |
1316 | |
1317 | /* Calculate temporary vectorial force */ |
1318 | tx = _mm_mul_ps(fscal,dx11); |
1319 | ty = _mm_mul_ps(fscal,dy11); |
1320 | tz = _mm_mul_ps(fscal,dz11); |
1321 | |
1322 | /* Update vectorial force */ |
1323 | fix1 = _mm_add_ps(fix1,tx); |
1324 | fiy1 = _mm_add_ps(fiy1,ty); |
1325 | fiz1 = _mm_add_ps(fiz1,tz); |
1326 | |
1327 | fjx1 = _mm_add_ps(fjx1,tx); |
1328 | fjy1 = _mm_add_ps(fjy1,ty); |
1329 | fjz1 = _mm_add_ps(fjz1,tz); |
1330 | |
1331 | /************************** |
1332 | * CALCULATE INTERACTIONS * |
1333 | **************************/ |
1334 | |
1335 | /* COULOMB ELECTROSTATICS */ |
1336 | velec = _mm_mul_ps(qq12,rinv12); |
1337 | felec = _mm_mul_ps(velec,rinvsq12); |
1338 | |
1339 | fscal = felec; |
1340 | |
1341 | /* Calculate temporary vectorial force */ |
1342 | tx = _mm_mul_ps(fscal,dx12); |
1343 | ty = _mm_mul_ps(fscal,dy12); |
1344 | tz = _mm_mul_ps(fscal,dz12); |
1345 | |
1346 | /* Update vectorial force */ |
1347 | fix1 = _mm_add_ps(fix1,tx); |
1348 | fiy1 = _mm_add_ps(fiy1,ty); |
1349 | fiz1 = _mm_add_ps(fiz1,tz); |
1350 | |
1351 | fjx2 = _mm_add_ps(fjx2,tx); |
1352 | fjy2 = _mm_add_ps(fjy2,ty); |
1353 | fjz2 = _mm_add_ps(fjz2,tz); |
1354 | |
1355 | /************************** |
1356 | * CALCULATE INTERACTIONS * |
1357 | **************************/ |
1358 | |
1359 | /* COULOMB ELECTROSTATICS */ |
1360 | velec = _mm_mul_ps(qq20,rinv20); |
1361 | felec = _mm_mul_ps(velec,rinvsq20); |
1362 | |
1363 | fscal = felec; |
1364 | |
1365 | /* Calculate temporary vectorial force */ |
1366 | tx = _mm_mul_ps(fscal,dx20); |
1367 | ty = _mm_mul_ps(fscal,dy20); |
1368 | tz = _mm_mul_ps(fscal,dz20); |
1369 | |
1370 | /* Update vectorial force */ |
1371 | fix2 = _mm_add_ps(fix2,tx); |
1372 | fiy2 = _mm_add_ps(fiy2,ty); |
1373 | fiz2 = _mm_add_ps(fiz2,tz); |
1374 | |
1375 | fjx0 = _mm_add_ps(fjx0,tx); |
1376 | fjy0 = _mm_add_ps(fjy0,ty); |
1377 | fjz0 = _mm_add_ps(fjz0,tz); |
1378 | |
1379 | /************************** |
1380 | * CALCULATE INTERACTIONS * |
1381 | **************************/ |
1382 | |
1383 | /* COULOMB ELECTROSTATICS */ |
1384 | velec = _mm_mul_ps(qq21,rinv21); |
1385 | felec = _mm_mul_ps(velec,rinvsq21); |
1386 | |
1387 | fscal = felec; |
1388 | |
1389 | /* Calculate temporary vectorial force */ |
1390 | tx = _mm_mul_ps(fscal,dx21); |
1391 | ty = _mm_mul_ps(fscal,dy21); |
1392 | tz = _mm_mul_ps(fscal,dz21); |
1393 | |
1394 | /* Update vectorial force */ |
1395 | fix2 = _mm_add_ps(fix2,tx); |
1396 | fiy2 = _mm_add_ps(fiy2,ty); |
1397 | fiz2 = _mm_add_ps(fiz2,tz); |
1398 | |
1399 | fjx1 = _mm_add_ps(fjx1,tx); |
1400 | fjy1 = _mm_add_ps(fjy1,ty); |
1401 | fjz1 = _mm_add_ps(fjz1,tz); |
1402 | |
1403 | /************************** |
1404 | * CALCULATE INTERACTIONS * |
1405 | **************************/ |
1406 | |
1407 | /* COULOMB ELECTROSTATICS */ |
1408 | velec = _mm_mul_ps(qq22,rinv22); |
1409 | felec = _mm_mul_ps(velec,rinvsq22); |
1410 | |
1411 | fscal = felec; |
1412 | |
1413 | /* Calculate temporary vectorial force */ |
1414 | tx = _mm_mul_ps(fscal,dx22); |
1415 | ty = _mm_mul_ps(fscal,dy22); |
1416 | tz = _mm_mul_ps(fscal,dz22); |
1417 | |
1418 | /* Update vectorial force */ |
1419 | fix2 = _mm_add_ps(fix2,tx); |
1420 | fiy2 = _mm_add_ps(fiy2,ty); |
1421 | fiz2 = _mm_add_ps(fiz2,tz); |
1422 | |
1423 | fjx2 = _mm_add_ps(fjx2,tx); |
1424 | fjy2 = _mm_add_ps(fjy2,ty); |
1425 | fjz2 = _mm_add_ps(fjz2,tz); |
1426 | |
1427 | fjptrA = f+j_coord_offsetA; |
1428 | fjptrB = f+j_coord_offsetB; |
1429 | fjptrC = f+j_coord_offsetC; |
1430 | fjptrD = f+j_coord_offsetD; |
1431 | |
1432 | gmx_mm_decrement_3rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD, |
1433 | fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2); |
1434 | |
1435 | /* Inner loop uses 250 flops */ |
1436 | } |
1437 | |
1438 | if(jidx<j_index_end) |
1439 | { |
1440 | |
1441 | /* Get j neighbor index, and coordinate index */ |
1442 | jnrlistA = jjnr[jidx]; |
1443 | jnrlistB = jjnr[jidx+1]; |
1444 | jnrlistC = jjnr[jidx+2]; |
1445 | jnrlistD = jjnr[jidx+3]; |
1446 | /* Sign of each element will be negative for non-real atoms. |
1447 | * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones, |
1448 | * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries. |
1449 | */ |
1450 | dummy_mask = gmx_mm_castsi128_ps_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128())); |
1451 | jnrA = (jnrlistA>=0) ? jnrlistA : 0; |
1452 | jnrB = (jnrlistB>=0) ? jnrlistB : 0; |
1453 | jnrC = (jnrlistC>=0) ? jnrlistC : 0; |
1454 | jnrD = (jnrlistD>=0) ? jnrlistD : 0; |
1455 | j_coord_offsetA = DIM3*jnrA; |
1456 | j_coord_offsetB = DIM3*jnrB; |
1457 | j_coord_offsetC = DIM3*jnrC; |
1458 | j_coord_offsetD = DIM3*jnrD; |
1459 | |
1460 | /* load j atom coordinates */ |
1461 | gmx_mm_load_3rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB, |
1462 | x+j_coord_offsetC,x+j_coord_offsetD, |
1463 | &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,&jy2,&jz2); |
1464 | |
1465 | /* Calculate displacement vector */ |
1466 | dx00 = _mm_sub_ps(ix0,jx0); |
1467 | dy00 = _mm_sub_ps(iy0,jy0); |
1468 | dz00 = _mm_sub_ps(iz0,jz0); |
1469 | dx01 = _mm_sub_ps(ix0,jx1); |
1470 | dy01 = _mm_sub_ps(iy0,jy1); |
1471 | dz01 = _mm_sub_ps(iz0,jz1); |
1472 | dx02 = _mm_sub_ps(ix0,jx2); |
1473 | dy02 = _mm_sub_ps(iy0,jy2); |
1474 | dz02 = _mm_sub_ps(iz0,jz2); |
1475 | dx10 = _mm_sub_ps(ix1,jx0); |
1476 | dy10 = _mm_sub_ps(iy1,jy0); |
1477 | dz10 = _mm_sub_ps(iz1,jz0); |
1478 | dx11 = _mm_sub_ps(ix1,jx1); |
1479 | dy11 = _mm_sub_ps(iy1,jy1); |
1480 | dz11 = _mm_sub_ps(iz1,jz1); |
1481 | dx12 = _mm_sub_ps(ix1,jx2); |
1482 | dy12 = _mm_sub_ps(iy1,jy2); |
1483 | dz12 = _mm_sub_ps(iz1,jz2); |
1484 | dx20 = _mm_sub_ps(ix2,jx0); |
1485 | dy20 = _mm_sub_ps(iy2,jy0); |
1486 | dz20 = _mm_sub_ps(iz2,jz0); |
1487 | dx21 = _mm_sub_ps(ix2,jx1); |
1488 | dy21 = _mm_sub_ps(iy2,jy1); |
1489 | dz21 = _mm_sub_ps(iz2,jz1); |
1490 | dx22 = _mm_sub_ps(ix2,jx2); |
1491 | dy22 = _mm_sub_ps(iy2,jy2); |
1492 | dz22 = _mm_sub_ps(iz2,jz2); |
1493 | |
1494 | /* Calculate squared distance and things based on it */ |
1495 | rsq00 = gmx_mm_calc_rsq_ps(dx00,dy00,dz00); |
1496 | rsq01 = gmx_mm_calc_rsq_ps(dx01,dy01,dz01); |
1497 | rsq02 = gmx_mm_calc_rsq_ps(dx02,dy02,dz02); |
1498 | rsq10 = gmx_mm_calc_rsq_ps(dx10,dy10,dz10); |
1499 | rsq11 = gmx_mm_calc_rsq_ps(dx11,dy11,dz11); |
1500 | rsq12 = gmx_mm_calc_rsq_ps(dx12,dy12,dz12); |
1501 | rsq20 = gmx_mm_calc_rsq_ps(dx20,dy20,dz20); |
1502 | rsq21 = gmx_mm_calc_rsq_ps(dx21,dy21,dz21); |
1503 | rsq22 = gmx_mm_calc_rsq_ps(dx22,dy22,dz22); |
1504 | |
1505 | rinv00 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq00); |
1506 | rinv01 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq01); |
1507 | rinv02 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq02); |
1508 | rinv10 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq10); |
1509 | rinv11 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq11); |
1510 | rinv12 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq12); |
1511 | rinv20 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq20); |
1512 | rinv21 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq21); |
1513 | rinv22 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq22); |
1514 | |
1515 | rinvsq00 = _mm_mul_ps(rinv00,rinv00); |
1516 | rinvsq01 = _mm_mul_ps(rinv01,rinv01); |
1517 | rinvsq02 = _mm_mul_ps(rinv02,rinv02); |
1518 | rinvsq10 = _mm_mul_ps(rinv10,rinv10); |
1519 | rinvsq11 = _mm_mul_ps(rinv11,rinv11); |
1520 | rinvsq12 = _mm_mul_ps(rinv12,rinv12); |
1521 | rinvsq20 = _mm_mul_ps(rinv20,rinv20); |
1522 | rinvsq21 = _mm_mul_ps(rinv21,rinv21); |
1523 | rinvsq22 = _mm_mul_ps(rinv22,rinv22); |
1524 | |
1525 | fjx0 = _mm_setzero_ps(); |
1526 | fjy0 = _mm_setzero_ps(); |
1527 | fjz0 = _mm_setzero_ps(); |
1528 | fjx1 = _mm_setzero_ps(); |
1529 | fjy1 = _mm_setzero_ps(); |
1530 | fjz1 = _mm_setzero_ps(); |
1531 | fjx2 = _mm_setzero_ps(); |
1532 | fjy2 = _mm_setzero_ps(); |
1533 | fjz2 = _mm_setzero_ps(); |
1534 | |
1535 | /************************** |
1536 | * CALCULATE INTERACTIONS * |
1537 | **************************/ |
1538 | |
1539 | /* COULOMB ELECTROSTATICS */ |
1540 | velec = _mm_mul_ps(qq00,rinv00); |
1541 | felec = _mm_mul_ps(velec,rinvsq00); |
1542 | |
1543 | /* LENNARD-JONES DISPERSION/REPULSION */ |
1544 | |
1545 | rinvsix = _mm_mul_ps(_mm_mul_ps(rinvsq00,rinvsq00),rinvsq00); |
1546 | fvdw = _mm_mul_ps(_mm_sub_ps(_mm_mul_ps(c12_00,rinvsix),c6_00),_mm_mul_ps(rinvsix,rinvsq00)); |
1547 | |
1548 | fscal = _mm_add_ps(felec,fvdw); |
1549 | |
1550 | fscal = _mm_andnot_ps(dummy_mask,fscal); |
1551 | |
1552 | /* Calculate temporary vectorial force */ |
1553 | tx = _mm_mul_ps(fscal,dx00); |
1554 | ty = _mm_mul_ps(fscal,dy00); |
1555 | tz = _mm_mul_ps(fscal,dz00); |
1556 | |
1557 | /* Update vectorial force */ |
1558 | fix0 = _mm_add_ps(fix0,tx); |
1559 | fiy0 = _mm_add_ps(fiy0,ty); |
1560 | fiz0 = _mm_add_ps(fiz0,tz); |
1561 | |
1562 | fjx0 = _mm_add_ps(fjx0,tx); |
1563 | fjy0 = _mm_add_ps(fjy0,ty); |
1564 | fjz0 = _mm_add_ps(fjz0,tz); |
1565 | |
1566 | /************************** |
1567 | * CALCULATE INTERACTIONS * |
1568 | **************************/ |
1569 | |
1570 | /* COULOMB ELECTROSTATICS */ |
1571 | velec = _mm_mul_ps(qq01,rinv01); |
1572 | felec = _mm_mul_ps(velec,rinvsq01); |
1573 | |
1574 | fscal = felec; |
1575 | |
1576 | fscal = _mm_andnot_ps(dummy_mask,fscal); |
1577 | |
1578 | /* Calculate temporary vectorial force */ |
1579 | tx = _mm_mul_ps(fscal,dx01); |
1580 | ty = _mm_mul_ps(fscal,dy01); |
1581 | tz = _mm_mul_ps(fscal,dz01); |
1582 | |
1583 | /* Update vectorial force */ |
1584 | fix0 = _mm_add_ps(fix0,tx); |
1585 | fiy0 = _mm_add_ps(fiy0,ty); |
1586 | fiz0 = _mm_add_ps(fiz0,tz); |
1587 | |
1588 | fjx1 = _mm_add_ps(fjx1,tx); |
1589 | fjy1 = _mm_add_ps(fjy1,ty); |
1590 | fjz1 = _mm_add_ps(fjz1,tz); |
1591 | |
1592 | /************************** |
1593 | * CALCULATE INTERACTIONS * |
1594 | **************************/ |
1595 | |
1596 | /* COULOMB ELECTROSTATICS */ |
1597 | velec = _mm_mul_ps(qq02,rinv02); |
1598 | felec = _mm_mul_ps(velec,rinvsq02); |
1599 | |
1600 | fscal = felec; |
1601 | |
1602 | fscal = _mm_andnot_ps(dummy_mask,fscal); |
1603 | |
1604 | /* Calculate temporary vectorial force */ |
1605 | tx = _mm_mul_ps(fscal,dx02); |
1606 | ty = _mm_mul_ps(fscal,dy02); |
1607 | tz = _mm_mul_ps(fscal,dz02); |
1608 | |
1609 | /* Update vectorial force */ |
1610 | fix0 = _mm_add_ps(fix0,tx); |
1611 | fiy0 = _mm_add_ps(fiy0,ty); |
1612 | fiz0 = _mm_add_ps(fiz0,tz); |
1613 | |
1614 | fjx2 = _mm_add_ps(fjx2,tx); |
1615 | fjy2 = _mm_add_ps(fjy2,ty); |
1616 | fjz2 = _mm_add_ps(fjz2,tz); |
1617 | |
1618 | /************************** |
1619 | * CALCULATE INTERACTIONS * |
1620 | **************************/ |
1621 | |
1622 | /* COULOMB ELECTROSTATICS */ |
1623 | velec = _mm_mul_ps(qq10,rinv10); |
1624 | felec = _mm_mul_ps(velec,rinvsq10); |
1625 | |
1626 | fscal = felec; |
1627 | |
1628 | fscal = _mm_andnot_ps(dummy_mask,fscal); |
1629 | |
1630 | /* Calculate temporary vectorial force */ |
1631 | tx = _mm_mul_ps(fscal,dx10); |
1632 | ty = _mm_mul_ps(fscal,dy10); |
1633 | tz = _mm_mul_ps(fscal,dz10); |
1634 | |
1635 | /* Update vectorial force */ |
1636 | fix1 = _mm_add_ps(fix1,tx); |
1637 | fiy1 = _mm_add_ps(fiy1,ty); |
1638 | fiz1 = _mm_add_ps(fiz1,tz); |
1639 | |
1640 | fjx0 = _mm_add_ps(fjx0,tx); |
1641 | fjy0 = _mm_add_ps(fjy0,ty); |
1642 | fjz0 = _mm_add_ps(fjz0,tz); |
1643 | |
1644 | /************************** |
1645 | * CALCULATE INTERACTIONS * |
1646 | **************************/ |
1647 | |
1648 | /* COULOMB ELECTROSTATICS */ |
1649 | velec = _mm_mul_ps(qq11,rinv11); |
1650 | felec = _mm_mul_ps(velec,rinvsq11); |
1651 | |
1652 | fscal = felec; |
1653 | |
1654 | fscal = _mm_andnot_ps(dummy_mask,fscal); |
1655 | |
1656 | /* Calculate temporary vectorial force */ |
1657 | tx = _mm_mul_ps(fscal,dx11); |
1658 | ty = _mm_mul_ps(fscal,dy11); |
1659 | tz = _mm_mul_ps(fscal,dz11); |
1660 | |
1661 | /* Update vectorial force */ |
1662 | fix1 = _mm_add_ps(fix1,tx); |
1663 | fiy1 = _mm_add_ps(fiy1,ty); |
1664 | fiz1 = _mm_add_ps(fiz1,tz); |
1665 | |
1666 | fjx1 = _mm_add_ps(fjx1,tx); |
1667 | fjy1 = _mm_add_ps(fjy1,ty); |
1668 | fjz1 = _mm_add_ps(fjz1,tz); |
1669 | |
1670 | /************************** |
1671 | * CALCULATE INTERACTIONS * |
1672 | **************************/ |
1673 | |
1674 | /* COULOMB ELECTROSTATICS */ |
1675 | velec = _mm_mul_ps(qq12,rinv12); |
1676 | felec = _mm_mul_ps(velec,rinvsq12); |
1677 | |
1678 | fscal = felec; |
1679 | |
1680 | fscal = _mm_andnot_ps(dummy_mask,fscal); |
1681 | |
1682 | /* Calculate temporary vectorial force */ |
1683 | tx = _mm_mul_ps(fscal,dx12); |
1684 | ty = _mm_mul_ps(fscal,dy12); |
1685 | tz = _mm_mul_ps(fscal,dz12); |
1686 | |
1687 | /* Update vectorial force */ |
1688 | fix1 = _mm_add_ps(fix1,tx); |
1689 | fiy1 = _mm_add_ps(fiy1,ty); |
1690 | fiz1 = _mm_add_ps(fiz1,tz); |
1691 | |
1692 | fjx2 = _mm_add_ps(fjx2,tx); |
1693 | fjy2 = _mm_add_ps(fjy2,ty); |
1694 | fjz2 = _mm_add_ps(fjz2,tz); |
1695 | |
1696 | /************************** |
1697 | * CALCULATE INTERACTIONS * |
1698 | **************************/ |
1699 | |
1700 | /* COULOMB ELECTROSTATICS */ |
1701 | velec = _mm_mul_ps(qq20,rinv20); |
1702 | felec = _mm_mul_ps(velec,rinvsq20); |
1703 | |
1704 | fscal = felec; |
1705 | |
1706 | fscal = _mm_andnot_ps(dummy_mask,fscal); |
1707 | |
1708 | /* Calculate temporary vectorial force */ |
1709 | tx = _mm_mul_ps(fscal,dx20); |
1710 | ty = _mm_mul_ps(fscal,dy20); |
1711 | tz = _mm_mul_ps(fscal,dz20); |
1712 | |
1713 | /* Update vectorial force */ |
1714 | fix2 = _mm_add_ps(fix2,tx); |
1715 | fiy2 = _mm_add_ps(fiy2,ty); |
1716 | fiz2 = _mm_add_ps(fiz2,tz); |
1717 | |
1718 | fjx0 = _mm_add_ps(fjx0,tx); |
1719 | fjy0 = _mm_add_ps(fjy0,ty); |
1720 | fjz0 = _mm_add_ps(fjz0,tz); |
1721 | |
1722 | /************************** |
1723 | * CALCULATE INTERACTIONS * |
1724 | **************************/ |
1725 | |
1726 | /* COULOMB ELECTROSTATICS */ |
1727 | velec = _mm_mul_ps(qq21,rinv21); |
1728 | felec = _mm_mul_ps(velec,rinvsq21); |
1729 | |
1730 | fscal = felec; |
1731 | |
1732 | fscal = _mm_andnot_ps(dummy_mask,fscal); |
1733 | |
1734 | /* Calculate temporary vectorial force */ |
1735 | tx = _mm_mul_ps(fscal,dx21); |
1736 | ty = _mm_mul_ps(fscal,dy21); |
1737 | tz = _mm_mul_ps(fscal,dz21); |
1738 | |
1739 | /* Update vectorial force */ |
1740 | fix2 = _mm_add_ps(fix2,tx); |
1741 | fiy2 = _mm_add_ps(fiy2,ty); |
1742 | fiz2 = _mm_add_ps(fiz2,tz); |
1743 | |
1744 | fjx1 = _mm_add_ps(fjx1,tx); |
1745 | fjy1 = _mm_add_ps(fjy1,ty); |
1746 | fjz1 = _mm_add_ps(fjz1,tz); |
1747 | |
1748 | /************************** |
1749 | * CALCULATE INTERACTIONS * |
1750 | **************************/ |
1751 | |
1752 | /* COULOMB ELECTROSTATICS */ |
1753 | velec = _mm_mul_ps(qq22,rinv22); |
1754 | felec = _mm_mul_ps(velec,rinvsq22); |
1755 | |
1756 | fscal = felec; |
1757 | |
1758 | fscal = _mm_andnot_ps(dummy_mask,fscal); |
1759 | |
1760 | /* Calculate temporary vectorial force */ |
1761 | tx = _mm_mul_ps(fscal,dx22); |
1762 | ty = _mm_mul_ps(fscal,dy22); |
1763 | tz = _mm_mul_ps(fscal,dz22); |
1764 | |
1765 | /* Update vectorial force */ |
1766 | fix2 = _mm_add_ps(fix2,tx); |
1767 | fiy2 = _mm_add_ps(fiy2,ty); |
1768 | fiz2 = _mm_add_ps(fiz2,tz); |
1769 | |
1770 | fjx2 = _mm_add_ps(fjx2,tx); |
1771 | fjy2 = _mm_add_ps(fjy2,ty); |
1772 | fjz2 = _mm_add_ps(fjz2,tz); |
1773 | |
1774 | fjptrA = (jnrlistA>=0) ? f+j_coord_offsetA : scratch; |
1775 | fjptrB = (jnrlistB>=0) ? f+j_coord_offsetB : scratch; |
1776 | fjptrC = (jnrlistC>=0) ? f+j_coord_offsetC : scratch; |
1777 | fjptrD = (jnrlistD>=0) ? f+j_coord_offsetD : scratch; |
1778 | |
1779 | gmx_mm_decrement_3rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD, |
1780 | fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2); |
1781 | |
1782 | /* Inner loop uses 250 flops */ |
1783 | } |
1784 | |
1785 | /* End of innermost loop */ |
1786 | |
1787 | gmx_mm_update_iforce_3atom_swizzle_ps(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2, |
1788 | f+i_coord_offset,fshift+i_shift_offset); |
1789 | |
1790 | /* Increment number of inner iterations */ |
1791 | inneriter += j_index_end - j_index_start; |
1792 | |
1793 | /* Outer loop uses 18 flops */ |
1794 | } |
1795 | |
1796 | /* Increment number of outer iterations */ |
1797 | outeriter += nri; |
1798 | |
1799 | /* Update outer/inner flops */ |
1800 | |
1801 | inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3W3_F,outeriter*18 + inneriter*250)(nrnb)->n[eNR_NBKERNEL_ELEC_VDW_W3W3_F] += outeriter*18 + inneriter *250; |
1802 | } |