nb_kernel303_ia32_sse2.intel_syntax.s
来自「最著名最快的分子模拟软件」· S 代码 · 共 2,228 行 · 第 1/5 页
S
2,228 行
mulsd xmm4, [esp + nb303_half] ;# iter1 ( new lu) movapd xmm2, xmm6 movapd xmm3, xmm4 mulsd xmm4, xmm4 ;# lu*lu mulsd xmm2, xmm4 ;# rsq*lu*lu movapd xmm4, [esp + nb303_three] subsd xmm4, xmm2 ;# 3-rsq*lu*lu mulsd xmm4, xmm3 ;# lu*( 3-rsq*lu*lu) mulsd xmm4, [esp + nb303_half] ;# rinv movapd [esp + nb303_rinvH1], xmm4 ;# rinvH1 mulsd xmm6, xmm4 movapd [esp + nb303_rH1], xmm6 ;# rH1 ;# rsqH2 - seed in xmm2 cvtsd2ss xmm2, xmm5 rsqrtss xmm2, xmm2 cvtss2sd xmm2, xmm2 movapd xmm3, xmm2 mulsd xmm2, xmm2 movapd xmm4, [esp + nb303_three] mulsd xmm2, xmm5 ;# rsq*lu*lu subsd xmm4, xmm2 ;# 30-rsq*lu*lu mulsd xmm4, xmm3 ;# lu*(3-rsq*lu*lu) mulsd xmm4, [esp + nb303_half] ;# iter1 ( new lu) movapd xmm2, xmm5 movapd xmm3, xmm4 mulsd xmm4, xmm4 ;# lu*lu mulsd xmm2, xmm4 ;# rsq*lu*lu movapd xmm4, [esp + nb303_three] subsd xmm4, xmm2 ;# 3-rsq*lu*lu mulsd xmm4, xmm3 ;# lu*( 3-rsq*lu*lu) mulsd xmm4, [esp + nb303_half] ;# rinv movapd [esp + nb303_rinvH2], xmm4 ;# rinv mulsd xmm5, xmm4 movapd [esp + nb303_rH2], xmm5 ;# r ;# do M interactions movd mm0, eax ;# rM is still in xmm7 mulsd xmm7, [esp + nb303_tsc] cvttsd2si eax, xmm7 ;# mm6 = lu idx cvtsi2sd xmm6, eax subsd xmm7, xmm6 movapd xmm1, xmm7 ;# xmm1=eps movapd xmm2, xmm1 mulsd xmm2, xmm2 ;# xmm2=eps2 shl eax, 2 ;# idx *= 4 mov esi, [ebp + nb303_VFtab] movlpd xmm4, [esi + eax*8] ;# Y1 movhpd xmm4, [esi + eax*8 + 8] ;# Y1 F1 xorpd xmm3, xmm3 movapd xmm5, xmm4 unpcklpd xmm4, xmm3 ;# Y1 unpckhpd xmm5, xmm3 ;# F1 movlpd xmm6, [esi + eax*8 + 16] ;# G1 movhpd xmm6, [esi + eax*8 + 24] ;# G1 H1 xorpd xmm3, xmm3 movapd xmm7, xmm6 unpcklpd xmm6, xmm3 ;# G1 unpckhpd xmm7, xmm3 ;# H1 ;# coulomb table ready, in xmm4-xmm7 mulsd xmm6, xmm1 ;# xmm6=Geps mulsd xmm7, xmm2 ;# xmm7=Heps2 addsd xmm5, xmm6 addsd xmm5, xmm7 ;# xmm5=Fp mulsd xmm7, [esp + nb303_two] ;# two*Heps2 movapd xmm3, [esp + nb303_qqM] addsd xmm7, xmm6 addsd xmm7, xmm5 ;# xmm7=FF mulsd xmm5, xmm1 ;# xmm5=eps*Fp addsd xmm5, xmm4 ;# xmm5=VV mulsd xmm5, xmm3 ;# vcoul=qq*VV mulsd xmm3, xmm7 ;# fijC=FF*qq ;# at this point mm5 contains vcoul and xmm3 fijC ;# increment vcoul - then we can get rid of mm5 addsd xmm5, [esp + nb303_vctot] movlpd [esp + nb303_vctot], xmm5 xorpd xmm4, xmm4 mulsd xmm3, [esp + nb303_tsc] mulsd xmm3, [esp + nb303_rinvM] subsd xmm4, xmm3 movapd xmm0, [esp + nb303_dxM] movapd xmm1, [esp + nb303_dyM] movapd xmm2, [esp + nb303_dzM] mulsd xmm0, xmm4 mulsd xmm1, xmm4 mulsd xmm2, xmm4 ;# tx in xmm0-xmm2 ;# update M forces movapd xmm3, [esp + nb303_fixM] movapd xmm4, [esp + nb303_fiyM] movapd xmm7, [esp + nb303_fizM] addsd xmm3, xmm0 addsd xmm4, xmm1 addsd xmm7, xmm2 movlpd [esp + nb303_fixM], xmm3 movlpd [esp + nb303_fiyM], xmm4 movlpd [esp + nb303_fizM], xmm7 ;# update j forces with water M movlpd [esp + nb303_fjx], xmm0 movlpd [esp + nb303_fjy], xmm1 movlpd [esp + nb303_fjz], xmm2 ;# Done with M interactions - now H1! movapd xmm7, [esp + nb303_rH1] mulsd xmm7, [esp + nb303_tsc] cvttsd2si eax, xmm7 ;# mm6 = lu idx cvtsi2sd xmm6, eax subsd xmm7, xmm6 movapd xmm1, xmm7 ;# xmm1=eps movapd xmm2, xmm1 mulsd xmm2, xmm2 ;# xmm2=eps2 shl eax, 2 ;# idx *= 4 mov esi, [ebp + nb303_VFtab] movlpd xmm4, [esi + eax*8] ;# Y1 movhpd xmm4, [esi + eax*8 + 8] ;# Y1 F1 xorpd xmm3, xmm3 movapd xmm5, xmm4 unpcklpd xmm4, xmm3 ;# Y1 unpckhpd xmm5, xmm3 ;# F1 movlpd xmm6, [esi + eax*8 + 16] ;# G1 movhpd xmm6, [esi + eax*8 + 24] ;# G1 H1 xorpd xmm3, xmm3 movapd xmm7, xmm6 unpcklpd xmm6, xmm3 ;# G1 unpckhpd xmm7, xmm3 ;# H1 ;# coulomb table ready, in xmm4-xmm7 mulsd xmm6, xmm1 ;# xmm6=Geps mulsd xmm7, xmm2 ;# xmm7=Heps2 addsd xmm5, xmm6 addsd xmm5, xmm7 ;# xmm5=Fp mulsd xmm7, [esp + nb303_two] ;# two*Heps2 movapd xmm3, [esp + nb303_qqH] addsd xmm7, xmm6 addsd xmm7, xmm5 ;# xmm7=FF mulsd xmm5, xmm1 ;# xmm5=eps*Fp addsd xmm5, xmm4 ;# xmm5=VV mulsd xmm5, xmm3 ;# vcoul=qq*VV mulsd xmm3, xmm7 ;# fijC=FF*qq ;# at this point mm5 contains vcoul and xmm3 fijC ;# increment vcoul xorpd xmm4, xmm4 addsd xmm5, [esp + nb303_vctot] mulsd xmm3, [esp + nb303_rinvH1] movlpd [esp + nb303_vctot], xmm5 mulsd xmm3, [esp + nb303_tsc] subsd xmm4, xmm3 movapd xmm0, [esp + nb303_dxH1] movapd xmm1, [esp + nb303_dyH1] movapd xmm2, [esp + nb303_dzH1] mulsd xmm0, xmm4 mulsd xmm1, xmm4 mulsd xmm2, xmm4 ;# update H1 forces movapd xmm3, [esp + nb303_fixH1] movapd xmm4, [esp + nb303_fiyH1] movapd xmm7, [esp + nb303_fizH1] addsd xmm3, xmm0 addsd xmm4, xmm1 addsd xmm7, xmm2 movlpd [esp + nb303_fixH1], xmm3 movlpd [esp + nb303_fiyH1], xmm4 movlpd [esp + nb303_fizH1], xmm7 ;# update j forces with water H1 addsd xmm0, [esp + nb303_fjx] addsd xmm1, [esp + nb303_fjy] addsd xmm2, [esp + nb303_fjz] movlpd [esp + nb303_fjx], xmm0 movlpd [esp + nb303_fjy], xmm1 movlpd [esp + nb303_fjz], xmm2 ;# Done with H1, finally we do H2 interactions movapd xmm7, [esp + nb303_rH2] mulsd xmm7, [esp + nb303_tsc] cvttsd2si eax, xmm7 ;# mm6 = lu idx cvtsi2sd xmm6, eax subsd xmm7, xmm6 movapd xmm1, xmm7 ;# xmm1=eps movapd xmm2, xmm1 mulsd xmm2, xmm2 ;# xmm2=eps2 shl eax, 2 ;# idx *= 4 mov esi, [ebp + nb303_VFtab] movlpd xmm4, [esi + eax*8] ;# Y1 movhpd xmm4, [esi + eax*8 + 8] ;# Y1 F1 xorpd xmm3, xmm3 movapd xmm5, xmm4 unpcklpd xmm4, xmm3 ;# Y1 unpckhpd xmm5, xmm3 ;# F1 movlpd xmm6, [esi + eax*8 + 16] ;# G1 movhpd xmm6, [esi + eax*8 + 24] ;# G1 H1 xorpd xmm3, xmm3 movapd xmm7, xmm6 unpcklpd xmm6, xmm3 ;# G1 unpckhpd xmm7, xmm3 ;# H1 ;# coulomb table ready, in xmm4-xmm7 mulsd xmm6, xmm1 ;# xmm6=Geps mulsd xmm7, xmm2 ;# xmm7=Heps2 addsd xmm5, xmm6 addsd xmm5, xmm7 ;# xmm5=Fp mulsd xmm7, [esp + nb303_two] ;# two*Heps2 movapd xmm3, [esp + nb303_qqH] addsd xmm7, xmm6 addsd xmm7, xmm5 ;# xmm7=FF mulsd xmm5, xmm1 ;# xmm5=eps*Fp addsd xmm5, xmm4 ;# xmm5=VV mulsd xmm5, xmm3 ;# vcoul=qq*VV mulsd xmm3, xmm7 ;# fijC=FF*qq ;# at this point mm5 contains vcoul and xmm3 fijC ;# increment vcoul xorpd xmm4, xmm4 addsd xmm5, [esp + nb303_vctot] mulsd xmm3, [esp + nb303_rinvH2] movlpd [esp + nb303_vctot], xmm5 mulsd xmm3, [esp + nb303_tsc] subsd xmm4, xmm3 movapd xmm0, [esp + nb303_dxH2] movapd xmm1, [esp + nb303_dyH2] movapd xmm2, [esp + nb303_dzH2] mulsd xmm0, xmm4 mulsd xmm1, xmm4 mulsd xmm2, xmm4 movd eax, mm0 ;# update H2 forces movapd xmm3, [esp + nb303_fixH2] movapd xmm4, [esp + nb303_fiyH2] movapd xmm7, [esp + nb303_fizH2] addsd xmm3, xmm0 addsd xmm4, xmm1 addsd xmm7, xmm2 movlpd [esp + nb303_fixH2], xmm3 movlpd [esp + nb303_fiyH2], xmm4 movlpd [esp + nb303_fizH2], xmm7 mov edi, [ebp + nb303_faction] ;# update j forces ;# update j forces with water H1 addsd xmm0, [esp + nb303_fjx] addsd xmm1, [esp + nb303_fjy] addsd xmm2, [esp + nb303_fjz] ;# the fj's - start by accumulating forces from memory movlpd xmm3, [edi + eax*8] movlpd xmm4, [edi + eax*8 + 8] movlpd xmm5, [edi + eax*8 + 16] subsd xmm3, xmm0 subsd xmm4, xmm1 subsd xmm5, xmm2 movlpd [edi + eax*8], xmm3 movlpd [edi + eax*8 + 8], xmm4 movlpd [edi + eax*8 + 16], xmm5.nb303_updateouterdata: mov ecx, [esp + nb303_ii3] mov edi, [ebp + nb303_faction] mov esi, [ebp + nb303_fshift] mov edx, [esp + nb303_is3] ;# accumulate H1i forces in xmm0, xmm1, xmm2 movapd xmm0, [esp + nb303_fixH1] movapd xmm1, [esp + nb303_fiyH1] movapd xmm2, [esp + nb303_fizH1] movhlps xmm3, xmm0 movhlps xmm4, xmm1 movhlps xmm5, xmm2 addsd xmm0, xmm3 addsd xmm1, xmm4 addsd xmm2, xmm5 ;# sum is in low xmm0-xmm2 ;# increment i force movsd xmm3, [edi + ecx*8 + 24] movsd xmm4, [edi + ecx*8 + 32] movsd xmm5, [edi + ecx*8 + 40] addsd xmm3, xmm0 addsd xmm4, xmm1 addsd xmm5, xmm2 movsd [edi + ecx*8 + 24], xmm3 movsd [edi + ecx*8 + 32], xmm4 movsd [edi + ecx*8 + 40], xmm5 ;# accumulate force in xmm6/xmm7 for fshift movapd xmm6, xmm0 movsd xmm7, xmm2 unpcklpd xmm6, xmm1 ;# accumulate H2i forces in xmm0, xmm1, xmm2 movapd xmm0, [esp + nb303_fixH2] movapd xmm1, [esp + nb303_fiyH2] movapd xmm2, [esp + nb303_fizH2] movhlps xmm3, xmm0 movhlps xmm4, xmm1 movhlps xmm5, xmm2 addsd xmm0, xmm3 addsd xmm1, xmm4 addsd xmm2, xmm5 ;# sum is in low xmm0-xmm2 ;# increment i force movsd xmm3, [edi + ecx*8 + 48] movsd xmm4, [edi + ecx*8 + 56] movsd xmm5, [edi + ecx*8 + 64] addsd xmm3, xmm0 addsd xmm4, xmm1 addsd xmm5, xmm2 movsd [edi + ecx*8 + 48], xmm3 movsd [edi + ecx*8 + 56], xmm4 movsd [edi + ecx*8 + 64], xmm5 ;# accumulate force in xmm6/xmm7 for fshift addsd xmm7, xmm2 unpcklpd xmm0, xmm1 addpd xmm6, xmm0 ;# accumulate H2i forces in xmm0, xmm1, xmm2 movapd xmm0, [esp + nb303_fixM] movapd xmm1, [esp + nb303_fiyM] movapd xmm2, [esp + nb303_fizM] movhlps xmm3, xmm0 movhlps xmm4, xmm1 movhlps xmm5, xmm2 addsd xmm0, xmm3 addsd xmm1, xmm4 addsd xmm2, xmm5 ;# sum is in low xmm0-xmm2 movapd xmm3, xmm0 movapd xmm4, xmm1 movapd xmm5, xmm2 ;# increment i force movsd xmm3, [edi + ecx*8 + 72] movsd xmm4, [edi + ecx*8 + 80] movsd xmm5, [edi + ecx*8 + 88] addsd xmm3, xmm0 addsd xmm4, xmm1 addsd xmm5, xmm2 movsd [edi + ecx*8 + 72], xmm3 movsd [edi + ecx*8 + 80], xmm4 movsd [edi + ecx*8 + 88], xmm5 ;# accumulate force in xmm6/xmm7 for fshift addsd xmm7, xmm2 unpcklpd xmm0, xmm1 addpd xmm6, xmm0 ;# increment fshift force movlpd xmm3, [esi + edx*8] movhpd xmm3, [esi + edx*8 + 8] movsd xmm4, [esi + edx*8 + 16] addpd xmm3, xmm6 addsd xmm4, xmm7 movlpd [esi + edx*8], xmm3 movhpd [esi + edx*8 + 8], xmm3 movsd [esi + edx*8 + 16], xmm4 ;# get n from stack mov esi, [esp + nb303_n] ;# get group index for i particle mov edx, [ebp + nb303_gid] ;# base of gid[] mov edx, [edx + esi*4] ;# ggid=gid[n] ;# accumulate total potential energy and update it movapd xmm7, [esp + nb303_vctot] ;# accumulate movhlps xmm6, xmm7 addsd xmm7, xmm6 ;# low xmm7 has the sum now ;# add earlier value from mem mov eax, [ebp + nb303_Vc] addsd xmm7, [eax + edx*8] ;# move back to mem movsd [eax + edx*8], xmm7 ;# finish if last mov ecx, [esp + nb303_nn1] ;# esi already loaded with n inc esi sub ecx, esi jz .nb303_outerend ;# not last, iterate outer loop once more! mov [esp + nb303_n], esi jmp .nb303_outer.nb303_outerend: ;# check if more outer neighborlists remain mov ecx, [esp + nb303_nri] ;# esi already loaded with n above sub ecx, esi jz .nb303_end ;# non-zero, do one more workunit jmp .nb303_threadloop.nb303_end: emms mov eax, [esp + nb303_nouter] mov ebx, [esp + nb303_ninner] mov ecx, [ebp + nb303_outeriter] mov edx, [ebp + nb303_inneriter] mov [ecx], eax mov [edx], ebx mov eax, [esp + nb303_salign] add esp, eax add esp, 760 pop edi pop esi pop edx pop ecx pop ebx pop eax leave ret .globl nb_kernel303nf_ia32_sse2.globl _nb_kernel303nf_ia32_sse2nb_kernel303nf_ia32_sse2: _nb_kernel303nf_ia32_sse2: .equiv nb303nf_p_nri, 8.equiv nb303nf_iinr, 12
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?