2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2012,2013,2014,2015,2017, 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 "gromacs/gmxlib/nrnb.h"
47 #include "kernelutil_sparc64_hpc_ace_double.h"
50 * Gromacs nonbonded kernel: nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sparc64_hpc_ace_double
51 * Electrostatics interaction: CubicSplineTable
52 * VdW interaction: CubicSplineTable
53 * Geometry: Water4-Particle
54 * Calculate force/pot: PotentialAndForce
57 nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sparc64_hpc_ace_double
58 (t_nblist
* gmx_restrict nlist
,
59 rvec
* gmx_restrict xx
,
60 rvec
* gmx_restrict ff
,
61 struct t_forcerec
* gmx_restrict fr
,
62 t_mdatoms
* gmx_restrict mdatoms
,
63 nb_kernel_data_t gmx_unused
* gmx_restrict kernel_data
,
64 t_nrnb
* gmx_restrict nrnb
)
66 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
67 * just 0 for non-waters.
68 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
69 * jnr indices corresponding to data put in the four positions in the SIMD register.
71 int i_shift_offset
,i_coord_offset
,outeriter
,inneriter
;
72 int j_index_start
,j_index_end
,jidx
,nri
,inr
,ggid
,iidx
;
74 int j_coord_offsetA
,j_coord_offsetB
;
75 int *iinr
,*jindex
,*jjnr
,*shiftidx
,*gid
;
77 real
*shiftvec
,*fshift
,*x
,*f
;
78 _fjsp_v2r8 tx
,ty
,tz
,fscal
,rcutoff
,rcutoff2
,jidxall
;
80 _fjsp_v2r8 ix0
,iy0
,iz0
,fix0
,fiy0
,fiz0
,iq0
,isai0
;
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 dx00
,dy00
,dz00
,rsq00
,rinv00
,rinvsq00
,r00
,qq00
,c6_00
,c12_00
;
90 _fjsp_v2r8 dx10
,dy10
,dz10
,rsq10
,rinv10
,rinvsq10
,r10
,qq10
,c6_10
,c12_10
;
91 _fjsp_v2r8 dx20
,dy20
,dz20
,rsq20
,rinv20
,rinvsq20
,r20
,qq20
,c6_20
,c12_20
;
92 _fjsp_v2r8 dx30
,dy30
,dz30
,rsq30
,rinv30
,rinvsq30
,r30
,qq30
,c6_30
,c12_30
;
93 _fjsp_v2r8 velec
,felec
,velecsum
,facel
,crf
,krf
,krf2
;
96 _fjsp_v2r8 rinvsix
,rvdw
,vvdw
,vvdw6
,vvdw12
,fvdw
,fvdw6
,fvdw12
,vvdwsum
,sh_vdw_invrcut6
;
99 _fjsp_v2r8 one_sixth
= gmx_fjsp_set1_v2r8(1.0/6.0);
100 _fjsp_v2r8 one_twelfth
= gmx_fjsp_set1_v2r8(1.0/12.0);
101 _fjsp_v2r8 rt
,vfeps
,vftabscale
,Y
,F
,G
,H
,Heps
,Fp
,VV
,FF
,twovfeps
;
104 _fjsp_v2r8 dummy_mask
,cutoff_mask
;
105 _fjsp_v2r8 one
= gmx_fjsp_set1_v2r8(1.0);
106 _fjsp_v2r8 two
= gmx_fjsp_set1_v2r8(2.0);
107 union { _fjsp_v2r8 simd
; long long int i
[2]; } vfconv
,gbconv
,ewconv
;
114 jindex
= nlist
->jindex
;
116 shiftidx
= nlist
->shift
;
118 shiftvec
= fr
->shift_vec
[0];
119 fshift
= fr
->fshift
[0];
120 facel
= gmx_fjsp_set1_v2r8(fr
->ic
->epsfac
);
121 charge
= mdatoms
->chargeA
;
122 nvdwtype
= fr
->ntype
;
124 vdwtype
= mdatoms
->typeA
;
126 vftab
= kernel_data
->table_elec_vdw
->data
;
127 vftabscale
= gmx_fjsp_set1_v2r8(kernel_data
->table_elec_vdw
->scale
);
129 /* Setup water-specific parameters */
130 inr
= nlist
->iinr
[0];
131 iq1
= _fjsp_mul_v2r8(facel
,gmx_fjsp_set1_v2r8(charge
[inr
+1]));
132 iq2
= _fjsp_mul_v2r8(facel
,gmx_fjsp_set1_v2r8(charge
[inr
+2]));
133 iq3
= _fjsp_mul_v2r8(facel
,gmx_fjsp_set1_v2r8(charge
[inr
+3]));
134 vdwioffset0
= 2*nvdwtype
*vdwtype
[inr
+0];
136 /* Avoid stupid compiler warnings */
144 /* Start outer loop over neighborlists */
145 for(iidx
=0; iidx
<nri
; iidx
++)
147 /* Load shift vector for this list */
148 i_shift_offset
= DIM
*shiftidx
[iidx
];
150 /* Load limits for loop over neighbors */
151 j_index_start
= jindex
[iidx
];
152 j_index_end
= jindex
[iidx
+1];
154 /* Get outer coordinate index */
156 i_coord_offset
= DIM
*inr
;
158 /* Load i particle coords and add shift vector */
159 gmx_fjsp_load_shift_and_4rvec_broadcast_v2r8(shiftvec
+i_shift_offset
,x
+i_coord_offset
,
160 &ix0
,&iy0
,&iz0
,&ix1
,&iy1
,&iz1
,&ix2
,&iy2
,&iz2
,&ix3
,&iy3
,&iz3
);
162 fix0
= _fjsp_setzero_v2r8();
163 fiy0
= _fjsp_setzero_v2r8();
164 fiz0
= _fjsp_setzero_v2r8();
165 fix1
= _fjsp_setzero_v2r8();
166 fiy1
= _fjsp_setzero_v2r8();
167 fiz1
= _fjsp_setzero_v2r8();
168 fix2
= _fjsp_setzero_v2r8();
169 fiy2
= _fjsp_setzero_v2r8();
170 fiz2
= _fjsp_setzero_v2r8();
171 fix3
= _fjsp_setzero_v2r8();
172 fiy3
= _fjsp_setzero_v2r8();
173 fiz3
= _fjsp_setzero_v2r8();
175 /* Reset potential sums */
176 velecsum
= _fjsp_setzero_v2r8();
177 vvdwsum
= _fjsp_setzero_v2r8();
179 /* Start inner kernel loop */
180 for(jidx
=j_index_start
; jidx
<j_index_end
-1; jidx
+=2)
183 /* Get j neighbor index, and coordinate index */
186 j_coord_offsetA
= DIM
*jnrA
;
187 j_coord_offsetB
= DIM
*jnrB
;
189 /* load j atom coordinates */
190 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x
+j_coord_offsetA
,x
+j_coord_offsetB
,
193 /* Calculate displacement vector */
194 dx00
= _fjsp_sub_v2r8(ix0
,jx0
);
195 dy00
= _fjsp_sub_v2r8(iy0
,jy0
);
196 dz00
= _fjsp_sub_v2r8(iz0
,jz0
);
197 dx10
= _fjsp_sub_v2r8(ix1
,jx0
);
198 dy10
= _fjsp_sub_v2r8(iy1
,jy0
);
199 dz10
= _fjsp_sub_v2r8(iz1
,jz0
);
200 dx20
= _fjsp_sub_v2r8(ix2
,jx0
);
201 dy20
= _fjsp_sub_v2r8(iy2
,jy0
);
202 dz20
= _fjsp_sub_v2r8(iz2
,jz0
);
203 dx30
= _fjsp_sub_v2r8(ix3
,jx0
);
204 dy30
= _fjsp_sub_v2r8(iy3
,jy0
);
205 dz30
= _fjsp_sub_v2r8(iz3
,jz0
);
207 /* Calculate squared distance and things based on it */
208 rsq00
= gmx_fjsp_calc_rsq_v2r8(dx00
,dy00
,dz00
);
209 rsq10
= gmx_fjsp_calc_rsq_v2r8(dx10
,dy10
,dz10
);
210 rsq20
= gmx_fjsp_calc_rsq_v2r8(dx20
,dy20
,dz20
);
211 rsq30
= gmx_fjsp_calc_rsq_v2r8(dx30
,dy30
,dz30
);
213 rinv00
= gmx_fjsp_invsqrt_v2r8(rsq00
);
214 rinv10
= gmx_fjsp_invsqrt_v2r8(rsq10
);
215 rinv20
= gmx_fjsp_invsqrt_v2r8(rsq20
);
216 rinv30
= gmx_fjsp_invsqrt_v2r8(rsq30
);
218 /* Load parameters for j particles */
219 jq0
= gmx_fjsp_load_2real_swizzle_v2r8(charge
+jnrA
+0,charge
+jnrB
+0);
220 vdwjidx0A
= 2*vdwtype
[jnrA
+0];
221 vdwjidx0B
= 2*vdwtype
[jnrB
+0];
223 fjx0
= _fjsp_setzero_v2r8();
224 fjy0
= _fjsp_setzero_v2r8();
225 fjz0
= _fjsp_setzero_v2r8();
227 /**************************
228 * CALCULATE INTERACTIONS *
229 **************************/
231 r00
= _fjsp_mul_v2r8(rsq00
,rinv00
);
233 /* Compute parameters for interactions between i and j atoms */
234 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam
+vdwioffset0
+vdwjidx0A
,
235 vdwparam
+vdwioffset0
+vdwjidx0B
,&c6_00
,&c12_00
);
237 /* Calculate table index by multiplying r with table scale and truncate to integer */
238 rt
= _fjsp_mul_v2r8(r00
,vftabscale
);
239 itab_tmp
= _fjsp_dtox_v2r8(rt
);
240 vfeps
= _fjsp_sub_v2r8(rt
, _fjsp_xtod_v2r8(itab_tmp
));
241 twovfeps
= _fjsp_add_v2r8(vfeps
,vfeps
);
242 _fjsp_store_v2r8(&vfconv
.simd
,itab_tmp
);
247 /* CUBIC SPLINE TABLE DISPERSION */
250 Y
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] );
251 F
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[1] );
252 GMX_FJSP_TRANSPOSE2_V2R8(Y
,F
);
253 G
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] + 2 );
254 H
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[1] + 2 );
255 GMX_FJSP_TRANSPOSE2_V2R8(G
,H
);
256 Fp
= _fjsp_madd_v2r8(vfeps
,_fjsp_madd_v2r8(H
,vfeps
,G
),F
);
257 VV
= _fjsp_madd_v2r8(vfeps
,Fp
,Y
);
258 vvdw6
= _fjsp_mul_v2r8(c6_00
,VV
);
259 FF
= _fjsp_madd_v2r8(vfeps
,_fjsp_madd_v2r8(twovfeps
,H
,G
),Fp
);
260 fvdw6
= _fjsp_mul_v2r8(c6_00
,FF
);
262 /* CUBIC SPLINE TABLE REPULSION */
263 Y
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] + 4 );
264 F
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[1] + 4 );
265 GMX_FJSP_TRANSPOSE2_V2R8(Y
,F
);
266 G
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] + 6 );
267 H
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[1] + 6 );
268 GMX_FJSP_TRANSPOSE2_V2R8(G
,H
);
269 Fp
= _fjsp_madd_v2r8(vfeps
,_fjsp_madd_v2r8(H
,vfeps
,G
),F
);
270 VV
= _fjsp_madd_v2r8(vfeps
,Fp
,Y
);
271 vvdw12
= _fjsp_mul_v2r8(c12_00
,VV
);
272 FF
= _fjsp_madd_v2r8(vfeps
,_fjsp_madd_v2r8(twovfeps
,H
,G
),Fp
);
273 fvdw12
= _fjsp_mul_v2r8(c12_00
,FF
);
274 vvdw
= _fjsp_add_v2r8(vvdw12
,vvdw6
);
275 fvdw
= _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6
,fvdw12
),_fjsp_mul_v2r8(vftabscale
,rinv00
)));
277 /* Update potential sum for this i atom from the interaction with this j atom. */
278 vvdwsum
= _fjsp_add_v2r8(vvdwsum
,vvdw
);
282 /* Update vectorial force */
283 fix0
= _fjsp_madd_v2r8(dx00
,fscal
,fix0
);
284 fiy0
= _fjsp_madd_v2r8(dy00
,fscal
,fiy0
);
285 fiz0
= _fjsp_madd_v2r8(dz00
,fscal
,fiz0
);
287 fjx0
= _fjsp_madd_v2r8(dx00
,fscal
,fjx0
);
288 fjy0
= _fjsp_madd_v2r8(dy00
,fscal
,fjy0
);
289 fjz0
= _fjsp_madd_v2r8(dz00
,fscal
,fjz0
);
291 /**************************
292 * CALCULATE INTERACTIONS *
293 **************************/
295 r10
= _fjsp_mul_v2r8(rsq10
,rinv10
);
297 /* Compute parameters for interactions between i and j atoms */
298 qq10
= _fjsp_mul_v2r8(iq1
,jq0
);
300 /* Calculate table index by multiplying r with table scale and truncate to integer */
301 rt
= _fjsp_mul_v2r8(r10
,vftabscale
);
302 itab_tmp
= _fjsp_dtox_v2r8(rt
);
303 vfeps
= _fjsp_sub_v2r8(rt
, _fjsp_xtod_v2r8(itab_tmp
));
304 twovfeps
= _fjsp_add_v2r8(vfeps
,vfeps
);
305 _fjsp_store_v2r8(&vfconv
.simd
,itab_tmp
);
310 /* CUBIC SPLINE TABLE ELECTROSTATICS */
311 Y
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] );
312 F
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[1] );
313 GMX_FJSP_TRANSPOSE2_V2R8(Y
,F
);
314 G
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] +2);
315 H
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[1] +2);
316 GMX_FJSP_TRANSPOSE2_V2R8(G
,H
);
317 Fp
= _fjsp_madd_v2r8(vfeps
,_fjsp_madd_v2r8(vfeps
,H
,G
),F
);
318 VV
= _fjsp_madd_v2r8(vfeps
,Fp
,Y
);
319 velec
= _fjsp_mul_v2r8(qq10
,VV
);
320 FF
= _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps
,H
,G
),vfeps
,Fp
);
321 felec
= _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10
,FF
),_fjsp_mul_v2r8(vftabscale
,rinv10
)));
323 /* Update potential sum for this i atom from the interaction with this j atom. */
324 velecsum
= _fjsp_add_v2r8(velecsum
,velec
);
328 /* Update vectorial force */
329 fix1
= _fjsp_madd_v2r8(dx10
,fscal
,fix1
);
330 fiy1
= _fjsp_madd_v2r8(dy10
,fscal
,fiy1
);
331 fiz1
= _fjsp_madd_v2r8(dz10
,fscal
,fiz1
);
333 fjx0
= _fjsp_madd_v2r8(dx10
,fscal
,fjx0
);
334 fjy0
= _fjsp_madd_v2r8(dy10
,fscal
,fjy0
);
335 fjz0
= _fjsp_madd_v2r8(dz10
,fscal
,fjz0
);
337 /**************************
338 * CALCULATE INTERACTIONS *
339 **************************/
341 r20
= _fjsp_mul_v2r8(rsq20
,rinv20
);
343 /* Compute parameters for interactions between i and j atoms */
344 qq20
= _fjsp_mul_v2r8(iq2
,jq0
);
346 /* Calculate table index by multiplying r with table scale and truncate to integer */
347 rt
= _fjsp_mul_v2r8(r20
,vftabscale
);
348 itab_tmp
= _fjsp_dtox_v2r8(rt
);
349 vfeps
= _fjsp_sub_v2r8(rt
, _fjsp_xtod_v2r8(itab_tmp
));
350 twovfeps
= _fjsp_add_v2r8(vfeps
,vfeps
);
351 _fjsp_store_v2r8(&vfconv
.simd
,itab_tmp
);
356 /* CUBIC SPLINE TABLE ELECTROSTATICS */
357 Y
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] );
358 F
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[1] );
359 GMX_FJSP_TRANSPOSE2_V2R8(Y
,F
);
360 G
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] +2);
361 H
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[1] +2);
362 GMX_FJSP_TRANSPOSE2_V2R8(G
,H
);
363 Fp
= _fjsp_madd_v2r8(vfeps
,_fjsp_madd_v2r8(vfeps
,H
,G
),F
);
364 VV
= _fjsp_madd_v2r8(vfeps
,Fp
,Y
);
365 velec
= _fjsp_mul_v2r8(qq20
,VV
);
366 FF
= _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps
,H
,G
),vfeps
,Fp
);
367 felec
= _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20
,FF
),_fjsp_mul_v2r8(vftabscale
,rinv20
)));
369 /* Update potential sum for this i atom from the interaction with this j atom. */
370 velecsum
= _fjsp_add_v2r8(velecsum
,velec
);
374 /* Update vectorial force */
375 fix2
= _fjsp_madd_v2r8(dx20
,fscal
,fix2
);
376 fiy2
= _fjsp_madd_v2r8(dy20
,fscal
,fiy2
);
377 fiz2
= _fjsp_madd_v2r8(dz20
,fscal
,fiz2
);
379 fjx0
= _fjsp_madd_v2r8(dx20
,fscal
,fjx0
);
380 fjy0
= _fjsp_madd_v2r8(dy20
,fscal
,fjy0
);
381 fjz0
= _fjsp_madd_v2r8(dz20
,fscal
,fjz0
);
383 /**************************
384 * CALCULATE INTERACTIONS *
385 **************************/
387 r30
= _fjsp_mul_v2r8(rsq30
,rinv30
);
389 /* Compute parameters for interactions between i and j atoms */
390 qq30
= _fjsp_mul_v2r8(iq3
,jq0
);
392 /* Calculate table index by multiplying r with table scale and truncate to integer */
393 rt
= _fjsp_mul_v2r8(r30
,vftabscale
);
394 itab_tmp
= _fjsp_dtox_v2r8(rt
);
395 vfeps
= _fjsp_sub_v2r8(rt
, _fjsp_xtod_v2r8(itab_tmp
));
396 twovfeps
= _fjsp_add_v2r8(vfeps
,vfeps
);
397 _fjsp_store_v2r8(&vfconv
.simd
,itab_tmp
);
402 /* CUBIC SPLINE TABLE ELECTROSTATICS */
403 Y
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] );
404 F
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[1] );
405 GMX_FJSP_TRANSPOSE2_V2R8(Y
,F
);
406 G
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] +2);
407 H
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[1] +2);
408 GMX_FJSP_TRANSPOSE2_V2R8(G
,H
);
409 Fp
= _fjsp_madd_v2r8(vfeps
,_fjsp_madd_v2r8(vfeps
,H
,G
),F
);
410 VV
= _fjsp_madd_v2r8(vfeps
,Fp
,Y
);
411 velec
= _fjsp_mul_v2r8(qq30
,VV
);
412 FF
= _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps
,H
,G
),vfeps
,Fp
);
413 felec
= _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq30
,FF
),_fjsp_mul_v2r8(vftabscale
,rinv30
)));
415 /* Update potential sum for this i atom from the interaction with this j atom. */
416 velecsum
= _fjsp_add_v2r8(velecsum
,velec
);
420 /* Update vectorial force */
421 fix3
= _fjsp_madd_v2r8(dx30
,fscal
,fix3
);
422 fiy3
= _fjsp_madd_v2r8(dy30
,fscal
,fiy3
);
423 fiz3
= _fjsp_madd_v2r8(dz30
,fscal
,fiz3
);
425 fjx0
= _fjsp_madd_v2r8(dx30
,fscal
,fjx0
);
426 fjy0
= _fjsp_madd_v2r8(dy30
,fscal
,fjy0
);
427 fjz0
= _fjsp_madd_v2r8(dz30
,fscal
,fjz0
);
429 gmx_fjsp_decrement_1rvec_2ptr_swizzle_v2r8(f
+j_coord_offsetA
,f
+j_coord_offsetB
,fjx0
,fjy0
,fjz0
);
431 /* Inner loop uses 200 flops */
438 j_coord_offsetA
= DIM
*jnrA
;
440 /* load j atom coordinates */
441 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x
+j_coord_offsetA
,
444 /* Calculate displacement vector */
445 dx00
= _fjsp_sub_v2r8(ix0
,jx0
);
446 dy00
= _fjsp_sub_v2r8(iy0
,jy0
);
447 dz00
= _fjsp_sub_v2r8(iz0
,jz0
);
448 dx10
= _fjsp_sub_v2r8(ix1
,jx0
);
449 dy10
= _fjsp_sub_v2r8(iy1
,jy0
);
450 dz10
= _fjsp_sub_v2r8(iz1
,jz0
);
451 dx20
= _fjsp_sub_v2r8(ix2
,jx0
);
452 dy20
= _fjsp_sub_v2r8(iy2
,jy0
);
453 dz20
= _fjsp_sub_v2r8(iz2
,jz0
);
454 dx30
= _fjsp_sub_v2r8(ix3
,jx0
);
455 dy30
= _fjsp_sub_v2r8(iy3
,jy0
);
456 dz30
= _fjsp_sub_v2r8(iz3
,jz0
);
458 /* Calculate squared distance and things based on it */
459 rsq00
= gmx_fjsp_calc_rsq_v2r8(dx00
,dy00
,dz00
);
460 rsq10
= gmx_fjsp_calc_rsq_v2r8(dx10
,dy10
,dz10
);
461 rsq20
= gmx_fjsp_calc_rsq_v2r8(dx20
,dy20
,dz20
);
462 rsq30
= gmx_fjsp_calc_rsq_v2r8(dx30
,dy30
,dz30
);
464 rinv00
= gmx_fjsp_invsqrt_v2r8(rsq00
);
465 rinv10
= gmx_fjsp_invsqrt_v2r8(rsq10
);
466 rinv20
= gmx_fjsp_invsqrt_v2r8(rsq20
);
467 rinv30
= gmx_fjsp_invsqrt_v2r8(rsq30
);
469 /* Load parameters for j particles */
470 jq0
= _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge
+jnrA
+0);
471 vdwjidx0A
= 2*vdwtype
[jnrA
+0];
473 fjx0
= _fjsp_setzero_v2r8();
474 fjy0
= _fjsp_setzero_v2r8();
475 fjz0
= _fjsp_setzero_v2r8();
477 /**************************
478 * CALCULATE INTERACTIONS *
479 **************************/
481 r00
= _fjsp_mul_v2r8(rsq00
,rinv00
);
483 /* Compute parameters for interactions between i and j atoms */
484 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam
+vdwioffset0
+vdwjidx0A
,
485 vdwparam
+vdwioffset0
+vdwjidx0B
,&c6_00
,&c12_00
);
487 /* Calculate table index by multiplying r with table scale and truncate to integer */
488 rt
= _fjsp_mul_v2r8(r00
,vftabscale
);
489 itab_tmp
= _fjsp_dtox_v2r8(rt
);
490 vfeps
= _fjsp_sub_v2r8(rt
, _fjsp_xtod_v2r8(itab_tmp
));
491 twovfeps
= _fjsp_add_v2r8(vfeps
,vfeps
);
492 _fjsp_store_v2r8(&vfconv
.simd
,itab_tmp
);
497 /* CUBIC SPLINE TABLE DISPERSION */
500 Y
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] );
501 F
= _fjsp_setzero_v2r8();
502 GMX_FJSP_TRANSPOSE2_V2R8(Y
,F
);
503 G
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] + 2 );
504 H
= _fjsp_setzero_v2r8();
505 GMX_FJSP_TRANSPOSE2_V2R8(G
,H
);
506 Fp
= _fjsp_madd_v2r8(vfeps
,_fjsp_madd_v2r8(H
,vfeps
,G
),F
);
507 VV
= _fjsp_madd_v2r8(vfeps
,Fp
,Y
);
508 vvdw6
= _fjsp_mul_v2r8(c6_00
,VV
);
509 FF
= _fjsp_madd_v2r8(vfeps
,_fjsp_madd_v2r8(twovfeps
,H
,G
),Fp
);
510 fvdw6
= _fjsp_mul_v2r8(c6_00
,FF
);
512 /* CUBIC SPLINE TABLE REPULSION */
513 Y
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] + 4 );
514 F
= _fjsp_setzero_v2r8();
515 GMX_FJSP_TRANSPOSE2_V2R8(Y
,F
);
516 G
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] + 6 );
517 H
= _fjsp_setzero_v2r8();
518 GMX_FJSP_TRANSPOSE2_V2R8(G
,H
);
519 Fp
= _fjsp_madd_v2r8(vfeps
,_fjsp_madd_v2r8(H
,vfeps
,G
),F
);
520 VV
= _fjsp_madd_v2r8(vfeps
,Fp
,Y
);
521 vvdw12
= _fjsp_mul_v2r8(c12_00
,VV
);
522 FF
= _fjsp_madd_v2r8(vfeps
,_fjsp_madd_v2r8(twovfeps
,H
,G
),Fp
);
523 fvdw12
= _fjsp_mul_v2r8(c12_00
,FF
);
524 vvdw
= _fjsp_add_v2r8(vvdw12
,vvdw6
);
525 fvdw
= _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6
,fvdw12
),_fjsp_mul_v2r8(vftabscale
,rinv00
)));
527 /* Update potential sum for this i atom from the interaction with this j atom. */
528 vvdw
= _fjsp_unpacklo_v2r8(vvdw
,_fjsp_setzero_v2r8());
529 vvdwsum
= _fjsp_add_v2r8(vvdwsum
,vvdw
);
533 fscal
= _fjsp_unpacklo_v2r8(fscal
,_fjsp_setzero_v2r8());
535 /* Update vectorial force */
536 fix0
= _fjsp_madd_v2r8(dx00
,fscal
,fix0
);
537 fiy0
= _fjsp_madd_v2r8(dy00
,fscal
,fiy0
);
538 fiz0
= _fjsp_madd_v2r8(dz00
,fscal
,fiz0
);
540 fjx0
= _fjsp_madd_v2r8(dx00
,fscal
,fjx0
);
541 fjy0
= _fjsp_madd_v2r8(dy00
,fscal
,fjy0
);
542 fjz0
= _fjsp_madd_v2r8(dz00
,fscal
,fjz0
);
544 /**************************
545 * CALCULATE INTERACTIONS *
546 **************************/
548 r10
= _fjsp_mul_v2r8(rsq10
,rinv10
);
550 /* Compute parameters for interactions between i and j atoms */
551 qq10
= _fjsp_mul_v2r8(iq1
,jq0
);
553 /* Calculate table index by multiplying r with table scale and truncate to integer */
554 rt
= _fjsp_mul_v2r8(r10
,vftabscale
);
555 itab_tmp
= _fjsp_dtox_v2r8(rt
);
556 vfeps
= _fjsp_sub_v2r8(rt
, _fjsp_xtod_v2r8(itab_tmp
));
557 twovfeps
= _fjsp_add_v2r8(vfeps
,vfeps
);
558 _fjsp_store_v2r8(&vfconv
.simd
,itab_tmp
);
563 /* CUBIC SPLINE TABLE ELECTROSTATICS */
564 Y
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] );
565 F
= _fjsp_setzero_v2r8();
566 GMX_FJSP_TRANSPOSE2_V2R8(Y
,F
);
567 G
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] +2);
568 H
= _fjsp_setzero_v2r8();
569 GMX_FJSP_TRANSPOSE2_V2R8(G
,H
);
570 Fp
= _fjsp_madd_v2r8(vfeps
,_fjsp_madd_v2r8(vfeps
,H
,G
),F
);
571 VV
= _fjsp_madd_v2r8(vfeps
,Fp
,Y
);
572 velec
= _fjsp_mul_v2r8(qq10
,VV
);
573 FF
= _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps
,H
,G
),vfeps
,Fp
);
574 felec
= _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10
,FF
),_fjsp_mul_v2r8(vftabscale
,rinv10
)));
576 /* Update potential sum for this i atom from the interaction with this j atom. */
577 velec
= _fjsp_unpacklo_v2r8(velec
,_fjsp_setzero_v2r8());
578 velecsum
= _fjsp_add_v2r8(velecsum
,velec
);
582 fscal
= _fjsp_unpacklo_v2r8(fscal
,_fjsp_setzero_v2r8());
584 /* Update vectorial force */
585 fix1
= _fjsp_madd_v2r8(dx10
,fscal
,fix1
);
586 fiy1
= _fjsp_madd_v2r8(dy10
,fscal
,fiy1
);
587 fiz1
= _fjsp_madd_v2r8(dz10
,fscal
,fiz1
);
589 fjx0
= _fjsp_madd_v2r8(dx10
,fscal
,fjx0
);
590 fjy0
= _fjsp_madd_v2r8(dy10
,fscal
,fjy0
);
591 fjz0
= _fjsp_madd_v2r8(dz10
,fscal
,fjz0
);
593 /**************************
594 * CALCULATE INTERACTIONS *
595 **************************/
597 r20
= _fjsp_mul_v2r8(rsq20
,rinv20
);
599 /* Compute parameters for interactions between i and j atoms */
600 qq20
= _fjsp_mul_v2r8(iq2
,jq0
);
602 /* Calculate table index by multiplying r with table scale and truncate to integer */
603 rt
= _fjsp_mul_v2r8(r20
,vftabscale
);
604 itab_tmp
= _fjsp_dtox_v2r8(rt
);
605 vfeps
= _fjsp_sub_v2r8(rt
, _fjsp_xtod_v2r8(itab_tmp
));
606 twovfeps
= _fjsp_add_v2r8(vfeps
,vfeps
);
607 _fjsp_store_v2r8(&vfconv
.simd
,itab_tmp
);
612 /* CUBIC SPLINE TABLE ELECTROSTATICS */
613 Y
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] );
614 F
= _fjsp_setzero_v2r8();
615 GMX_FJSP_TRANSPOSE2_V2R8(Y
,F
);
616 G
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] +2);
617 H
= _fjsp_setzero_v2r8();
618 GMX_FJSP_TRANSPOSE2_V2R8(G
,H
);
619 Fp
= _fjsp_madd_v2r8(vfeps
,_fjsp_madd_v2r8(vfeps
,H
,G
),F
);
620 VV
= _fjsp_madd_v2r8(vfeps
,Fp
,Y
);
621 velec
= _fjsp_mul_v2r8(qq20
,VV
);
622 FF
= _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps
,H
,G
),vfeps
,Fp
);
623 felec
= _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20
,FF
),_fjsp_mul_v2r8(vftabscale
,rinv20
)));
625 /* Update potential sum for this i atom from the interaction with this j atom. */
626 velec
= _fjsp_unpacklo_v2r8(velec
,_fjsp_setzero_v2r8());
627 velecsum
= _fjsp_add_v2r8(velecsum
,velec
);
631 fscal
= _fjsp_unpacklo_v2r8(fscal
,_fjsp_setzero_v2r8());
633 /* Update vectorial force */
634 fix2
= _fjsp_madd_v2r8(dx20
,fscal
,fix2
);
635 fiy2
= _fjsp_madd_v2r8(dy20
,fscal
,fiy2
);
636 fiz2
= _fjsp_madd_v2r8(dz20
,fscal
,fiz2
);
638 fjx0
= _fjsp_madd_v2r8(dx20
,fscal
,fjx0
);
639 fjy0
= _fjsp_madd_v2r8(dy20
,fscal
,fjy0
);
640 fjz0
= _fjsp_madd_v2r8(dz20
,fscal
,fjz0
);
642 /**************************
643 * CALCULATE INTERACTIONS *
644 **************************/
646 r30
= _fjsp_mul_v2r8(rsq30
,rinv30
);
648 /* Compute parameters for interactions between i and j atoms */
649 qq30
= _fjsp_mul_v2r8(iq3
,jq0
);
651 /* Calculate table index by multiplying r with table scale and truncate to integer */
652 rt
= _fjsp_mul_v2r8(r30
,vftabscale
);
653 itab_tmp
= _fjsp_dtox_v2r8(rt
);
654 vfeps
= _fjsp_sub_v2r8(rt
, _fjsp_xtod_v2r8(itab_tmp
));
655 twovfeps
= _fjsp_add_v2r8(vfeps
,vfeps
);
656 _fjsp_store_v2r8(&vfconv
.simd
,itab_tmp
);
661 /* CUBIC SPLINE TABLE ELECTROSTATICS */
662 Y
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] );
663 F
= _fjsp_setzero_v2r8();
664 GMX_FJSP_TRANSPOSE2_V2R8(Y
,F
);
665 G
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] +2);
666 H
= _fjsp_setzero_v2r8();
667 GMX_FJSP_TRANSPOSE2_V2R8(G
,H
);
668 Fp
= _fjsp_madd_v2r8(vfeps
,_fjsp_madd_v2r8(vfeps
,H
,G
),F
);
669 VV
= _fjsp_madd_v2r8(vfeps
,Fp
,Y
);
670 velec
= _fjsp_mul_v2r8(qq30
,VV
);
671 FF
= _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps
,H
,G
),vfeps
,Fp
);
672 felec
= _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq30
,FF
),_fjsp_mul_v2r8(vftabscale
,rinv30
)));
674 /* Update potential sum for this i atom from the interaction with this j atom. */
675 velec
= _fjsp_unpacklo_v2r8(velec
,_fjsp_setzero_v2r8());
676 velecsum
= _fjsp_add_v2r8(velecsum
,velec
);
680 fscal
= _fjsp_unpacklo_v2r8(fscal
,_fjsp_setzero_v2r8());
682 /* Update vectorial force */
683 fix3
= _fjsp_madd_v2r8(dx30
,fscal
,fix3
);
684 fiy3
= _fjsp_madd_v2r8(dy30
,fscal
,fiy3
);
685 fiz3
= _fjsp_madd_v2r8(dz30
,fscal
,fiz3
);
687 fjx0
= _fjsp_madd_v2r8(dx30
,fscal
,fjx0
);
688 fjy0
= _fjsp_madd_v2r8(dy30
,fscal
,fjy0
);
689 fjz0
= _fjsp_madd_v2r8(dz30
,fscal
,fjz0
);
691 gmx_fjsp_decrement_1rvec_1ptr_swizzle_v2r8(f
+j_coord_offsetA
,fjx0
,fjy0
,fjz0
);
693 /* Inner loop uses 200 flops */
696 /* End of innermost loop */
698 gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0
,fiy0
,fiz0
,fix1
,fiy1
,fiz1
,fix2
,fiy2
,fiz2
,fix3
,fiy3
,fiz3
,
699 f
+i_coord_offset
,fshift
+i_shift_offset
);
702 /* Update potential energies */
703 gmx_fjsp_update_1pot_v2r8(velecsum
,kernel_data
->energygrp_elec
+ggid
);
704 gmx_fjsp_update_1pot_v2r8(vvdwsum
,kernel_data
->energygrp_vdw
+ggid
);
706 /* Increment number of inner iterations */
707 inneriter
+= j_index_end
- j_index_start
;
709 /* Outer loop uses 26 flops */
712 /* Increment number of outer iterations */
715 /* Update outer/inner flops */
717 inc_nrnb(nrnb
,eNR_NBKERNEL_ELEC_VDW_W4_VF
,outeriter
*26 + inneriter
*200);
720 * Gromacs nonbonded kernel: nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sparc64_hpc_ace_double
721 * Electrostatics interaction: CubicSplineTable
722 * VdW interaction: CubicSplineTable
723 * Geometry: Water4-Particle
724 * Calculate force/pot: Force
727 nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sparc64_hpc_ace_double
728 (t_nblist
* gmx_restrict nlist
,
729 rvec
* gmx_restrict xx
,
730 rvec
* gmx_restrict ff
,
731 struct t_forcerec
* gmx_restrict fr
,
732 t_mdatoms
* gmx_restrict mdatoms
,
733 nb_kernel_data_t gmx_unused
* gmx_restrict kernel_data
,
734 t_nrnb
* gmx_restrict nrnb
)
736 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
737 * just 0 for non-waters.
738 * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
739 * jnr indices corresponding to data put in the four positions in the SIMD register.
741 int i_shift_offset
,i_coord_offset
,outeriter
,inneriter
;
742 int j_index_start
,j_index_end
,jidx
,nri
,inr
,ggid
,iidx
;
744 int j_coord_offsetA
,j_coord_offsetB
;
745 int *iinr
,*jindex
,*jjnr
,*shiftidx
,*gid
;
747 real
*shiftvec
,*fshift
,*x
,*f
;
748 _fjsp_v2r8 tx
,ty
,tz
,fscal
,rcutoff
,rcutoff2
,jidxall
;
750 _fjsp_v2r8 ix0
,iy0
,iz0
,fix0
,fiy0
,fiz0
,iq0
,isai0
;
752 _fjsp_v2r8 ix1
,iy1
,iz1
,fix1
,fiy1
,fiz1
,iq1
,isai1
;
754 _fjsp_v2r8 ix2
,iy2
,iz2
,fix2
,fiy2
,fiz2
,iq2
,isai2
;
756 _fjsp_v2r8 ix3
,iy3
,iz3
,fix3
,fiy3
,fiz3
,iq3
,isai3
;
757 int vdwjidx0A
,vdwjidx0B
;
758 _fjsp_v2r8 jx0
,jy0
,jz0
,fjx0
,fjy0
,fjz0
,jq0
,isaj0
;
759 _fjsp_v2r8 dx00
,dy00
,dz00
,rsq00
,rinv00
,rinvsq00
,r00
,qq00
,c6_00
,c12_00
;
760 _fjsp_v2r8 dx10
,dy10
,dz10
,rsq10
,rinv10
,rinvsq10
,r10
,qq10
,c6_10
,c12_10
;
761 _fjsp_v2r8 dx20
,dy20
,dz20
,rsq20
,rinv20
,rinvsq20
,r20
,qq20
,c6_20
,c12_20
;
762 _fjsp_v2r8 dx30
,dy30
,dz30
,rsq30
,rinv30
,rinvsq30
,r30
,qq30
,c6_30
,c12_30
;
763 _fjsp_v2r8 velec
,felec
,velecsum
,facel
,crf
,krf
,krf2
;
766 _fjsp_v2r8 rinvsix
,rvdw
,vvdw
,vvdw6
,vvdw12
,fvdw
,fvdw6
,fvdw12
,vvdwsum
,sh_vdw_invrcut6
;
769 _fjsp_v2r8 one_sixth
= gmx_fjsp_set1_v2r8(1.0/6.0);
770 _fjsp_v2r8 one_twelfth
= gmx_fjsp_set1_v2r8(1.0/12.0);
771 _fjsp_v2r8 rt
,vfeps
,vftabscale
,Y
,F
,G
,H
,Heps
,Fp
,VV
,FF
,twovfeps
;
774 _fjsp_v2r8 dummy_mask
,cutoff_mask
;
775 _fjsp_v2r8 one
= gmx_fjsp_set1_v2r8(1.0);
776 _fjsp_v2r8 two
= gmx_fjsp_set1_v2r8(2.0);
777 union { _fjsp_v2r8 simd
; long long int i
[2]; } vfconv
,gbconv
,ewconv
;
784 jindex
= nlist
->jindex
;
786 shiftidx
= nlist
->shift
;
788 shiftvec
= fr
->shift_vec
[0];
789 fshift
= fr
->fshift
[0];
790 facel
= gmx_fjsp_set1_v2r8(fr
->ic
->epsfac
);
791 charge
= mdatoms
->chargeA
;
792 nvdwtype
= fr
->ntype
;
794 vdwtype
= mdatoms
->typeA
;
796 vftab
= kernel_data
->table_elec_vdw
->data
;
797 vftabscale
= gmx_fjsp_set1_v2r8(kernel_data
->table_elec_vdw
->scale
);
799 /* Setup water-specific parameters */
800 inr
= nlist
->iinr
[0];
801 iq1
= _fjsp_mul_v2r8(facel
,gmx_fjsp_set1_v2r8(charge
[inr
+1]));
802 iq2
= _fjsp_mul_v2r8(facel
,gmx_fjsp_set1_v2r8(charge
[inr
+2]));
803 iq3
= _fjsp_mul_v2r8(facel
,gmx_fjsp_set1_v2r8(charge
[inr
+3]));
804 vdwioffset0
= 2*nvdwtype
*vdwtype
[inr
+0];
806 /* Avoid stupid compiler warnings */
814 /* Start outer loop over neighborlists */
815 for(iidx
=0; iidx
<nri
; iidx
++)
817 /* Load shift vector for this list */
818 i_shift_offset
= DIM
*shiftidx
[iidx
];
820 /* Load limits for loop over neighbors */
821 j_index_start
= jindex
[iidx
];
822 j_index_end
= jindex
[iidx
+1];
824 /* Get outer coordinate index */
826 i_coord_offset
= DIM
*inr
;
828 /* Load i particle coords and add shift vector */
829 gmx_fjsp_load_shift_and_4rvec_broadcast_v2r8(shiftvec
+i_shift_offset
,x
+i_coord_offset
,
830 &ix0
,&iy0
,&iz0
,&ix1
,&iy1
,&iz1
,&ix2
,&iy2
,&iz2
,&ix3
,&iy3
,&iz3
);
832 fix0
= _fjsp_setzero_v2r8();
833 fiy0
= _fjsp_setzero_v2r8();
834 fiz0
= _fjsp_setzero_v2r8();
835 fix1
= _fjsp_setzero_v2r8();
836 fiy1
= _fjsp_setzero_v2r8();
837 fiz1
= _fjsp_setzero_v2r8();
838 fix2
= _fjsp_setzero_v2r8();
839 fiy2
= _fjsp_setzero_v2r8();
840 fiz2
= _fjsp_setzero_v2r8();
841 fix3
= _fjsp_setzero_v2r8();
842 fiy3
= _fjsp_setzero_v2r8();
843 fiz3
= _fjsp_setzero_v2r8();
845 /* Start inner kernel loop */
846 for(jidx
=j_index_start
; jidx
<j_index_end
-1; jidx
+=2)
849 /* Get j neighbor index, and coordinate index */
852 j_coord_offsetA
= DIM
*jnrA
;
853 j_coord_offsetB
= DIM
*jnrB
;
855 /* load j atom coordinates */
856 gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x
+j_coord_offsetA
,x
+j_coord_offsetB
,
859 /* Calculate displacement vector */
860 dx00
= _fjsp_sub_v2r8(ix0
,jx0
);
861 dy00
= _fjsp_sub_v2r8(iy0
,jy0
);
862 dz00
= _fjsp_sub_v2r8(iz0
,jz0
);
863 dx10
= _fjsp_sub_v2r8(ix1
,jx0
);
864 dy10
= _fjsp_sub_v2r8(iy1
,jy0
);
865 dz10
= _fjsp_sub_v2r8(iz1
,jz0
);
866 dx20
= _fjsp_sub_v2r8(ix2
,jx0
);
867 dy20
= _fjsp_sub_v2r8(iy2
,jy0
);
868 dz20
= _fjsp_sub_v2r8(iz2
,jz0
);
869 dx30
= _fjsp_sub_v2r8(ix3
,jx0
);
870 dy30
= _fjsp_sub_v2r8(iy3
,jy0
);
871 dz30
= _fjsp_sub_v2r8(iz3
,jz0
);
873 /* Calculate squared distance and things based on it */
874 rsq00
= gmx_fjsp_calc_rsq_v2r8(dx00
,dy00
,dz00
);
875 rsq10
= gmx_fjsp_calc_rsq_v2r8(dx10
,dy10
,dz10
);
876 rsq20
= gmx_fjsp_calc_rsq_v2r8(dx20
,dy20
,dz20
);
877 rsq30
= gmx_fjsp_calc_rsq_v2r8(dx30
,dy30
,dz30
);
879 rinv00
= gmx_fjsp_invsqrt_v2r8(rsq00
);
880 rinv10
= gmx_fjsp_invsqrt_v2r8(rsq10
);
881 rinv20
= gmx_fjsp_invsqrt_v2r8(rsq20
);
882 rinv30
= gmx_fjsp_invsqrt_v2r8(rsq30
);
884 /* Load parameters for j particles */
885 jq0
= gmx_fjsp_load_2real_swizzle_v2r8(charge
+jnrA
+0,charge
+jnrB
+0);
886 vdwjidx0A
= 2*vdwtype
[jnrA
+0];
887 vdwjidx0B
= 2*vdwtype
[jnrB
+0];
889 fjx0
= _fjsp_setzero_v2r8();
890 fjy0
= _fjsp_setzero_v2r8();
891 fjz0
= _fjsp_setzero_v2r8();
893 /**************************
894 * CALCULATE INTERACTIONS *
895 **************************/
897 r00
= _fjsp_mul_v2r8(rsq00
,rinv00
);
899 /* Compute parameters for interactions between i and j atoms */
900 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam
+vdwioffset0
+vdwjidx0A
,
901 vdwparam
+vdwioffset0
+vdwjidx0B
,&c6_00
,&c12_00
);
903 /* Calculate table index by multiplying r with table scale and truncate to integer */
904 rt
= _fjsp_mul_v2r8(r00
,vftabscale
);
905 itab_tmp
= _fjsp_dtox_v2r8(rt
);
906 vfeps
= _fjsp_sub_v2r8(rt
, _fjsp_xtod_v2r8(itab_tmp
));
907 twovfeps
= _fjsp_add_v2r8(vfeps
,vfeps
);
908 _fjsp_store_v2r8(&vfconv
.simd
,itab_tmp
);
913 /* CUBIC SPLINE TABLE DISPERSION */
916 Y
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] );
917 F
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[1] );
918 GMX_FJSP_TRANSPOSE2_V2R8(Y
,F
);
919 G
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] + 2 );
920 H
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[1] + 2 );
921 GMX_FJSP_TRANSPOSE2_V2R8(G
,H
);
922 Fp
= _fjsp_madd_v2r8(vfeps
,_fjsp_madd_v2r8(H
,vfeps
,G
),F
);
923 FF
= _fjsp_madd_v2r8(vfeps
,_fjsp_madd_v2r8(twovfeps
,H
,G
),Fp
);
924 fvdw6
= _fjsp_mul_v2r8(c6_00
,FF
);
926 /* CUBIC SPLINE TABLE REPULSION */
927 Y
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] + 4 );
928 F
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[1] + 4 );
929 GMX_FJSP_TRANSPOSE2_V2R8(Y
,F
);
930 G
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] + 6 );
931 H
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[1] + 6 );
932 GMX_FJSP_TRANSPOSE2_V2R8(G
,H
);
933 Fp
= _fjsp_madd_v2r8(vfeps
,_fjsp_madd_v2r8(H
,vfeps
,G
),F
);
934 FF
= _fjsp_madd_v2r8(vfeps
,_fjsp_madd_v2r8(twovfeps
,H
,G
),Fp
);
935 fvdw12
= _fjsp_mul_v2r8(c12_00
,FF
);
936 fvdw
= _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6
,fvdw12
),_fjsp_mul_v2r8(vftabscale
,rinv00
)));
940 /* Update vectorial force */
941 fix0
= _fjsp_madd_v2r8(dx00
,fscal
,fix0
);
942 fiy0
= _fjsp_madd_v2r8(dy00
,fscal
,fiy0
);
943 fiz0
= _fjsp_madd_v2r8(dz00
,fscal
,fiz0
);
945 fjx0
= _fjsp_madd_v2r8(dx00
,fscal
,fjx0
);
946 fjy0
= _fjsp_madd_v2r8(dy00
,fscal
,fjy0
);
947 fjz0
= _fjsp_madd_v2r8(dz00
,fscal
,fjz0
);
949 /**************************
950 * CALCULATE INTERACTIONS *
951 **************************/
953 r10
= _fjsp_mul_v2r8(rsq10
,rinv10
);
955 /* Compute parameters for interactions between i and j atoms */
956 qq10
= _fjsp_mul_v2r8(iq1
,jq0
);
958 /* Calculate table index by multiplying r with table scale and truncate to integer */
959 rt
= _fjsp_mul_v2r8(r10
,vftabscale
);
960 itab_tmp
= _fjsp_dtox_v2r8(rt
);
961 vfeps
= _fjsp_sub_v2r8(rt
, _fjsp_xtod_v2r8(itab_tmp
));
962 twovfeps
= _fjsp_add_v2r8(vfeps
,vfeps
);
963 _fjsp_store_v2r8(&vfconv
.simd
,itab_tmp
);
968 /* CUBIC SPLINE TABLE ELECTROSTATICS */
969 Y
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] );
970 F
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[1] );
971 GMX_FJSP_TRANSPOSE2_V2R8(Y
,F
);
972 G
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] +2);
973 H
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[1] +2);
974 GMX_FJSP_TRANSPOSE2_V2R8(G
,H
);
975 Fp
= _fjsp_madd_v2r8(vfeps
,_fjsp_madd_v2r8(vfeps
,H
,G
),F
);
976 FF
= _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps
,H
,G
),vfeps
,Fp
);
977 felec
= _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10
,FF
),_fjsp_mul_v2r8(vftabscale
,rinv10
)));
981 /* Update vectorial force */
982 fix1
= _fjsp_madd_v2r8(dx10
,fscal
,fix1
);
983 fiy1
= _fjsp_madd_v2r8(dy10
,fscal
,fiy1
);
984 fiz1
= _fjsp_madd_v2r8(dz10
,fscal
,fiz1
);
986 fjx0
= _fjsp_madd_v2r8(dx10
,fscal
,fjx0
);
987 fjy0
= _fjsp_madd_v2r8(dy10
,fscal
,fjy0
);
988 fjz0
= _fjsp_madd_v2r8(dz10
,fscal
,fjz0
);
990 /**************************
991 * CALCULATE INTERACTIONS *
992 **************************/
994 r20
= _fjsp_mul_v2r8(rsq20
,rinv20
);
996 /* Compute parameters for interactions between i and j atoms */
997 qq20
= _fjsp_mul_v2r8(iq2
,jq0
);
999 /* Calculate table index by multiplying r with table scale and truncate to integer */
1000 rt
= _fjsp_mul_v2r8(r20
,vftabscale
);
1001 itab_tmp
= _fjsp_dtox_v2r8(rt
);
1002 vfeps
= _fjsp_sub_v2r8(rt
, _fjsp_xtod_v2r8(itab_tmp
));
1003 twovfeps
= _fjsp_add_v2r8(vfeps
,vfeps
);
1004 _fjsp_store_v2r8(&vfconv
.simd
,itab_tmp
);
1009 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1010 Y
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] );
1011 F
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[1] );
1012 GMX_FJSP_TRANSPOSE2_V2R8(Y
,F
);
1013 G
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] +2);
1014 H
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[1] +2);
1015 GMX_FJSP_TRANSPOSE2_V2R8(G
,H
);
1016 Fp
= _fjsp_madd_v2r8(vfeps
,_fjsp_madd_v2r8(vfeps
,H
,G
),F
);
1017 FF
= _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps
,H
,G
),vfeps
,Fp
);
1018 felec
= _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20
,FF
),_fjsp_mul_v2r8(vftabscale
,rinv20
)));
1022 /* Update vectorial force */
1023 fix2
= _fjsp_madd_v2r8(dx20
,fscal
,fix2
);
1024 fiy2
= _fjsp_madd_v2r8(dy20
,fscal
,fiy2
);
1025 fiz2
= _fjsp_madd_v2r8(dz20
,fscal
,fiz2
);
1027 fjx0
= _fjsp_madd_v2r8(dx20
,fscal
,fjx0
);
1028 fjy0
= _fjsp_madd_v2r8(dy20
,fscal
,fjy0
);
1029 fjz0
= _fjsp_madd_v2r8(dz20
,fscal
,fjz0
);
1031 /**************************
1032 * CALCULATE INTERACTIONS *
1033 **************************/
1035 r30
= _fjsp_mul_v2r8(rsq30
,rinv30
);
1037 /* Compute parameters for interactions between i and j atoms */
1038 qq30
= _fjsp_mul_v2r8(iq3
,jq0
);
1040 /* Calculate table index by multiplying r with table scale and truncate to integer */
1041 rt
= _fjsp_mul_v2r8(r30
,vftabscale
);
1042 itab_tmp
= _fjsp_dtox_v2r8(rt
);
1043 vfeps
= _fjsp_sub_v2r8(rt
, _fjsp_xtod_v2r8(itab_tmp
));
1044 twovfeps
= _fjsp_add_v2r8(vfeps
,vfeps
);
1045 _fjsp_store_v2r8(&vfconv
.simd
,itab_tmp
);
1050 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1051 Y
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] );
1052 F
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[1] );
1053 GMX_FJSP_TRANSPOSE2_V2R8(Y
,F
);
1054 G
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] +2);
1055 H
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[1] +2);
1056 GMX_FJSP_TRANSPOSE2_V2R8(G
,H
);
1057 Fp
= _fjsp_madd_v2r8(vfeps
,_fjsp_madd_v2r8(vfeps
,H
,G
),F
);
1058 FF
= _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps
,H
,G
),vfeps
,Fp
);
1059 felec
= _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq30
,FF
),_fjsp_mul_v2r8(vftabscale
,rinv30
)));
1063 /* Update vectorial force */
1064 fix3
= _fjsp_madd_v2r8(dx30
,fscal
,fix3
);
1065 fiy3
= _fjsp_madd_v2r8(dy30
,fscal
,fiy3
);
1066 fiz3
= _fjsp_madd_v2r8(dz30
,fscal
,fiz3
);
1068 fjx0
= _fjsp_madd_v2r8(dx30
,fscal
,fjx0
);
1069 fjy0
= _fjsp_madd_v2r8(dy30
,fscal
,fjy0
);
1070 fjz0
= _fjsp_madd_v2r8(dz30
,fscal
,fjz0
);
1072 gmx_fjsp_decrement_1rvec_2ptr_swizzle_v2r8(f
+j_coord_offsetA
,f
+j_coord_offsetB
,fjx0
,fjy0
,fjz0
);
1074 /* Inner loop uses 180 flops */
1077 if(jidx
<j_index_end
)
1081 j_coord_offsetA
= DIM
*jnrA
;
1083 /* load j atom coordinates */
1084 gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x
+j_coord_offsetA
,
1087 /* Calculate displacement vector */
1088 dx00
= _fjsp_sub_v2r8(ix0
,jx0
);
1089 dy00
= _fjsp_sub_v2r8(iy0
,jy0
);
1090 dz00
= _fjsp_sub_v2r8(iz0
,jz0
);
1091 dx10
= _fjsp_sub_v2r8(ix1
,jx0
);
1092 dy10
= _fjsp_sub_v2r8(iy1
,jy0
);
1093 dz10
= _fjsp_sub_v2r8(iz1
,jz0
);
1094 dx20
= _fjsp_sub_v2r8(ix2
,jx0
);
1095 dy20
= _fjsp_sub_v2r8(iy2
,jy0
);
1096 dz20
= _fjsp_sub_v2r8(iz2
,jz0
);
1097 dx30
= _fjsp_sub_v2r8(ix3
,jx0
);
1098 dy30
= _fjsp_sub_v2r8(iy3
,jy0
);
1099 dz30
= _fjsp_sub_v2r8(iz3
,jz0
);
1101 /* Calculate squared distance and things based on it */
1102 rsq00
= gmx_fjsp_calc_rsq_v2r8(dx00
,dy00
,dz00
);
1103 rsq10
= gmx_fjsp_calc_rsq_v2r8(dx10
,dy10
,dz10
);
1104 rsq20
= gmx_fjsp_calc_rsq_v2r8(dx20
,dy20
,dz20
);
1105 rsq30
= gmx_fjsp_calc_rsq_v2r8(dx30
,dy30
,dz30
);
1107 rinv00
= gmx_fjsp_invsqrt_v2r8(rsq00
);
1108 rinv10
= gmx_fjsp_invsqrt_v2r8(rsq10
);
1109 rinv20
= gmx_fjsp_invsqrt_v2r8(rsq20
);
1110 rinv30
= gmx_fjsp_invsqrt_v2r8(rsq30
);
1112 /* Load parameters for j particles */
1113 jq0
= _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge
+jnrA
+0);
1114 vdwjidx0A
= 2*vdwtype
[jnrA
+0];
1116 fjx0
= _fjsp_setzero_v2r8();
1117 fjy0
= _fjsp_setzero_v2r8();
1118 fjz0
= _fjsp_setzero_v2r8();
1120 /**************************
1121 * CALCULATE INTERACTIONS *
1122 **************************/
1124 r00
= _fjsp_mul_v2r8(rsq00
,rinv00
);
1126 /* Compute parameters for interactions between i and j atoms */
1127 gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam
+vdwioffset0
+vdwjidx0A
,
1128 vdwparam
+vdwioffset0
+vdwjidx0B
,&c6_00
,&c12_00
);
1130 /* Calculate table index by multiplying r with table scale and truncate to integer */
1131 rt
= _fjsp_mul_v2r8(r00
,vftabscale
);
1132 itab_tmp
= _fjsp_dtox_v2r8(rt
);
1133 vfeps
= _fjsp_sub_v2r8(rt
, _fjsp_xtod_v2r8(itab_tmp
));
1134 twovfeps
= _fjsp_add_v2r8(vfeps
,vfeps
);
1135 _fjsp_store_v2r8(&vfconv
.simd
,itab_tmp
);
1140 /* CUBIC SPLINE TABLE DISPERSION */
1143 Y
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] );
1144 F
= _fjsp_setzero_v2r8();
1145 GMX_FJSP_TRANSPOSE2_V2R8(Y
,F
);
1146 G
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] + 2 );
1147 H
= _fjsp_setzero_v2r8();
1148 GMX_FJSP_TRANSPOSE2_V2R8(G
,H
);
1149 Fp
= _fjsp_madd_v2r8(vfeps
,_fjsp_madd_v2r8(H
,vfeps
,G
),F
);
1150 FF
= _fjsp_madd_v2r8(vfeps
,_fjsp_madd_v2r8(twovfeps
,H
,G
),Fp
);
1151 fvdw6
= _fjsp_mul_v2r8(c6_00
,FF
);
1153 /* CUBIC SPLINE TABLE REPULSION */
1154 Y
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] + 4 );
1155 F
= _fjsp_setzero_v2r8();
1156 GMX_FJSP_TRANSPOSE2_V2R8(Y
,F
);
1157 G
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] + 6 );
1158 H
= _fjsp_setzero_v2r8();
1159 GMX_FJSP_TRANSPOSE2_V2R8(G
,H
);
1160 Fp
= _fjsp_madd_v2r8(vfeps
,_fjsp_madd_v2r8(H
,vfeps
,G
),F
);
1161 FF
= _fjsp_madd_v2r8(vfeps
,_fjsp_madd_v2r8(twovfeps
,H
,G
),Fp
);
1162 fvdw12
= _fjsp_mul_v2r8(c12_00
,FF
);
1163 fvdw
= _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6
,fvdw12
),_fjsp_mul_v2r8(vftabscale
,rinv00
)));
1167 fscal
= _fjsp_unpacklo_v2r8(fscal
,_fjsp_setzero_v2r8());
1169 /* Update vectorial force */
1170 fix0
= _fjsp_madd_v2r8(dx00
,fscal
,fix0
);
1171 fiy0
= _fjsp_madd_v2r8(dy00
,fscal
,fiy0
);
1172 fiz0
= _fjsp_madd_v2r8(dz00
,fscal
,fiz0
);
1174 fjx0
= _fjsp_madd_v2r8(dx00
,fscal
,fjx0
);
1175 fjy0
= _fjsp_madd_v2r8(dy00
,fscal
,fjy0
);
1176 fjz0
= _fjsp_madd_v2r8(dz00
,fscal
,fjz0
);
1178 /**************************
1179 * CALCULATE INTERACTIONS *
1180 **************************/
1182 r10
= _fjsp_mul_v2r8(rsq10
,rinv10
);
1184 /* Compute parameters for interactions between i and j atoms */
1185 qq10
= _fjsp_mul_v2r8(iq1
,jq0
);
1187 /* Calculate table index by multiplying r with table scale and truncate to integer */
1188 rt
= _fjsp_mul_v2r8(r10
,vftabscale
);
1189 itab_tmp
= _fjsp_dtox_v2r8(rt
);
1190 vfeps
= _fjsp_sub_v2r8(rt
, _fjsp_xtod_v2r8(itab_tmp
));
1191 twovfeps
= _fjsp_add_v2r8(vfeps
,vfeps
);
1192 _fjsp_store_v2r8(&vfconv
.simd
,itab_tmp
);
1197 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1198 Y
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] );
1199 F
= _fjsp_setzero_v2r8();
1200 GMX_FJSP_TRANSPOSE2_V2R8(Y
,F
);
1201 G
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] +2);
1202 H
= _fjsp_setzero_v2r8();
1203 GMX_FJSP_TRANSPOSE2_V2R8(G
,H
);
1204 Fp
= _fjsp_madd_v2r8(vfeps
,_fjsp_madd_v2r8(vfeps
,H
,G
),F
);
1205 FF
= _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps
,H
,G
),vfeps
,Fp
);
1206 felec
= _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq10
,FF
),_fjsp_mul_v2r8(vftabscale
,rinv10
)));
1210 fscal
= _fjsp_unpacklo_v2r8(fscal
,_fjsp_setzero_v2r8());
1212 /* Update vectorial force */
1213 fix1
= _fjsp_madd_v2r8(dx10
,fscal
,fix1
);
1214 fiy1
= _fjsp_madd_v2r8(dy10
,fscal
,fiy1
);
1215 fiz1
= _fjsp_madd_v2r8(dz10
,fscal
,fiz1
);
1217 fjx0
= _fjsp_madd_v2r8(dx10
,fscal
,fjx0
);
1218 fjy0
= _fjsp_madd_v2r8(dy10
,fscal
,fjy0
);
1219 fjz0
= _fjsp_madd_v2r8(dz10
,fscal
,fjz0
);
1221 /**************************
1222 * CALCULATE INTERACTIONS *
1223 **************************/
1225 r20
= _fjsp_mul_v2r8(rsq20
,rinv20
);
1227 /* Compute parameters for interactions between i and j atoms */
1228 qq20
= _fjsp_mul_v2r8(iq2
,jq0
);
1230 /* Calculate table index by multiplying r with table scale and truncate to integer */
1231 rt
= _fjsp_mul_v2r8(r20
,vftabscale
);
1232 itab_tmp
= _fjsp_dtox_v2r8(rt
);
1233 vfeps
= _fjsp_sub_v2r8(rt
, _fjsp_xtod_v2r8(itab_tmp
));
1234 twovfeps
= _fjsp_add_v2r8(vfeps
,vfeps
);
1235 _fjsp_store_v2r8(&vfconv
.simd
,itab_tmp
);
1240 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1241 Y
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] );
1242 F
= _fjsp_setzero_v2r8();
1243 GMX_FJSP_TRANSPOSE2_V2R8(Y
,F
);
1244 G
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] +2);
1245 H
= _fjsp_setzero_v2r8();
1246 GMX_FJSP_TRANSPOSE2_V2R8(G
,H
);
1247 Fp
= _fjsp_madd_v2r8(vfeps
,_fjsp_madd_v2r8(vfeps
,H
,G
),F
);
1248 FF
= _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps
,H
,G
),vfeps
,Fp
);
1249 felec
= _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq20
,FF
),_fjsp_mul_v2r8(vftabscale
,rinv20
)));
1253 fscal
= _fjsp_unpacklo_v2r8(fscal
,_fjsp_setzero_v2r8());
1255 /* Update vectorial force */
1256 fix2
= _fjsp_madd_v2r8(dx20
,fscal
,fix2
);
1257 fiy2
= _fjsp_madd_v2r8(dy20
,fscal
,fiy2
);
1258 fiz2
= _fjsp_madd_v2r8(dz20
,fscal
,fiz2
);
1260 fjx0
= _fjsp_madd_v2r8(dx20
,fscal
,fjx0
);
1261 fjy0
= _fjsp_madd_v2r8(dy20
,fscal
,fjy0
);
1262 fjz0
= _fjsp_madd_v2r8(dz20
,fscal
,fjz0
);
1264 /**************************
1265 * CALCULATE INTERACTIONS *
1266 **************************/
1268 r30
= _fjsp_mul_v2r8(rsq30
,rinv30
);
1270 /* Compute parameters for interactions between i and j atoms */
1271 qq30
= _fjsp_mul_v2r8(iq3
,jq0
);
1273 /* Calculate table index by multiplying r with table scale and truncate to integer */
1274 rt
= _fjsp_mul_v2r8(r30
,vftabscale
);
1275 itab_tmp
= _fjsp_dtox_v2r8(rt
);
1276 vfeps
= _fjsp_sub_v2r8(rt
, _fjsp_xtod_v2r8(itab_tmp
));
1277 twovfeps
= _fjsp_add_v2r8(vfeps
,vfeps
);
1278 _fjsp_store_v2r8(&vfconv
.simd
,itab_tmp
);
1283 /* CUBIC SPLINE TABLE ELECTROSTATICS */
1284 Y
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] );
1285 F
= _fjsp_setzero_v2r8();
1286 GMX_FJSP_TRANSPOSE2_V2R8(Y
,F
);
1287 G
= _fjsp_load_v2r8( vftab
+ vfconv
.i
[0] +2);
1288 H
= _fjsp_setzero_v2r8();
1289 GMX_FJSP_TRANSPOSE2_V2R8(G
,H
);
1290 Fp
= _fjsp_madd_v2r8(vfeps
,_fjsp_madd_v2r8(vfeps
,H
,G
),F
);
1291 FF
= _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps
,H
,G
),vfeps
,Fp
);
1292 felec
= _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq30
,FF
),_fjsp_mul_v2r8(vftabscale
,rinv30
)));
1296 fscal
= _fjsp_unpacklo_v2r8(fscal
,_fjsp_setzero_v2r8());
1298 /* Update vectorial force */
1299 fix3
= _fjsp_madd_v2r8(dx30
,fscal
,fix3
);
1300 fiy3
= _fjsp_madd_v2r8(dy30
,fscal
,fiy3
);
1301 fiz3
= _fjsp_madd_v2r8(dz30
,fscal
,fiz3
);
1303 fjx0
= _fjsp_madd_v2r8(dx30
,fscal
,fjx0
);
1304 fjy0
= _fjsp_madd_v2r8(dy30
,fscal
,fjy0
);
1305 fjz0
= _fjsp_madd_v2r8(dz30
,fscal
,fjz0
);
1307 gmx_fjsp_decrement_1rvec_1ptr_swizzle_v2r8(f
+j_coord_offsetA
,fjx0
,fjy0
,fjz0
);
1309 /* Inner loop uses 180 flops */
1312 /* End of innermost loop */
1314 gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0
,fiy0
,fiz0
,fix1
,fiy1
,fiz1
,fix2
,fiy2
,fiz2
,fix3
,fiy3
,fiz3
,
1315 f
+i_coord_offset
,fshift
+i_shift_offset
);
1317 /* Increment number of inner iterations */
1318 inneriter
+= j_index_end
- j_index_start
;
1320 /* Outer loop uses 24 flops */
1323 /* Increment number of outer iterations */
1326 /* Update outer/inner flops */
1328 inc_nrnb(nrnb
,eNR_NBKERNEL_ELEC_VDW_W4_F
,outeriter
*24 + inneriter
*180);