nb_kernel131_ia32_sse2.intel_syntax.s
来自「最著名最快的分子模拟软件」· S 代码 · 共 2,209 行 · 第 1/4 页
S
2,209 行
pslld mm6, 3 ;# idx *= 8 movd mm0, eax movd mm1, ebx mov esi, [ebp + nb131_VFtab] movd eax, mm6 psrlq mm6, 32 movd ebx, mm6 ;# dispersion movlpd xmm4, [esi + eax*8] ;# Y1 movlpd xmm3, [esi + ebx*8] ;# Y2 movhpd xmm4, [esi + eax*8 + 8] ;# Y1 F1 movhpd xmm3, [esi + ebx*8 + 8] ;# Y2 F2 movapd xmm5, xmm4 unpcklpd xmm4, xmm3 ;# Y1 Y2 unpckhpd xmm5, xmm3 ;# F1 F2 movlpd xmm6, [esi + eax*8 + 16] ;# G1 movlpd xmm3, [esi + ebx*8 + 16] ;# G2 movhpd xmm6, [esi + eax*8 + 24] ;# G1 H1 movhpd xmm3, [esi + ebx*8 + 24] ;# G2 H2 movapd xmm7, xmm6 unpcklpd xmm6, xmm3 ;# G1 G2 unpckhpd xmm7, xmm3 ;# H1 H2 ;# dispersion table ready, in xmm4-xmm7 mulpd xmm6, xmm1 ;# xmm6=Geps mulpd xmm7, xmm2 ;# xmm7=Heps2 addpd xmm5, xmm6 addpd xmm5, xmm7 ;# xmm5=Fp mulpd xmm7, [esp + nb131_two] ;# two*Heps2 addpd xmm7, xmm6 addpd xmm7, xmm5 ;# xmm7=FF mulpd xmm5, xmm1 ;# xmm5=eps*Fp addpd xmm5, xmm4 ;# xmm5=VV movapd xmm4, [esp + nb131_c6] mulpd xmm7, xmm4 ;# fijD mulpd xmm5, xmm4 ;# Vvdw6 ;# put scalar force on stack Update Vvdwtot directly addpd xmm5, [esp + nb131_Vvdwtot] movapd xmm3, [esp + nb131_fstmp] mulpd xmm7, [esp + nb131_tsc] subpd xmm3, xmm7 movapd [esp + nb131_fstmp], xmm3 movapd [esp + nb131_Vvdwtot], xmm5 ;# repulsion movlpd xmm4, [esi + eax*8 + 32] ;# Y1 movlpd xmm3, [esi + ebx*8 + 32] ;# Y2 movhpd xmm4, [esi + eax*8 + 40] ;# Y1 F1 movhpd xmm3, [esi + ebx*8 + 40] ;# Y2 F2 movapd xmm5, xmm4 unpcklpd xmm4, xmm3 ;# Y1 Y2 unpckhpd xmm5, xmm3 ;# F1 F2 movlpd xmm6, [esi + eax*8 + 48] ;# G1 movlpd xmm3, [esi + ebx*8 + 48] ;# G2 movhpd xmm6, [esi + eax*8 + 56] ;# G1 H1 movhpd xmm3, [esi + ebx*8 + 56] ;# G2 H2 movapd xmm7, xmm6 unpcklpd xmm6, xmm3 ;# G1 G2 unpckhpd xmm7, xmm3 ;# H1 H2 ;# table ready, in xmm4-xmm7 mulpd xmm6, xmm1 ;# xmm6=Geps mulpd xmm7, xmm2 ;# xmm7=Heps2 addpd xmm5, xmm6 addpd xmm5, xmm7 ;# xmm5=Fp mulpd xmm7, [esp + nb131_two] ;# two*Heps2 addpd xmm7, xmm6 addpd xmm7, xmm5 ;# xmm7=FF mulpd xmm5, xmm1 ;# xmm5=eps*Fp addpd xmm5, xmm4 ;# xmm5=VV movapd xmm4, [esp + nb131_c12] mulpd xmm7, xmm4 mulpd xmm5, xmm4 addpd xmm5, [esp + nb131_Vvdwtot] movapd xmm3, [esp + nb131_fstmp] mulpd xmm7, [esp + nb131_tsc] subpd xmm3, xmm7 movapd [esp + nb131_Vvdwtot], xmm5 mulpd xmm3, xmm0 movapd xmm0, [esp + nb131_dxO] movapd xmm1, [esp + nb131_dyO] movapd xmm2, [esp + nb131_dzO] movd eax, mm0 movd ebx, mm1 mov edi, [ebp + nb131_faction] mulpd xmm0, xmm3 mulpd xmm1, xmm3 mulpd xmm2, xmm3 ;# update O forces movapd xmm3, [esp + nb131_fixO] movapd xmm4, [esp + nb131_fiyO] movapd xmm7, [esp + nb131_fizO] addpd xmm3, xmm0 addpd xmm4, xmm1 addpd xmm7, xmm2 movapd [esp + nb131_fixO], xmm3 movapd [esp + nb131_fiyO], xmm4 movapd [esp + nb131_fizO], xmm7 ;# update j forces with water O movapd [esp + nb131_fjx], xmm0 movapd [esp + nb131_fjy], xmm1 movapd [esp + nb131_fjz], xmm2 ;# H1 interactions movapd xmm6, [esp + nb131_rinvH1] movapd xmm4, xmm6 mulpd xmm6, [esp + nb131_qqH] ;# vcoul mulpd xmm4, xmm4 ;# rinvsq mulpd xmm4, xmm6 ;# vcoul*rinvsq addpd xmm6, [esp + nb131_vctot] movapd [esp + nb131_vctot], xmm6 movapd xmm0, [esp + nb131_dxH1] movapd xmm1, [esp + nb131_dyH1] movapd xmm2, [esp + nb131_dzH1] mulpd xmm0, xmm4 mulpd xmm1, xmm4 mulpd xmm2, xmm4 ;# update H1 forces movapd xmm3, [esp + nb131_fixH1] movapd xmm4, [esp + nb131_fiyH1] movapd xmm7, [esp + nb131_fizH1] addpd xmm3, xmm0 addpd xmm4, xmm1 addpd xmm7, xmm2 movapd [esp + nb131_fixH1], xmm3 movapd [esp + nb131_fiyH1], xmm4 movapd [esp + nb131_fizH1], xmm7 ;# update j forces with water H1 addpd xmm0, [esp + nb131_fjx] addpd xmm1, [esp + nb131_fjy] addpd xmm2, [esp + nb131_fjz] movapd [esp + nb131_fjx], xmm0 movapd [esp + nb131_fjy], xmm1 movapd [esp + nb131_fjz], xmm2 ;# H2 interactions movapd xmm6, [esp + nb131_rinvH2] movapd xmm4, xmm6 mulpd xmm6, [esp + nb131_qqH] ;# vcoul mulpd xmm4, xmm4 ;# rinvsq mulpd xmm4, xmm6 ;# vcoul*rinvsq addpd xmm6, [esp + nb131_vctot] movapd xmm0, [esp + nb131_dxH2] movapd xmm1, [esp + nb131_dyH2] movapd xmm2, [esp + nb131_dzH2] movapd [esp + nb131_vctot], xmm6 mulpd xmm0, xmm4 mulpd xmm1, xmm4 mulpd xmm2, xmm4 ;# update H2 forces movapd xmm3, [esp + nb131_fixH2] movapd xmm4, [esp + nb131_fiyH2] movapd xmm7, [esp + nb131_fizH2] addpd xmm3, xmm0 addpd xmm4, xmm1 addpd xmm7, xmm2 movapd [esp + nb131_fixH2], xmm3 movapd [esp + nb131_fiyH2], xmm4 movapd [esp + nb131_fizH2], xmm7 mov edi, [ebp + nb131_faction] ;# update j forces addpd xmm0, [esp + nb131_fjx] addpd xmm1, [esp + nb131_fjy] addpd xmm2, [esp + nb131_fjz] movlpd xmm3, [edi + eax*8] movlpd xmm4, [edi + eax*8 + 8] movlpd xmm5, [edi + eax*8 + 16] movhpd xmm3, [edi + ebx*8] movhpd xmm4, [edi + ebx*8 + 8] movhpd xmm5, [edi + ebx*8 + 16] subpd xmm3, xmm0 subpd xmm4, xmm1 subpd xmm5, xmm2 movlpd [edi + eax*8], xmm3 movlpd [edi + eax*8 + 8], xmm4 movlpd [edi + eax*8 + 16], xmm5 movhpd [edi + ebx*8], xmm3 movhpd [edi + ebx*8 + 8], xmm4 movhpd [edi + ebx*8 + 16], xmm5 ;# should we do one more iteration? sub dword ptr [esp + nb131_innerk], 2 jl .nb131_checksingle jmp .nb131_unroll_loop.nb131_checksingle: mov edx, [esp + nb131_innerk] and edx, 1 jnz .nb131_dosingle jmp .nb131_updateouterdata.nb131_dosingle: mov edx, [esp + nb131_innerjjnr] ;# pointer to jjnr[k] mov eax, [edx] add dword ptr [esp + nb131_innerjjnr], 4 mov esi, [ebp + nb131_charge] ;# base of charge[] xorpd xmm3, xmm3 movlpd xmm3, [esi + eax*8] movapd xmm4, xmm3 mulpd xmm3, [esp + nb131_iqO] mulpd xmm4, [esp + nb131_iqH] movd mm0, eax ;# use mmx registers as temp storage movapd [esp + nb131_qqO], xmm3 movapd [esp + nb131_qqH], xmm4 mov esi, [ebp + nb131_type] mov eax, [esi + eax*4] mov esi, [ebp + nb131_vdwparam] shl eax, 1 mov edi, [esp + nb131_ntia] add eax, edi movlpd xmm6, [esi + eax*8] ;# c6a movhpd xmm6, [esi + eax*8 + 8] ;# c6a c12a xorpd xmm7, xmm7 movapd xmm4, xmm6 unpcklpd xmm4, xmm7 unpckhpd xmm6, xmm7 movd eax, mm0 movapd [esp + nb131_c6], xmm4 movapd [esp + nb131_c12], xmm6 mov esi, [ebp + nb131_pos] ;# base of pos[] lea eax, [eax + eax*2] ;# replace jnr with j3 ;# move coordinates to xmm0-xmm2 movlpd xmm0, [esi + eax*8] movlpd xmm1, [esi + eax*8 + 8] movlpd xmm2, [esi + eax*8 + 16] ;# move ixO-izO to xmm4-xmm6 movapd xmm4, [esp + nb131_ixO] movapd xmm5, [esp + nb131_iyO] movapd xmm6, [esp + nb131_izO] ;# calc dr subsd xmm4, xmm0 subsd xmm5, xmm1 subsd xmm6, xmm2 ;# store dr movapd [esp + nb131_dxO], xmm4 movapd [esp + nb131_dyO], xmm5 movapd [esp + nb131_dzO], xmm6 ;# square it mulsd xmm4,xmm4 mulsd xmm5,xmm5 mulsd xmm6,xmm6 addsd xmm4, xmm5 addsd xmm4, xmm6 movapd xmm7, xmm4 ;# rsqO in xmm7 movapd [esp + nb131_rsqO], xmm7 ;# move ixH1-izH1 to xmm4-xmm6 movapd xmm4, [esp + nb131_ixH1] movapd xmm5, [esp + nb131_iyH1] movapd xmm6, [esp + nb131_izH1] ;# calc dr subsd xmm4, xmm0 subsd xmm5, xmm1 subsd xmm6, xmm2 ;# store dr movapd [esp + nb131_dxH1], xmm4 movapd [esp + nb131_dyH1], xmm5 movapd [esp + nb131_dzH1], xmm6 ;# square it mulsd xmm4,xmm4 mulsd xmm5,xmm5 mulsd xmm6,xmm6 addsd xmm6, xmm5 addsd xmm6, xmm4 ;# rsqH1 in xmm6 ;# move ixH2-izH2 to xmm3-xmm5 movapd xmm3, [esp + nb131_ixH2] movapd xmm4, [esp + nb131_iyH2] movapd xmm5, [esp + nb131_izH2] ;# calc dr subsd xmm3, xmm0 subsd xmm4, xmm1 subsd xmm5, xmm2 ;# store dr movapd [esp + nb131_dxH2], xmm3 movapd [esp + nb131_dyH2], xmm4 movapd [esp + nb131_dzH2], xmm5 ;# square it mulsd xmm3,xmm3 mulsd xmm4,xmm4 mulsd xmm5,xmm5 addsd xmm5, xmm4 addsd xmm5, xmm3 ;# rsqH2 in xmm5, rsqH1 in xmm6, rsqO in xmm7 ;# start with rsqO - put seed in xmm2 cvtsd2ss xmm2, xmm7 rsqrtss xmm2, xmm2 cvtss2sd xmm2, xmm2 movapd xmm3, xmm2 mulsd xmm2, xmm2 movapd xmm4, [esp + nb131_three] mulsd xmm2, xmm7 ;# rsq*lu*lu subsd xmm4, xmm2 ;# 30-rsq*lu*lu mulsd xmm4, xmm3 ;# lu*(3-rsq*lu*lu) mulsd xmm4, [esp + nb131_half] ;# iter1 ( new lu) movapd xmm3, xmm4 mulsd xmm4, xmm4 ;# lu*lu mulsd xmm7, xmm4 ;# rsq*lu*lu movapd xmm4, [esp + nb131_three] subsd xmm4, xmm7 ;# 3-rsq*lu*lu mulsd xmm4, xmm3 ;# lu*( 3-rsq*lu*lu) mulsd xmm4, [esp + nb131_half] ;# rinv movapd xmm7, xmm4 ;# rinvO in xmm7 ;# rsqH1 - seed in xmm2 cvtsd2ss xmm2, xmm6 rsqrtss xmm2, xmm2 cvtss2sd xmm2, xmm2 movapd xmm3, xmm2 mulsd xmm2, xmm2 movapd xmm4, [esp + nb131_three] mulsd xmm2, xmm6 ;# rsq*lu*lu subsd xmm4, xmm2 ;# 30-rsq*lu*lu mulsd xmm4, xmm3 ;# lu*(3-rsq*lu*lu) mulsd xmm4, [esp + nb131_half] ;# iter1 ( new lu) movapd xmm3, xmm4 mulsd xmm4, xmm4 ;# lu*lu mulsd xmm6, xmm4 ;# rsq*lu*lu movapd xmm4, [esp + nb131_three] subsd xmm4, xmm6 ;# 3-rsq*lu*lu mulsd xmm4, xmm3 ;# lu*( 3-rsq*lu*lu) mulsd xmm4, [esp + nb131_half] ;# rinv movapd xmm6, xmm4 ;# rinvH1 in xmm6 movsd [esp + nb131_rinvH1], xmm6 ;# rsqH2 - seed in xmm2 cvtsd2ss xmm2, xmm5 rsqrtss xmm2, xmm2 cvtss2sd xmm2, xmm2 movapd xmm3, xmm2 mulsd xmm2, xmm2 movapd xmm4, [esp + nb131_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 + nb131_half] ;# iter1 ( new lu) movapd xmm3, xmm4 mulsd xmm4, xmm4 ;# lu*lu mulsd xmm5, xmm4 ;# rsq*lu*lu movapd xmm4, [esp + nb131_three] subsd xmm4, xmm5 ;# 3-rsq*lu*lu mulsd xmm4, xmm3 ;# lu*( 3-rsq*lu*lu) mulsd xmm4, [esp + nb131_half] ;# rinv movapd xmm5, xmm4 ;# rinvH2 in xmm5 movsd [esp + nb131_rinvH2], xmm5 ;# do O interactions movsd xmm0, xmm7 mulsd xmm7, [esp + nb131_qqO] ;# vcoul movsd xmm6, xmm0 mulsd xmm6, xmm7 ;# vcoul*rinv movsd [esp + nb131_fstmp], xmm6 ;# save to temp. storage addsd xmm7, [esp + nb131_vctot] movsd [esp + nb131_vctot], xmm7 movsd xmm4, [esp + nb131_rsqO] ;# LJ table interaction. xmm0=rinv, xmm4=rsq mulsd xmm4, xmm0 ;# xmm4=r mulsd xmm4, [esp + nb131_tsc] cvttsd2si ebx, xmm4 ;# mm6 = lu idx cvtsi2sd xmm5, ebx subpd xmm4, xmm5 movapd xmm1, xmm4 ;# xmm1=eps movapd xmm2, xmm1 mulpd xmm2, xmm2 ;# xmm2=eps2 shl ebx, 3 mov esi, [ebp + nb131_VFtab] ;# dispersion movlpd xmm4, [esi + ebx*8] ;# Y1 movhpd xmm4, [esi + ebx*8 + 8] ;# Y1 F1 movapd xmm5, xmm4 unpcklpd xmm4, xmm3 ;# Y1 Y2 unpckhpd xmm5, xmm3 ;# F1 F2 movlpd xmm6, [esi + ebx*8 + 16] ;# G1 movhpd xmm6, [esi + ebx*8 + 24] ;# G1 H1 movapd xmm7, xmm6 unpcklpd xmm6, xmm3 ;# G1 G2 unpckhpd xmm7, xmm3 ;# H1 H2 ;# dispersion 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 + nb131_two] ;# two*Heps2 addsd xmm7, xmm6 addsd xmm7, xmm5 ;# xmm7=FF mulsd xmm5, xmm1 ;# xmm5=eps*Fp addsd xmm5, xmm4 ;# xmm5=VV movsd xmm4, [esp + nb131_c6] mulsd xmm7, xmm4 ;# fijD mulsd xmm5, xmm4 ;# Vvdw6 ;# put scalar force on stack Update Vvdwtot directly addsd xmm5, [esp + nb131_Vvdwtot] movsd xmm3, [esp + nb131_fstmp] mulsd xmm7, [esp + nb131_tsc] subsd xmm3, xmm7 movsd [esp + nb131_fstmp], xmm3 movsd [esp + nb131_Vvdwtot], xmm5 ;# repulsion movlpd xmm4, [esi + ebx*8 + 32] ;# Y1 movhpd xmm4, [esi + ebx*8 + 40] ;# Y1 F1 movapd xmm5, xmm4 unpcklpd xmm4, xmm3 ;# Y1 Y2 unpckhpd xmm5, xmm3 ;# F1 F2 movlpd xmm6, [esi + ebx*8 + 48] ;# G1 movhpd xmm6, [esi + ebx*8 + 56] ;# G1 H1 movapd xmm7, xmm6 unpcklpd xmm6, xmm3 ;# G1 G2 unpckhpd xmm7, xmm3 ;# H1 H2 ;# 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 + nb131_two] ;# two*Heps2 addsd xmm7, xmm6 addsd xmm7, xmm5 ;# xmm7=FF mulsd xmm5, xmm1 ;# xmm5=eps*Fp addsd xmm5, xmm4 ;# xmm5=VV movsd xmm4, [esp + nb131_c12] mulsd xmm7, xmm4 mulsd xmm5, xmm4 addsd xmm5, [esp + nb131_Vvdwtot] movsd xmm3, [esp + nb131_fstmp] mulsd xmm7, [esp + nb131_tsc] subsd xmm3, xmm7 movsd [esp + nb131_Vvdwtot], xmm5 mulsd xmm3, xmm0 movsd xmm0, [esp + nb131_dxO] movsd xmm1, [esp + nb131_dyO] movsd xmm2, [esp + nb131_dzO] mov edi, [ebp + nb131_faction] mulsd xmm0, xmm3 mulsd xmm1, xmm3 mulsd xmm2, xmm3 ;# update O forces movapd xmm3, [esp + nb131_fixO] movapd xmm4, [esp + nb131_fiyO] movapd xmm7, [esp + nb131_fizO] addsd xmm3, xmm0 addsd xmm4, xmm1 addsd xmm7, xmm2 movlpd [esp + nb131_fixO], xmm3 movlpd [esp + nb131_fiyO], xmm4 movlpd [esp + nb131_fizO], xmm7 ;# update j forces with water O movlpd [esp + nb131_fjx], xmm0 movlpd [esp + nb131_fjy], xmm1 movlpd [esp + nb131_fjz], xmm2 ;# H1 interactions movsd xmm6, [esp + nb131_rinvH1] movsd xmm4, xmm6 mulsd xmm6, [esp + nb131_qqH] ;# vcoul mulsd xmm4, xmm4 ;# rinvsq mulsd xmm4, xmm6 ;# vcoul*rinvsq addsd xmm6, [esp + nb131_vctot] movapd xmm0, [esp + nb131_dxH1] movapd xmm1, [esp + nb131_dyH1] movapd xmm2, [esp + nb131_dzH1] movlpd [esp + nb131_vctot], xmm6 mulsd xmm0, xmm4 mulsd xmm1, xmm4 mulsd xmm2, xmm4 ;# update H1 forces movapd xmm3, [esp + nb131_fixH1] movapd xmm4, [esp + nb131_fiyH1] movapd xmm7, [esp + nb131_fizH1] addsd xmm3, xmm0 addsd xmm4, xmm1 addsd xmm7, xmm2 movlpd [esp + nb131_fixH1], xmm3 movlpd [esp + nb131_fiyH1], xmm4 movlpd [esp + nb131_fizH1], xmm7 ;# update j forces with water H1 addsd xmm0, [esp + nb131_fjx] addsd xmm1, [esp + nb131_fjy] addsd xmm2, [esp + nb131_fjz] movlpd [esp + nb131_fjx], xmm0 movlpd [esp + nb131_fjy], xmm1 movlpd [esp + nb131_fjz], xmm2
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?