nb_kernel104_ia32_sse.intel_syntax.s

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

S
2,174
字号
	add   eax, ecx	mov   [esp + nb104nf_innerjjnr], eax 	;# pointer to jjnr[nj0] 	mov   ecx, edx	sub   edx,  4	add   ecx, [esp + nb104nf_ninner]	mov   [esp + nb104nf_ninner], ecx	add   edx, 0	mov   [esp + nb104nf_innerk], edx	;# number of innerloop atoms 	jge   .nb104nf_unroll_loop	jmp   .nb104nf_single_check.nb104nf_unroll_loop:		;# quad-unroll innerloop here 	mov   edx, [esp + nb104nf_innerjjnr] 	;# pointer to jjnr[k] 	mov   eax, [edx]		mov   ebx, [edx + 4] 	mov   ecx, [edx + 8]	mov   edx, [edx + 12]     	;# eax-edx=jnr1-4 		add dword ptr [esp + nb104nf_innerjjnr],  16 ;# advance pointer (unrolled 4) 	mov esi, [ebp + nb104nf_pos]   	;# base of pos[] 	lea   eax, [eax + eax*2] 	;# replace jnr with j3 	lea   ebx, [ebx + ebx*2]		lea   ecx, [ecx + ecx*2] 	;# replace jnr with j3 	lea   edx, [edx + edx*2]			;# move j coordinates to local temp variables 	movlps xmm2, [esi + eax*4 + 12]	movlps xmm3, [esi + eax*4 + 24]	movlps xmm4, [esi + eax*4 + 36]	movlps xmm5, [esi + ebx*4 + 12]	movlps xmm6, [esi + ebx*4 + 24]	movlps xmm7, [esi + ebx*4 + 36]	movhps xmm2, [esi + ecx*4 + 12]	movhps xmm3, [esi + ecx*4 + 24]	movhps xmm4, [esi + ecx*4 + 36]	movhps xmm5, [esi + edx*4 + 12]	movhps xmm6, [esi + edx*4 + 24]	movhps xmm7, [esi + edx*4 + 36]	;# current state: 		;# xmm2= jxh1a  jyH1a  jxH1c  jyH1c 	;# xmm3= jxH2a jyH2a jxH2c jyH2c 	;# xmm4= jxMa jyMa jxMc jyMc 	;# xmm5= jxH1b  jyH1b  jxH1d  jyH1d 	;# xmm6= jxH2b jyH2b jxH2d jyH2d 	;# xmm7= jxMb jyMb jxMd jyMd 		movaps xmm0, xmm2	movaps xmm1, xmm3	unpcklps xmm0, xmm5	;# xmm0= jxH1a  jxH1b  jyH1a  jyH1b 	unpcklps xmm1, xmm6	;# xmm1= jxH2a jxH2b jyH2a jyH2b 	unpckhps xmm2, xmm5	;# xmm2= jxH1c  jxH1d  jyH1c  jyH1d 	unpckhps xmm3, xmm6	;# xmm3= jxH2c jxH2d jyH2c jyH2d  	movaps xmm5, xmm4	movaps   xmm6, xmm0	unpcklps xmm4, xmm7	;# xmm4= jxMa jxMb jyMa jyMb 			unpckhps xmm5, xmm7	;# xmm5= jxMc jxMd jyMc jyMd	 	movaps   xmm7, xmm1	movlhps  xmm0, xmm2	;# xmm0= jxH1a  jxH1b  jxH1c  jxH1d  	movaps [esp + nb104nf_jxH1], xmm0	movhlps  xmm2, xmm6	;# xmm2= jyH1a  jyH1b  jyH1c  jyH1d 	movaps [esp + nb104nf_jyH1], xmm2	movlhps  xmm1, xmm3	movaps [esp + nb104nf_jxH2], xmm1	movhlps  xmm3, xmm7	movaps   xmm6, xmm4	movaps [esp + nb104nf_jyH2], xmm3	movlhps  xmm4, xmm5	movaps [esp + nb104nf_jxM], xmm4	movhlps  xmm5, xmm6	movaps [esp + nb104nf_jyM], xmm5	movss  xmm0, [esi + eax*4 + 20]	movss  xmm1, [esi + eax*4 + 32]	movss  xmm2, [esi + eax*4 + 44]	movss  xmm3, [esi + ecx*4 + 20]	movss  xmm4, [esi + ecx*4 + 32]	movss  xmm5, [esi + ecx*4 + 44]	movhps xmm0, [esi + ebx*4 + 16]	movhps xmm1, [esi + ebx*4 + 28]	movhps xmm2, [esi + ebx*4 + 40]		movhps xmm3, [esi + edx*4 + 16]	movhps xmm4, [esi + edx*4 + 28]	movhps xmm5, [esi + edx*4 + 40]		shufps xmm0, xmm3, 204  ;# constant 11001100	shufps xmm1, xmm4, 204  ;# constant 11001100	shufps xmm2, xmm5, 204  ;# constant 11001100	movaps [esp + nb104nf_jzH1],  xmm0	movaps [esp + nb104nf_jzH2],  xmm1	movaps [esp + nb104nf_jzM],  xmm2	movaps xmm0, [esp + nb104nf_ixH1]	movaps xmm1, [esp + nb104nf_iyH1]	movaps xmm2, [esp + nb104nf_izH1]	movaps xmm3, [esp + nb104nf_ixH1]	movaps xmm4, [esp + nb104nf_iyH1]	movaps xmm5, [esp + nb104nf_izH1]	subps  xmm0, [esp + nb104nf_jxH1]	subps  xmm1, [esp + nb104nf_jyH1]	subps  xmm2, [esp + nb104nf_jzH1]	subps  xmm3, [esp + nb104nf_jxH2]	subps  xmm4, [esp + nb104nf_jyH2]	subps  xmm5, [esp + nb104nf_jzH2]	mulps  xmm0, xmm0	mulps  xmm1, xmm1	mulps  xmm2, xmm2	mulps  xmm3, xmm3	mulps  xmm4, xmm4	mulps  xmm5, xmm5	addps  xmm0, xmm1	addps  xmm0, xmm2	addps  xmm3, xmm4	addps  xmm3, xmm5	movaps [esp + nb104nf_rsqH1H1], xmm0	movaps [esp + nb104nf_rsqH1H2], xmm3	movaps xmm0, [esp + nb104nf_ixH1]	movaps xmm1, [esp + nb104nf_iyH1]	movaps xmm2, [esp + nb104nf_izH1]	movaps xmm3, [esp + nb104nf_ixH2]	movaps xmm4, [esp + nb104nf_iyH2]	movaps xmm5, [esp + nb104nf_izH2]	subps  xmm0, [esp + nb104nf_jxM]	subps  xmm1, [esp + nb104nf_jyM]	subps  xmm2, [esp + nb104nf_jzM]	subps  xmm3, [esp + nb104nf_jxH1]	subps  xmm4, [esp + nb104nf_jyH1]	subps  xmm5, [esp + nb104nf_jzH1]	mulps  xmm0, xmm0	mulps  xmm1, xmm1	mulps  xmm2, xmm2	mulps  xmm3, xmm3	mulps  xmm4, xmm4	mulps  xmm5, xmm5	addps  xmm0, xmm1	addps  xmm0, xmm2	addps  xmm3, xmm4	addps  xmm3, xmm5	movaps [esp + nb104nf_rsqH1M], xmm0	movaps [esp + nb104nf_rsqH2H1], xmm3	movaps xmm0, [esp + nb104nf_ixH2]	movaps xmm1, [esp + nb104nf_iyH2]	movaps xmm2, [esp + nb104nf_izH2]	movaps xmm3, [esp + nb104nf_ixH2]	movaps xmm4, [esp + nb104nf_iyH2]	movaps xmm5, [esp + nb104nf_izH2]	subps  xmm0, [esp + nb104nf_jxH2]	subps  xmm1, [esp + nb104nf_jyH2]	subps  xmm2, [esp + nb104nf_jzH2]	subps  xmm3, [esp + nb104nf_jxM]	subps  xmm4, [esp + nb104nf_jyM]	subps  xmm5, [esp + nb104nf_jzM]	mulps  xmm0, xmm0	mulps  xmm1, xmm1	mulps  xmm2, xmm2	mulps  xmm3, xmm3	mulps  xmm4, xmm4	mulps  xmm5, xmm5	addps  xmm0, xmm1	addps  xmm0, xmm2	addps  xmm3, xmm4	addps  xmm3, xmm5	movaps [esp + nb104nf_rsqH2H2], xmm0	movaps [esp + nb104nf_rsqH2M], xmm3	movaps xmm0, [esp + nb104nf_ixM]	movaps xmm1, [esp + nb104nf_iyM]	movaps xmm2, [esp + nb104nf_izM]	movaps xmm3, [esp + nb104nf_ixM]	movaps xmm4, [esp + nb104nf_iyM]	movaps xmm5, [esp + nb104nf_izM]	subps  xmm0, [esp + nb104nf_jxH1]	subps  xmm1, [esp + nb104nf_jyH1]	subps  xmm2, [esp + nb104nf_jzH1]	subps  xmm3, [esp + nb104nf_jxH2]	subps  xmm4, [esp + nb104nf_jyH2]	subps  xmm5, [esp + nb104nf_jzH2]	mulps  xmm0, xmm0	mulps  xmm1, xmm1	mulps  xmm2, xmm2	mulps  xmm3, xmm3	mulps  xmm4, xmm4	mulps  xmm5, xmm5	addps  xmm0, xmm1	addps  xmm0, xmm2	addps  xmm4, xmm3	addps  xmm4, xmm5	movaps [esp + nb104nf_rsqMH1], xmm0	movaps [esp + nb104nf_rsqMH2], xmm4	movaps xmm0, [esp + nb104nf_ixM]	movaps xmm1, [esp + nb104nf_iyM]	movaps xmm2, [esp + nb104nf_izM]	subps  xmm0, [esp + nb104nf_jxM]	subps  xmm1, [esp + nb104nf_jyM]	subps  xmm2, [esp + nb104nf_jzM]	mulps xmm0, xmm0	mulps xmm1, xmm1	mulps xmm2, xmm2	addps xmm0, xmm1	addps xmm0, xmm2	movaps [esp + nb104nf_rsqMM], xmm0			;# start doing invsqrt use rsq values in xmm0, xmm4 	rsqrtps xmm1, xmm0	rsqrtps xmm5, xmm4	movaps  xmm2, xmm1	movaps  xmm6, xmm5	mulps   xmm1, xmm1	mulps   xmm5, xmm5	movaps  xmm3, [esp + nb104nf_three]	movaps  xmm7, xmm3	mulps   xmm1, xmm0	mulps   xmm5, xmm4	subps   xmm3, xmm1	subps   xmm7, xmm5	mulps   xmm3, xmm2	mulps   xmm7, xmm6	mulps   xmm3, [esp + nb104nf_half] ;# rinvMM 	mulps   xmm7, [esp + nb104nf_half] ;# rinvMH2 	movaps  [esp + nb104nf_rinvMM], xmm3	movaps  [esp + nb104nf_rinvMH2], xmm7		rsqrtps xmm1, [esp + nb104nf_rsqH1H1]	rsqrtps xmm5, [esp + nb104nf_rsqH1H2]	movaps  xmm2, xmm1	movaps  xmm6, xmm5	mulps   xmm1, xmm1	mulps   xmm5, xmm5	movaps  xmm3, [esp + nb104nf_three]	movaps  xmm7, xmm3	mulps   xmm1, [esp + nb104nf_rsqH1H1]	mulps   xmm5, [esp + nb104nf_rsqH1H2]	subps   xmm3, xmm1	subps   xmm7, xmm5	mulps   xmm3, xmm2	mulps   xmm7, xmm6	mulps   xmm3, [esp + nb104nf_half] 	mulps   xmm7, [esp + nb104nf_half]	movaps  [esp + nb104nf_rinvH1H1], xmm3	movaps  [esp + nb104nf_rinvH1H2], xmm7		rsqrtps xmm1, [esp + nb104nf_rsqH1M]	rsqrtps xmm5, [esp + nb104nf_rsqH2H1]	movaps  xmm2, xmm1	movaps  xmm6, xmm5	mulps   xmm1, xmm1	mulps   xmm5, xmm5	movaps  xmm3, [esp + nb104nf_three]	movaps  xmm7, xmm3	mulps   xmm1, [esp + nb104nf_rsqH1M]	mulps   xmm5, [esp + nb104nf_rsqH2H1]	subps   xmm3, xmm1	subps   xmm7, xmm5	mulps   xmm3, xmm2	mulps   xmm7, xmm6	mulps   xmm3, [esp + nb104nf_half] 	mulps   xmm7, [esp + nb104nf_half]	movaps  [esp + nb104nf_rinvH1M], xmm3	movaps  [esp + nb104nf_rinvH2H1], xmm7		rsqrtps xmm1, [esp + nb104nf_rsqH2H2]	rsqrtps xmm5, [esp + nb104nf_rsqH2M]	movaps  xmm2, xmm1	movaps  xmm6, xmm5	mulps   xmm1, xmm1	mulps   xmm5, xmm5	movaps  xmm3, [esp + nb104nf_three]	movaps  xmm7, xmm3	mulps   xmm1, [esp + nb104nf_rsqH2H2]	mulps   xmm5, [esp + nb104nf_rsqH2M]	subps   xmm3, xmm1	subps   xmm7, xmm5	mulps   xmm3, xmm2	mulps   xmm7, xmm6	mulps   xmm3, [esp + nb104nf_half] 	mulps   xmm7, [esp + nb104nf_half]	movaps  [esp + nb104nf_rinvH2H2], xmm3	movaps  [esp + nb104nf_rinvH2M], xmm7		rsqrtps xmm1, [esp + nb104nf_rsqMH1]	movaps  xmm2, xmm1	mulps   xmm1, xmm1	movaps  xmm3, [esp + nb104nf_three]	mulps   xmm1, [esp + nb104nf_rsqMH1]	subps   xmm3, xmm1	mulps   xmm3, xmm2	mulps   xmm3, [esp + nb104nf_half] 	movaps  [esp + nb104nf_rinvMH1], xmm3	;# all H-H interactions	movaps xmm0, [esp + nb104nf_rinvH1H1]	addps  xmm0, [esp + nb104nf_rinvH1H2]	addps  xmm0, [esp + nb104nf_rinvH2H1]	addps  xmm0, [esp + nb104nf_rinvH2H2]	mulps  xmm0, [esp + nb104nf_qqHH]	;# all M-H interactions	movaps xmm1, [esp + nb104nf_rinvH1M]	addps  xmm1, [esp + nb104nf_rinvH2M]	addps  xmm1, [esp + nb104nf_rinvMH1]	addps  xmm1, [esp + nb104nf_rinvMH2]	mulps  xmm1, [esp + nb104nf_qqMH]	;# The M-M interaction	movaps xmm2, [esp + nb104nf_rinvMM]	mulps  xmm2, [esp + nb104nf_qqMM]	addps  xmm0, xmm1	addps  xmm2, [esp + nb104nf_vctot] 	addps  xmm0, xmm2	movaps [esp + nb104nf_vctot], xmm0 		;# should we do one more iteration? 	sub dword ptr [esp + nb104nf_innerk],  4	jl    .nb104nf_single_check	jmp   .nb104nf_unroll_loop.nb104nf_single_check:	add dword ptr [esp + nb104nf_innerk],  4	jnz   .nb104nf_single_loop	jmp   .nb104nf_updateouterdata.nb104nf_single_loop:	mov   edx, [esp + nb104nf_innerjjnr] 	;# pointer to jjnr[k] 	mov   eax, [edx]		add dword ptr [esp + nb104nf_innerjjnr],  4		mov esi, [ebp + nb104nf_pos]	lea   eax, [eax + eax*2]  	;# fetch j coordinates 	xorps xmm3, xmm3	xorps xmm4, xmm4	xorps xmm5, xmm5	movss xmm3, [esi + eax*4 + 36]		;# jxM  -  -  -	movss xmm4, [esi + eax*4 + 40]		;# jyM  -  -  -	movss xmm5, [esi + eax*4 + 44]		;# jzM  -  -  -  	movlps xmm6, [esi + eax*4 + 12]		;# xmm6 = jxH1 jyH1   -    -	movss  xmm7, [esi + eax*4 + 20]		;# xmm7 = jzH1   -    -    - 	movhps xmm6, [esi + eax*4 + 24]		;# xmm6 = jxH1 jyH1 jxH2 jyH2	movss  xmm2, [esi + eax*4 + 32]		;# xmm2 = jzH2   -    -    -		;# have all coords, time for some shuffling.	shufps xmm6, xmm6, 216 ;# constant 11011000	;# xmm6 = jxH1 jxH2 jyH1 jyH2 	unpcklps xmm7, xmm2			;# xmm7 = jzH1 jzH2   -    -	movaps  xmm0, [esp + nb104nf_ixM]     	movaps  xmm1, [esp + nb104nf_iyM]	movaps  xmm2, [esp + nb104nf_izM]		movlhps xmm3, xmm6			;# xmm3 = jxM   0   jxH1 jxH2 	shufps  xmm4, xmm6, 228 ;# constant 11100100	;# xmm4 = jyM   0   jyH1 jyH2 	shufps  xmm5, xmm7, 68  ;# constant 01000100	;# xmm5 = jzM   0   jzH1 jzH2		;# store all j coordinates in jM 	movaps [esp + nb104nf_jxM], xmm3	movaps [esp + nb104nf_jyM], xmm4	movaps [esp + nb104nf_jzM], xmm5	subps  xmm0, xmm3	subps  xmm1, xmm4	subps  xmm2, xmm5	mulps xmm0, xmm0	mulps xmm1, xmm1	mulps xmm2, xmm2	addps xmm0, xmm1	addps xmm0, xmm2	;# have rsq in xmm0 		;# do invsqrt 	rsqrtps xmm1, xmm0	movaps  xmm2, xmm1		mulps   xmm1, xmm1	movaps  xmm3, [esp + nb104nf_three]	mulps   xmm1, xmm0	subps   xmm3, xmm1	mulps   xmm3, xmm2	mulps   xmm3, [esp + nb104nf_half] ;# rinv iM- j water 	xorps   xmm1, xmm1	movaps  xmm0, xmm3	xorps   xmm4, xmm4	mulps   xmm0, xmm0	;# xmm0=rinvsq		;# fetch charges to xmm4	movss   xmm4, [esp + nb104nf_qqMM] 	movhps  xmm4, [esp + nb104nf_qqMH]		mulps   xmm3, xmm4	;# xmm3=vcoul 	addps   xmm3, [esp + nb104nf_vctot]	movaps  [esp + nb104nf_vctot], xmm3			;# done with i M Now do i H1 & H2 simultaneously first get i particle coords: 	movaps  xmm0, [esp + nb104nf_ixH1]	movaps  xmm1, [esp + nb104nf_iyH1]	movaps  xmm2, [esp + nb104nf_izH1]		movaps  xmm3, [esp + nb104nf_ixH2] 	movaps  xmm4, [esp + nb104nf_iyH2] 	movaps  xmm5, [esp + nb104nf_izH2] 	subps   xmm0, [esp + nb104nf_jxM]	subps   xmm1, [esp + nb104nf_jyM]	subps   xmm2, [esp + nb104nf_jzM]	subps   xmm3, [esp + nb104nf_jxM]	subps   xmm4, [esp + nb104nf_jyM]	subps   xmm5, [esp + nb104nf_jzM]	mulps xmm0, xmm0	mulps xmm1, xmm1	mulps xmm2, xmm2	mulps xmm3, xmm3	mulps xmm4, xmm4	mulps xmm5, xmm5	addps xmm0, xmm1	addps xmm4, xmm3	addps xmm0, xmm2	;# have rsqH1 in xmm0 	addps xmm4, xmm5	;# have rsqH2 in xmm4 	;# do invsqrt 	rsqrtps xmm1, xmm0	rsqrtps xmm5, xmm4	movaps  xmm2, xmm1	movaps  xmm6, xmm5	mulps   xmm1, xmm1	mulps   xmm5, xmm5	movaps  xmm3, [esp + nb104nf_three]	movaps  xmm7, xmm3	mulps   xmm1, xmm0	mulps   xmm5, xmm4	subps   xmm3, xmm1	subps

⌨️ 快捷键说明

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