nb_kernel302_x86_64_sse.intel_syntax.s

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

S
2,306
字号
	movhlps xmm2, xmm1		cvttps2pi mm6, xmm1	cvttps2pi mm7, xmm2 	;# mm6/mm7 contain lu indices 	cvtpi2ps xmm3, mm6	cvtpi2ps xmm2, mm7	movlhps  xmm3, xmm2	subps    xmm1, xmm3	;# xmm1=eps 	movaps xmm2, xmm1	mulps  xmm2, xmm2   	;# xmm2=eps2 	pslld   mm6, 2	pslld   mm7, 2	movd ebx, mm6	movd ecx, mm7	psrlq mm7, 32	movd edx, mm7		;# table indices in ebx,ecx,edx 	movlps xmm5, [rsi + rbx*4]	movlps xmm7, [rsi + rcx*4]	movhps xmm7, [rsi + rdx*4] ;# got half coulomb table 	movaps xmm4, xmm5	shufps xmm4, xmm7, 136  ;# 10001000	shufps xmm5, xmm7, 221  ;# 11011101	movlps xmm7, [rsi + rbx*4 + 8]	movlps xmm3, [rsi + rcx*4 + 8]	movhps xmm3, [rsi + rdx*4 + 8] ;# other half of coulomb table  	movaps xmm6, xmm7	shufps xmm6, xmm3, 136  ;# 10001000	shufps xmm7, xmm3, 221  ;# 11011101	;# coulomb table ready, in xmm4-xmm7  	mulps  xmm6, xmm1   	;# xmm6=Geps 	mulps  xmm7, xmm2   	;# xmm7=Heps2 	addps  xmm5, xmm6	addps  xmm5, xmm7   	;# xmm5=Fp 	mulps  xmm7, [rsp + nb302_two]   	;# two*Heps2 	xorps  xmm3, xmm3	;# fetch charges to xmm3 (temporary) 	movss   xmm3, [rsp + nb302_qqOH]	movhps  xmm3, [rsp + nb302_qqHH]		addps  xmm7, xmm6	addps  xmm7, xmm5 ;# xmm7=FF 	mulps  xmm5, xmm1 ;# xmm5=eps*Fp 	addps  xmm5, xmm4 ;# xmm5=VV 	mulps  xmm5, xmm3 ;# vcoul=qq*VV  	mulps  xmm3, xmm7 ;# fijC=FF*qq 	;# at this point xmm5 contains vcoul and xmm3 fijC 	addps  xmm5, [rsp + nb302_vctot]	movaps [rsp + nb302_vctot], xmm5	    xorps  xmm1, xmm1	mulps xmm3, [rsp + nb302_tsc]	mulps xmm3, xmm0	subps  xmm1, xmm3		movaps  xmm0, xmm1	movaps  xmm2, xmm1		mulps   xmm0, [rsp + nb302_dxH2O]	mulps   xmm1, [rsp + nb302_dyH2O]	mulps   xmm2, [rsp + nb302_dzH2O]	movaps  xmm3, [rsp + nb302_fjxO]	movaps  xmm4, [rsp + nb302_fjyO]	movaps  xmm5, [rsp + nb302_fjzO]	addps   xmm3, xmm0	addps   xmm4, xmm1	addps   xmm5, xmm2	mov     rsi, [rbp + nb302_faction]	movaps  [rsp + nb302_fjxO], xmm3	movaps  [rsp + nb302_fjyO], xmm4	movaps  [rsp + nb302_fjzO], xmm5	addps   xmm0, [rsp + nb302_fixH2]	addps   xmm1, [rsp + nb302_fiyH2]	addps   xmm2, [rsp + nb302_fizH2]	movaps  [rsp + nb302_fixH2], xmm0	movaps  [rsp + nb302_fiyH2], xmm1	movaps  [rsp + nb302_fizH2], xmm2	;# update j water forces from local variables 	movlps  xmm0, [rsi + rax*4]	movlps  xmm1, [rsi + rax*4 + 12]	movhps  xmm1, [rsi + rax*4 + 24]	movaps  xmm3, [rsp + nb302_fjxO]	movaps  xmm4, [rsp + nb302_fjyO]	movaps  xmm5, [rsp + nb302_fjzO]	movaps  xmm6, xmm5	movaps  xmm7, xmm5	shufps  xmm6, xmm6, 2 ;# 00000010	shufps  xmm7, xmm7, 3 ;# 00000011	addss   xmm5, [rsi + rax*4 + 8]	addss   xmm6, [rsi + rax*4 + 20]	addss   xmm7, [rsi + rax*4 + 32]	movss   [rsi + rax*4 + 8], xmm5	movss   [rsi + rax*4 + 20], xmm6	movss   [rsi + rax*4 + 32], xmm7	movaps   xmm5, xmm3	unpcklps xmm3, xmm4	unpckhps xmm5, xmm4	addps    xmm0, xmm3	addps    xmm1, xmm5	movlps  [rsi + rax*4], xmm0 	movlps  [rsi + rax*4 + 12], xmm1 	movhps  [rsi + rax*4 + 24], xmm1 		dec dword ptr [rsp + nb302_innerk]	jz    .nb302_updateouterdata	jmp   .nb302_single_loop.nb302_updateouterdata:	mov   ecx, [rsp + nb302_ii3]	mov   rdi, [rbp + nb302_faction]	mov   rsi, [rbp + nb302_fshift]	mov   edx, [rsp + nb302_is3]	;# accumulate  Oi forces in xmm0, xmm1, xmm2 	movaps xmm0, [rsp + nb302_fixO]	movaps xmm1, [rsp + nb302_fiyO] 	movaps xmm2, [rsp + nb302_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 + nb302_fixH1]	movaps xmm1, [rsp + nb302_fiyH1]	movaps xmm2, [rsp + nb302_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 + nb302_fixH2]	movaps xmm1, [rsp + nb302_fiyH2]	movaps xmm2, [rsp + nb302_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 + nb302_n]        ;# get group index for i particle         mov   rdx, [rbp + nb302_gid]      	;# base of gid[]        mov   edx, [rdx + rsi*4]		;# ggid=gid[n]	;# accumulate total potential energy and update it 	movaps xmm7, [rsp + nb302_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 + nb302_Vc]	addss xmm7, [rax + rdx*4] 	;# move back to mem 	movss [rax + rdx*4], xmm7 	        ;# finish if last         mov ecx, [rsp + nb302_nn1]	;# esi already loaded with n	inc esi        sub ecx, esi        jz .nb302_outerend        ;# not last, iterate outer loop once more!          mov [rsp + nb302_n], esi        jmp .nb302_outer.nb302_outerend:        ;# check if more outer neighborlists remain        mov   ecx, [rsp + nb302_nri]	;# esi already loaded with n above        sub   ecx, esi        jz .nb302_end        ;# non-zero, do one more workunit        jmp   .nb302_threadloop.nb302_end:	mov eax, [rsp + nb302_nouter]	mov ebx, [rsp + nb302_ninner]	mov rcx, [rbp + nb302_outeriter]	mov rdx, [rbp + nb302_inneriter]	mov [rcx], eax	mov [rdx], ebx	add rsp, 1528	emms	pop r15	pop r14	pop r13	pop r12		pop rbx	pop	rbp	ret		.globl nb_kernel302nf_x86_64_sse.globl _nb_kernel302nf_x86_64_ssenb_kernel302nf_x86_64_sse:	_nb_kernel302nf_x86_64_sse:	;#	Room for return address and rbp (16 bytes).equiv          nb302nf_fshift,         16.equiv          nb302nf_gid,            24.equiv          nb302nf_pos,            32.equiv          nb302nf_faction,        40.equiv          nb302nf_charge,         48.equiv          nb302nf_p_facel,        56.equiv          nb302nf_argkrf,         64.equiv          nb302nf_argcrf,         72.equiv          nb302nf_Vc,             80.equiv          nb302nf_type,           88.equiv          nb302nf_p_ntype,        96.equiv          nb302nf_vdwparam,       104.equiv          nb302nf_Vvdw,           112.equiv          nb302nf_p_tabscale,     120.equiv          nb302nf_VFtab,          128.equiv          nb302nf_invsqrta,       136.equiv          nb302nf_dvda,           144.equiv          nb302nf_p_gbtabscale,   152.equiv          nb302nf_GBtab,          160.equiv          nb302nf_p_nthreads,     168.equiv          nb302nf_count,          176.equiv          nb302nf_mtx,            184.equiv          nb302nf_outeriter,      192.equiv          nb302nf_inneriter,      200.equiv          nb302nf_work,           208	;# stack offsets for local variables  	;# bottom of stack is cache-aligned for sse use .equiv          nb302nf_ixO,            0.equiv          nb302nf_iyO,            16.equiv          nb302nf_izO,            32.equiv          nb302nf_ixH1,           48.equiv          nb302nf_iyH1,           64.equiv          nb302nf_izH1,           80.equiv          nb302nf_ixH2,           96.equiv          nb302nf_iyH2,           112.equiv          nb302nf_izH2,           128.equiv          nb302nf_jxO,            144.equiv          nb302nf_jyO,            160.equiv          nb302nf_jzO,            176.equiv          nb302nf_jxH1,           192.equiv          nb302nf_jyH1,           208.equiv          nb302nf_jzH1,           224.equiv          nb302nf_jxH2,           240.equiv          nb302nf_jyH2,           256.equiv          nb302nf_jzH2,           272.equiv          nb302nf_qqOO,           288.equiv          nb302nf_qqOH,           304.equiv          nb302nf_qqHH,           320.equiv          nb302nf_tsc,            336.equiv          nb302nf_vctot,          352.equiv          nb302nf_half,           368.equiv          nb302nf_three,          384.equiv          nb302nf_rsqOO,          400.equiv          nb302nf_rsqOH1,         416.equiv          nb302nf_rsqOH2,         432.equiv          nb302nf_rsqH1O,         448.equiv          nb302nf_rsqH1H1,        464.equiv          nb302nf_rsqH1H2,        480.equiv          nb302nf_rsqH2O,         496.equiv          nb302nf_rsqH2H1,        512.equiv          nb302nf_rsqH2H2,        528.equiv          nb302nf_rinvOO,         544.equiv          nb302nf_rinvOH1,        560.equiv          nb302nf_rinvOH2,        576.equiv          nb302nf_rinvH1O,        592.equiv          nb302nf_rinvH1H1,       608.equiv          nb302nf_rinvH1H2,       624.equiv          nb302nf_rinvH2O,        640.equiv          nb302nf_rinvH2H1,       656.equiv          nb302nf_rinvH2H2,       672.equiv          nb302nf_is3,            688.equiv          nb302nf_ii3,            692.equiv          nb302nf_nri,            696.equiv          nb302nf_iinr,           704.equiv          nb302nf_jindex,         712.equiv          nb302nf_jjnr,           720.equiv          nb302nf_shift,          728.equiv          nb302nf_shiftvec,       736.equiv          nb302nf_facel,          744.equiv          nb302nf_innerjjnr,      752.equiv          nb302nf_innerk,         760.equiv          nb302nf_n,              764.equiv          nb302nf_nn1,            768.equiv          nb302nf_nouter,         772.equiv          nb302nf_ninner,         776	push rbp	mov  rbp, rsp	push rbx	emms	sub rsp, 792		;# local variable stack space (n*4+8)	;# zero 32-bit iteration counters	mov eax, 0	mov [rsp + nb302nf_nouter], eax	mov [rsp + nb302nf_ninner], eax	mov edi, [rdi]	mov [rsp + nb302nf_nri], edi	mov [rsp + nb302nf_iinr], rsi	mov [rsp + nb302nf_jindex], rdx	mov [rsp + nb302nf_jjnr], rcx	mov [rsp + nb302nf_shift], r8	mov [rsp + nb302nf_shiftvec], r9	mov rsi, [rbp + nb302nf_p_facel]	movss xmm0, [rsi]	movss [rsp + nb302nf_facel], xmm0	mov rax, [rbp + nb302nf_p_tabscale]	movss xmm3, [rax]	shufps xmm3, xmm3, 0	movaps [rsp + nb302nf_tsc], xmm3	;# assume we have at least one i particle - start directly 	mov   rcx, [rsp + nb302nf_iinr]   	;# rcx = pointer into iinr[] 		mov   ebx, [rcx]		;# ebx =ii 	mov   rdx, [rbp + nb302nf_charge]	movss xmm3, [rdx + rbx*4]		movss xmm4, xmm3		movss xmm5, [rdx + rbx*4 + 4]		mov rsi, [rbp + nb302nf_p_facel]	movss xmm0, [rsi]	movss xmm6, [rsp + nb302nf_facel]	mulss  xmm3, xmm3	mulss  xmm4, xmm5	mulss  xmm5, xmm5	mulss  xmm3, xmm6	mulss  xmm4, xmm6	mulss  xmm5, xmm6	shufps xmm3, xmm3, 0	shufps xmm4, xmm4, 0	shufps xmm5, xmm5, 0	movaps [rsp + nb302nf_qqOO], xmm3	movaps [rsp + nb302nf_qqOH], xmm4	movaps [rsp + nb302nf_qqHH], xmm5			;# create constant floating-point factors on stack	mov eax, 0x3f000000     ;# half in IEEE (hex)	mov [rsp + nb302nf_half], eax	movss xmm1, [rsp + nb302nf_half]	shufps xmm1, xmm1, 0    ;# splat to all elements	movaps xmm2, xmm1  

⌨️ 快捷键说明

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