nb_kernel101_x86_64_sse.intel_syntax.s

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

S
1,440
字号
    movlhps xmm3, xmm5 ;# jzc  -  jzd -    shufps xmm2, xmm3,  136  ;# 10001000 => jza jzb jzc jzd    ;# xmm0: jxa jya jxb jyb     ;# xmm1: jxc jyc jxd jyd    ;# xmm2: jza jzb jzc jzd    movaps xmm7, xmm9    movaps xmm8, xmm9    movaps xmm13, xmm11    movaps xmm14, xmm11    movaps xmm15, xmm11    movaps xmm11, xmm10    movaps xmm12, xmm10	mulps xmm7, [rsp + nb101_dxO]	mulps xmm8, [rsp + nb101_dyO]	mulps xmm9, [rsp + nb101_dzO]	mulps xmm10, [rsp + nb101_dxH1]	mulps xmm11, [rsp + nb101_dyH1]	mulps xmm12, [rsp + nb101_dzH1]	mulps xmm13, [rsp + nb101_dxH2]	mulps xmm14, [rsp + nb101_dyH2]	mulps xmm15, [rsp + nb101_dzH2]    movaps xmm3, xmm7    movaps xmm4, xmm8    addps xmm2, xmm9    addps xmm7, [rsp + nb101_fixO]    addps xmm8, [rsp + nb101_fiyO]    addps xmm9, [rsp + nb101_fizO]    addps xmm3, xmm10    addps xmm4, xmm11    addps xmm2, xmm12    addps xmm10, [rsp + nb101_fixH1]    addps xmm11, [rsp + nb101_fiyH1]    addps xmm12, [rsp + nb101_fizH1]    addps xmm3, xmm13    addps xmm4, xmm14    addps xmm2, xmm15    addps xmm13, [rsp + nb101_fixH2]    addps xmm14, [rsp + nb101_fiyH2]    addps xmm15, [rsp + nb101_fizH2]    movaps [rsp + nb101_fixO], xmm7    movaps [rsp + nb101_fiyO], xmm8    movaps [rsp + nb101_fizO], xmm9    movaps [rsp + nb101_fixH1], xmm10    movaps [rsp + nb101_fiyH1], xmm11    movaps [rsp + nb101_fizH1], xmm12    movaps [rsp + nb101_fixH2], xmm13    movaps [rsp + nb101_fiyH2], xmm14    movaps [rsp + nb101_fizH2], xmm15        ;# xmm3 = fjx , xmm4 = fjy    movaps xmm5, xmm3    unpcklps xmm3, xmm4    unpckhps xmm5, xmm4        addps xmm0, xmm3    addps xmm1, xmm5    movhlps  xmm3, xmm2 ;# fjzc fjzd        movlps [rdi + rax*4], xmm0    movhps [rdi + rbx*4], xmm0    movlps [rdi + rcx*4], xmm1    movhps [rdi + rdx*4], xmm1    movss  [rdi + rax*4 + 8], xmm2    movss  [rdi + rcx*4 + 8], xmm3    shufps xmm2, xmm2, 1    shufps xmm3, xmm3, 1    movss  [rdi + rbx*4 + 8], xmm2    movss  [rdi + rdx*4 + 8], xmm3	;# should we do one more iteration? 	sub dword ptr [rsp + nb101_innerk],  4	jl    .nb101_odd_inner	jmp   .nb101_unroll_loop.nb101_odd_inner:		add dword ptr [rsp + nb101_innerk],  4	jnz   .nb101_odd_loop	jmp   .nb101_updateouterdata.nb101_odd_loop:	mov   rdx, [rsp + nb101_innerjjnr]     ;# pointer to jjnr[k] 	mov   eax, [rdx]		add qword ptr [rsp + nb101_innerjjnr],  4	 	xorps xmm4, xmm4	movss xmm4, [rsp + nb101_iqO]	mov rsi, [rbp + nb101_charge] 	movhps xmm4, [rsp + nb101_iqH]     	movss xmm3, [rsi + rax*4]	;# charge in xmm3 	shufps xmm3, xmm3, 0	mulps xmm3, xmm4	movaps [rsp + nb101_qqO], xmm3	;# use oxygen qq for storage 	mov rsi, [rbp + nb101_pos]	lea   rax, [rax + rax*2]  		;# 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		movss xmm0, [rsp + nb101_ixO]	movss xmm1, [rsp + nb101_iyO]	movss xmm2, [rsp + nb101_izO]		movlps xmm6, [rsp + nb101_ixH1]	movlps xmm7, [rsp + nb101_ixH2]	unpcklps xmm6, xmm7	movlhps xmm0, xmm6	movlps xmm6, [rsp + nb101_iyH1]	movlps xmm7, [rsp + nb101_iyH2]	unpcklps xmm6, xmm7	movlhps xmm1, xmm6	movlps xmm6, [rsp + nb101_izH1]	movlps xmm7, [rsp + nb101_izH2]	unpcklps xmm6, xmm7	movlhps xmm2, xmm6	subps xmm3, xmm0	subps xmm4, xmm1	subps xmm5, xmm2		movaps [rsp + nb101_dxO], xmm3	movaps [rsp + nb101_dyO], xmm4	movaps [rsp + nb101_dzO], xmm5	mulps  xmm3, xmm3	mulps  xmm4, xmm4	mulps  xmm5, xmm5	addps  xmm4, xmm3	addps  xmm4, xmm5	;# rsq in xmm4 	rsqrtps xmm5, xmm4	;# lookup seed in xmm5 	movaps xmm2, xmm5	mulps xmm5, xmm5	movaps xmm1, [rsp + nb101_three]	mulps xmm5, xmm4	;# rsq*lu*lu 				movaps xmm0, [rsp + nb101_half]	subps xmm1, xmm5	;# 30-rsq*lu*lu 	mulps xmm1, xmm2		mulps xmm0, xmm1	;# xmm0=rinv 	;# a little trick to avoid NaNs: 	;# positions 0,2,and 3 are valid, but not 1. 	;# If it contains NaN it doesnt help to mult by 0, 	;# So we shuffle it and copy pos 0 to pos1! 	shufps xmm0, xmm0, 224 ;# 11100000		movaps xmm4, xmm0	mulps  xmm4, xmm4	;# xmm4=rinvsq 	movaps xmm3, [rsp + nb101_qqO]	mulps  xmm3, xmm0	;# xmm3=vcoul 	mulps  xmm4, xmm3	;# xmm4=total fscal 	addps  xmm3, [rsp + nb101_vctot]	movaps xmm0, [rsp + nb101_dxO]	movaps xmm1, [rsp + nb101_dyO]	movaps xmm2, [rsp + nb101_dzO]	movaps [rsp + nb101_vctot], xmm3	mulps  xmm0, xmm4	mulps  xmm1, xmm4	mulps  xmm2, xmm4	;# xmm0-xmm2 contains tx-tz (partial force) 	movss  xmm3, [rsp + nb101_fixO]		movss  xmm4, [rsp + nb101_fiyO]		movss  xmm5, [rsp + nb101_fizO]		addss  xmm3, xmm0	addss  xmm4, xmm1	addss  xmm5, xmm2	movss  [rsp + nb101_fixO], xmm3		movss  [rsp + nb101_fiyO], xmm4		movss  [rsp + nb101_fizO], xmm5	;# updated the O force now do the H's 	movaps xmm3, xmm0	movaps xmm4, xmm1	movaps xmm5, xmm2	shufps xmm3, xmm3, 230 ;# 11100110	;# shift right 	shufps xmm4, xmm4, 230 ;# 11100110	shufps xmm5, xmm5, 230 ;# 11100110	addss  xmm3, [rsp + nb101_fixH1]	addss  xmm4, [rsp + nb101_fiyH1]	addss  xmm5, [rsp + nb101_fizH1]	movss  [rsp + nb101_fixH1], xmm3		movss  [rsp + nb101_fiyH1], xmm4		movss  [rsp + nb101_fizH1], xmm5	;# updated the H1 force 	mov rdi, [rbp + nb101_faction]	shufps xmm3, xmm3, 231 ;# 11100111	;# shift right 	shufps xmm4, xmm4, 231 ;# 11100111	shufps xmm5, xmm5, 231 ;# 11100111	addss  xmm3, [rsp + nb101_fixH2]	addss  xmm4, [rsp + nb101_fiyH2]	addss  xmm5, [rsp + nb101_fizH2]	movss  [rsp + nb101_fixH2], xmm3		movss  [rsp + nb101_fiyH2], xmm4		movss  [rsp + nb101_fizH2], xmm5	;# updated the H2 force 	;# the fj's - start by accumulating the tx/ty/tz force in xmm0, xmm1 	xorps  xmm5, xmm5	movaps xmm3, xmm0	movlps xmm6, [rdi + rax*4]	movss  xmm7, [rdi + rax*4 + 8]	unpcklps xmm3, xmm1	movlhps  xmm3, xmm5		unpckhps xmm0, xmm1			addps    xmm0, xmm3	movhlps  xmm3, xmm0		addps    xmm0, xmm3	;# x,y sum in xmm0 	movhlps  xmm1, xmm2	addss    xmm2, xmm1	shufps   xmm1, xmm1, 1 	addss    xmm2, xmm1    ;# 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 + nb101_innerk]	jz    .nb101_updateouterdata	jmp   .nb101_odd_loop.nb101_updateouterdata:	mov   ecx, [rsp + nb101_ii3]	mov   rdi, [rbp + nb101_faction]	mov   rsi, [rbp + nb101_fshift]	mov   edx, [rsp + nb101_is3]	;# accumulate Oi forces in xmm0, xmm1, xmm2 	movaps xmm0, [rsp + nb101_fixO]	movaps xmm1, [rsp + nb101_fiyO]	movaps xmm2, [rsp + nb101_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 ;# 00001000		;# accumulate H1i forces in xmm0, xmm1, xmm2 	movaps xmm0, [rsp + nb101_fixH1]	movaps xmm1, [rsp + nb101_fiyH1]	movaps xmm2, [rsp + nb101_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 ;# 00001000		addps   xmm6, xmm0	;# accumulate H2i forces in xmm0, xmm1, xmm2 	movaps xmm0, [rsp + nb101_fixH2]	movaps xmm1, [rsp + nb101_fiyH2]	movaps xmm2, [rsp + nb101_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 ;# 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 + nb101_n]        ;# get group index for i particle         mov   rdx, [rbp + nb101_gid]      	;# base of gid[]        mov   edx, [rdx + rsi*4]		;# ggid=gid[n]	;# accumulate total potential energy and update it 	movaps xmm7, [rsp + nb101_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 + nb101_Vc]	addss xmm7, [rax + rdx*4] 	;# move back to mem 	movss [rax + rdx*4], xmm7 		        ;# finish if last         mov ecx, [rsp + nb101_nn1]	;# esi already loaded with n	inc esi        sub ecx, esi        jz .nb101_outerend        ;# not last, iterate outer loop once more!          mov [rsp + nb101_n], esi        jmp .nb101_outer.nb101_outerend:        ;# check if more outer neighborlists remain        mov   ecx, [rsp + nb101_nri]	;# esi already loaded with n above        sub   ecx, esi        jz .nb101_end        ;# non-zero, do one more workunit        jmp   .nb101_threadloop.nb101_end:	mov eax, [rsp + nb101_nouter]	mov ebx, [rsp + nb101_ninner]	mov rcx, [rbp + nb101_outeriter]	mov rdx, [rbp + nb101_inneriter]	mov [rcx], eax	mov [rdx], ebx	add rsp, 696	emms		pop r15	pop r14	pop r13	pop r12		pop rbx	pop	rbp	ret.globl nb_kernel101nf_x86_64_sse.globl _nb_kernel101nf_x86_64_ssenb_kernel101nf_x86_64_sse:	_nb_kernel101nf_x86_64_sse:	.equiv          nb101nf_fshift,         16.equiv          nb101nf_gid,            24.equiv          nb101nf_pos,            32.equiv          nb101nf_faction,        40.equiv          nb101nf_charge,         48.equiv          nb101nf_p_facel,        56.equiv          nb101nf_argkrf,         64.equiv          nb101nf_argcrf,         72.equiv          nb101nf_Vc,             80.equiv          nb101nf_type,           88.equiv          nb101nf_p_ntype,        96.equiv          nb101nf_vdwparam,       104.equiv          nb101nf_Vvdw,           112.equiv          nb101nf_p_tabscale,     120.equiv          nb101nf_VFtab,          128.equiv          nb101nf_invsqrta,       136.equiv          nb101nf_dvda,           144.equiv          nb101nf_p_gbtabscale,   152.equiv          nb101nf_GBtab,          160.equiv          nb101nf_p_nthreads,     168.equiv          nb101nf_count,          176.equiv          nb101nf_mtx,            184.equiv          nb101nf_outeriter,      192.equiv          nb101nf_inneriter,      200.equiv          nb101nf_work,           208	;# stack offsets for local variables  	;# bottom of stack is cache-aligned for sse use .equiv          nb101nf_ixO,            0.equiv          nb101nf_iyO,            16.equiv          nb101nf_izO,            32.equiv          nb101nf_ixH1,           48.equiv          nb101nf_iyH1,           64.equiv          nb101nf_izH1,           80.equiv          nb101nf_ixH2,           96.equiv          nb101nf_iyH2,           112.equiv          nb101nf_izH2,           128.equiv          nb101nf_iqO,            144.equiv          nb101nf_iqH,            160.equiv          nb101nf_qqO,            176.equiv          nb101nf_qqH,            192.equiv          nb101nf_vctot,          208.equiv          nb101nf_half,           224.equiv          nb101nf_three,          240.equiv          nb101nf_is3,            256.equiv          nb101nf_ii3,            260.equiv          nb101nf_nri,            264

⌨️ 快捷键说明

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