nb_kernel131_x86_64_sse2.intel_syntax.s

来自「最著名最快的分子模拟软件」· S 代码 · 共 2,068 行 · 第 1/4 页

S
2,068
字号
	;# calc dr 	subpd xmm3, xmm0	subpd xmm4, xmm1	subpd xmm5, xmm2	;# square it 	mulpd xmm3,xmm3	mulpd xmm4,xmm4	mulpd xmm5,xmm5	addpd xmm5, xmm4	addpd xmm5, xmm3	;# rsqH2 in xmm5, rsqH1 in xmm6, rsqO in xmm7 			;# start with rsqO - put seed in xmm2 	cvtpd2ps xmm2, xmm7		rsqrtps xmm2, xmm2	cvtps2pd xmm2, xmm2	movapd  xmm3, xmm2	mulpd   xmm2, xmm2	movapd  xmm4, [rsp + nb131nf_three]	mulpd   xmm2, xmm7	;# rsq*lu*lu 	subpd   xmm4, xmm2	;# 30-rsq*lu*lu 	mulpd   xmm4, xmm3	;# lu*(3-rsq*lu*lu) 	mulpd   xmm4, [rsp + nb131nf_half] ;# iter1 ( new lu) 	movapd xmm3, xmm4	mulpd xmm4, xmm4	;# lu*lu 	mulpd xmm7, xmm4	;# rsq*lu*lu 	movapd xmm4, [rsp + nb131nf_three]	subpd xmm4, xmm7	;# 3-rsq*lu*lu 	mulpd xmm4, xmm3	;# lu*(	3-rsq*lu*lu) 	mulpd xmm4, [rsp + nb131nf_half] ;# rinv 	movapd  xmm7, xmm4	;# rinvO in xmm7 		;# rsqH1 - seed in xmm2 	cvtpd2ps xmm2, xmm6		rsqrtps xmm2, xmm2	cvtps2pd xmm2, xmm2	movapd  xmm3, xmm2	mulpd   xmm2, xmm2	movapd  xmm4, [rsp + nb131nf_three]	mulpd   xmm2, xmm6	;# rsq*lu*lu 	subpd   xmm4, xmm2	;# 30-rsq*lu*lu 	mulpd   xmm4, xmm3	;# lu*(3-rsq*lu*lu) 	mulpd   xmm4, [rsp + nb131nf_half] ;# iter1 ( new lu) 	movapd xmm3, xmm4	mulpd xmm4, xmm4	;# lu*lu 	mulpd xmm6, xmm4	;# rsq*lu*lu 	movapd xmm4, [rsp + nb131nf_three]	subpd xmm4, xmm6	;# 3-rsq*lu*lu 	mulpd xmm4, xmm3	;# lu*(	3-rsq*lu*lu) 	mulpd xmm4, [rsp + nb131nf_half] ;# rinv 	movapd  xmm6, xmm4	;# rinvH1 in xmm6 	movapd  [rsp + nb131nf_rinvH1], xmm6		;# rsqH2 - seed in xmm2 	cvtpd2ps xmm2, xmm5		rsqrtps xmm2, xmm2	cvtps2pd xmm2, xmm2	movapd  xmm3, xmm2	mulpd   xmm2, xmm2	movapd  xmm4, [rsp + nb131nf_three]	mulpd   xmm2, xmm5	;# rsq*lu*lu 	subpd   xmm4, xmm2	;# 30-rsq*lu*lu 	mulpd   xmm4, xmm3	;# lu*(3-rsq*lu*lu) 	mulpd   xmm4, [rsp + nb131nf_half] ;# iter1 ( new lu) 	movapd xmm3, xmm4	mulpd xmm4, xmm4	;# lu*lu 	mulpd xmm5, xmm4	;# rsq*lu*lu 	movapd xmm4, [rsp + nb131nf_three]	subpd xmm4, xmm5	;# 3-rsq*lu*lu 	mulpd xmm4, xmm3	;# lu*(	3-rsq*lu*lu) 	mulpd xmm4, [rsp + nb131nf_half] ;# rinv 	movapd  xmm5, xmm4	;# rinvH2 in xmm5 	movapd  [rsp + nb131nf_rinvH2], xmm5	;# do O interactions 	movapd xmm0, xmm7	mulpd  xmm7, [rsp + nb131nf_qqO]	addpd  xmm7, [rsp + nb131nf_vctot]	movapd [rsp + nb131nf_vctot], xmm7	movapd xmm4, [rsp + nb131nf_rsqO]	;# LJ table interaction. xmm0=rinv, xmm4=rsq		mulpd xmm4, xmm0	;# xmm4=r 	mulpd xmm4, [rsp + nb131nf_tsc]		cvttpd2pi mm6, xmm4	;# mm6 = lu idx 	cvtpi2pd xmm5, mm6	subpd xmm4, xmm5	movapd xmm1, xmm4	;# xmm1=eps 	movapd xmm2, xmm1		mulpd  xmm2, xmm2	;# xmm2=eps2 	pslld mm6, 3		;# idx *= 8 		mov  rsi, [rbp + nb131nf_VFtab]	movd eax, mm6	psrlq mm6, 32	movd ebx, mm6	;# dispersion 	movlpd xmm4, [rsi + rax*8]	;# Y1 		movlpd xmm3, [rsi + rbx*8]	;# Y2 	movhpd xmm4, [rsi + rax*8 + 8]	;# Y1 F1 		movhpd xmm3, [rsi + rbx*8 + 8]	;# Y2 F2 	movapd xmm5, xmm4	unpcklpd xmm4, xmm3	;# Y1 Y2 	unpckhpd xmm5, xmm3	;# F1 F2 	movlpd xmm6, [rsi + rax*8 + 16]	;# G1	movlpd xmm3, [rsi + rbx*8 + 16]	;# G2	movhpd xmm6, [rsi + rax*8 + 24]	;# G1 H1 		movhpd xmm3, [rsi + rbx*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  xmm5, xmm1 ;# xmm5=eps*Fp 	addpd  xmm5, xmm4 ;# xmm5=VV 	movapd xmm4, [rsp + nb131nf_c6]	mulpd  xmm5, xmm4	 ;# Vvdw6 	;#  Update Vvdwtot directly 	addpd  xmm5, [rsp + nb131nf_Vvdwtot]	movapd [rsp + nb131nf_Vvdwtot], xmm5	;# repulsion 	movlpd xmm4, [rsi + rax*8 + 32]	;# Y1 		movlpd xmm3, [rsi + rbx*8 + 32]	;# Y2 	movhpd xmm4, [rsi + rax*8 + 40]	;# Y1 F1 		movhpd xmm3, [rsi + rbx*8 + 40]	;# Y2 F2 	movapd xmm5, xmm4	unpcklpd xmm4, xmm3	;# Y1 Y2 	unpckhpd xmm5, xmm3	;# F1 F2 	movlpd xmm6, [rsi + rax*8 + 48]	;# G1	movlpd xmm3, [rsi + rbx*8 + 48]	;# G2	movhpd xmm6, [rsi + rax*8 + 56]	;# G1 H1 		movhpd xmm3, [rsi + rbx*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  xmm5, xmm1 ;# xmm5=eps*Fp 	addpd  xmm5, xmm4 ;# xmm5=VV 		movapd xmm4, [rsp + nb131nf_c12]	mulpd  xmm5, xmm4  		addpd  xmm5, [rsp + nb131nf_Vvdwtot]	movapd [rsp + nb131nf_Vvdwtot], xmm5	;# H1 & H2 interactions 	movapd  xmm6, [rsp + nb131nf_rinvH1]		addpd   xmm6, [rsp + nb131nf_rinvH2]	mulpd   xmm6, [rsp + nb131nf_qqH] ;# vcoul 		addpd  xmm6, [rsp + nb131nf_vctot]	movapd [rsp + nb131nf_vctot], xmm6	;# should we do one more iteration? 	sub dword ptr [rsp + nb131nf_innerk],  2	jl    .nb131nf_checksingle	jmp   .nb131nf_unroll_loop.nb131nf_checksingle:		mov   edx, [rsp + nb131nf_innerk]	and   edx, 1	jnz   .nb131nf_dosingle	jmp   .nb131nf_updateouterdata.nb131nf_dosingle:	mov   rdx, [rsp + nb131nf_innerjjnr]     ;# pointer to jjnr[k] 	mov   eax, [rdx]		add qword ptr [rsp + nb131nf_innerjjnr],  4		mov rsi, [rbp + nb131nf_charge]    ;# base of charge[] 	xorpd xmm3, xmm3	movlpd xmm3, [rsi + rax*8]	movapd xmm4, xmm3	mulpd  xmm3, [rsp + nb131nf_iqO]	mulpd  xmm4, [rsp + nb131nf_iqH]	movd  mm0, eax		;# use mmx registers as temp storage 	movapd  [rsp + nb131nf_qqO], xmm3	movapd  [rsp + nb131nf_qqH], xmm4		mov rsi, [rbp + nb131nf_type]	mov eax, [rsi + rax*4]	mov rsi, [rbp + nb131nf_vdwparam]	shl eax, 1		mov edi, [rsp + nb131nf_ntia]	add eax, edi	movlpd xmm6, [rsi + rax*8]	;# c6a	movhpd xmm6, [rsi + rax*8 + 8]	;# c6a c12a 	xorpd xmm7, xmm7	movapd xmm4, xmm6	unpcklpd xmm4, xmm7	unpckhpd xmm6, xmm7		movd  eax, mm0	movapd [rsp + nb131nf_c6], xmm4	movapd [rsp + nb131nf_c12], xmm6		mov rsi, [rbp + nb131nf_pos]       ;# base of pos[] 	lea   rax, [rax + rax*2]     ;# replace jnr with j3 	;# move coordinates to xmm0-xmm2 	movlpd xmm0, [rsi + rax*8]	movlpd xmm1, [rsi + rax*8 + 8]	movlpd xmm2, [rsi + rax*8 + 16]	;# move ixO-izO to xmm4-xmm6 	movapd xmm4, [rsp + nb131nf_ixO]	movapd xmm5, [rsp + nb131nf_iyO]	movapd xmm6, [rsp + nb131nf_izO]	;# calc dr 	subsd xmm4, xmm0	subsd xmm5, xmm1	subsd xmm6, xmm2	;# square it 	mulsd xmm4,xmm4	mulsd xmm5,xmm5	mulsd xmm6,xmm6	addsd xmm4, xmm5	addsd xmm4, xmm6	movapd xmm7, xmm4	;# rsqO in xmm7 	movapd [rsp + nb131nf_rsqO], xmm7		;# move ixH1-izH1 to xmm4-xmm6 	movapd xmm4, [rsp + nb131nf_ixH1]	movapd xmm5, [rsp + nb131nf_iyH1]	movapd xmm6, [rsp + nb131nf_izH1]	;# calc dr 	subsd xmm4, xmm0	subsd xmm5, xmm1	subsd xmm6, xmm2	;# 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, [rsp + nb131nf_ixH2]	movapd xmm4, [rsp + nb131nf_iyH2]	movapd xmm5, [rsp + nb131nf_izH2]	;# calc dr 	subsd xmm3, xmm0	subsd xmm4, xmm1	subsd xmm5, xmm2	;# 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, [rsp + nb131nf_three]	mulsd   xmm2, xmm7	;# rsq*lu*lu 	subsd   xmm4, xmm2	;# 30-rsq*lu*lu 	mulsd   xmm4, xmm3	;# lu*(3-rsq*lu*lu) 	mulsd   xmm4, [rsp + nb131nf_half] ;# iter1 ( new lu) 	movapd xmm3, xmm4	mulsd xmm4, xmm4	;# lu*lu 	mulsd xmm7, xmm4	;# rsq*lu*lu 	movapd xmm4, [rsp + nb131nf_three]	subsd xmm4, xmm7	;# 3-rsq*lu*lu 	mulsd xmm4, xmm3	;# lu*(	3-rsq*lu*lu) 	mulsd xmm4, [rsp + nb131nf_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, [rsp + nb131nf_three]	mulsd   xmm2, xmm6	;# rsq*lu*lu 	subsd   xmm4, xmm2	;# 30-rsq*lu*lu 	mulsd   xmm4, xmm3	;# lu*(3-rsq*lu*lu) 	mulsd   xmm4, [rsp + nb131nf_half] ;# iter1 ( new lu) 	movapd xmm3, xmm4	mulsd xmm4, xmm4	;# lu*lu 	mulsd xmm6, xmm4	;# rsq*lu*lu 	movapd xmm4, [rsp + nb131nf_three]	subsd xmm4, xmm6	;# 3-rsq*lu*lu 	mulsd xmm4, xmm3	;# lu*(	3-rsq*lu*lu) 	mulsd xmm4, [rsp + nb131nf_half] ;# rinv 	movapd  xmm6, xmm4	;# rinvH1 in xmm6 	movsd  [rsp + nb131nf_rinvH1], xmm6		;# rsqH2 - seed in xmm2 	cvtsd2ss xmm2, xmm5		rsqrtss xmm2, xmm2	cvtss2sd xmm2, xmm2	movapd  xmm3, xmm2	mulsd   xmm2, xmm2	movapd  xmm4, [rsp + nb131nf_three]	mulsd   xmm2, xmm5	;# rsq*lu*lu 	subsd   xmm4, xmm2	;# 30-rsq*lu*lu 	mulsd   xmm4, xmm3	;# lu*(3-rsq*lu*lu) 	mulsd   xmm4, [rsp + nb131nf_half] ;# iter1 ( new lu) 	movapd xmm3, xmm4	mulsd xmm4, xmm4	;# lu*lu 	mulsd xmm5, xmm4	;# rsq*lu*lu 	movapd xmm4, [rsp + nb131nf_three]	subsd xmm4, xmm5	;# 3-rsq*lu*lu 	mulsd xmm4, xmm3	;# lu*(	3-rsq*lu*lu) 	mulsd xmm4, [rsp + nb131nf_half] ;# rinv 	movapd  xmm5, xmm4	;# rinvH2 in xmm5 	movsd [rsp + nb131nf_rinvH2], xmm5		;# do O interactions 	movsd xmm0, xmm7	mulsd  xmm7, [rsp + nb131nf_qqO]	addsd  xmm7, [rsp + nb131nf_vctot]	movsd [rsp + nb131nf_vctot], xmm7	movsd xmm4, [rsp + nb131nf_rsqO]	;# LJ table interaction. xmm0=rinv, xmm4=rsq		mulsd xmm4, xmm0	;# xmm4=r 	mulsd xmm4, [rsp + nb131nf_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  rsi, [rbp + nb131nf_VFtab]	;# dispersion 	movlpd xmm4, [rsi + rbx*8]	;# Y1 		movhpd xmm4, [rsi + rbx*8 + 8]	;# Y1 F1 		movapd xmm5, xmm4	unpcklpd xmm4, xmm3	;# Y1 Y2 	unpckhpd xmm5, xmm3	;# F1 F2 	movlpd xmm6, [rsi + rbx*8 + 16]	;# G1	movhpd xmm6, [rsi + rbx*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  xmm5, xmm1 ;# xmm5=eps*Fp 	addsd  xmm5, xmm4 ;# xmm5=VV 	movsd xmm4, [rsp + nb131nf_c6]	mulsd  xmm5, xmm4	 ;# Vvdw6 	;# Update Vvdwtot directly 	addsd  xmm5, [rsp + nb131nf_Vvdwtot]	movsd [rsp + nb131nf_Vvdwtot], xmm5	;# repulsion 	movlpd xmm4, [rsi + rbx*8 + 32]	;# Y1 		movhpd xmm4, [rsi + rbx*8 + 40]	;# Y1 F1 		movapd xmm5, xmm4	unpcklpd xmm4, xmm3	;# Y1 Y2 	unpckhpd xmm5, xmm3	;# F1 F2 	movlpd xmm6, [rsi + rbx*8 + 48]	;# G1	movhpd xmm6, [rsi + rbx*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  xmm5, xmm1 ;# xmm5=eps*Fp 	addsd  xmm5, xmm4 ;# xmm5=VV 		movsd xmm4, [rsp + nb131nf_c12]	mulsd  xmm5, xmm4  		addsd  xmm5, [rsp + nb131nf_Vvdwtot]	movsd [rsp + nb131nf_Vvdwtot], xmm5	;# H1 & H2 interactions 	movsd  xmm6, [rsp + nb131nf_rinvH1]		addsd   xmm6, [rsp + nb131nf_rinvH2]	mulsd   xmm6, [rsp + nb131nf_qqH] ;# vcoul 	addsd   xmm6, [rsp + nb131nf_vctot]	movsd  [rsp + nb131nf_vctot], xmm6	.nb131nf_updateouterdata:	;# get n from stack	mov esi, [rsp + nb131nf_n]        ;# get group index for i particle         mov   rdx, [rbp + nb131nf_gid]      	;# base of gid[]        mov   edx, [rdx + rsi*4]		;# ggid=gid[n]	;# accumulate total potential energy and update it 	movapd xmm7, [rsp + nb131nf_vctot]	;# accumulate 	movhlps xmm6, xmm7	addsd  xmm7, xmm6	;# low xmm7 has the sum now 	;# add earlier value from mem 	mov   rax, [rbp + nb131nf_Vc]	addsd xmm7, [rax + rdx*8] 	;# move back to mem 	movsd [rax + rdx*8], xmm7 		;# accumulate total lj energy and update it 	movapd xmm7, [rsp + nb131nf_Vvdwtot]	;# accumulate 	movhlps xmm6, xmm7	addsd  xmm7, xmm6	;# low xmm7 has the sum now 		;# add earlier value from mem 	mov   rax, [rbp + nb131nf_Vvdw]	addsd xmm7, [rax + rdx*8] 	;# move back to mem 	movsd [rax + rdx*8], xmm7 	       ;# finish if last         mov ecx, [rsp + nb131nf_nn1]	;# esi already loaded with n	inc esi        sub ecx, esi        jz .nb131nf_outerend        ;# not last, iterate outer loop once more!          mov [rsp + nb131nf_n], esi        jmp .nb131nf_outer.nb131nf_outerend:        ;# check if more outer neighborlists remain        mov   ecx, [rsp + nb131nf_nri]	;# esi already loaded with n above        sub   ecx, esi        jz .nb131nf_end        ;# non-zero, do one more workunit        jmp   .nb131nf_threadloop.nb131nf_end:	mov eax, [rsp + nb131nf_nouter]	mov ebx, [rsp + nb131nf_ninner]	mov rcx, [rbp + nb131nf_outeriter]	mov rdx, [rbp + nb131nf_inneriter]	mov [rcx], eax	mov [rdx], ebx	add rsp, 520	emms        pop r15        pop r14        pop r13        pop r12	pop rbx	pop	rbp	ret

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?