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