nb_kernel233_x86_64_sse.intel_syntax.s

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

S
2,269
字号
	;# move j coords to xmm0-xmm2 	movss xmm3, [rsi + rax*4]	movss xmm4, [rsi + rax*4 + 4]	movss xmm5, [rsi + rax*4 + 8]	shufps xmm3, xmm3, 0	shufps xmm4, xmm4, 0	shufps xmm5, xmm5, 0		subps xmm3, xmm0	subps xmm4, xmm1	subps xmm5, xmm2	;# use O distances for storage	movaps [rsp + nb233_dxO], xmm3	movaps [rsp + nb233_dyO], xmm4	movaps [rsp + nb233_dzO], xmm5	mulps  xmm3, xmm3	mulps  xmm4, xmm4	mulps  xmm5, xmm5	addps  xmm4, xmm3	addps  xmm4, xmm5	;# rsq in xmm4 	movaps xmm0, xmm4	mulps xmm0, [rsp + nb233_krf]	movaps [rsp + nb233_krsqM], xmm0			rsqrtps xmm5, xmm4	;# lookup seed in xmm5 	movaps xmm2, xmm5	mulps xmm5, xmm5	movaps xmm1, [rsp + nb233_three]	mulps xmm5, xmm4	;# rsq*lu*lu 				movaps xmm0, [rsp + nb233_half]	subps xmm1, xmm5	;# constant 30-rsq*lu*lu 	mulps xmm1, xmm2		mulps xmm0, xmm1	;# xmm0=rinv, xmm4=rsq	#; LJ table interaction	mulps xmm4, xmm0	mulps  xmm4, [rsp + nb233_tsc] ;# rtab		cvttps2pi mm6, xmm4	cvtpi2ps xmm6, mm6	subss  xmm4, xmm6		movss xmm1, xmm4	;# xmm1=eps 	movss xmm2, xmm1		mulss  xmm2, xmm2	;# xmm2=eps2 	pslld mm6, 3	movd mm0, eax		mov  rsi, [rbp + nb233_VFtab]	movd eax, mm6		;# dispersion 	movlps xmm5, [rsi + rax*4]	movaps xmm4, xmm5	shufps xmm4, xmm7, 136  ;# constant 10001000	shufps xmm5, xmm7, 221  ;# constant 11011101		movlps xmm7, [rsi + rax*4 + 8]	movaps xmm6, xmm7	shufps xmm6, xmm3, 136  ;# constant 10001000	shufps xmm7, xmm3, 221  ;# constant 11011101	;# dispersion table ready, in xmm4-xmm7 		mulss  xmm6, xmm1	;# xmm6=Geps 	mulss  xmm7, xmm2	;# xmm7=Heps2 	addss  xmm5, xmm6	addss  xmm5, xmm7	;# xmm5=Fp 		mulss  xmm7, [rsp + nb233_two]	;# two*Heps2 	addss  xmm7, xmm6	addss  xmm7, xmm5 ;# xmm7=FF 	mulss  xmm5, xmm1 ;# xmm5=eps*Fp 	addss  xmm5, xmm4 ;# xmm5=VV 	movss xmm4, [rsp + nb233_c6]	mulss  xmm7, xmm4	 ;# fijD 	mulss  xmm5, xmm4	 ;# Vvdw6 	mulss  xmm7, [rsp + nb233_tsc]	;# put scalar force on stack Update Vvdwtot directly 	addss  xmm5, [rsp + nb233_Vvdwtot]	movss [rsp + nb233_fstmp], xmm7	movss [rsp + nb233_Vvdwtot], xmm5	;# repulsion 	movlps xmm5, [rsi + rax*4 + 16]	movaps xmm4, xmm5	shufps xmm4, xmm7, 136  ;# constant 10001000	shufps xmm5, xmm7, 221  ;# constant 11011101	movlps xmm7, [rsi + rax*4 + 24]	movaps xmm6, xmm7	shufps xmm6, xmm3, 136  ;# constant 10001000	shufps xmm7, xmm3, 221  ;# constant 11011101	;# table ready, in xmm4-xmm7 		mulss  xmm6, xmm1	;# xmm6=Geps 	mulss  xmm7, xmm2	;# xmm7=Heps2 	addss  xmm5, xmm6	addss  xmm5, xmm7	;# xmm5=Fp 		mulss  xmm7, [rsp + nb233_two]	;# two*Heps2 	addss  xmm7, xmm6	addss  xmm7, xmm5 ;# xmm7=FF 	mulss  xmm5, xmm1 ;# xmm5=eps*Fp 	addss  xmm5, xmm4 ;# xmm5=VV  		movss xmm4, [rsp + nb233_c12]	mulss  xmm7, xmm4 ;# fijR 	mulss  xmm5, xmm4 ;# Vvdw12 	mulss  xmm7, [rsp + nb233_tsc]	addss  xmm7, [rsp + nb233_fstmp]	movss [rsp + nb233_fstmp], xmm7	addss  xmm5, [rsp + nb233_Vvdwtot]	movss [rsp + nb233_Vvdwtot], xmm5		movd eax, mm0		movaps xmm4, xmm0	movaps xmm1, xmm0	movaps xmm5, xmm0	mulps  xmm4, xmm4	;# xmm1=rinv, xmm4=rinvsq	movaps xmm3, [rsp + nb233_krsqM]	addps  xmm5, xmm3	;# xmm0=rinv+ krsq 	subps  xmm5, [rsp + nb233_crf] ;# xmm0=rinv+ krsq-crf 	mulps  xmm3, [rsp + nb233_two]	subps  xmm1, xmm3	;# xmm1=rinv-2*krsq	movaps xmm2, xmm5	mulps  xmm2, [rsp + nb233_qqM]	;# xmm2=vcoul 	mulps  xmm1, [rsp + nb233_qqM] 	;# xmm1=coul part of fs 	mulps  xmm1, xmm0	subss  xmm1, [rsp + nb233_fstmp]	mulps  xmm1, xmm0	movaps xmm4, xmm1		addps  xmm2, [rsp + nb233_vctot]		movaps [rsp + nb233_vctot], xmm2			movaps xmm0, [rsp + nb233_dxO]	movaps xmm1, [rsp + nb233_dyO]	movaps xmm2, [rsp + nb233_dzO]	mulps  xmm0, xmm4	mulps  xmm1, xmm4	mulps  xmm2, xmm4 ;# xmm0-xmm2 now contains tx-tz (partial force)		movss  xmm3, [rsp + nb233_fixO]		movss  xmm4, [rsp + nb233_fiyO]		movss  xmm5, [rsp + nb233_fizO]		addss  xmm3, xmm0	addss  xmm4, xmm1	addss  xmm5, xmm2	movss  [rsp + nb233_fixO], xmm3		movss  [rsp + nb233_fiyO], xmm4		movss  [rsp + nb233_fizO], xmm5	;# updated the O force now do the H's		movaps xmm3, xmm0	movaps xmm4, xmm1	movaps xmm5, xmm2      	shufps xmm3, xmm3, 0x39	;# shift right 	shufps xmm4, xmm4, 0x39	shufps xmm5, xmm5, 0x39	addss  xmm3, [rsp + nb233_fixH1]	addss  xmm4, [rsp + nb233_fiyH1]	addss  xmm5, [rsp + nb233_fizH1]	movss  [rsp + nb233_fixH1], xmm3		movss  [rsp + nb233_fiyH1], xmm4		movss  [rsp + nb233_fizH1], xmm5	;# updated the H1 force 	shufps xmm3, xmm3, 0x39	shufps xmm4, xmm4, 0x39	shufps xmm5, xmm5, 0x39	addss  xmm3, [rsp + nb233_fixH2]	addss  xmm4, [rsp + nb233_fiyH2]	addss  xmm5, [rsp + nb233_fizH2]	movss  [rsp + nb233_fixH2], xmm3		movss  [rsp + nb233_fiyH2], xmm4		movss  [rsp + nb233_fizH2], xmm5	;# updated the H2 force 	mov rdi, [rbp + nb233_faction]	shufps xmm3, xmm3, 0x39	shufps xmm4, xmm4, 0x39	shufps xmm5, xmm5, 0x39	addss  xmm3, [rsp + nb233_fixM]	addss  xmm4, [rsp + nb233_fiyM]	addss  xmm5, [rsp + nb233_fizM]	movss  [rsp + nb233_fixM], xmm3		movss  [rsp + nb233_fiyM], xmm4		movss  [rsp + nb233_fizM], xmm5	;# updated the M force 	;# the fj's - move in from mem start by acc. tx/ty/tz in xmm0, xmm1	movlps xmm6, [rdi + rax*4]	movss  xmm7, [rdi + rax*4 + 8]		movhlps xmm3, xmm0	movhlps xmm4, xmm1	movhlps xmm5, xmm2	addps   xmm3, xmm0	addps   xmm4, xmm1	addps   xmm5, xmm2	movaps  xmm0, xmm3	movaps  xmm1, xmm4	movaps  xmm2, xmm5			shufps xmm3, xmm3, 0x39	;# shift right 	shufps xmm4, xmm4, 0x39	shufps xmm5, xmm5, 0x39	addss  xmm0, xmm3	addss  xmm1, xmm4	addss  xmm2, xmm5	unpcklps xmm0, xmm1 	;# x,y sum in xmm0, z sum in xmm2		addps    xmm6, xmm0	addss    xmm7, xmm2		movlps [rdi + rax*4],     xmm6	movss  [rdi + rax*4 + 8], xmm7	dec dword ptr [rsp + nb233_innerk]	jz    .nb233_updateouterdata	jmp   .nb233_odd_loop.nb233_updateouterdata:	mov   ecx, [rsp + nb233_ii3]	mov   rdi, [rbp + nb233_faction]	mov   rsi, [rbp + nb233_fshift]	mov   edx, [rsp + nb233_is3]	;# accumulate  Oi forces in xmm0, xmm1, xmm2 	movaps xmm0, [rsp + nb233_fixO]	movaps xmm1, [rsp + nb233_fiyO]	movaps xmm2, [rsp + nb233_fizO]	movhlps xmm3, xmm0	movhlps xmm4, xmm1	movhlps xmm5, xmm2	addps  xmm0, xmm3	addps  xmm1, xmm4	addps  xmm2, xmm5 ;# sum is in 1/2 in xmm0-xmm2 	movaps xmm3, xmm0		movaps xmm4, xmm1		movaps xmm5, xmm2		shufps xmm3, xmm3, 1	shufps xmm4, xmm4, 1	shufps xmm5, xmm5, 1	addss  xmm0, xmm3	addss  xmm1, xmm4	addss  xmm2, xmm5	;# xmm0-xmm2 has single force in pos0 	;# increment i force 	movss  xmm3, [rdi + rcx*4]	movss  xmm4, [rdi + rcx*4 + 4]	movss  xmm5, [rdi + rcx*4 + 8]	subss  xmm3, xmm0	subss  xmm4, xmm1	subss  xmm5, xmm2	movss  [rdi + rcx*4],     xmm3	movss  [rdi + rcx*4 + 4], xmm4	movss  [rdi + rcx*4 + 8], xmm5	;# accumulate force in xmm6/xmm7 for fshift 	movaps xmm6, xmm0	movss xmm7, xmm2	movlhps xmm6, xmm1	shufps  xmm6, xmm6, 8 ;# constant 00001000		;# accumulate H1i forces in xmm0, xmm1, xmm2 	movaps xmm0, [rsp + nb233_fixH1]	movaps xmm1, [rsp + nb233_fiyH1]	movaps xmm2, [rsp + nb233_fizH1]	movhlps xmm3, xmm0	movhlps xmm4, xmm1	movhlps xmm5, xmm2	addps  xmm0, xmm3	addps  xmm1, xmm4	addps  xmm2, xmm5 ;# sum is in 1/2 in xmm0-xmm2 	movaps xmm3, xmm0		movaps xmm4, xmm1		movaps xmm5, xmm2		shufps xmm3, xmm3, 1	shufps xmm4, xmm4, 1	shufps xmm5, xmm5, 1	addss  xmm0, xmm3	addss  xmm1, xmm4	addss  xmm2, xmm5	;# xmm0-xmm2 has single force in pos0 	;# increment i force 	movss  xmm3, [rdi + rcx*4 + 12]	movss  xmm4, [rdi + rcx*4 + 16]	movss  xmm5, [rdi + rcx*4 + 20]	subss  xmm3, xmm0	subss  xmm4, xmm1	subss  xmm5, xmm2	movss  [rdi + rcx*4 + 12], xmm3	movss  [rdi + rcx*4 + 16], xmm4	movss  [rdi + rcx*4 + 20], xmm5	;# accumulate force in xmm6/xmm7 for fshift 	addss xmm7, xmm2	movlhps xmm0, xmm1	shufps  xmm0, xmm0, 8 ;# constant 00001000		addps   xmm6, xmm0	;# accumulate H2i forces in xmm0, xmm1, xmm2 	movaps xmm0, [rsp + nb233_fixH2]	movaps xmm1, [rsp + nb233_fiyH2]	movaps xmm2, [rsp + nb233_fizH2]	movhlps xmm3, xmm0	movhlps xmm4, xmm1	movhlps xmm5, xmm2	addps  xmm0, xmm3	addps  xmm1, xmm4	addps  xmm2, xmm5 ;# sum is in 1/2 in xmm0-xmm2 	movaps xmm3, xmm0		movaps xmm4, xmm1		movaps xmm5, xmm2		shufps xmm3, xmm3, 1	shufps xmm4, xmm4, 1	shufps xmm5, xmm5, 1	addss  xmm0, xmm3	addss  xmm1, xmm4	addss  xmm2, xmm5	;# xmm0-xmm2 has single force in pos0 	;# increment i force 	movss  xmm3, [rdi + rcx*4 + 24]	movss  xmm4, [rdi + rcx*4 + 28]	movss  xmm5, [rdi + rcx*4 + 32]	subss  xmm3, xmm0	subss  xmm4, xmm1	subss  xmm5, xmm2	movss  [rdi + rcx*4 + 24], xmm3	movss  [rdi + rcx*4 + 28], xmm4	movss  [rdi + rcx*4 + 32], xmm5	;# accumulate force in xmm6/xmm7 for fshift 	addss xmm7, xmm2	movlhps xmm0, xmm1	shufps  xmm0, xmm0, 8 ;# constant 00001000		addps   xmm6, xmm0	;# accumulate Mi forces in xmm0, xmm1, xmm2 	movaps xmm0, [rsp + nb233_fixM]	movaps xmm1, [rsp + nb233_fiyM]	movaps xmm2, [rsp + nb233_fizM]	movhlps xmm3, xmm0	movhlps xmm4, xmm1	movhlps xmm5, xmm2	addps  xmm0, xmm3	addps  xmm1, xmm4	addps  xmm2, xmm5 ;# sum is in 1/2 in xmm0-xmm2 	movaps xmm3, xmm0		movaps xmm4, xmm1		movaps xmm5, xmm2		shufps xmm3, xmm3, 1	shufps xmm4, xmm4, 1	shufps xmm5, xmm5, 1	addss  xmm0, xmm3	addss  xmm1, xmm4	addss  xmm2, xmm5	;# xmm0-xmm2 has single force in pos0 	;# increment i force 	movss  xmm3, [rdi + rcx*4 + 36]	movss  xmm4, [rdi + rcx*4 + 40]	movss  xmm5, [rdi + rcx*4 + 44]	subss  xmm3, xmm0	subss  xmm4, xmm1	subss  xmm5, xmm2	movss  [rdi + rcx*4 + 36], xmm3	movss  [rdi + rcx*4 + 40], xmm4	movss  [rdi + rcx*4 + 44], xmm5	;# accumulate force in xmm6/xmm7 for fshift 	addss xmm7, xmm2	movlhps xmm0, xmm1	shufps  xmm0, xmm0, 8 ;# constant 00001000		addps   xmm6, xmm0	;# increment fshift force  	movlps  xmm3, [rsi + rdx*4]	movss  xmm4, [rsi + rdx*4 + 8]	subps  xmm3, xmm6	subss  xmm4, xmm7	movlps  [rsi + rdx*4],    xmm3	movss  [rsi + rdx*4 + 8], xmm4	;# get n from stack	mov esi, [rsp + nb233_n]        ;# get group index for i particle         mov   rdx, [rbp + nb233_gid]      	;# base of gid[]        mov   edx, [rdx + rsi*4]		;# ggid=gid[n]	;# accumulate total potential energy and update it 	movaps xmm7, [rsp + nb233_vctot]	;# accumulate 	movhlps xmm6, xmm7	addps  xmm7, xmm6	;# pos 0-1 in xmm7 have the sum now 	movaps xmm6, xmm7	shufps xmm6, xmm6, 1	addss  xmm7, xmm6		        	;# add earlier value from mem 	mov   rax, [rbp + nb233_Vc]	addss xmm7, [rax + rdx*4] 	;# move back to mem 	movss [rax + rdx*4], xmm7 		;# accumulate total lj energy and update it 	movaps xmm7, [rsp + nb233_Vvdwtot]	;# accumulate 	movhlps xmm6, xmm7	addps  xmm7, xmm6	;# pos 0-1 in xmm7 have the sum now 	movaps xmm6, xmm7	shufps xmm6, xmm6, 1	addss  xmm7, xmm6			;# add earlier value from mem 	mov   rax, [rbp + nb233_Vvdw]	addss xmm7, [rax + rdx*4] 	;# move back to mem 	movss [rax + rdx*4], xmm7 	        ;# finish if last         mov ecx, [rsp + nb233_nn1]	;# esi already loaded with n	inc esi        sub ecx, esi        jz .nb233_outerend        ;# not last, iterate outer loop once more!          mov [rsp + nb233_n], esi        jmp .nb233_outer.nb233_outerend:        ;# check if more outer neighborlists remain        mov   ecx, [rsp + nb233_nri]	;# esi already loaded with n above        sub   ecx, esi        jz .nb233_end        ;# non-zero, do one more workunit        jmp   .nb233_threadloop.nb233_end:	mov eax, [rsp + nb233_nouter]	mov ebx, [rsp + nb233_ninner]

⌨️ 快捷键说明

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