2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2012,2013, by the GROMACS development team, led by
5 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6 * and including many others, as listed in the AUTHORS file in the
7 * top-level source directory and at http://www.gromacs.org.
9 * GROMACS is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 2.1
12 * of the License, or (at your option) any later version.
14 * GROMACS is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with GROMACS; if not, see
21 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 * If you want to redistribute modifications to GROMACS, please
25 * consider that scientific software is very special. Version
26 * control is crucial - bugs must be traceable. We will be happy to
27 * consider code for inclusion in the official distribution, but
28 * derived work must not be called official GROMACS. Details are found
29 * in the README & COPYING files - if they are missing, get the
30 * official version at http://www.gromacs.org.
32 * To help us fund GROMACS development, we humbly ask that you cite
33 * the research papers on the package. Check out http://www.gromacs.org.
36 * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
44 #include "../nb_kernel.h"
45 #include "types/simple.h"
49 #include "kernelutil_sparc64_hpc_ace_double.h"
52 * Gromacs nonbonded kernel: nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sparc64_hpc_ace_double
53 * Electrostatics interaction: CubicSplineTable
54 * VdW interaction: None
55 * Geometry: Water4-Particle
56 * Calculate force/pot: PotentialAndForce
59 nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sparc64_hpc_ace_double
60 (t_nblist * gmx_restrict nlist,
61 rvec * gmx_restrict xx,
62 rvec * gmx_restrict ff,
63 t_forcerec * gmx_restrict fr,
64 t_mdatoms * gmx_restrict mdatoms,
65 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
66 t_nrnb * gmx_restrict nrnb)
68 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
69 * just 0 for non-waters.
70 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
71 * jnr indices corresponding to data put in the four positions in the SIMD register.
73 int i_shift_offset,i_coord_offset,outeriter,inneriter;
74 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
76 int j_coord_offsetA,j_coord_offsetB;
77 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
79 real *shiftvec,*fshift,*x,*f;
80 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
82 _fjsp_v2r8 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
84 _fjsp_v2r8 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
86 _fjsp_v2r8 ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
87 int vdwjidx0A,vdwjidx0B;
88 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
89 _fjsp_v2r8 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
90 _fjsp_v2r8 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
91 _fjsp_v2r8 dx30,dy30,dz30,rsq30,rinv30,rinvsq30,r30,qq30,c6_30,c12_30;
92 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
94 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
97 _fjsp_v2r8 dummy_mask,cutoff_mask;
98 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
99 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
100 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
107 jindex = nlist->jindex;
109 shiftidx = nlist->shift;
111 shiftvec = fr->shift_vec[0];
112 fshift = fr->fshift[0];
113 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
114 charge = mdatoms->chargeA;
116 vftab = kernel_data->table_elec->data;
117 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_elec->scale);
119 /* Setup water-specific parameters */
120 inr = nlist->iinr[0];
121 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
122 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
123 iq3 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+3]));
125 /* Avoid stupid compiler warnings */
133 /* Start outer loop over neighborlists */
134 for(iidx=0; iidx<nri; iidx++)
136 /* Load shift vector for this list */
137 i_shift_offset = DIM*shiftidx[iidx];
139 /* Load limits for loop over neighbors */
140 j_index_start = jindex[iidx];
141 j_index_end = jindex[iidx+1];
143 /* Get outer coordinate index */
145 i_coord_offset = DIM*inr;
147 /* Load i particle coords and add shift vector */
148 gmx_fjsp_load_shift_and_3rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset+DIM,
149 &ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
151 fix1 = _fjsp_setzero_v2r8();
152 fiy1 = _fjsp_setzero_v2r8();
153 fiz1 = _fjsp_setzero_v2r8();
154 fix2 = _fjsp_setzero_v2r8();
155 fiy2 = _fjsp_setzero_v2r8();
156 fiz2 = _fjsp_setzero_v2r8();
157 fix3 = _fjsp_setzero_v2r8();
158 fiy3 = _fjsp_setzero_v2r8();
159 fiz3 = _fjsp_setzero_v2r8();
161 /* Reset potential sums */
162 velecsum = _fjsp_setzero_v2r8();
164 /* Start inner kernel loop */
165 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
168 /* Get j neighbor index, and coordinate index */
171 j_coord_offsetA = DIM*jnrA;
172 j_coord_offsetB = DIM*jnrB;
174 /* load j atom coordinates */
175 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
178 /* Calculate displacement vector */
179 dx10 = _fjsp_sub_v2r8(ix1,jx0);
180 dy10 = _fjsp_sub_v2r8(iy1,jy0);
181 dz10 = _fjsp_sub_v2r8(iz1,jz0);
182 dx20 = _fjsp_sub_v2r8(ix2,jx0);
183 dy20 = _fjsp_sub_v2r8(iy2,jy0);
184 dz20 = _fjsp_sub_v2r8(iz2,jz0);
185 dx30 = _fjsp_sub_v2r8(ix3,jx0);
186 dy30 = _fjsp_sub_v2r8(iy3,jy0);
187 dz30 = _fjsp_sub_v2r8(iz3,jz0);
189 /* Calculate squared distance and things based on it */
190 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
191 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
192 rsq30 = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
194 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
195 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
196 rinv30 = gmx_fjsp_invsqrt_v2r8(rsq30);
198 /* Load parameters for j particles */
199 jq0 = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
201 fjx0 = _fjsp_setzero_v2r8();
202 fjy0 = _fjsp_setzero_v2r8();
203 fjz0 = _fjsp_setzero_v2r8();
205 /**************************
206 * CALCULATE INTERACTIONS *
207 **************************/
209 r10 = _fjsp_mul_v2r8(rsq10,rinv10);
211 /* Compute parameters for interactions between i and j atoms */
212 qq10 = _fjsp_mul_v2r8(iq1,jq0);
214 /* Calculate table index by multiplying r with table scale and truncate to integer */
215 rt = _fjsp_mul_v2r8(r10,vftabscale);
216 itab_tmp = _fjsp_dtox_v2r8(rt);
217 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
218 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
219 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
224 /* CUBIC SPLINE TABLE ELECTROSTATICS */
225 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
226 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
227 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
228 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
229 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
230 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
231 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
232 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
233 velec = _fjsp_mul_v2r8(qq10,VV);
234 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
235 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,FF),_fjsp_mul_v2r8(vftabscale,rinv10)));
237 /* Update potential sum for this i atom from the interaction with this j atom. */
238 velecsum = _fjsp_add_v2r8(velecsum,velec);
242 /* Update vectorial force */
243 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
244 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
245 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
247 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
248 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
249 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
251 /**************************
252 * CALCULATE INTERACTIONS *
253 **************************/
255 r20 = _fjsp_mul_v2r8(rsq20,rinv20);
257 /* Compute parameters for interactions between i and j atoms */
258 qq20 = _fjsp_mul_v2r8(iq2,jq0);
260 /* Calculate table index by multiplying r with table scale and truncate to integer */
261 rt = _fjsp_mul_v2r8(r20,vftabscale);
262 itab_tmp = _fjsp_dtox_v2r8(rt);
263 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
264 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
265 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
270 /* CUBIC SPLINE TABLE ELECTROSTATICS */
271 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
272 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
273 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
274 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
275 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
276 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
277 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
278 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
279 velec = _fjsp_mul_v2r8(qq20,VV);
280 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
281 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,FF),_fjsp_mul_v2r8(vftabscale,rinv20)));
283 /* Update potential sum for this i atom from the interaction with this j atom. */
284 velecsum = _fjsp_add_v2r8(velecsum,velec);
288 /* Update vectorial force */
289 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
290 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
291 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
293 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
294 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
295 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
297 /**************************
298 * CALCULATE INTERACTIONS *
299 **************************/
301 r30 = _fjsp_mul_v2r8(rsq30,rinv30);
303 /* Compute parameters for interactions between i and j atoms */
304 qq30 = _fjsp_mul_v2r8(iq3,jq0);
306 /* Calculate table index by multiplying r with table scale and truncate to integer */
307 rt = _fjsp_mul_v2r8(r30,vftabscale);
308 itab_tmp = _fjsp_dtox_v2r8(rt);
309 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
310 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
311 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
316 /* CUBIC SPLINE TABLE ELECTROSTATICS */
317 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
318 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
319 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
320 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
321 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
322 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
323 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
324 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
325 velec = _fjsp_mul_v2r8(qq30,VV);
326 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
327 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq30,FF),_fjsp_mul_v2r8(vftabscale,rinv30)));
329 /* Update potential sum for this i atom from the interaction with this j atom. */
330 velecsum = _fjsp_add_v2r8(velecsum,velec);
334 /* Update vectorial force */
335 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
336 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
337 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
339 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
340 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
341 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
343 gmx_fjsp_decrement_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0);
345 /* Inner loop uses 141 flops */
352 j_coord_offsetA = DIM*jnrA;
354 /* load j atom coordinates */
355 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
358 /* Calculate displacement vector */
359 dx10 = _fjsp_sub_v2r8(ix1,jx0);
360 dy10 = _fjsp_sub_v2r8(iy1,jy0);
361 dz10 = _fjsp_sub_v2r8(iz1,jz0);
362 dx20 = _fjsp_sub_v2r8(ix2,jx0);
363 dy20 = _fjsp_sub_v2r8(iy2,jy0);
364 dz20 = _fjsp_sub_v2r8(iz2,jz0);
365 dx30 = _fjsp_sub_v2r8(ix3,jx0);
366 dy30 = _fjsp_sub_v2r8(iy3,jy0);
367 dz30 = _fjsp_sub_v2r8(iz3,jz0);
369 /* Calculate squared distance and things based on it */
370 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
371 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
372 rsq30 = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
374 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
375 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
376 rinv30 = gmx_fjsp_invsqrt_v2r8(rsq30);
378 /* Load parameters for j particles */
379 jq0 = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
381 fjx0 = _fjsp_setzero_v2r8();
382 fjy0 = _fjsp_setzero_v2r8();
383 fjz0 = _fjsp_setzero_v2r8();
385 /**************************
386 * CALCULATE INTERACTIONS *
387 **************************/
389 r10 = _fjsp_mul_v2r8(rsq10,rinv10);
391 /* Compute parameters for interactions between i and j atoms */
392 qq10 = _fjsp_mul_v2r8(iq1,jq0);
394 /* Calculate table index by multiplying r with table scale and truncate to integer */
395 rt = _fjsp_mul_v2r8(r10,vftabscale);
396 itab_tmp = _fjsp_dtox_v2r8(rt);
397 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
398 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
399 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
404 /* CUBIC SPLINE TABLE ELECTROSTATICS */
405 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
406 F = _fjsp_setzero_v2r8();
407 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
408 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
409 H = _fjsp_setzero_v2r8();
410 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
411 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
412 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
413 velec = _fjsp_mul_v2r8(qq10,VV);
414 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
415 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,FF),_fjsp_mul_v2r8(vftabscale,rinv10)));
417 /* Update potential sum for this i atom from the interaction with this j atom. */
418 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
419 velecsum = _fjsp_add_v2r8(velecsum,velec);
423 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
425 /* Update vectorial force */
426 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
427 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
428 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
430 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
431 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
432 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
434 /**************************
435 * CALCULATE INTERACTIONS *
436 **************************/
438 r20 = _fjsp_mul_v2r8(rsq20,rinv20);
440 /* Compute parameters for interactions between i and j atoms */
441 qq20 = _fjsp_mul_v2r8(iq2,jq0);
443 /* Calculate table index by multiplying r with table scale and truncate to integer */
444 rt = _fjsp_mul_v2r8(r20,vftabscale);
445 itab_tmp = _fjsp_dtox_v2r8(rt);
446 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
447 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
448 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
453 /* CUBIC SPLINE TABLE ELECTROSTATICS */
454 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
455 F = _fjsp_setzero_v2r8();
456 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
457 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
458 H = _fjsp_setzero_v2r8();
459 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
460 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
461 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
462 velec = _fjsp_mul_v2r8(qq20,VV);
463 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
464 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,FF),_fjsp_mul_v2r8(vftabscale,rinv20)));
466 /* Update potential sum for this i atom from the interaction with this j atom. */
467 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
468 velecsum = _fjsp_add_v2r8(velecsum,velec);
472 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
474 /* Update vectorial force */
475 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
476 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
477 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
479 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
480 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
481 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
483 /**************************
484 * CALCULATE INTERACTIONS *
485 **************************/
487 r30 = _fjsp_mul_v2r8(rsq30,rinv30);
489 /* Compute parameters for interactions between i and j atoms */
490 qq30 = _fjsp_mul_v2r8(iq3,jq0);
492 /* Calculate table index by multiplying r with table scale and truncate to integer */
493 rt = _fjsp_mul_v2r8(r30,vftabscale);
494 itab_tmp = _fjsp_dtox_v2r8(rt);
495 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
496 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
497 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
502 /* CUBIC SPLINE TABLE ELECTROSTATICS */
503 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
504 F = _fjsp_setzero_v2r8();
505 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
506 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
507 H = _fjsp_setzero_v2r8();
508 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
509 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
510 VV = _fjsp_madd_v2r8(vfeps,Fp,Y);
511 velec = _fjsp_mul_v2r8(qq30,VV);
512 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
513 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq30,FF),_fjsp_mul_v2r8(vftabscale,rinv30)));
515 /* Update potential sum for this i atom from the interaction with this j atom. */
516 velec = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
517 velecsum = _fjsp_add_v2r8(velecsum,velec);
521 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
523 /* Update vectorial force */
524 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
525 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
526 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
528 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
529 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
530 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
532 gmx_fjsp_decrement_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0);
534 /* Inner loop uses 141 flops */
537 /* End of innermost loop */
539 gmx_fjsp_update_iforce_3atom_swizzle_v2r8(fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
540 f+i_coord_offset+DIM,fshift+i_shift_offset);
543 /* Update potential energies */
544 gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
546 /* Increment number of inner iterations */
547 inneriter += j_index_end - j_index_start;
549 /* Outer loop uses 19 flops */
552 /* Increment number of outer iterations */
555 /* Update outer/inner flops */
557 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_W4_VF,outeriter*19 + inneriter*141);
560 * Gromacs nonbonded kernel: nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sparc64_hpc_ace_double
561 * Electrostatics interaction: CubicSplineTable
562 * VdW interaction: None
563 * Geometry: Water4-Particle
564 * Calculate force/pot: Force
567 nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sparc64_hpc_ace_double
568 (t_nblist * gmx_restrict nlist,
569 rvec * gmx_restrict xx,
570 rvec * gmx_restrict ff,
571 t_forcerec * gmx_restrict fr,
572 t_mdatoms * gmx_restrict mdatoms,
573 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
574 t_nrnb * gmx_restrict nrnb)
576 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
577 * just 0 for non-waters.
578 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
579 * jnr indices corresponding to data put in the four positions in the SIMD register.
581 int i_shift_offset,i_coord_offset,outeriter,inneriter;
582 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
584 int j_coord_offsetA,j_coord_offsetB;
585 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
587 real *shiftvec,*fshift,*x,*f;
588 _fjsp_v2r8 tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
590 _fjsp_v2r8 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
592 _fjsp_v2r8 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
594 _fjsp_v2r8 ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
595 int vdwjidx0A,vdwjidx0B;
596 _fjsp_v2r8 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
597 _fjsp_v2r8 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
598 _fjsp_v2r8 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
599 _fjsp_v2r8 dx30,dy30,dz30,rsq30,rinv30,rinvsq30,r30,qq30,c6_30,c12_30;
600 _fjsp_v2r8 velec,felec,velecsum,facel,crf,krf,krf2;
602 _fjsp_v2r8 rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
605 _fjsp_v2r8 dummy_mask,cutoff_mask;
606 _fjsp_v2r8 one = gmx_fjsp_set1_v2r8(1.0);
607 _fjsp_v2r8 two = gmx_fjsp_set1_v2r8(2.0);
608 union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
615 jindex = nlist->jindex;
617 shiftidx = nlist->shift;
619 shiftvec = fr->shift_vec[0];
620 fshift = fr->fshift[0];
621 facel = gmx_fjsp_set1_v2r8(fr->epsfac);
622 charge = mdatoms->chargeA;
624 vftab = kernel_data->table_elec->data;
625 vftabscale = gmx_fjsp_set1_v2r8(kernel_data->table_elec->scale);
627 /* Setup water-specific parameters */
628 inr = nlist->iinr[0];
629 iq1 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+1]));
630 iq2 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+2]));
631 iq3 = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+3]));
633 /* Avoid stupid compiler warnings */
641 /* Start outer loop over neighborlists */
642 for(iidx=0; iidx<nri; iidx++)
644 /* Load shift vector for this list */
645 i_shift_offset = DIM*shiftidx[iidx];
647 /* Load limits for loop over neighbors */
648 j_index_start = jindex[iidx];
649 j_index_end = jindex[iidx+1];
651 /* Get outer coordinate index */
653 i_coord_offset = DIM*inr;
655 /* Load i particle coords and add shift vector */
656 gmx_fjsp_load_shift_and_3rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset+DIM,
657 &ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
659 fix1 = _fjsp_setzero_v2r8();
660 fiy1 = _fjsp_setzero_v2r8();
661 fiz1 = _fjsp_setzero_v2r8();
662 fix2 = _fjsp_setzero_v2r8();
663 fiy2 = _fjsp_setzero_v2r8();
664 fiz2 = _fjsp_setzero_v2r8();
665 fix3 = _fjsp_setzero_v2r8();
666 fiy3 = _fjsp_setzero_v2r8();
667 fiz3 = _fjsp_setzero_v2r8();
669 /* Start inner kernel loop */
670 for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
673 /* Get j neighbor index, and coordinate index */
676 j_coord_offsetA = DIM*jnrA;
677 j_coord_offsetB = DIM*jnrB;
679 /* load j atom coordinates */
680 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
683 /* Calculate displacement vector */
684 dx10 = _fjsp_sub_v2r8(ix1,jx0);
685 dy10 = _fjsp_sub_v2r8(iy1,jy0);
686 dz10 = _fjsp_sub_v2r8(iz1,jz0);
687 dx20 = _fjsp_sub_v2r8(ix2,jx0);
688 dy20 = _fjsp_sub_v2r8(iy2,jy0);
689 dz20 = _fjsp_sub_v2r8(iz2,jz0);
690 dx30 = _fjsp_sub_v2r8(ix3,jx0);
691 dy30 = _fjsp_sub_v2r8(iy3,jy0);
692 dz30 = _fjsp_sub_v2r8(iz3,jz0);
694 /* Calculate squared distance and things based on it */
695 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
696 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
697 rsq30 = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
699 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
700 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
701 rinv30 = gmx_fjsp_invsqrt_v2r8(rsq30);
703 /* Load parameters for j particles */
704 jq0 = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
706 fjx0 = _fjsp_setzero_v2r8();
707 fjy0 = _fjsp_setzero_v2r8();
708 fjz0 = _fjsp_setzero_v2r8();
710 /**************************
711 * CALCULATE INTERACTIONS *
712 **************************/
714 r10 = _fjsp_mul_v2r8(rsq10,rinv10);
716 /* Compute parameters for interactions between i and j atoms */
717 qq10 = _fjsp_mul_v2r8(iq1,jq0);
719 /* Calculate table index by multiplying r with table scale and truncate to integer */
720 rt = _fjsp_mul_v2r8(r10,vftabscale);
721 itab_tmp = _fjsp_dtox_v2r8(rt);
722 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
723 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
724 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
729 /* CUBIC SPLINE TABLE ELECTROSTATICS */
730 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
731 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
732 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
733 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
734 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
735 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
736 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
737 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
738 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,FF),_fjsp_mul_v2r8(vftabscale,rinv10)));
742 /* Update vectorial force */
743 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
744 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
745 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
747 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
748 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
749 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
751 /**************************
752 * CALCULATE INTERACTIONS *
753 **************************/
755 r20 = _fjsp_mul_v2r8(rsq20,rinv20);
757 /* Compute parameters for interactions between i and j atoms */
758 qq20 = _fjsp_mul_v2r8(iq2,jq0);
760 /* Calculate table index by multiplying r with table scale and truncate to integer */
761 rt = _fjsp_mul_v2r8(r20,vftabscale);
762 itab_tmp = _fjsp_dtox_v2r8(rt);
763 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
764 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
765 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
770 /* CUBIC SPLINE TABLE ELECTROSTATICS */
771 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
772 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
773 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
774 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
775 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
776 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
777 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
778 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
779 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,FF),_fjsp_mul_v2r8(vftabscale,rinv20)));
783 /* Update vectorial force */
784 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
785 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
786 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
788 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
789 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
790 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
792 /**************************
793 * CALCULATE INTERACTIONS *
794 **************************/
796 r30 = _fjsp_mul_v2r8(rsq30,rinv30);
798 /* Compute parameters for interactions between i and j atoms */
799 qq30 = _fjsp_mul_v2r8(iq3,jq0);
801 /* Calculate table index by multiplying r with table scale and truncate to integer */
802 rt = _fjsp_mul_v2r8(r30,vftabscale);
803 itab_tmp = _fjsp_dtox_v2r8(rt);
804 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
805 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
806 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
811 /* CUBIC SPLINE TABLE ELECTROSTATICS */
812 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
813 F = _fjsp_load_v2r8( vftab + vfconv.i[1] );
814 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
815 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
816 H = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
817 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
818 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
819 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
820 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq30,FF),_fjsp_mul_v2r8(vftabscale,rinv30)));
824 /* Update vectorial force */
825 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
826 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
827 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
829 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
830 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
831 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
833 gmx_fjsp_decrement_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0);
835 /* Inner loop uses 129 flops */
842 j_coord_offsetA = DIM*jnrA;
844 /* load j atom coordinates */
845 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
848 /* Calculate displacement vector */
849 dx10 = _fjsp_sub_v2r8(ix1,jx0);
850 dy10 = _fjsp_sub_v2r8(iy1,jy0);
851 dz10 = _fjsp_sub_v2r8(iz1,jz0);
852 dx20 = _fjsp_sub_v2r8(ix2,jx0);
853 dy20 = _fjsp_sub_v2r8(iy2,jy0);
854 dz20 = _fjsp_sub_v2r8(iz2,jz0);
855 dx30 = _fjsp_sub_v2r8(ix3,jx0);
856 dy30 = _fjsp_sub_v2r8(iy3,jy0);
857 dz30 = _fjsp_sub_v2r8(iz3,jz0);
859 /* Calculate squared distance and things based on it */
860 rsq10 = gmx_fjsp_calc_rsq_v2r8(dx10,dy10,dz10);
861 rsq20 = gmx_fjsp_calc_rsq_v2r8(dx20,dy20,dz20);
862 rsq30 = gmx_fjsp_calc_rsq_v2r8(dx30,dy30,dz30);
864 rinv10 = gmx_fjsp_invsqrt_v2r8(rsq10);
865 rinv20 = gmx_fjsp_invsqrt_v2r8(rsq20);
866 rinv30 = gmx_fjsp_invsqrt_v2r8(rsq30);
868 /* Load parameters for j particles */
869 jq0 = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
871 fjx0 = _fjsp_setzero_v2r8();
872 fjy0 = _fjsp_setzero_v2r8();
873 fjz0 = _fjsp_setzero_v2r8();
875 /**************************
876 * CALCULATE INTERACTIONS *
877 **************************/
879 r10 = _fjsp_mul_v2r8(rsq10,rinv10);
881 /* Compute parameters for interactions between i and j atoms */
882 qq10 = _fjsp_mul_v2r8(iq1,jq0);
884 /* Calculate table index by multiplying r with table scale and truncate to integer */
885 rt = _fjsp_mul_v2r8(r10,vftabscale);
886 itab_tmp = _fjsp_dtox_v2r8(rt);
887 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
888 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
889 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
894 /* CUBIC SPLINE TABLE ELECTROSTATICS */
895 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
896 F = _fjsp_setzero_v2r8();
897 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
898 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
899 H = _fjsp_setzero_v2r8();
900 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
901 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
902 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
903 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10,FF),_fjsp_mul_v2r8(vftabscale,rinv10)));
907 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
909 /* Update vectorial force */
910 fix1 = _fjsp_madd_v2r8(dx10,fscal,fix1);
911 fiy1 = _fjsp_madd_v2r8(dy10,fscal,fiy1);
912 fiz1 = _fjsp_madd_v2r8(dz10,fscal,fiz1);
914 fjx0 = _fjsp_madd_v2r8(dx10,fscal,fjx0);
915 fjy0 = _fjsp_madd_v2r8(dy10,fscal,fjy0);
916 fjz0 = _fjsp_madd_v2r8(dz10,fscal,fjz0);
918 /**************************
919 * CALCULATE INTERACTIONS *
920 **************************/
922 r20 = _fjsp_mul_v2r8(rsq20,rinv20);
924 /* Compute parameters for interactions between i and j atoms */
925 qq20 = _fjsp_mul_v2r8(iq2,jq0);
927 /* Calculate table index by multiplying r with table scale and truncate to integer */
928 rt = _fjsp_mul_v2r8(r20,vftabscale);
929 itab_tmp = _fjsp_dtox_v2r8(rt);
930 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
931 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
932 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
937 /* CUBIC SPLINE TABLE ELECTROSTATICS */
938 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
939 F = _fjsp_setzero_v2r8();
940 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
941 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
942 H = _fjsp_setzero_v2r8();
943 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
944 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
945 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
946 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20,FF),_fjsp_mul_v2r8(vftabscale,rinv20)));
950 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
952 /* Update vectorial force */
953 fix2 = _fjsp_madd_v2r8(dx20,fscal,fix2);
954 fiy2 = _fjsp_madd_v2r8(dy20,fscal,fiy2);
955 fiz2 = _fjsp_madd_v2r8(dz20,fscal,fiz2);
957 fjx0 = _fjsp_madd_v2r8(dx20,fscal,fjx0);
958 fjy0 = _fjsp_madd_v2r8(dy20,fscal,fjy0);
959 fjz0 = _fjsp_madd_v2r8(dz20,fscal,fjz0);
961 /**************************
962 * CALCULATE INTERACTIONS *
963 **************************/
965 r30 = _fjsp_mul_v2r8(rsq30,rinv30);
967 /* Compute parameters for interactions between i and j atoms */
968 qq30 = _fjsp_mul_v2r8(iq3,jq0);
970 /* Calculate table index by multiplying r with table scale and truncate to integer */
971 rt = _fjsp_mul_v2r8(r30,vftabscale);
972 itab_tmp = _fjsp_dtox_v2r8(rt);
973 vfeps = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
974 twovfeps = _fjsp_add_v2r8(vfeps,vfeps);
975 _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
980 /* CUBIC SPLINE TABLE ELECTROSTATICS */
981 Y = _fjsp_load_v2r8( vftab + vfconv.i[0] );
982 F = _fjsp_setzero_v2r8();
983 GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
984 G = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
985 H = _fjsp_setzero_v2r8();
986 GMX_FJSP_TRANSPOSE2_V2R8(G,H);
987 Fp = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
988 FF = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
989 felec = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq30,FF),_fjsp_mul_v2r8(vftabscale,rinv30)));
993 fscal = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
995 /* Update vectorial force */
996 fix3 = _fjsp_madd_v2r8(dx30,fscal,fix3);
997 fiy3 = _fjsp_madd_v2r8(dy30,fscal,fiy3);
998 fiz3 = _fjsp_madd_v2r8(dz30,fscal,fiz3);
1000 fjx0 = _fjsp_madd_v2r8(dx30,fscal,fjx0);
1001 fjy0 = _fjsp_madd_v2r8(dy30,fscal,fjy0);
1002 fjz0 = _fjsp_madd_v2r8(dz30,fscal,fjz0);
1004 gmx_fjsp_decrement_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0);
1006 /* Inner loop uses 129 flops */
1009 /* End of innermost loop */
1011 gmx_fjsp_update_iforce_3atom_swizzle_v2r8(fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
1012 f+i_coord_offset+DIM,fshift+i_shift_offset);
1014 /* Increment number of inner iterations */
1015 inneriter += j_index_end - j_index_start;
1017 /* Outer loop uses 18 flops */
1020 /* Increment number of outer iterations */
1023 /* Update outer/inner flops */
1025 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_W4_F,outeriter*18 + inneriter*129);