Bug Summary

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

Annotated Source Code

1/*
2 * This file is part of the GROMACS molecular simulation package.
3 *
4 * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
5 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6 * and including many others, as listed in the AUTHORS file in the
7 * top-level source directory and at http://www.gromacs.org.
8 *
9 * GROMACS is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 2.1
12 * of the License, or (at your option) any later version.
13 *
14 * GROMACS is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with GROMACS; if not, see
21 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 *
24 * If you want to redistribute modifications to GROMACS, please
25 * consider that scientific software is very special. Version
26 * control is crucial - bugs must be traceable. We will be happy to
27 * consider code for inclusion in the official distribution, but
28 * derived work must not be called official GROMACS. Details are found
29 * in the README & COPYING files - if they are missing, get the
30 * official version at http://www.gromacs.org.
31 *
32 * To help us fund GROMACS development, we humbly ask that you cite
33 * the research papers on the package. Check out http://www.gromacs.org.
34 */
35/*
36 * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
37 */
38#ifdef HAVE_CONFIG_H1
39#include <config.h>
40#endif
41
42#include <math.h>
43
44#include "../nb_kernel.h"
45#include "types/simple.h"
46#include "gromacs/math/vec.h"
47#include "nrnb.h"
48
49#include "gromacs/simd/math_x86_sse4_1_single.h"
50#include "kernelutil_x86_sse4_1_single.h"
51
52/*
53 * Gromacs nonbonded kernel: nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_sse4_1_single
54 * Electrostatics interaction: CubicSplineTable
55 * VdW interaction: CubicSplineTable
56 * Geometry: Water4-Water4
57 * Calculate force/pot: PotentialAndForce
58 */
59void
60nb_kernel_ElecCSTab_VdwCSTab_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 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 vdwioffset3;
92 __m128 ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
93 int vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
94 __m128 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
95 int vdwjidx1A,vdwjidx1B,vdwjidx1C,vdwjidx1D;
96 __m128 jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
97 int vdwjidx2A,vdwjidx2B,vdwjidx2C,vdwjidx2D;
98 __m128 jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
99 int vdwjidx3A,vdwjidx3B,vdwjidx3C,vdwjidx3D;
100 __m128 jx3,jy3,jz3,fjx3,fjy3,fjz3,jq3,isaj3;
101 __m128 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
102 __m128 dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11;
103 __m128 dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12;
104 __m128 dx13,dy13,dz13,rsq13,rinv13,rinvsq13,r13,qq13,c6_13,c12_13;
105 __m128 dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21;
106 __m128 dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22;
107 __m128 dx23,dy23,dz23,rsq23,rinv23,rinvsq23,r23,qq23,c6_23,c12_23;
108 __m128 dx31,dy31,dz31,rsq31,rinv31,rinvsq31,r31,qq31,c6_31,c12_31;
109 __m128 dx32,dy32,dz32,rsq32,rinv32,rinvsq32,r32,qq32,c6_32,c12_32;
110 __m128 dx33,dy33,dz33,rsq33,rinv33,rinvsq33,r33,qq33,c6_33,c12_33;
111 __m128 velec,felec,velecsum,facel,crf,krf,krf2;
112 real *charge;
113 int nvdwtype;
114 __m128 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
115 int *vdwtype;
116 real *vdwparam;
117 __m128 one_sixth = _mm_set1_ps(1.0/6.0);
118 __m128 one_twelfth = _mm_set1_ps(1.0/12.0);
119 __m128i vfitab;
120 __m128i ifour = _mm_set1_epi32(4);
121 __m128 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
122 real *vftab;
123 __m128 dummy_mask,cutoff_mask;
124 __m128 signbit = _mm_castsi128_ps( _mm_set1_epi32(0x80000000) );
125 __m128 one = _mm_set1_ps(1.0);
126 __m128 two = _mm_set1_ps(2.0);
127 x = xx[0];
128 f = ff[0];
129
130 nri = nlist->nri;
131 iinr = nlist->iinr;
132 jindex = nlist->jindex;
133 jjnr = nlist->jjnr;
134 shiftidx = nlist->shift;
135 gid = nlist->gid;
136 shiftvec = fr->shift_vec[0];
137 fshift = fr->fshift[0];
138 facel = _mm_set1_ps(fr->epsfac);
139 charge = mdatoms->chargeA;
140 nvdwtype = fr->ntype;
141 vdwparam = fr->nbfp;
142 vdwtype = mdatoms->typeA;
143
144 vftab = kernel_data->table_elec_vdw->data;
145 vftabscale = _mm_set1_ps(kernel_data->table_elec_vdw->scale);
146
147 /* Setup water-specific parameters */
148 inr = nlist->iinr[0];
149 iq1 = _mm_mul_ps(facel,_mm_set1_ps(charge[inr+1]));
150 iq2 = _mm_mul_ps(facel,_mm_set1_ps(charge[inr+2]));
151 iq3 = _mm_mul_ps(facel,_mm_set1_ps(charge[inr+3]));
152 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
153
154 jq1 = _mm_set1_ps(charge[inr+1]);
155 jq2 = _mm_set1_ps(charge[inr+2]);
156 jq3 = _mm_set1_ps(charge[inr+3]);
157 vdwjidx0A = 2*vdwtype[inr+0];
158 c6_00 = _mm_set1_ps(vdwparam[vdwioffset0+vdwjidx0A]);
159 c12_00 = _mm_set1_ps(vdwparam[vdwioffset0+vdwjidx0A+1]);
160 qq11 = _mm_mul_ps(iq1,jq1);
161 qq12 = _mm_mul_ps(iq1,jq2);
162 qq13 = _mm_mul_ps(iq1,jq3);
163 qq21 = _mm_mul_ps(iq2,jq1);
164 qq22 = _mm_mul_ps(iq2,jq2);
165 qq23 = _mm_mul_ps(iq2,jq3);
166 qq31 = _mm_mul_ps(iq3,jq1);
167 qq32 = _mm_mul_ps(iq3,jq2);
168 qq33 = _mm_mul_ps(iq3,jq3);
169
170 /* Avoid stupid compiler warnings */
171 jnrA = jnrB = jnrC = jnrD = 0;
172 j_coord_offsetA = 0;
173 j_coord_offsetB = 0;
174 j_coord_offsetC = 0;
175 j_coord_offsetD = 0;
176
177 outeriter = 0;
178 inneriter = 0;
179
180 for(iidx=0;iidx<4*DIM3;iidx++)
181 {
182 scratch[iidx] = 0.0;
183 }
184
185 /* Start outer loop over neighborlists */
186 for(iidx=0; iidx<nri; iidx++)
187 {
188 /* Load shift vector for this list */
189 i_shift_offset = DIM3*shiftidx[iidx];
190
191 /* Load limits for loop over neighbors */
192 j_index_start = jindex[iidx];
193 j_index_end = jindex[iidx+1];
194
195 /* Get outer coordinate index */
196 inr = iinr[iidx];
197 i_coord_offset = DIM3*inr;
198
199 /* Load i particle coords and add shift vector */
200 gmx_mm_load_shift_and_4rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,
201 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
202
203 fix0 = _mm_setzero_ps();
204 fiy0 = _mm_setzero_ps();
205 fiz0 = _mm_setzero_ps();
206 fix1 = _mm_setzero_ps();
207 fiy1 = _mm_setzero_ps();
208 fiz1 = _mm_setzero_ps();
209 fix2 = _mm_setzero_ps();
210 fiy2 = _mm_setzero_ps();
211 fiz2 = _mm_setzero_ps();
212 fix3 = _mm_setzero_ps();
213 fiy3 = _mm_setzero_ps();
214 fiz3 = _mm_setzero_ps();
215
216 /* Reset potential sums */
217 velecsum = _mm_setzero_ps();
218 vvdwsum = _mm_setzero_ps();
219
220 /* Start inner kernel loop */
221 for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
222 {
223
224 /* Get j neighbor index, and coordinate index */
225 jnrA = jjnr[jidx];
226 jnrB = jjnr[jidx+1];
227 jnrC = jjnr[jidx+2];
228 jnrD = jjnr[jidx+3];
229 j_coord_offsetA = DIM3*jnrA;
230 j_coord_offsetB = DIM3*jnrB;
231 j_coord_offsetC = DIM3*jnrC;
232 j_coord_offsetD = DIM3*jnrD;
233
234 /* load j atom coordinates */
235 gmx_mm_load_4rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
236 x+j_coord_offsetC,x+j_coord_offsetD,
237 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,
238 &jy2,&jz2,&jx3,&jy3,&jz3);
239
240 /* Calculate displacement vector */
241 dx00 = _mm_sub_ps(ix0,jx0);
242 dy00 = _mm_sub_ps(iy0,jy0);
243 dz00 = _mm_sub_ps(iz0,jz0);
244 dx11 = _mm_sub_ps(ix1,jx1);
245 dy11 = _mm_sub_ps(iy1,jy1);
246 dz11 = _mm_sub_ps(iz1,jz1);
247 dx12 = _mm_sub_ps(ix1,jx2);
248 dy12 = _mm_sub_ps(iy1,jy2);
249 dz12 = _mm_sub_ps(iz1,jz2);
250 dx13 = _mm_sub_ps(ix1,jx3);
251 dy13 = _mm_sub_ps(iy1,jy3);
252 dz13 = _mm_sub_ps(iz1,jz3);
253 dx21 = _mm_sub_ps(ix2,jx1);
254 dy21 = _mm_sub_ps(iy2,jy1);
255 dz21 = _mm_sub_ps(iz2,jz1);
256 dx22 = _mm_sub_ps(ix2,jx2);
257 dy22 = _mm_sub_ps(iy2,jy2);
258 dz22 = _mm_sub_ps(iz2,jz2);
259 dx23 = _mm_sub_ps(ix2,jx3);
260 dy23 = _mm_sub_ps(iy2,jy3);
261 dz23 = _mm_sub_ps(iz2,jz3);
262 dx31 = _mm_sub_ps(ix3,jx1);
263 dy31 = _mm_sub_ps(iy3,jy1);
264 dz31 = _mm_sub_ps(iz3,jz1);
265 dx32 = _mm_sub_ps(ix3,jx2);
266 dy32 = _mm_sub_ps(iy3,jy2);
267 dz32 = _mm_sub_ps(iz3,jz2);
268 dx33 = _mm_sub_ps(ix3,jx3);
269 dy33 = _mm_sub_ps(iy3,jy3);
270 dz33 = _mm_sub_ps(iz3,jz3);
271
272 /* Calculate squared distance and things based on it */
273 rsq00 = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
274 rsq11 = gmx_mm_calc_rsq_ps(dx11,dy11,dz11);
275 rsq12 = gmx_mm_calc_rsq_ps(dx12,dy12,dz12);
276 rsq13 = gmx_mm_calc_rsq_ps(dx13,dy13,dz13);
277 rsq21 = gmx_mm_calc_rsq_ps(dx21,dy21,dz21);
278 rsq22 = gmx_mm_calc_rsq_ps(dx22,dy22,dz22);
279 rsq23 = gmx_mm_calc_rsq_ps(dx23,dy23,dz23);
280 rsq31 = gmx_mm_calc_rsq_ps(dx31,dy31,dz31);
281 rsq32 = gmx_mm_calc_rsq_ps(dx32,dy32,dz32);
282 rsq33 = gmx_mm_calc_rsq_ps(dx33,dy33,dz33);
283
284 rinv00 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq00);
285 rinv11 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq11);
286 rinv12 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq12);
287 rinv13 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq13);
288 rinv21 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq21);
289 rinv22 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq22);
290 rinv23 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq23);
291 rinv31 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq31);
292 rinv32 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq32);
293 rinv33 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq33);
294
295 fjx0 = _mm_setzero_ps();
296 fjy0 = _mm_setzero_ps();
297 fjz0 = _mm_setzero_ps();
298 fjx1 = _mm_setzero_ps();
299 fjy1 = _mm_setzero_ps();
300 fjz1 = _mm_setzero_ps();
301 fjx2 = _mm_setzero_ps();
302 fjy2 = _mm_setzero_ps();
303 fjz2 = _mm_setzero_ps();
304 fjx3 = _mm_setzero_ps();
305 fjy3 = _mm_setzero_ps();
306 fjz3 = _mm_setzero_ps();
307
308 /**************************
309 * CALCULATE INTERACTIONS *
310 **************************/
311
312 r00 = _mm_mul_ps(rsq00,rinv00);
313
314 /* Calculate table index by multiplying r with table scale and truncate to integer */
315 rt = _mm_mul_ps(r00,vftabscale);
316 vfitab = _mm_cvttps_epi32(rt);
317 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
318 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
319
320 /* CUBIC SPLINE TABLE DISPERSION */
321 vfitab = _mm_add_epi32(vfitab,ifour);
322 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
323 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
324 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
325 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
326 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
327 Heps = _mm_mul_ps(vfeps,H);
328 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
329 VV = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
330 vvdw6 = _mm_mul_ps(c6_00,VV);
331 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
332 fvdw6 = _mm_mul_ps(c6_00,FF);
333
334 /* CUBIC SPLINE TABLE REPULSION */
335 vfitab = _mm_add_epi32(vfitab,ifour);
336 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
337 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
338 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
339 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
340 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
341 Heps = _mm_mul_ps(vfeps,H);
342 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
343 VV = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
344 vvdw12 = _mm_mul_ps(c12_00,VV);
345 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
346 fvdw12 = _mm_mul_ps(c12_00,FF);
347 vvdw = _mm_add_ps(vvdw12,vvdw6);
348 fvdw = _mm_xor_ps(signbit,_mm_mul_ps(_mm_add_ps(fvdw6,fvdw12),_mm_mul_ps(vftabscale,rinv00)));
349
350 /* Update potential sum for this i atom from the interaction with this j atom. */
351 vvdwsum = _mm_add_ps(vvdwsum,vvdw);
352
353 fscal = fvdw;
354
355 /* Calculate temporary vectorial force */
356 tx = _mm_mul_ps(fscal,dx00);
357 ty = _mm_mul_ps(fscal,dy00);
358 tz = _mm_mul_ps(fscal,dz00);
359
360 /* Update vectorial force */
361 fix0 = _mm_add_ps(fix0,tx);
362 fiy0 = _mm_add_ps(fiy0,ty);
363 fiz0 = _mm_add_ps(fiz0,tz);
364
365 fjx0 = _mm_add_ps(fjx0,tx);
366 fjy0 = _mm_add_ps(fjy0,ty);
367 fjz0 = _mm_add_ps(fjz0,tz);
368
369 /**************************
370 * CALCULATE INTERACTIONS *
371 **************************/
372
373 r11 = _mm_mul_ps(rsq11,rinv11);
374
375 /* Calculate table index by multiplying r with table scale and truncate to integer */
376 rt = _mm_mul_ps(r11,vftabscale);
377 vfitab = _mm_cvttps_epi32(rt);
378 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
379 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
380
381 /* CUBIC SPLINE TABLE ELECTROSTATICS */
382 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
383 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
384 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
385 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
386 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
387 Heps = _mm_mul_ps(vfeps,H);
388 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
389 VV = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
390 velec = _mm_mul_ps(qq11,VV);
391 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
392 felec = _mm_xor_ps(signbit,_mm_mul_ps(_mm_mul_ps(qq11,FF),_mm_mul_ps(vftabscale,rinv11)));
393
394 /* Update potential sum for this i atom from the interaction with this j atom. */
395 velecsum = _mm_add_ps(velecsum,velec);
396
397 fscal = felec;
398
399 /* Calculate temporary vectorial force */
400 tx = _mm_mul_ps(fscal,dx11);
401 ty = _mm_mul_ps(fscal,dy11);
402 tz = _mm_mul_ps(fscal,dz11);
403
404 /* Update vectorial force */
405 fix1 = _mm_add_ps(fix1,tx);
406 fiy1 = _mm_add_ps(fiy1,ty);
407 fiz1 = _mm_add_ps(fiz1,tz);
408
409 fjx1 = _mm_add_ps(fjx1,tx);
410 fjy1 = _mm_add_ps(fjy1,ty);
411 fjz1 = _mm_add_ps(fjz1,tz);
412
413 /**************************
414 * CALCULATE INTERACTIONS *
415 **************************/
416
417 r12 = _mm_mul_ps(rsq12,rinv12);
418
419 /* Calculate table index by multiplying r with table scale and truncate to integer */
420 rt = _mm_mul_ps(r12,vftabscale);
421 vfitab = _mm_cvttps_epi32(rt);
422 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
423 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
424
425 /* CUBIC SPLINE TABLE ELECTROSTATICS */
426 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
427 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
428 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
429 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
430 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
431 Heps = _mm_mul_ps(vfeps,H);
432 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
433 VV = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
434 velec = _mm_mul_ps(qq12,VV);
435 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
436 felec = _mm_xor_ps(signbit,_mm_mul_ps(_mm_mul_ps(qq12,FF),_mm_mul_ps(vftabscale,rinv12)));
437
438 /* Update potential sum for this i atom from the interaction with this j atom. */
439 velecsum = _mm_add_ps(velecsum,velec);
440
441 fscal = felec;
442
443 /* Calculate temporary vectorial force */
444 tx = _mm_mul_ps(fscal,dx12);
445 ty = _mm_mul_ps(fscal,dy12);
446 tz = _mm_mul_ps(fscal,dz12);
447
448 /* Update vectorial force */
449 fix1 = _mm_add_ps(fix1,tx);
450 fiy1 = _mm_add_ps(fiy1,ty);
451 fiz1 = _mm_add_ps(fiz1,tz);
452
453 fjx2 = _mm_add_ps(fjx2,tx);
454 fjy2 = _mm_add_ps(fjy2,ty);
455 fjz2 = _mm_add_ps(fjz2,tz);
456
457 /**************************
458 * CALCULATE INTERACTIONS *
459 **************************/
460
461 r13 = _mm_mul_ps(rsq13,rinv13);
462
463 /* Calculate table index by multiplying r with table scale and truncate to integer */
464 rt = _mm_mul_ps(r13,vftabscale);
465 vfitab = _mm_cvttps_epi32(rt);
466 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
467 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
468
469 /* CUBIC SPLINE TABLE ELECTROSTATICS */
470 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
471 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
472 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
473 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
474 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
475 Heps = _mm_mul_ps(vfeps,H);
476 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
477 VV = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
478 velec = _mm_mul_ps(qq13,VV);
479 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
480 felec = _mm_xor_ps(signbit,_mm_mul_ps(_mm_mul_ps(qq13,FF),_mm_mul_ps(vftabscale,rinv13)));
481
482 /* Update potential sum for this i atom from the interaction with this j atom. */
483 velecsum = _mm_add_ps(velecsum,velec);
484
485 fscal = felec;
486
487 /* Calculate temporary vectorial force */
488 tx = _mm_mul_ps(fscal,dx13);
489 ty = _mm_mul_ps(fscal,dy13);
490 tz = _mm_mul_ps(fscal,dz13);
491
492 /* Update vectorial force */
493 fix1 = _mm_add_ps(fix1,tx);
494 fiy1 = _mm_add_ps(fiy1,ty);
495 fiz1 = _mm_add_ps(fiz1,tz);
496
497 fjx3 = _mm_add_ps(fjx3,tx);
498 fjy3 = _mm_add_ps(fjy3,ty);
499 fjz3 = _mm_add_ps(fjz3,tz);
500
501 /**************************
502 * CALCULATE INTERACTIONS *
503 **************************/
504
505 r21 = _mm_mul_ps(rsq21,rinv21);
506
507 /* Calculate table index by multiplying r with table scale and truncate to integer */
508 rt = _mm_mul_ps(r21,vftabscale);
509 vfitab = _mm_cvttps_epi32(rt);
510 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
511 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
512
513 /* CUBIC SPLINE TABLE ELECTROSTATICS */
514 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
515 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
516 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
517 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
518 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
519 Heps = _mm_mul_ps(vfeps,H);
520 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
521 VV = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
522 velec = _mm_mul_ps(qq21,VV);
523 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
524 felec = _mm_xor_ps(signbit,_mm_mul_ps(_mm_mul_ps(qq21,FF),_mm_mul_ps(vftabscale,rinv21)));
525
526 /* Update potential sum for this i atom from the interaction with this j atom. */
527 velecsum = _mm_add_ps(velecsum,velec);
528
529 fscal = felec;
530
531 /* Calculate temporary vectorial force */
532 tx = _mm_mul_ps(fscal,dx21);
533 ty = _mm_mul_ps(fscal,dy21);
534 tz = _mm_mul_ps(fscal,dz21);
535
536 /* Update vectorial force */
537 fix2 = _mm_add_ps(fix2,tx);
538 fiy2 = _mm_add_ps(fiy2,ty);
539 fiz2 = _mm_add_ps(fiz2,tz);
540
541 fjx1 = _mm_add_ps(fjx1,tx);
542 fjy1 = _mm_add_ps(fjy1,ty);
543 fjz1 = _mm_add_ps(fjz1,tz);
544
545 /**************************
546 * CALCULATE INTERACTIONS *
547 **************************/
548
549 r22 = _mm_mul_ps(rsq22,rinv22);
550
551 /* Calculate table index by multiplying r with table scale and truncate to integer */
552 rt = _mm_mul_ps(r22,vftabscale);
553 vfitab = _mm_cvttps_epi32(rt);
554 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
555 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
556
557 /* CUBIC SPLINE TABLE ELECTROSTATICS */
558 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
559 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
560 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
561 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
562 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
563 Heps = _mm_mul_ps(vfeps,H);
564 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
565 VV = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
566 velec = _mm_mul_ps(qq22,VV);
567 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
568 felec = _mm_xor_ps(signbit,_mm_mul_ps(_mm_mul_ps(qq22,FF),_mm_mul_ps(vftabscale,rinv22)));
569
570 /* Update potential sum for this i atom from the interaction with this j atom. */
571 velecsum = _mm_add_ps(velecsum,velec);
572
573 fscal = felec;
574
575 /* Calculate temporary vectorial force */
576 tx = _mm_mul_ps(fscal,dx22);
577 ty = _mm_mul_ps(fscal,dy22);
578 tz = _mm_mul_ps(fscal,dz22);
579
580 /* Update vectorial force */
581 fix2 = _mm_add_ps(fix2,tx);
582 fiy2 = _mm_add_ps(fiy2,ty);
583 fiz2 = _mm_add_ps(fiz2,tz);
584
585 fjx2 = _mm_add_ps(fjx2,tx);
586 fjy2 = _mm_add_ps(fjy2,ty);
587 fjz2 = _mm_add_ps(fjz2,tz);
588
589 /**************************
590 * CALCULATE INTERACTIONS *
591 **************************/
592
593 r23 = _mm_mul_ps(rsq23,rinv23);
594
595 /* Calculate table index by multiplying r with table scale and truncate to integer */
596 rt = _mm_mul_ps(r23,vftabscale);
597 vfitab = _mm_cvttps_epi32(rt);
598 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
599 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
600
601 /* CUBIC SPLINE TABLE ELECTROSTATICS */
602 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
603 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
604 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
605 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
606 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
607 Heps = _mm_mul_ps(vfeps,H);
608 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
609 VV = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
610 velec = _mm_mul_ps(qq23,VV);
611 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
612 felec = _mm_xor_ps(signbit,_mm_mul_ps(_mm_mul_ps(qq23,FF),_mm_mul_ps(vftabscale,rinv23)));
613
614 /* Update potential sum for this i atom from the interaction with this j atom. */
615 velecsum = _mm_add_ps(velecsum,velec);
616
617 fscal = felec;
618
619 /* Calculate temporary vectorial force */
620 tx = _mm_mul_ps(fscal,dx23);
621 ty = _mm_mul_ps(fscal,dy23);
622 tz = _mm_mul_ps(fscal,dz23);
623
624 /* Update vectorial force */
625 fix2 = _mm_add_ps(fix2,tx);
626 fiy2 = _mm_add_ps(fiy2,ty);
627 fiz2 = _mm_add_ps(fiz2,tz);
628
629 fjx3 = _mm_add_ps(fjx3,tx);
630 fjy3 = _mm_add_ps(fjy3,ty);
631 fjz3 = _mm_add_ps(fjz3,tz);
632
633 /**************************
634 * CALCULATE INTERACTIONS *
635 **************************/
636
637 r31 = _mm_mul_ps(rsq31,rinv31);
638
639 /* Calculate table index by multiplying r with table scale and truncate to integer */
640 rt = _mm_mul_ps(r31,vftabscale);
641 vfitab = _mm_cvttps_epi32(rt);
642 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
643 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
644
645 /* CUBIC SPLINE TABLE ELECTROSTATICS */
646 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
647 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
648 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
649 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
650 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
651 Heps = _mm_mul_ps(vfeps,H);
652 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
653 VV = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
654 velec = _mm_mul_ps(qq31,VV);
655 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
656 felec = _mm_xor_ps(signbit,_mm_mul_ps(_mm_mul_ps(qq31,FF),_mm_mul_ps(vftabscale,rinv31)));
657
658 /* Update potential sum for this i atom from the interaction with this j atom. */
659 velecsum = _mm_add_ps(velecsum,velec);
660
661 fscal = felec;
662
663 /* Calculate temporary vectorial force */
664 tx = _mm_mul_ps(fscal,dx31);
665 ty = _mm_mul_ps(fscal,dy31);
666 tz = _mm_mul_ps(fscal,dz31);
667
668 /* Update vectorial force */
669 fix3 = _mm_add_ps(fix3,tx);
670 fiy3 = _mm_add_ps(fiy3,ty);
671 fiz3 = _mm_add_ps(fiz3,tz);
672
673 fjx1 = _mm_add_ps(fjx1,tx);
674 fjy1 = _mm_add_ps(fjy1,ty);
675 fjz1 = _mm_add_ps(fjz1,tz);
676
677 /**************************
678 * CALCULATE INTERACTIONS *
679 **************************/
680
681 r32 = _mm_mul_ps(rsq32,rinv32);
682
683 /* Calculate table index by multiplying r with table scale and truncate to integer */
684 rt = _mm_mul_ps(r32,vftabscale);
685 vfitab = _mm_cvttps_epi32(rt);
686 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
687 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
688
689 /* CUBIC SPLINE TABLE ELECTROSTATICS */
690 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
691 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
692 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
693 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
694 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
695 Heps = _mm_mul_ps(vfeps,H);
696 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
697 VV = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
698 velec = _mm_mul_ps(qq32,VV);
699 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
700 felec = _mm_xor_ps(signbit,_mm_mul_ps(_mm_mul_ps(qq32,FF),_mm_mul_ps(vftabscale,rinv32)));
701
702 /* Update potential sum for this i atom from the interaction with this j atom. */
703 velecsum = _mm_add_ps(velecsum,velec);
704
705 fscal = felec;
706
707 /* Calculate temporary vectorial force */
708 tx = _mm_mul_ps(fscal,dx32);
709 ty = _mm_mul_ps(fscal,dy32);
710 tz = _mm_mul_ps(fscal,dz32);
711
712 /* Update vectorial force */
713 fix3 = _mm_add_ps(fix3,tx);
714 fiy3 = _mm_add_ps(fiy3,ty);
715 fiz3 = _mm_add_ps(fiz3,tz);
716
717 fjx2 = _mm_add_ps(fjx2,tx);
718 fjy2 = _mm_add_ps(fjy2,ty);
719 fjz2 = _mm_add_ps(fjz2,tz);
720
721 /**************************
722 * CALCULATE INTERACTIONS *
723 **************************/
724
725 r33 = _mm_mul_ps(rsq33,rinv33);
726
727 /* Calculate table index by multiplying r with table scale and truncate to integer */
728 rt = _mm_mul_ps(r33,vftabscale);
729 vfitab = _mm_cvttps_epi32(rt);
730 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
731 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
732
733 /* CUBIC SPLINE TABLE ELECTROSTATICS */
734 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
735 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
736 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
737 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
738 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
739 Heps = _mm_mul_ps(vfeps,H);
740 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
741 VV = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
742 velec = _mm_mul_ps(qq33,VV);
743 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
744 felec = _mm_xor_ps(signbit,_mm_mul_ps(_mm_mul_ps(qq33,FF),_mm_mul_ps(vftabscale,rinv33)));
745
746 /* Update potential sum for this i atom from the interaction with this j atom. */
747 velecsum = _mm_add_ps(velecsum,velec);
748
749 fscal = felec;
750
751 /* Calculate temporary vectorial force */
752 tx = _mm_mul_ps(fscal,dx33);
753 ty = _mm_mul_ps(fscal,dy33);
754 tz = _mm_mul_ps(fscal,dz33);
755
756 /* Update vectorial force */
757 fix3 = _mm_add_ps(fix3,tx);
758 fiy3 = _mm_add_ps(fiy3,ty);
759 fiz3 = _mm_add_ps(fiz3,tz);
760
761 fjx3 = _mm_add_ps(fjx3,tx);
762 fjy3 = _mm_add_ps(fjy3,ty);
763 fjz3 = _mm_add_ps(fjz3,tz);
764
765 fjptrA = f+j_coord_offsetA;
766 fjptrB = f+j_coord_offsetB;
767 fjptrC = f+j_coord_offsetC;
768 fjptrD = f+j_coord_offsetD;
769
770 gmx_mm_decrement_4rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,
771 fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,
772 fjx2,fjy2,fjz2,fjx3,fjy3,fjz3);
773
774 /* Inner loop uses 446 flops */
775 }
776
777 if(jidx<j_index_end)
778 {
779
780 /* Get j neighbor index, and coordinate index */
781 jnrlistA = jjnr[jidx];
782 jnrlistB = jjnr[jidx+1];
783 jnrlistC = jjnr[jidx+2];
784 jnrlistD = jjnr[jidx+3];
785 /* Sign of each element will be negative for non-real atoms.
786 * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
787 * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
788 */
789 dummy_mask = gmx_mm_castsi128_ps_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
790 jnrA = (jnrlistA>=0) ? jnrlistA : 0;
791 jnrB = (jnrlistB>=0) ? jnrlistB : 0;
792 jnrC = (jnrlistC>=0) ? jnrlistC : 0;
793 jnrD = (jnrlistD>=0) ? jnrlistD : 0;
794 j_coord_offsetA = DIM3*jnrA;
795 j_coord_offsetB = DIM3*jnrB;
796 j_coord_offsetC = DIM3*jnrC;
797 j_coord_offsetD = DIM3*jnrD;
798
799 /* load j atom coordinates */
800 gmx_mm_load_4rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
801 x+j_coord_offsetC,x+j_coord_offsetD,
802 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,
803 &jy2,&jz2,&jx3,&jy3,&jz3);
804
805 /* Calculate displacement vector */
806 dx00 = _mm_sub_ps(ix0,jx0);
807 dy00 = _mm_sub_ps(iy0,jy0);
808 dz00 = _mm_sub_ps(iz0,jz0);
809 dx11 = _mm_sub_ps(ix1,jx1);
810 dy11 = _mm_sub_ps(iy1,jy1);
811 dz11 = _mm_sub_ps(iz1,jz1);
812 dx12 = _mm_sub_ps(ix1,jx2);
813 dy12 = _mm_sub_ps(iy1,jy2);
814 dz12 = _mm_sub_ps(iz1,jz2);
815 dx13 = _mm_sub_ps(ix1,jx3);
816 dy13 = _mm_sub_ps(iy1,jy3);
817 dz13 = _mm_sub_ps(iz1,jz3);
818 dx21 = _mm_sub_ps(ix2,jx1);
819 dy21 = _mm_sub_ps(iy2,jy1);
820 dz21 = _mm_sub_ps(iz2,jz1);
821 dx22 = _mm_sub_ps(ix2,jx2);
822 dy22 = _mm_sub_ps(iy2,jy2);
823 dz22 = _mm_sub_ps(iz2,jz2);
824 dx23 = _mm_sub_ps(ix2,jx3);
825 dy23 = _mm_sub_ps(iy2,jy3);
826 dz23 = _mm_sub_ps(iz2,jz3);
827 dx31 = _mm_sub_ps(ix3,jx1);
828 dy31 = _mm_sub_ps(iy3,jy1);
829 dz31 = _mm_sub_ps(iz3,jz1);
830 dx32 = _mm_sub_ps(ix3,jx2);
831 dy32 = _mm_sub_ps(iy3,jy2);
832 dz32 = _mm_sub_ps(iz3,jz2);
833 dx33 = _mm_sub_ps(ix3,jx3);
834 dy33 = _mm_sub_ps(iy3,jy3);
835 dz33 = _mm_sub_ps(iz3,jz3);
836
837 /* Calculate squared distance and things based on it */
838 rsq00 = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
839 rsq11 = gmx_mm_calc_rsq_ps(dx11,dy11,dz11);
840 rsq12 = gmx_mm_calc_rsq_ps(dx12,dy12,dz12);
841 rsq13 = gmx_mm_calc_rsq_ps(dx13,dy13,dz13);
842 rsq21 = gmx_mm_calc_rsq_ps(dx21,dy21,dz21);
843 rsq22 = gmx_mm_calc_rsq_ps(dx22,dy22,dz22);
844 rsq23 = gmx_mm_calc_rsq_ps(dx23,dy23,dz23);
845 rsq31 = gmx_mm_calc_rsq_ps(dx31,dy31,dz31);
846 rsq32 = gmx_mm_calc_rsq_ps(dx32,dy32,dz32);
847 rsq33 = gmx_mm_calc_rsq_ps(dx33,dy33,dz33);
848
849 rinv00 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq00);
850 rinv11 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq11);
851 rinv12 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq12);
852 rinv13 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq13);
853 rinv21 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq21);
854 rinv22 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq22);
855 rinv23 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq23);
856 rinv31 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq31);
857 rinv32 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq32);
858 rinv33 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq33);
859
860 fjx0 = _mm_setzero_ps();
861 fjy0 = _mm_setzero_ps();
862 fjz0 = _mm_setzero_ps();
863 fjx1 = _mm_setzero_ps();
864 fjy1 = _mm_setzero_ps();
865 fjz1 = _mm_setzero_ps();
866 fjx2 = _mm_setzero_ps();
867 fjy2 = _mm_setzero_ps();
868 fjz2 = _mm_setzero_ps();
869 fjx3 = _mm_setzero_ps();
870 fjy3 = _mm_setzero_ps();
871 fjz3 = _mm_setzero_ps();
872
873 /**************************
874 * CALCULATE INTERACTIONS *
875 **************************/
876
877 r00 = _mm_mul_ps(rsq00,rinv00);
878 r00 = _mm_andnot_ps(dummy_mask,r00);
879
880 /* Calculate table index by multiplying r with table scale and truncate to integer */
881 rt = _mm_mul_ps(r00,vftabscale);
882 vfitab = _mm_cvttps_epi32(rt);
883 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
884 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
885
886 /* CUBIC SPLINE TABLE DISPERSION */
887 vfitab = _mm_add_epi32(vfitab,ifour);
888 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
889 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
890 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
891 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
892 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
893 Heps = _mm_mul_ps(vfeps,H);
894 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
895 VV = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
896 vvdw6 = _mm_mul_ps(c6_00,VV);
897 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
898 fvdw6 = _mm_mul_ps(c6_00,FF);
899
900 /* CUBIC SPLINE TABLE REPULSION */
901 vfitab = _mm_add_epi32(vfitab,ifour);
902 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
903 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
904 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
905 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
906 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
907 Heps = _mm_mul_ps(vfeps,H);
908 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
909 VV = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
910 vvdw12 = _mm_mul_ps(c12_00,VV);
911 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
912 fvdw12 = _mm_mul_ps(c12_00,FF);
913 vvdw = _mm_add_ps(vvdw12,vvdw6);
914 fvdw = _mm_xor_ps(signbit,_mm_mul_ps(_mm_add_ps(fvdw6,fvdw12),_mm_mul_ps(vftabscale,rinv00)));
915
916 /* Update potential sum for this i atom from the interaction with this j atom. */
917 vvdw = _mm_andnot_ps(dummy_mask,vvdw);
918 vvdwsum = _mm_add_ps(vvdwsum,vvdw);
919
920 fscal = fvdw;
921
922 fscal = _mm_andnot_ps(dummy_mask,fscal);
923
924 /* Calculate temporary vectorial force */
925 tx = _mm_mul_ps(fscal,dx00);
926 ty = _mm_mul_ps(fscal,dy00);
927 tz = _mm_mul_ps(fscal,dz00);
928
929 /* Update vectorial force */
930 fix0 = _mm_add_ps(fix0,tx);
931 fiy0 = _mm_add_ps(fiy0,ty);
932 fiz0 = _mm_add_ps(fiz0,tz);
933
934 fjx0 = _mm_add_ps(fjx0,tx);
935 fjy0 = _mm_add_ps(fjy0,ty);
936 fjz0 = _mm_add_ps(fjz0,tz);
937
938 /**************************
939 * CALCULATE INTERACTIONS *
940 **************************/
941
942 r11 = _mm_mul_ps(rsq11,rinv11);
943 r11 = _mm_andnot_ps(dummy_mask,r11);
944
945 /* Calculate table index by multiplying r with table scale and truncate to integer */
946 rt = _mm_mul_ps(r11,vftabscale);
947 vfitab = _mm_cvttps_epi32(rt);
948 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
949 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
950
951 /* CUBIC SPLINE TABLE ELECTROSTATICS */
952 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
953 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
954 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
955 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
956 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
957 Heps = _mm_mul_ps(vfeps,H);
958 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
959 VV = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
960 velec = _mm_mul_ps(qq11,VV);
961 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
962 felec = _mm_xor_ps(signbit,_mm_mul_ps(_mm_mul_ps(qq11,FF),_mm_mul_ps(vftabscale,rinv11)));
963
964 /* Update potential sum for this i atom from the interaction with this j atom. */
965 velec = _mm_andnot_ps(dummy_mask,velec);
966 velecsum = _mm_add_ps(velecsum,velec);
967
968 fscal = felec;
969
970 fscal = _mm_andnot_ps(dummy_mask,fscal);
971
972 /* Calculate temporary vectorial force */
973 tx = _mm_mul_ps(fscal,dx11);
974 ty = _mm_mul_ps(fscal,dy11);
975 tz = _mm_mul_ps(fscal,dz11);
976
977 /* Update vectorial force */
978 fix1 = _mm_add_ps(fix1,tx);
979 fiy1 = _mm_add_ps(fiy1,ty);
980 fiz1 = _mm_add_ps(fiz1,tz);
981
982 fjx1 = _mm_add_ps(fjx1,tx);
983 fjy1 = _mm_add_ps(fjy1,ty);
984 fjz1 = _mm_add_ps(fjz1,tz);
985
986 /**************************
987 * CALCULATE INTERACTIONS *
988 **************************/
989
990 r12 = _mm_mul_ps(rsq12,rinv12);
991 r12 = _mm_andnot_ps(dummy_mask,r12);
992
993 /* Calculate table index by multiplying r with table scale and truncate to integer */
994 rt = _mm_mul_ps(r12,vftabscale);
995 vfitab = _mm_cvttps_epi32(rt);
996 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
997 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
998
999 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1000 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
1001 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
1002 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
1003 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
1004 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
1005 Heps = _mm_mul_ps(vfeps,H);
1006 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
1007 VV = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
1008 velec = _mm_mul_ps(qq12,VV);
1009 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
1010 felec = _mm_xor_ps(signbit,_mm_mul_ps(_mm_mul_ps(qq12,FF),_mm_mul_ps(vftabscale,rinv12)));
1011
1012 /* Update potential sum for this i atom from the interaction with this j atom. */
1013 velec = _mm_andnot_ps(dummy_mask,velec);
1014 velecsum = _mm_add_ps(velecsum,velec);
1015
1016 fscal = felec;
1017
1018 fscal = _mm_andnot_ps(dummy_mask,fscal);
1019
1020 /* Calculate temporary vectorial force */
1021 tx = _mm_mul_ps(fscal,dx12);
1022 ty = _mm_mul_ps(fscal,dy12);
1023 tz = _mm_mul_ps(fscal,dz12);
1024
1025 /* Update vectorial force */
1026 fix1 = _mm_add_ps(fix1,tx);
1027 fiy1 = _mm_add_ps(fiy1,ty);
1028 fiz1 = _mm_add_ps(fiz1,tz);
1029
1030 fjx2 = _mm_add_ps(fjx2,tx);
1031 fjy2 = _mm_add_ps(fjy2,ty);
1032 fjz2 = _mm_add_ps(fjz2,tz);
1033
1034 /**************************
1035 * CALCULATE INTERACTIONS *
1036 **************************/
1037
1038 r13 = _mm_mul_ps(rsq13,rinv13);
1039 r13 = _mm_andnot_ps(dummy_mask,r13);
1040
1041 /* Calculate table index by multiplying r with table scale and truncate to integer */
1042 rt = _mm_mul_ps(r13,vftabscale);
1043 vfitab = _mm_cvttps_epi32(rt);
1044 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
1045 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
1046
1047 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1048 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
1049 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
1050 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
1051 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
1052 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
1053 Heps = _mm_mul_ps(vfeps,H);
1054 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
1055 VV = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
1056 velec = _mm_mul_ps(qq13,VV);
1057 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
1058 felec = _mm_xor_ps(signbit,_mm_mul_ps(_mm_mul_ps(qq13,FF),_mm_mul_ps(vftabscale,rinv13)));
1059
1060 /* Update potential sum for this i atom from the interaction with this j atom. */
1061 velec = _mm_andnot_ps(dummy_mask,velec);
1062 velecsum = _mm_add_ps(velecsum,velec);
1063
1064 fscal = felec;
1065
1066 fscal = _mm_andnot_ps(dummy_mask,fscal);
1067
1068 /* Calculate temporary vectorial force */
1069 tx = _mm_mul_ps(fscal,dx13);
1070 ty = _mm_mul_ps(fscal,dy13);
1071 tz = _mm_mul_ps(fscal,dz13);
1072
1073 /* Update vectorial force */
1074 fix1 = _mm_add_ps(fix1,tx);
1075 fiy1 = _mm_add_ps(fiy1,ty);
1076 fiz1 = _mm_add_ps(fiz1,tz);
1077
1078 fjx3 = _mm_add_ps(fjx3,tx);
1079 fjy3 = _mm_add_ps(fjy3,ty);
1080 fjz3 = _mm_add_ps(fjz3,tz);
1081
1082 /**************************
1083 * CALCULATE INTERACTIONS *
1084 **************************/
1085
1086 r21 = _mm_mul_ps(rsq21,rinv21);
1087 r21 = _mm_andnot_ps(dummy_mask,r21);
1088
1089 /* Calculate table index by multiplying r with table scale and truncate to integer */
1090 rt = _mm_mul_ps(r21,vftabscale);
1091 vfitab = _mm_cvttps_epi32(rt);
1092 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
1093 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
1094
1095 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1096 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
1097 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
1098 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
1099 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
1100 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
1101 Heps = _mm_mul_ps(vfeps,H);
1102 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
1103 VV = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
1104 velec = _mm_mul_ps(qq21,VV);
1105 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
1106 felec = _mm_xor_ps(signbit,_mm_mul_ps(_mm_mul_ps(qq21,FF),_mm_mul_ps(vftabscale,rinv21)));
1107
1108 /* Update potential sum for this i atom from the interaction with this j atom. */
1109 velec = _mm_andnot_ps(dummy_mask,velec);
1110 velecsum = _mm_add_ps(velecsum,velec);
1111
1112 fscal = felec;
1113
1114 fscal = _mm_andnot_ps(dummy_mask,fscal);
1115
1116 /* Calculate temporary vectorial force */
1117 tx = _mm_mul_ps(fscal,dx21);
1118 ty = _mm_mul_ps(fscal,dy21);
1119 tz = _mm_mul_ps(fscal,dz21);
1120
1121 /* Update vectorial force */
1122 fix2 = _mm_add_ps(fix2,tx);
1123 fiy2 = _mm_add_ps(fiy2,ty);
1124 fiz2 = _mm_add_ps(fiz2,tz);
1125
1126 fjx1 = _mm_add_ps(fjx1,tx);
1127 fjy1 = _mm_add_ps(fjy1,ty);
1128 fjz1 = _mm_add_ps(fjz1,tz);
1129
1130 /**************************
1131 * CALCULATE INTERACTIONS *
1132 **************************/
1133
1134 r22 = _mm_mul_ps(rsq22,rinv22);
1135 r22 = _mm_andnot_ps(dummy_mask,r22);
1136
1137 /* Calculate table index by multiplying r with table scale and truncate to integer */
1138 rt = _mm_mul_ps(r22,vftabscale);
1139 vfitab = _mm_cvttps_epi32(rt);
1140 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
1141 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
1142
1143 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1144 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
1145 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
1146 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
1147 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
1148 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
1149 Heps = _mm_mul_ps(vfeps,H);
1150 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
1151 VV = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
1152 velec = _mm_mul_ps(qq22,VV);
1153 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
1154 felec = _mm_xor_ps(signbit,_mm_mul_ps(_mm_mul_ps(qq22,FF),_mm_mul_ps(vftabscale,rinv22)));
1155
1156 /* Update potential sum for this i atom from the interaction with this j atom. */
1157 velec = _mm_andnot_ps(dummy_mask,velec);
1158 velecsum = _mm_add_ps(velecsum,velec);
1159
1160 fscal = felec;
1161
1162 fscal = _mm_andnot_ps(dummy_mask,fscal);
1163
1164 /* Calculate temporary vectorial force */
1165 tx = _mm_mul_ps(fscal,dx22);
1166 ty = _mm_mul_ps(fscal,dy22);
1167 tz = _mm_mul_ps(fscal,dz22);
1168
1169 /* Update vectorial force */
1170 fix2 = _mm_add_ps(fix2,tx);
1171 fiy2 = _mm_add_ps(fiy2,ty);
1172 fiz2 = _mm_add_ps(fiz2,tz);
1173
1174 fjx2 = _mm_add_ps(fjx2,tx);
1175 fjy2 = _mm_add_ps(fjy2,ty);
1176 fjz2 = _mm_add_ps(fjz2,tz);
1177
1178 /**************************
1179 * CALCULATE INTERACTIONS *
1180 **************************/
1181
1182 r23 = _mm_mul_ps(rsq23,rinv23);
1183 r23 = _mm_andnot_ps(dummy_mask,r23);
1184
1185 /* Calculate table index by multiplying r with table scale and truncate to integer */
1186 rt = _mm_mul_ps(r23,vftabscale);
1187 vfitab = _mm_cvttps_epi32(rt);
1188 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
1189 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
1190
1191 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1192 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
1193 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
1194 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
1195 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
1196 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
1197 Heps = _mm_mul_ps(vfeps,H);
1198 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
1199 VV = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
1200 velec = _mm_mul_ps(qq23,VV);
1201 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
1202 felec = _mm_xor_ps(signbit,_mm_mul_ps(_mm_mul_ps(qq23,FF),_mm_mul_ps(vftabscale,rinv23)));
1203
1204 /* Update potential sum for this i atom from the interaction with this j atom. */
1205 velec = _mm_andnot_ps(dummy_mask,velec);
1206 velecsum = _mm_add_ps(velecsum,velec);
1207
1208 fscal = felec;
1209
1210 fscal = _mm_andnot_ps(dummy_mask,fscal);
1211
1212 /* Calculate temporary vectorial force */
1213 tx = _mm_mul_ps(fscal,dx23);
1214 ty = _mm_mul_ps(fscal,dy23);
1215 tz = _mm_mul_ps(fscal,dz23);
1216
1217 /* Update vectorial force */
1218 fix2 = _mm_add_ps(fix2,tx);
1219 fiy2 = _mm_add_ps(fiy2,ty);
1220 fiz2 = _mm_add_ps(fiz2,tz);
1221
1222 fjx3 = _mm_add_ps(fjx3,tx);
1223 fjy3 = _mm_add_ps(fjy3,ty);
1224 fjz3 = _mm_add_ps(fjz3,tz);
1225
1226 /**************************
1227 * CALCULATE INTERACTIONS *
1228 **************************/
1229
1230 r31 = _mm_mul_ps(rsq31,rinv31);
1231 r31 = _mm_andnot_ps(dummy_mask,r31);
1232
1233 /* Calculate table index by multiplying r with table scale and truncate to integer */
1234 rt = _mm_mul_ps(r31,vftabscale);
1235 vfitab = _mm_cvttps_epi32(rt);
1236 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
1237 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
1238
1239 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1240 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
1241 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
1242 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
1243 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
1244 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
1245 Heps = _mm_mul_ps(vfeps,H);
1246 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
1247 VV = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
1248 velec = _mm_mul_ps(qq31,VV);
1249 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
1250 felec = _mm_xor_ps(signbit,_mm_mul_ps(_mm_mul_ps(qq31,FF),_mm_mul_ps(vftabscale,rinv31)));
1251
1252 /* Update potential sum for this i atom from the interaction with this j atom. */
1253 velec = _mm_andnot_ps(dummy_mask,velec);
1254 velecsum = _mm_add_ps(velecsum,velec);
1255
1256 fscal = felec;
1257
1258 fscal = _mm_andnot_ps(dummy_mask,fscal);
1259
1260 /* Calculate temporary vectorial force */
1261 tx = _mm_mul_ps(fscal,dx31);
1262 ty = _mm_mul_ps(fscal,dy31);
1263 tz = _mm_mul_ps(fscal,dz31);
1264
1265 /* Update vectorial force */
1266 fix3 = _mm_add_ps(fix3,tx);
1267 fiy3 = _mm_add_ps(fiy3,ty);
1268 fiz3 = _mm_add_ps(fiz3,tz);
1269
1270 fjx1 = _mm_add_ps(fjx1,tx);
1271 fjy1 = _mm_add_ps(fjy1,ty);
1272 fjz1 = _mm_add_ps(fjz1,tz);
1273
1274 /**************************
1275 * CALCULATE INTERACTIONS *
1276 **************************/
1277
1278 r32 = _mm_mul_ps(rsq32,rinv32);
1279 r32 = _mm_andnot_ps(dummy_mask,r32);
1280
1281 /* Calculate table index by multiplying r with table scale and truncate to integer */
1282 rt = _mm_mul_ps(r32,vftabscale);
1283 vfitab = _mm_cvttps_epi32(rt);
1284 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
1285 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
1286
1287 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1288 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
1289 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
1290 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
1291 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
1292 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
1293 Heps = _mm_mul_ps(vfeps,H);
1294 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
1295 VV = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
1296 velec = _mm_mul_ps(qq32,VV);
1297 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
1298 felec = _mm_xor_ps(signbit,_mm_mul_ps(_mm_mul_ps(qq32,FF),_mm_mul_ps(vftabscale,rinv32)));
1299
1300 /* Update potential sum for this i atom from the interaction with this j atom. */
1301 velec = _mm_andnot_ps(dummy_mask,velec);
1302 velecsum = _mm_add_ps(velecsum,velec);
1303
1304 fscal = felec;
1305
1306 fscal = _mm_andnot_ps(dummy_mask,fscal);
1307
1308 /* Calculate temporary vectorial force */
1309 tx = _mm_mul_ps(fscal,dx32);
1310 ty = _mm_mul_ps(fscal,dy32);
1311 tz = _mm_mul_ps(fscal,dz32);
1312
1313 /* Update vectorial force */
1314 fix3 = _mm_add_ps(fix3,tx);
1315 fiy3 = _mm_add_ps(fiy3,ty);
1316 fiz3 = _mm_add_ps(fiz3,tz);
1317
1318 fjx2 = _mm_add_ps(fjx2,tx);
1319 fjy2 = _mm_add_ps(fjy2,ty);
1320 fjz2 = _mm_add_ps(fjz2,tz);
1321
1322 /**************************
1323 * CALCULATE INTERACTIONS *
1324 **************************/
1325
1326 r33 = _mm_mul_ps(rsq33,rinv33);
1327 r33 = _mm_andnot_ps(dummy_mask,r33);
1328
1329 /* Calculate table index by multiplying r with table scale and truncate to integer */
1330 rt = _mm_mul_ps(r33,vftabscale);
1331 vfitab = _mm_cvttps_epi32(rt);
1332 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
1333 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
1334
1335 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1336 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
1337 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
1338 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
1339 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
1340 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
1341 Heps = _mm_mul_ps(vfeps,H);
1342 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
1343 VV = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
1344 velec = _mm_mul_ps(qq33,VV);
1345 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
1346 felec = _mm_xor_ps(signbit,_mm_mul_ps(_mm_mul_ps(qq33,FF),_mm_mul_ps(vftabscale,rinv33)));
1347
1348 /* Update potential sum for this i atom from the interaction with this j atom. */
1349 velec = _mm_andnot_ps(dummy_mask,velec);
1350 velecsum = _mm_add_ps(velecsum,velec);
1351
1352 fscal = felec;
1353
1354 fscal = _mm_andnot_ps(dummy_mask,fscal);
1355
1356 /* Calculate temporary vectorial force */
1357 tx = _mm_mul_ps(fscal,dx33);
1358 ty = _mm_mul_ps(fscal,dy33);
1359 tz = _mm_mul_ps(fscal,dz33);
1360
1361 /* Update vectorial force */
1362 fix3 = _mm_add_ps(fix3,tx);
1363 fiy3 = _mm_add_ps(fiy3,ty);
1364 fiz3 = _mm_add_ps(fiz3,tz);
1365
1366 fjx3 = _mm_add_ps(fjx3,tx);
1367 fjy3 = _mm_add_ps(fjy3,ty);
1368 fjz3 = _mm_add_ps(fjz3,tz);
1369
1370 fjptrA = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
1371 fjptrB = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
1372 fjptrC = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
1373 fjptrD = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
1374
1375 gmx_mm_decrement_4rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,
1376 fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,
1377 fjx2,fjy2,fjz2,fjx3,fjy3,fjz3);
1378
1379 /* Inner loop uses 456 flops */
1380 }
1381
1382 /* End of innermost loop */
1383
1384 gmx_mm_update_iforce_4atom_swizzle_ps(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
1385 f+i_coord_offset,fshift+i_shift_offset);
1386
1387 ggid = gid[iidx];
1388 /* Update potential energies */
1389 gmx_mm_update_1pot_ps(velecsum,kernel_data->energygrp_elec+ggid);
1390 gmx_mm_update_1pot_ps(vvdwsum,kernel_data->energygrp_vdw+ggid);
1391
1392 /* Increment number of inner iterations */
1393 inneriter += j_index_end - j_index_start;
1394
1395 /* Outer loop uses 26 flops */
1396 }
1397
1398 /* Increment number of outer iterations */
1399 outeriter += nri;
1400
1401 /* Update outer/inner flops */
1402
1403 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4W4_VF,outeriter*26 + inneriter*456)(nrnb)->n[eNR_NBKERNEL_ELEC_VDW_W4W4_VF] += outeriter*26 +
inneriter*456
;
1404}
1405/*
1406 * Gromacs nonbonded kernel: nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sse4_1_single
1407 * Electrostatics interaction: CubicSplineTable
1408 * VdW interaction: CubicSplineTable
1409 * Geometry: Water4-Water4
1410 * Calculate force/pot: Force
1411 */
1412void
1413nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sse4_1_single
1414 (t_nblist * gmx_restrict nlist,
1415 rvec * gmx_restrict xx,
1416 rvec * gmx_restrict ff,
1417 t_forcerec * gmx_restrict fr,
1418 t_mdatoms * gmx_restrict mdatoms,
1419 nb_kernel_data_t gmx_unused__attribute__ ((unused)) * gmx_restrict kernel_data,
1420 t_nrnb * gmx_restrict nrnb)
1421{
1422 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
1423 * just 0 for non-waters.
1424 * Suffixes A,B,C,D refer to j loop unrolling done with SSE, e.g. for the four different
1425 * jnr indices corresponding to data put in the four positions in the SIMD register.
1426 */
1427 int i_shift_offset,i_coord_offset,outeriter,inneriter;
1428 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
1429 int jnrA,jnrB,jnrC,jnrD;
1430 int jnrlistA,jnrlistB,jnrlistC,jnrlistD;
1431 int j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
1432 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
1433 real rcutoff_scalar;
1434 real *shiftvec,*fshift,*x,*f;
1435 real *fjptrA,*fjptrB,*fjptrC,*fjptrD;
1436 real scratch[4*DIM3];
1437 __m128 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
1438 int vdwioffset0;
1439 __m128 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
1440 int vdwioffset1;
1441 __m128 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
1442 int vdwioffset2;
1443 __m128 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
1444 int vdwioffset3;
1445 __m128 ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
1446 int vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
1447 __m128 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
1448 int vdwjidx1A,vdwjidx1B,vdwjidx1C,vdwjidx1D;
1449 __m128 jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
1450 int vdwjidx2A,vdwjidx2B,vdwjidx2C,vdwjidx2D;
1451 __m128 jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
1452 int vdwjidx3A,vdwjidx3B,vdwjidx3C,vdwjidx3D;
1453 __m128 jx3,jy3,jz3,fjx3,fjy3,fjz3,jq3,isaj3;
1454 __m128 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
1455 __m128 dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11;
1456 __m128 dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12;
1457 __m128 dx13,dy13,dz13,rsq13,rinv13,rinvsq13,r13,qq13,c6_13,c12_13;
1458 __m128 dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21;
1459 __m128 dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22;
1460 __m128 dx23,dy23,dz23,rsq23,rinv23,rinvsq23,r23,qq23,c6_23,c12_23;
1461 __m128 dx31,dy31,dz31,rsq31,rinv31,rinvsq31,r31,qq31,c6_31,c12_31;
1462 __m128 dx32,dy32,dz32,rsq32,rinv32,rinvsq32,r32,qq32,c6_32,c12_32;
1463 __m128 dx33,dy33,dz33,rsq33,rinv33,rinvsq33,r33,qq33,c6_33,c12_33;
1464 __m128 velec,felec,velecsum,facel,crf,krf,krf2;
1465 real *charge;
1466 int nvdwtype;
1467 __m128 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
1468 int *vdwtype;
1469 real *vdwparam;
1470 __m128 one_sixth = _mm_set1_ps(1.0/6.0);
1471 __m128 one_twelfth = _mm_set1_ps(1.0/12.0);
1472 __m128i vfitab;
1473 __m128i ifour = _mm_set1_epi32(4);
1474 __m128 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
1475 real *vftab;
1476 __m128 dummy_mask,cutoff_mask;
1477 __m128 signbit = _mm_castsi128_ps( _mm_set1_epi32(0x80000000) );
1478 __m128 one = _mm_set1_ps(1.0);
1479 __m128 two = _mm_set1_ps(2.0);
Value stored to 'two' during its initialization is never read
1480 x = xx[0];
1481 f = ff[0];
1482
1483 nri = nlist->nri;
1484 iinr = nlist->iinr;
1485 jindex = nlist->jindex;
1486 jjnr = nlist->jjnr;
1487 shiftidx = nlist->shift;
1488 gid = nlist->gid;
1489 shiftvec = fr->shift_vec[0];
1490 fshift = fr->fshift[0];
1491 facel = _mm_set1_ps(fr->epsfac);
1492 charge = mdatoms->chargeA;
1493 nvdwtype = fr->ntype;
1494 vdwparam = fr->nbfp;
1495 vdwtype = mdatoms->typeA;
1496
1497 vftab = kernel_data->table_elec_vdw->data;
1498 vftabscale = _mm_set1_ps(kernel_data->table_elec_vdw->scale);
1499
1500 /* Setup water-specific parameters */
1501 inr = nlist->iinr[0];
1502 iq1 = _mm_mul_ps(facel,_mm_set1_ps(charge[inr+1]));
1503 iq2 = _mm_mul_ps(facel,_mm_set1_ps(charge[inr+2]));
1504 iq3 = _mm_mul_ps(facel,_mm_set1_ps(charge[inr+3]));
1505 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
1506
1507 jq1 = _mm_set1_ps(charge[inr+1]);
1508 jq2 = _mm_set1_ps(charge[inr+2]);
1509 jq3 = _mm_set1_ps(charge[inr+3]);
1510 vdwjidx0A = 2*vdwtype[inr+0];
1511 c6_00 = _mm_set1_ps(vdwparam[vdwioffset0+vdwjidx0A]);
1512 c12_00 = _mm_set1_ps(vdwparam[vdwioffset0+vdwjidx0A+1]);
1513 qq11 = _mm_mul_ps(iq1,jq1);
1514 qq12 = _mm_mul_ps(iq1,jq2);
1515 qq13 = _mm_mul_ps(iq1,jq3);
1516 qq21 = _mm_mul_ps(iq2,jq1);
1517 qq22 = _mm_mul_ps(iq2,jq2);
1518 qq23 = _mm_mul_ps(iq2,jq3);
1519 qq31 = _mm_mul_ps(iq3,jq1);
1520 qq32 = _mm_mul_ps(iq3,jq2);
1521 qq33 = _mm_mul_ps(iq3,jq3);
1522
1523 /* Avoid stupid compiler warnings */
1524 jnrA = jnrB = jnrC = jnrD = 0;
1525 j_coord_offsetA = 0;
1526 j_coord_offsetB = 0;
1527 j_coord_offsetC = 0;
1528 j_coord_offsetD = 0;
1529
1530 outeriter = 0;
1531 inneriter = 0;
1532
1533 for(iidx=0;iidx<4*DIM3;iidx++)
1534 {
1535 scratch[iidx] = 0.0;
1536 }
1537
1538 /* Start outer loop over neighborlists */
1539 for(iidx=0; iidx<nri; iidx++)
1540 {
1541 /* Load shift vector for this list */
1542 i_shift_offset = DIM3*shiftidx[iidx];
1543
1544 /* Load limits for loop over neighbors */
1545 j_index_start = jindex[iidx];
1546 j_index_end = jindex[iidx+1];
1547
1548 /* Get outer coordinate index */
1549 inr = iinr[iidx];
1550 i_coord_offset = DIM3*inr;
1551
1552 /* Load i particle coords and add shift vector */
1553 gmx_mm_load_shift_and_4rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,
1554 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
1555
1556 fix0 = _mm_setzero_ps();
1557 fiy0 = _mm_setzero_ps();
1558 fiz0 = _mm_setzero_ps();
1559 fix1 = _mm_setzero_ps();
1560 fiy1 = _mm_setzero_ps();
1561 fiz1 = _mm_setzero_ps();
1562 fix2 = _mm_setzero_ps();
1563 fiy2 = _mm_setzero_ps();
1564 fiz2 = _mm_setzero_ps();
1565 fix3 = _mm_setzero_ps();
1566 fiy3 = _mm_setzero_ps();
1567 fiz3 = _mm_setzero_ps();
1568
1569 /* Start inner kernel loop */
1570 for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
1571 {
1572
1573 /* Get j neighbor index, and coordinate index */
1574 jnrA = jjnr[jidx];
1575 jnrB = jjnr[jidx+1];
1576 jnrC = jjnr[jidx+2];
1577 jnrD = jjnr[jidx+3];
1578 j_coord_offsetA = DIM3*jnrA;
1579 j_coord_offsetB = DIM3*jnrB;
1580 j_coord_offsetC = DIM3*jnrC;
1581 j_coord_offsetD = DIM3*jnrD;
1582
1583 /* load j atom coordinates */
1584 gmx_mm_load_4rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
1585 x+j_coord_offsetC,x+j_coord_offsetD,
1586 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,
1587 &jy2,&jz2,&jx3,&jy3,&jz3);
1588
1589 /* Calculate displacement vector */
1590 dx00 = _mm_sub_ps(ix0,jx0);
1591 dy00 = _mm_sub_ps(iy0,jy0);
1592 dz00 = _mm_sub_ps(iz0,jz0);
1593 dx11 = _mm_sub_ps(ix1,jx1);
1594 dy11 = _mm_sub_ps(iy1,jy1);
1595 dz11 = _mm_sub_ps(iz1,jz1);
1596 dx12 = _mm_sub_ps(ix1,jx2);
1597 dy12 = _mm_sub_ps(iy1,jy2);
1598 dz12 = _mm_sub_ps(iz1,jz2);
1599 dx13 = _mm_sub_ps(ix1,jx3);
1600 dy13 = _mm_sub_ps(iy1,jy3);
1601 dz13 = _mm_sub_ps(iz1,jz3);
1602 dx21 = _mm_sub_ps(ix2,jx1);
1603 dy21 = _mm_sub_ps(iy2,jy1);
1604 dz21 = _mm_sub_ps(iz2,jz1);
1605 dx22 = _mm_sub_ps(ix2,jx2);
1606 dy22 = _mm_sub_ps(iy2,jy2);
1607 dz22 = _mm_sub_ps(iz2,jz2);
1608 dx23 = _mm_sub_ps(ix2,jx3);
1609 dy23 = _mm_sub_ps(iy2,jy3);
1610 dz23 = _mm_sub_ps(iz2,jz3);
1611 dx31 = _mm_sub_ps(ix3,jx1);
1612 dy31 = _mm_sub_ps(iy3,jy1);
1613 dz31 = _mm_sub_ps(iz3,jz1);
1614 dx32 = _mm_sub_ps(ix3,jx2);
1615 dy32 = _mm_sub_ps(iy3,jy2);
1616 dz32 = _mm_sub_ps(iz3,jz2);
1617 dx33 = _mm_sub_ps(ix3,jx3);
1618 dy33 = _mm_sub_ps(iy3,jy3);
1619 dz33 = _mm_sub_ps(iz3,jz3);
1620
1621 /* Calculate squared distance and things based on it */
1622 rsq00 = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
1623 rsq11 = gmx_mm_calc_rsq_ps(dx11,dy11,dz11);
1624 rsq12 = gmx_mm_calc_rsq_ps(dx12,dy12,dz12);
1625 rsq13 = gmx_mm_calc_rsq_ps(dx13,dy13,dz13);
1626 rsq21 = gmx_mm_calc_rsq_ps(dx21,dy21,dz21);
1627 rsq22 = gmx_mm_calc_rsq_ps(dx22,dy22,dz22);
1628 rsq23 = gmx_mm_calc_rsq_ps(dx23,dy23,dz23);
1629 rsq31 = gmx_mm_calc_rsq_ps(dx31,dy31,dz31);
1630 rsq32 = gmx_mm_calc_rsq_ps(dx32,dy32,dz32);
1631 rsq33 = gmx_mm_calc_rsq_ps(dx33,dy33,dz33);
1632
1633 rinv00 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq00);
1634 rinv11 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq11);
1635 rinv12 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq12);
1636 rinv13 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq13);
1637 rinv21 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq21);
1638 rinv22 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq22);
1639 rinv23 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq23);
1640 rinv31 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq31);
1641 rinv32 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq32);
1642 rinv33 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq33);
1643
1644 fjx0 = _mm_setzero_ps();
1645 fjy0 = _mm_setzero_ps();
1646 fjz0 = _mm_setzero_ps();
1647 fjx1 = _mm_setzero_ps();
1648 fjy1 = _mm_setzero_ps();
1649 fjz1 = _mm_setzero_ps();
1650 fjx2 = _mm_setzero_ps();
1651 fjy2 = _mm_setzero_ps();
1652 fjz2 = _mm_setzero_ps();
1653 fjx3 = _mm_setzero_ps();
1654 fjy3 = _mm_setzero_ps();
1655 fjz3 = _mm_setzero_ps();
1656
1657 /**************************
1658 * CALCULATE INTERACTIONS *
1659 **************************/
1660
1661 r00 = _mm_mul_ps(rsq00,rinv00);
1662
1663 /* Calculate table index by multiplying r with table scale and truncate to integer */
1664 rt = _mm_mul_ps(r00,vftabscale);
1665 vfitab = _mm_cvttps_epi32(rt);
1666 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
1667 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
1668
1669 /* CUBIC SPLINE TABLE DISPERSION */
1670 vfitab = _mm_add_epi32(vfitab,ifour);
1671 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
1672 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
1673 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
1674 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
1675 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
1676 Heps = _mm_mul_ps(vfeps,H);
1677 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
1678 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
1679 fvdw6 = _mm_mul_ps(c6_00,FF);
1680
1681 /* CUBIC SPLINE TABLE REPULSION */
1682 vfitab = _mm_add_epi32(vfitab,ifour);
1683 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
1684 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
1685 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
1686 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
1687 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
1688 Heps = _mm_mul_ps(vfeps,H);
1689 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
1690 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
1691 fvdw12 = _mm_mul_ps(c12_00,FF);
1692 fvdw = _mm_xor_ps(signbit,_mm_mul_ps(_mm_add_ps(fvdw6,fvdw12),_mm_mul_ps(vftabscale,rinv00)));
1693
1694 fscal = fvdw;
1695
1696 /* Calculate temporary vectorial force */
1697 tx = _mm_mul_ps(fscal,dx00);
1698 ty = _mm_mul_ps(fscal,dy00);
1699 tz = _mm_mul_ps(fscal,dz00);
1700
1701 /* Update vectorial force */
1702 fix0 = _mm_add_ps(fix0,tx);
1703 fiy0 = _mm_add_ps(fiy0,ty);
1704 fiz0 = _mm_add_ps(fiz0,tz);
1705
1706 fjx0 = _mm_add_ps(fjx0,tx);
1707 fjy0 = _mm_add_ps(fjy0,ty);
1708 fjz0 = _mm_add_ps(fjz0,tz);
1709
1710 /**************************
1711 * CALCULATE INTERACTIONS *
1712 **************************/
1713
1714 r11 = _mm_mul_ps(rsq11,rinv11);
1715
1716 /* Calculate table index by multiplying r with table scale and truncate to integer */
1717 rt = _mm_mul_ps(r11,vftabscale);
1718 vfitab = _mm_cvttps_epi32(rt);
1719 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
1720 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
1721
1722 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1723 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
1724 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
1725 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
1726 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
1727 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
1728 Heps = _mm_mul_ps(vfeps,H);
1729 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
1730 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
1731 felec = _mm_xor_ps(signbit,_mm_mul_ps(_mm_mul_ps(qq11,FF),_mm_mul_ps(vftabscale,rinv11)));
1732
1733 fscal = felec;
1734
1735 /* Calculate temporary vectorial force */
1736 tx = _mm_mul_ps(fscal,dx11);
1737 ty = _mm_mul_ps(fscal,dy11);
1738 tz = _mm_mul_ps(fscal,dz11);
1739
1740 /* Update vectorial force */
1741 fix1 = _mm_add_ps(fix1,tx);
1742 fiy1 = _mm_add_ps(fiy1,ty);
1743 fiz1 = _mm_add_ps(fiz1,tz);
1744
1745 fjx1 = _mm_add_ps(fjx1,tx);
1746 fjy1 = _mm_add_ps(fjy1,ty);
1747 fjz1 = _mm_add_ps(fjz1,tz);
1748
1749 /**************************
1750 * CALCULATE INTERACTIONS *
1751 **************************/
1752
1753 r12 = _mm_mul_ps(rsq12,rinv12);
1754
1755 /* Calculate table index by multiplying r with table scale and truncate to integer */
1756 rt = _mm_mul_ps(r12,vftabscale);
1757 vfitab = _mm_cvttps_epi32(rt);
1758 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
1759 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
1760
1761 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1762 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
1763 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
1764 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
1765 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
1766 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
1767 Heps = _mm_mul_ps(vfeps,H);
1768 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
1769 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
1770 felec = _mm_xor_ps(signbit,_mm_mul_ps(_mm_mul_ps(qq12,FF),_mm_mul_ps(vftabscale,rinv12)));
1771
1772 fscal = felec;
1773
1774 /* Calculate temporary vectorial force */
1775 tx = _mm_mul_ps(fscal,dx12);
1776 ty = _mm_mul_ps(fscal,dy12);
1777 tz = _mm_mul_ps(fscal,dz12);
1778
1779 /* Update vectorial force */
1780 fix1 = _mm_add_ps(fix1,tx);
1781 fiy1 = _mm_add_ps(fiy1,ty);
1782 fiz1 = _mm_add_ps(fiz1,tz);
1783
1784 fjx2 = _mm_add_ps(fjx2,tx);
1785 fjy2 = _mm_add_ps(fjy2,ty);
1786 fjz2 = _mm_add_ps(fjz2,tz);
1787
1788 /**************************
1789 * CALCULATE INTERACTIONS *
1790 **************************/
1791
1792 r13 = _mm_mul_ps(rsq13,rinv13);
1793
1794 /* Calculate table index by multiplying r with table scale and truncate to integer */
1795 rt = _mm_mul_ps(r13,vftabscale);
1796 vfitab = _mm_cvttps_epi32(rt);
1797 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
1798 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
1799
1800 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1801 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
1802 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
1803 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
1804 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
1805 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
1806 Heps = _mm_mul_ps(vfeps,H);
1807 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
1808 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
1809 felec = _mm_xor_ps(signbit,_mm_mul_ps(_mm_mul_ps(qq13,FF),_mm_mul_ps(vftabscale,rinv13)));
1810
1811 fscal = felec;
1812
1813 /* Calculate temporary vectorial force */
1814 tx = _mm_mul_ps(fscal,dx13);
1815 ty = _mm_mul_ps(fscal,dy13);
1816 tz = _mm_mul_ps(fscal,dz13);
1817
1818 /* Update vectorial force */
1819 fix1 = _mm_add_ps(fix1,tx);
1820 fiy1 = _mm_add_ps(fiy1,ty);
1821 fiz1 = _mm_add_ps(fiz1,tz);
1822
1823 fjx3 = _mm_add_ps(fjx3,tx);
1824 fjy3 = _mm_add_ps(fjy3,ty);
1825 fjz3 = _mm_add_ps(fjz3,tz);
1826
1827 /**************************
1828 * CALCULATE INTERACTIONS *
1829 **************************/
1830
1831 r21 = _mm_mul_ps(rsq21,rinv21);
1832
1833 /* Calculate table index by multiplying r with table scale and truncate to integer */
1834 rt = _mm_mul_ps(r21,vftabscale);
1835 vfitab = _mm_cvttps_epi32(rt);
1836 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
1837 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
1838
1839 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1840 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
1841 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
1842 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
1843 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
1844 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
1845 Heps = _mm_mul_ps(vfeps,H);
1846 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
1847 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
1848 felec = _mm_xor_ps(signbit,_mm_mul_ps(_mm_mul_ps(qq21,FF),_mm_mul_ps(vftabscale,rinv21)));
1849
1850 fscal = felec;
1851
1852 /* Calculate temporary vectorial force */
1853 tx = _mm_mul_ps(fscal,dx21);
1854 ty = _mm_mul_ps(fscal,dy21);
1855 tz = _mm_mul_ps(fscal,dz21);
1856
1857 /* Update vectorial force */
1858 fix2 = _mm_add_ps(fix2,tx);
1859 fiy2 = _mm_add_ps(fiy2,ty);
1860 fiz2 = _mm_add_ps(fiz2,tz);
1861
1862 fjx1 = _mm_add_ps(fjx1,tx);
1863 fjy1 = _mm_add_ps(fjy1,ty);
1864 fjz1 = _mm_add_ps(fjz1,tz);
1865
1866 /**************************
1867 * CALCULATE INTERACTIONS *
1868 **************************/
1869
1870 r22 = _mm_mul_ps(rsq22,rinv22);
1871
1872 /* Calculate table index by multiplying r with table scale and truncate to integer */
1873 rt = _mm_mul_ps(r22,vftabscale);
1874 vfitab = _mm_cvttps_epi32(rt);
1875 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
1876 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
1877
1878 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1879 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
1880 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
1881 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
1882 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
1883 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
1884 Heps = _mm_mul_ps(vfeps,H);
1885 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
1886 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
1887 felec = _mm_xor_ps(signbit,_mm_mul_ps(_mm_mul_ps(qq22,FF),_mm_mul_ps(vftabscale,rinv22)));
1888
1889 fscal = felec;
1890
1891 /* Calculate temporary vectorial force */
1892 tx = _mm_mul_ps(fscal,dx22);
1893 ty = _mm_mul_ps(fscal,dy22);
1894 tz = _mm_mul_ps(fscal,dz22);
1895
1896 /* Update vectorial force */
1897 fix2 = _mm_add_ps(fix2,tx);
1898 fiy2 = _mm_add_ps(fiy2,ty);
1899 fiz2 = _mm_add_ps(fiz2,tz);
1900
1901 fjx2 = _mm_add_ps(fjx2,tx);
1902 fjy2 = _mm_add_ps(fjy2,ty);
1903 fjz2 = _mm_add_ps(fjz2,tz);
1904
1905 /**************************
1906 * CALCULATE INTERACTIONS *
1907 **************************/
1908
1909 r23 = _mm_mul_ps(rsq23,rinv23);
1910
1911 /* Calculate table index by multiplying r with table scale and truncate to integer */
1912 rt = _mm_mul_ps(r23,vftabscale);
1913 vfitab = _mm_cvttps_epi32(rt);
1914 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
1915 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
1916
1917 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1918 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
1919 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
1920 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
1921 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
1922 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
1923 Heps = _mm_mul_ps(vfeps,H);
1924 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
1925 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
1926 felec = _mm_xor_ps(signbit,_mm_mul_ps(_mm_mul_ps(qq23,FF),_mm_mul_ps(vftabscale,rinv23)));
1927
1928 fscal = felec;
1929
1930 /* Calculate temporary vectorial force */
1931 tx = _mm_mul_ps(fscal,dx23);
1932 ty = _mm_mul_ps(fscal,dy23);
1933 tz = _mm_mul_ps(fscal,dz23);
1934
1935 /* Update vectorial force */
1936 fix2 = _mm_add_ps(fix2,tx);
1937 fiy2 = _mm_add_ps(fiy2,ty);
1938 fiz2 = _mm_add_ps(fiz2,tz);
1939
1940 fjx3 = _mm_add_ps(fjx3,tx);
1941 fjy3 = _mm_add_ps(fjy3,ty);
1942 fjz3 = _mm_add_ps(fjz3,tz);
1943
1944 /**************************
1945 * CALCULATE INTERACTIONS *
1946 **************************/
1947
1948 r31 = _mm_mul_ps(rsq31,rinv31);
1949
1950 /* Calculate table index by multiplying r with table scale and truncate to integer */
1951 rt = _mm_mul_ps(r31,vftabscale);
1952 vfitab = _mm_cvttps_epi32(rt);
1953 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
1954 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
1955
1956 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1957 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
1958 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
1959 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
1960 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
1961 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
1962 Heps = _mm_mul_ps(vfeps,H);
1963 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
1964 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
1965 felec = _mm_xor_ps(signbit,_mm_mul_ps(_mm_mul_ps(qq31,FF),_mm_mul_ps(vftabscale,rinv31)));
1966
1967 fscal = felec;
1968
1969 /* Calculate temporary vectorial force */
1970 tx = _mm_mul_ps(fscal,dx31);
1971 ty = _mm_mul_ps(fscal,dy31);
1972 tz = _mm_mul_ps(fscal,dz31);
1973
1974 /* Update vectorial force */
1975 fix3 = _mm_add_ps(fix3,tx);
1976 fiy3 = _mm_add_ps(fiy3,ty);
1977 fiz3 = _mm_add_ps(fiz3,tz);
1978
1979 fjx1 = _mm_add_ps(fjx1,tx);
1980 fjy1 = _mm_add_ps(fjy1,ty);
1981 fjz1 = _mm_add_ps(fjz1,tz);
1982
1983 /**************************
1984 * CALCULATE INTERACTIONS *
1985 **************************/
1986
1987 r32 = _mm_mul_ps(rsq32,rinv32);
1988
1989 /* Calculate table index by multiplying r with table scale and truncate to integer */
1990 rt = _mm_mul_ps(r32,vftabscale);
1991 vfitab = _mm_cvttps_epi32(rt);
1992 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
1993 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
1994
1995 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1996 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
1997 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
1998 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
1999 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
2000 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
2001 Heps = _mm_mul_ps(vfeps,H);
2002 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
2003 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
2004 felec = _mm_xor_ps(signbit,_mm_mul_ps(_mm_mul_ps(qq32,FF),_mm_mul_ps(vftabscale,rinv32)));
2005
2006 fscal = felec;
2007
2008 /* Calculate temporary vectorial force */
2009 tx = _mm_mul_ps(fscal,dx32);
2010 ty = _mm_mul_ps(fscal,dy32);
2011 tz = _mm_mul_ps(fscal,dz32);
2012
2013 /* Update vectorial force */
2014 fix3 = _mm_add_ps(fix3,tx);
2015 fiy3 = _mm_add_ps(fiy3,ty);
2016 fiz3 = _mm_add_ps(fiz3,tz);
2017
2018 fjx2 = _mm_add_ps(fjx2,tx);
2019 fjy2 = _mm_add_ps(fjy2,ty);
2020 fjz2 = _mm_add_ps(fjz2,tz);
2021
2022 /**************************
2023 * CALCULATE INTERACTIONS *
2024 **************************/
2025
2026 r33 = _mm_mul_ps(rsq33,rinv33);
2027
2028 /* Calculate table index by multiplying r with table scale and truncate to integer */
2029 rt = _mm_mul_ps(r33,vftabscale);
2030 vfitab = _mm_cvttps_epi32(rt);
2031 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
2032 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
2033
2034 /* CUBIC SPLINE TABLE ELECTROSTATICS */
2035 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
2036 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
2037 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
2038 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
2039 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
2040 Heps = _mm_mul_ps(vfeps,H);
2041 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
2042 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
2043 felec = _mm_xor_ps(signbit,_mm_mul_ps(_mm_mul_ps(qq33,FF),_mm_mul_ps(vftabscale,rinv33)));
2044
2045 fscal = felec;
2046
2047 /* Calculate temporary vectorial force */
2048 tx = _mm_mul_ps(fscal,dx33);
2049 ty = _mm_mul_ps(fscal,dy33);
2050 tz = _mm_mul_ps(fscal,dz33);
2051
2052 /* Update vectorial force */
2053 fix3 = _mm_add_ps(fix3,tx);
2054 fiy3 = _mm_add_ps(fiy3,ty);
2055 fiz3 = _mm_add_ps(fiz3,tz);
2056
2057 fjx3 = _mm_add_ps(fjx3,tx);
2058 fjy3 = _mm_add_ps(fjy3,ty);
2059 fjz3 = _mm_add_ps(fjz3,tz);
2060
2061 fjptrA = f+j_coord_offsetA;
2062 fjptrB = f+j_coord_offsetB;
2063 fjptrC = f+j_coord_offsetC;
2064 fjptrD = f+j_coord_offsetD;
2065
2066 gmx_mm_decrement_4rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,
2067 fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,
2068 fjx2,fjy2,fjz2,fjx3,fjy3,fjz3);
2069
2070 /* Inner loop uses 402 flops */
2071 }
2072
2073 if(jidx<j_index_end)
2074 {
2075
2076 /* Get j neighbor index, and coordinate index */
2077 jnrlistA = jjnr[jidx];
2078 jnrlistB = jjnr[jidx+1];
2079 jnrlistC = jjnr[jidx+2];
2080 jnrlistD = jjnr[jidx+3];
2081 /* Sign of each element will be negative for non-real atoms.
2082 * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
2083 * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
2084 */
2085 dummy_mask = gmx_mm_castsi128_ps_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
2086 jnrA = (jnrlistA>=0) ? jnrlistA : 0;
2087 jnrB = (jnrlistB>=0) ? jnrlistB : 0;
2088 jnrC = (jnrlistC>=0) ? jnrlistC : 0;
2089 jnrD = (jnrlistD>=0) ? jnrlistD : 0;
2090 j_coord_offsetA = DIM3*jnrA;
2091 j_coord_offsetB = DIM3*jnrB;
2092 j_coord_offsetC = DIM3*jnrC;
2093 j_coord_offsetD = DIM3*jnrD;
2094
2095 /* load j atom coordinates */
2096 gmx_mm_load_4rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
2097 x+j_coord_offsetC,x+j_coord_offsetD,
2098 &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,
2099 &jy2,&jz2,&jx3,&jy3,&jz3);
2100
2101 /* Calculate displacement vector */
2102 dx00 = _mm_sub_ps(ix0,jx0);
2103 dy00 = _mm_sub_ps(iy0,jy0);
2104 dz00 = _mm_sub_ps(iz0,jz0);
2105 dx11 = _mm_sub_ps(ix1,jx1);
2106 dy11 = _mm_sub_ps(iy1,jy1);
2107 dz11 = _mm_sub_ps(iz1,jz1);
2108 dx12 = _mm_sub_ps(ix1,jx2);
2109 dy12 = _mm_sub_ps(iy1,jy2);
2110 dz12 = _mm_sub_ps(iz1,jz2);
2111 dx13 = _mm_sub_ps(ix1,jx3);
2112 dy13 = _mm_sub_ps(iy1,jy3);
2113 dz13 = _mm_sub_ps(iz1,jz3);
2114 dx21 = _mm_sub_ps(ix2,jx1);
2115 dy21 = _mm_sub_ps(iy2,jy1);
2116 dz21 = _mm_sub_ps(iz2,jz1);
2117 dx22 = _mm_sub_ps(ix2,jx2);
2118 dy22 = _mm_sub_ps(iy2,jy2);
2119 dz22 = _mm_sub_ps(iz2,jz2);
2120 dx23 = _mm_sub_ps(ix2,jx3);
2121 dy23 = _mm_sub_ps(iy2,jy3);
2122 dz23 = _mm_sub_ps(iz2,jz3);
2123 dx31 = _mm_sub_ps(ix3,jx1);
2124 dy31 = _mm_sub_ps(iy3,jy1);
2125 dz31 = _mm_sub_ps(iz3,jz1);
2126 dx32 = _mm_sub_ps(ix3,jx2);
2127 dy32 = _mm_sub_ps(iy3,jy2);
2128 dz32 = _mm_sub_ps(iz3,jz2);
2129 dx33 = _mm_sub_ps(ix3,jx3);
2130 dy33 = _mm_sub_ps(iy3,jy3);
2131 dz33 = _mm_sub_ps(iz3,jz3);
2132
2133 /* Calculate squared distance and things based on it */
2134 rsq00 = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
2135 rsq11 = gmx_mm_calc_rsq_ps(dx11,dy11,dz11);
2136 rsq12 = gmx_mm_calc_rsq_ps(dx12,dy12,dz12);
2137 rsq13 = gmx_mm_calc_rsq_ps(dx13,dy13,dz13);
2138 rsq21 = gmx_mm_calc_rsq_ps(dx21,dy21,dz21);
2139 rsq22 = gmx_mm_calc_rsq_ps(dx22,dy22,dz22);
2140 rsq23 = gmx_mm_calc_rsq_ps(dx23,dy23,dz23);
2141 rsq31 = gmx_mm_calc_rsq_ps(dx31,dy31,dz31);
2142 rsq32 = gmx_mm_calc_rsq_ps(dx32,dy32,dz32);
2143 rsq33 = gmx_mm_calc_rsq_ps(dx33,dy33,dz33);
2144
2145 rinv00 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq00);
2146 rinv11 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq11);
2147 rinv12 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq12);
2148 rinv13 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq13);
2149 rinv21 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq21);
2150 rinv22 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq22);
2151 rinv23 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq23);
2152 rinv31 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq31);
2153 rinv32 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq32);
2154 rinv33 = gmx_mm_invsqrt_psgmx_simd_invsqrt_f(rsq33);
2155
2156 fjx0 = _mm_setzero_ps();
2157 fjy0 = _mm_setzero_ps();
2158 fjz0 = _mm_setzero_ps();
2159 fjx1 = _mm_setzero_ps();
2160 fjy1 = _mm_setzero_ps();
2161 fjz1 = _mm_setzero_ps();
2162 fjx2 = _mm_setzero_ps();
2163 fjy2 = _mm_setzero_ps();
2164 fjz2 = _mm_setzero_ps();
2165 fjx3 = _mm_setzero_ps();
2166 fjy3 = _mm_setzero_ps();
2167 fjz3 = _mm_setzero_ps();
2168
2169 /**************************
2170 * CALCULATE INTERACTIONS *
2171 **************************/
2172
2173 r00 = _mm_mul_ps(rsq00,rinv00);
2174 r00 = _mm_andnot_ps(dummy_mask,r00);
2175
2176 /* Calculate table index by multiplying r with table scale and truncate to integer */
2177 rt = _mm_mul_ps(r00,vftabscale);
2178 vfitab = _mm_cvttps_epi32(rt);
2179 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
2180 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
2181
2182 /* CUBIC SPLINE TABLE DISPERSION */
2183 vfitab = _mm_add_epi32(vfitab,ifour);
2184 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
2185 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
2186 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
2187 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
2188 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
2189 Heps = _mm_mul_ps(vfeps,H);
2190 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
2191 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
2192 fvdw6 = _mm_mul_ps(c6_00,FF);
2193
2194 /* CUBIC SPLINE TABLE REPULSION */
2195 vfitab = _mm_add_epi32(vfitab,ifour);
2196 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
2197 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
2198 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
2199 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
2200 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
2201 Heps = _mm_mul_ps(vfeps,H);
2202 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
2203 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
2204 fvdw12 = _mm_mul_ps(c12_00,FF);
2205 fvdw = _mm_xor_ps(signbit,_mm_mul_ps(_mm_add_ps(fvdw6,fvdw12),_mm_mul_ps(vftabscale,rinv00)));
2206
2207 fscal = fvdw;
2208
2209 fscal = _mm_andnot_ps(dummy_mask,fscal);
2210
2211 /* Calculate temporary vectorial force */
2212 tx = _mm_mul_ps(fscal,dx00);
2213 ty = _mm_mul_ps(fscal,dy00);
2214 tz = _mm_mul_ps(fscal,dz00);
2215
2216 /* Update vectorial force */
2217 fix0 = _mm_add_ps(fix0,tx);
2218 fiy0 = _mm_add_ps(fiy0,ty);
2219 fiz0 = _mm_add_ps(fiz0,tz);
2220
2221 fjx0 = _mm_add_ps(fjx0,tx);
2222 fjy0 = _mm_add_ps(fjy0,ty);
2223 fjz0 = _mm_add_ps(fjz0,tz);
2224
2225 /**************************
2226 * CALCULATE INTERACTIONS *
2227 **************************/
2228
2229 r11 = _mm_mul_ps(rsq11,rinv11);
2230 r11 = _mm_andnot_ps(dummy_mask,r11);
2231
2232 /* Calculate table index by multiplying r with table scale and truncate to integer */
2233 rt = _mm_mul_ps(r11,vftabscale);
2234 vfitab = _mm_cvttps_epi32(rt);
2235 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
2236 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
2237
2238 /* CUBIC SPLINE TABLE ELECTROSTATICS */
2239 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
2240 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
2241 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
2242 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
2243 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
2244 Heps = _mm_mul_ps(vfeps,H);
2245 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
2246 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
2247 felec = _mm_xor_ps(signbit,_mm_mul_ps(_mm_mul_ps(qq11,FF),_mm_mul_ps(vftabscale,rinv11)));
2248
2249 fscal = felec;
2250
2251 fscal = _mm_andnot_ps(dummy_mask,fscal);
2252
2253 /* Calculate temporary vectorial force */
2254 tx = _mm_mul_ps(fscal,dx11);
2255 ty = _mm_mul_ps(fscal,dy11);
2256 tz = _mm_mul_ps(fscal,dz11);
2257
2258 /* Update vectorial force */
2259 fix1 = _mm_add_ps(fix1,tx);
2260 fiy1 = _mm_add_ps(fiy1,ty);
2261 fiz1 = _mm_add_ps(fiz1,tz);
2262
2263 fjx1 = _mm_add_ps(fjx1,tx);
2264 fjy1 = _mm_add_ps(fjy1,ty);
2265 fjz1 = _mm_add_ps(fjz1,tz);
2266
2267 /**************************
2268 * CALCULATE INTERACTIONS *
2269 **************************/
2270
2271 r12 = _mm_mul_ps(rsq12,rinv12);
2272 r12 = _mm_andnot_ps(dummy_mask,r12);
2273
2274 /* Calculate table index by multiplying r with table scale and truncate to integer */
2275 rt = _mm_mul_ps(r12,vftabscale);
2276 vfitab = _mm_cvttps_epi32(rt);
2277 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
2278 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
2279
2280 /* CUBIC SPLINE TABLE ELECTROSTATICS */
2281 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
2282 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
2283 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
2284 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
2285 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
2286 Heps = _mm_mul_ps(vfeps,H);
2287 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
2288 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
2289 felec = _mm_xor_ps(signbit,_mm_mul_ps(_mm_mul_ps(qq12,FF),_mm_mul_ps(vftabscale,rinv12)));
2290
2291 fscal = felec;
2292
2293 fscal = _mm_andnot_ps(dummy_mask,fscal);
2294
2295 /* Calculate temporary vectorial force */
2296 tx = _mm_mul_ps(fscal,dx12);
2297 ty = _mm_mul_ps(fscal,dy12);
2298 tz = _mm_mul_ps(fscal,dz12);
2299
2300 /* Update vectorial force */
2301 fix1 = _mm_add_ps(fix1,tx);
2302 fiy1 = _mm_add_ps(fiy1,ty);
2303 fiz1 = _mm_add_ps(fiz1,tz);
2304
2305 fjx2 = _mm_add_ps(fjx2,tx);
2306 fjy2 = _mm_add_ps(fjy2,ty);
2307 fjz2 = _mm_add_ps(fjz2,tz);
2308
2309 /**************************
2310 * CALCULATE INTERACTIONS *
2311 **************************/
2312
2313 r13 = _mm_mul_ps(rsq13,rinv13);
2314 r13 = _mm_andnot_ps(dummy_mask,r13);
2315
2316 /* Calculate table index by multiplying r with table scale and truncate to integer */
2317 rt = _mm_mul_ps(r13,vftabscale);
2318 vfitab = _mm_cvttps_epi32(rt);
2319 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
2320 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
2321
2322 /* CUBIC SPLINE TABLE ELECTROSTATICS */
2323 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
2324 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
2325 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
2326 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
2327 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
2328 Heps = _mm_mul_ps(vfeps,H);
2329 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
2330 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
2331 felec = _mm_xor_ps(signbit,_mm_mul_ps(_mm_mul_ps(qq13,FF),_mm_mul_ps(vftabscale,rinv13)));
2332
2333 fscal = felec;
2334
2335 fscal = _mm_andnot_ps(dummy_mask,fscal);
2336
2337 /* Calculate temporary vectorial force */
2338 tx = _mm_mul_ps(fscal,dx13);
2339 ty = _mm_mul_ps(fscal,dy13);
2340 tz = _mm_mul_ps(fscal,dz13);
2341
2342 /* Update vectorial force */
2343 fix1 = _mm_add_ps(fix1,tx);
2344 fiy1 = _mm_add_ps(fiy1,ty);
2345 fiz1 = _mm_add_ps(fiz1,tz);
2346
2347 fjx3 = _mm_add_ps(fjx3,tx);
2348 fjy3 = _mm_add_ps(fjy3,ty);
2349 fjz3 = _mm_add_ps(fjz3,tz);
2350
2351 /**************************
2352 * CALCULATE INTERACTIONS *
2353 **************************/
2354
2355 r21 = _mm_mul_ps(rsq21,rinv21);
2356 r21 = _mm_andnot_ps(dummy_mask,r21);
2357
2358 /* Calculate table index by multiplying r with table scale and truncate to integer */
2359 rt = _mm_mul_ps(r21,vftabscale);
2360 vfitab = _mm_cvttps_epi32(rt);
2361 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
2362 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
2363
2364 /* CUBIC SPLINE TABLE ELECTROSTATICS */
2365 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
2366 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
2367 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
2368 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
2369 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
2370 Heps = _mm_mul_ps(vfeps,H);
2371 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
2372 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
2373 felec = _mm_xor_ps(signbit,_mm_mul_ps(_mm_mul_ps(qq21,FF),_mm_mul_ps(vftabscale,rinv21)));
2374
2375 fscal = felec;
2376
2377 fscal = _mm_andnot_ps(dummy_mask,fscal);
2378
2379 /* Calculate temporary vectorial force */
2380 tx = _mm_mul_ps(fscal,dx21);
2381 ty = _mm_mul_ps(fscal,dy21);
2382 tz = _mm_mul_ps(fscal,dz21);
2383
2384 /* Update vectorial force */
2385 fix2 = _mm_add_ps(fix2,tx);
2386 fiy2 = _mm_add_ps(fiy2,ty);
2387 fiz2 = _mm_add_ps(fiz2,tz);
2388
2389 fjx1 = _mm_add_ps(fjx1,tx);
2390 fjy1 = _mm_add_ps(fjy1,ty);
2391 fjz1 = _mm_add_ps(fjz1,tz);
2392
2393 /**************************
2394 * CALCULATE INTERACTIONS *
2395 **************************/
2396
2397 r22 = _mm_mul_ps(rsq22,rinv22);
2398 r22 = _mm_andnot_ps(dummy_mask,r22);
2399
2400 /* Calculate table index by multiplying r with table scale and truncate to integer */
2401 rt = _mm_mul_ps(r22,vftabscale);
2402 vfitab = _mm_cvttps_epi32(rt);
2403 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
2404 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
2405
2406 /* CUBIC SPLINE TABLE ELECTROSTATICS */
2407 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
2408 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
2409 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
2410 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
2411 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
2412 Heps = _mm_mul_ps(vfeps,H);
2413 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
2414 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
2415 felec = _mm_xor_ps(signbit,_mm_mul_ps(_mm_mul_ps(qq22,FF),_mm_mul_ps(vftabscale,rinv22)));
2416
2417 fscal = felec;
2418
2419 fscal = _mm_andnot_ps(dummy_mask,fscal);
2420
2421 /* Calculate temporary vectorial force */
2422 tx = _mm_mul_ps(fscal,dx22);
2423 ty = _mm_mul_ps(fscal,dy22);
2424 tz = _mm_mul_ps(fscal,dz22);
2425
2426 /* Update vectorial force */
2427 fix2 = _mm_add_ps(fix2,tx);
2428 fiy2 = _mm_add_ps(fiy2,ty);
2429 fiz2 = _mm_add_ps(fiz2,tz);
2430
2431 fjx2 = _mm_add_ps(fjx2,tx);
2432 fjy2 = _mm_add_ps(fjy2,ty);
2433 fjz2 = _mm_add_ps(fjz2,tz);
2434
2435 /**************************
2436 * CALCULATE INTERACTIONS *
2437 **************************/
2438
2439 r23 = _mm_mul_ps(rsq23,rinv23);
2440 r23 = _mm_andnot_ps(dummy_mask,r23);
2441
2442 /* Calculate table index by multiplying r with table scale and truncate to integer */
2443 rt = _mm_mul_ps(r23,vftabscale);
2444 vfitab = _mm_cvttps_epi32(rt);
2445 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
2446 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
2447
2448 /* CUBIC SPLINE TABLE ELECTROSTATICS */
2449 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
2450 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
2451 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
2452 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
2453 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
2454 Heps = _mm_mul_ps(vfeps,H);
2455 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
2456 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
2457 felec = _mm_xor_ps(signbit,_mm_mul_ps(_mm_mul_ps(qq23,FF),_mm_mul_ps(vftabscale,rinv23)));
2458
2459 fscal = felec;
2460
2461 fscal = _mm_andnot_ps(dummy_mask,fscal);
2462
2463 /* Calculate temporary vectorial force */
2464 tx = _mm_mul_ps(fscal,dx23);
2465 ty = _mm_mul_ps(fscal,dy23);
2466 tz = _mm_mul_ps(fscal,dz23);
2467
2468 /* Update vectorial force */
2469 fix2 = _mm_add_ps(fix2,tx);
2470 fiy2 = _mm_add_ps(fiy2,ty);
2471 fiz2 = _mm_add_ps(fiz2,tz);
2472
2473 fjx3 = _mm_add_ps(fjx3,tx);
2474 fjy3 = _mm_add_ps(fjy3,ty);
2475 fjz3 = _mm_add_ps(fjz3,tz);
2476
2477 /**************************
2478 * CALCULATE INTERACTIONS *
2479 **************************/
2480
2481 r31 = _mm_mul_ps(rsq31,rinv31);
2482 r31 = _mm_andnot_ps(dummy_mask,r31);
2483
2484 /* Calculate table index by multiplying r with table scale and truncate to integer */
2485 rt = _mm_mul_ps(r31,vftabscale);
2486 vfitab = _mm_cvttps_epi32(rt);
2487 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
2488 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
2489
2490 /* CUBIC SPLINE TABLE ELECTROSTATICS */
2491 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
2492 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
2493 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
2494 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
2495 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
2496 Heps = _mm_mul_ps(vfeps,H);
2497 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
2498 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
2499 felec = _mm_xor_ps(signbit,_mm_mul_ps(_mm_mul_ps(qq31,FF),_mm_mul_ps(vftabscale,rinv31)));
2500
2501 fscal = felec;
2502
2503 fscal = _mm_andnot_ps(dummy_mask,fscal);
2504
2505 /* Calculate temporary vectorial force */
2506 tx = _mm_mul_ps(fscal,dx31);
2507 ty = _mm_mul_ps(fscal,dy31);
2508 tz = _mm_mul_ps(fscal,dz31);
2509
2510 /* Update vectorial force */
2511 fix3 = _mm_add_ps(fix3,tx);
2512 fiy3 = _mm_add_ps(fiy3,ty);
2513 fiz3 = _mm_add_ps(fiz3,tz);
2514
2515 fjx1 = _mm_add_ps(fjx1,tx);
2516 fjy1 = _mm_add_ps(fjy1,ty);
2517 fjz1 = _mm_add_ps(fjz1,tz);
2518
2519 /**************************
2520 * CALCULATE INTERACTIONS *
2521 **************************/
2522
2523 r32 = _mm_mul_ps(rsq32,rinv32);
2524 r32 = _mm_andnot_ps(dummy_mask,r32);
2525
2526 /* Calculate table index by multiplying r with table scale and truncate to integer */
2527 rt = _mm_mul_ps(r32,vftabscale);
2528 vfitab = _mm_cvttps_epi32(rt);
2529 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
2530 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
2531
2532 /* CUBIC SPLINE TABLE ELECTROSTATICS */
2533 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
2534 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
2535 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
2536 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
2537 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
2538 Heps = _mm_mul_ps(vfeps,H);
2539 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
2540 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
2541 felec = _mm_xor_ps(signbit,_mm_mul_ps(_mm_mul_ps(qq32,FF),_mm_mul_ps(vftabscale,rinv32)));
2542
2543 fscal = felec;
2544
2545 fscal = _mm_andnot_ps(dummy_mask,fscal);
2546
2547 /* Calculate temporary vectorial force */
2548 tx = _mm_mul_ps(fscal,dx32);
2549 ty = _mm_mul_ps(fscal,dy32);
2550 tz = _mm_mul_ps(fscal,dz32);
2551
2552 /* Update vectorial force */
2553 fix3 = _mm_add_ps(fix3,tx);
2554 fiy3 = _mm_add_ps(fiy3,ty);
2555 fiz3 = _mm_add_ps(fiz3,tz);
2556
2557 fjx2 = _mm_add_ps(fjx2,tx);
2558 fjy2 = _mm_add_ps(fjy2,ty);
2559 fjz2 = _mm_add_ps(fjz2,tz);
2560
2561 /**************************
2562 * CALCULATE INTERACTIONS *
2563 **************************/
2564
2565 r33 = _mm_mul_ps(rsq33,rinv33);
2566 r33 = _mm_andnot_ps(dummy_mask,r33);
2567
2568 /* Calculate table index by multiplying r with table scale and truncate to integer */
2569 rt = _mm_mul_ps(r33,vftabscale);
2570 vfitab = _mm_cvttps_epi32(rt);
2571 vfeps = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR)__extension__ ({ __m128 __X = (rt); (__m128) __builtin_ia32_roundps
((__v4sf)__X, ((0x00 | 0x01))); })
);
2572 vfitab = _mm_slli_epi32(_mm_add_epi32(vfitab,_mm_slli_epi32(vfitab,1)),2);
2573
2574 /* CUBIC SPLINE TABLE ELECTROSTATICS */
2575 Y = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(0) &
3];}))
);
2576 F = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(1) &
3];}))
);
2577 G = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(2) &
3];}))
);
2578 H = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3)(__extension__ ({ __v4si __a = (__v4si)(vfitab); __a[(3) &
3];}))
);
2579 _MM_TRANSPOSE4_PS(Y,F,G,H)do { __m128 tmp3, tmp2, tmp1, tmp0; tmp0 = _mm_unpacklo_ps((Y
), (F)); tmp2 = _mm_unpacklo_ps((G), (H)); tmp1 = _mm_unpackhi_ps
((Y), (F)); tmp3 = _mm_unpackhi_ps((G), (H)); (Y) = _mm_movelh_ps
(tmp0, tmp2); (F) = _mm_movehl_ps(tmp2, tmp0); (G) = _mm_movelh_ps
(tmp1, tmp3); (H) = _mm_movehl_ps(tmp3, tmp1); } while (0)
;
2580 Heps = _mm_mul_ps(vfeps,H);
2581 Fp = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
2582 FF = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
2583 felec = _mm_xor_ps(signbit,_mm_mul_ps(_mm_mul_ps(qq33,FF),_mm_mul_ps(vftabscale,rinv33)));
2584
2585 fscal = felec;
2586
2587 fscal = _mm_andnot_ps(dummy_mask,fscal);
2588
2589 /* Calculate temporary vectorial force */
2590 tx = _mm_mul_ps(fscal,dx33);
2591 ty = _mm_mul_ps(fscal,dy33);
2592 tz = _mm_mul_ps(fscal,dz33);
2593
2594 /* Update vectorial force */
2595 fix3 = _mm_add_ps(fix3,tx);
2596 fiy3 = _mm_add_ps(fiy3,ty);
2597 fiz3 = _mm_add_ps(fiz3,tz);
2598
2599 fjx3 = _mm_add_ps(fjx3,tx);
2600 fjy3 = _mm_add_ps(fjy3,ty);
2601 fjz3 = _mm_add_ps(fjz3,tz);
2602
2603 fjptrA = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
2604 fjptrB = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
2605 fjptrC = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
2606 fjptrD = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
2607
2608 gmx_mm_decrement_4rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,
2609 fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,
2610 fjx2,fjy2,fjz2,fjx3,fjy3,fjz3);
2611
2612 /* Inner loop uses 412 flops */
2613 }
2614
2615 /* End of innermost loop */
2616
2617 gmx_mm_update_iforce_4atom_swizzle_ps(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
2618 f+i_coord_offset,fshift+i_shift_offset);
2619
2620 /* Increment number of inner iterations */
2621 inneriter += j_index_end - j_index_start;
2622
2623 /* Outer loop uses 24 flops */
2624 }
2625
2626 /* Increment number of outer iterations */
2627 outeriter += nri;
2628
2629 /* Update outer/inner flops */
2630
2631 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4W4_F,outeriter*24 + inneriter*412)(nrnb)->n[eNR_NBKERNEL_ELEC_VDW_W4W4_F] += outeriter*24 + inneriter
*412
;
2632}