⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nb_kernel111_ia32_3dnow.s

📁 最著名最快的分子模拟软件
💻 S
📖 第 1 页 / 共 2 页
字号:
        movq  24(%edi,%ecx,4),%mm6          ## increment iH2 force         movd  32(%edi,%ecx,4),%mm7        pfadd %mm2,%mm6        pfadd %mm3,%mm7        movq  %mm6,24(%edi,%ecx,4)        movd  %mm7,32(%edi,%ecx,4)        movl  nb111_fshift(%ebp),%ebx      ## increment fshift force         movl  nb111_is3(%esp),%edx        movq  (%ebx,%edx,4),%mm6        movd  8(%ebx,%edx,4),%mm7        pfadd nb111_fixO(%esp),%mm6        pfadd nb111_fizO(%esp),%mm7        pfadd %mm0,%mm6        pfadd %mm1,%mm7        pfadd %mm2,%mm6        pfadd %mm3,%mm7        movq  %mm6,(%ebx,%edx,4)        movd  %mm7,8(%ebx,%edx,4)        ## get n from stack        movl nb111_n(%esp),%esi        ## get group index for i particle         movl  nb111_gid(%ebp),%edx              ## base of gid[]        movl  (%edx,%esi,4),%edx                ## ggid=gid[n]        movq  nb111_vctot(%esp),%mm7        pfacc %mm7,%mm7           ## get and sum the two parts of total potential         movl  nb111_Vc(%ebp),%eax        movd  (%eax,%edx,4),%mm6        pfadd %mm7,%mm6        movd  %mm6,(%eax,%edx,4)          ## increment vc[gid]         movq  nb111_Vvdwtot(%esp),%mm7        pfacc %mm7,%mm7           ## same for Vvdw         movl  nb111_Vvdw(%ebp),%eax        movd  (%eax,%edx,4),%mm6        pfadd %mm7,%mm6        movd  %mm6,(%eax,%edx,4)          ## increment Vvdw[gid]        ## finish if last         movl nb111_nn1(%esp),%ecx        ## esi already loaded with n        incl %esi        subl %esi,%ecx        jz _nb_kernel111_ia32_3dnow.nb111_outerend        ## not last, iterate outer loop once more!          movl %esi,nb111_n(%esp)        jmp _nb_kernel111_ia32_3dnow.nb111_outer_nb_kernel111_ia32_3dnow.nb111_outerend:         ## check if more outer neighborlists remain        movl  nb111_nri(%esp),%ecx        ## esi already loaded with n above        subl  %esi,%ecx        jz _nb_kernel111_ia32_3dnow.nb111_end        ## non-zero, do one more workunit        jmp   _nb_kernel111_ia32_3dnow.nb111_threadloop_nb_kernel111_ia32_3dnow.nb111_end:         femms        movl nb111_nouter(%esp),%eax        movl nb111_ninner(%esp),%ebx        movl nb111_outeriter(%ebp),%ecx        movl nb111_inneriter(%ebp),%edx        movl %eax,(%ecx)        movl %ebx,(%edx)        addl $220,%esp        popl %edi        popl %esi        popl %edx        popl %ecx        popl %ebx        popl %eax        leave        ret.globl nb_kernel111nf_ia32_3dnow.globl _nb_kernel111nf_ia32_3dnownb_kernel111nf_ia32_3dnow:      _nb_kernel111nf_ia32_3dnow:     .set nb111nf_p_nri, 8.set nb111nf_iinr, 12.set nb111nf_jindex, 16.set nb111nf_jjnr, 20.set nb111nf_shift, 24.set nb111nf_shiftvec, 28.set nb111nf_fshift, 32.set nb111nf_gid, 36.set nb111nf_pos, 40.set nb111nf_faction, 44.set nb111nf_charge, 48.set nb111nf_p_facel, 52.set nb111nf_p_krf, 56.set nb111nf_p_crf, 60.set nb111nf_Vc, 64.set nb111nf_type, 68.set nb111nf_p_ntype, 72.set nb111nf_vdwparam, 76.set nb111nf_Vvdw, 80.set nb111nf_p_tabscale, 84.set nb111nf_VFtab, 88.set nb111nf_invsqrta, 92.set nb111nf_dvda, 96.set nb111nf_p_gbtabscale, 100.set nb111nf_GBtab, 104.set nb111nf_p_nthreads, 108.set nb111nf_count, 112.set nb111nf_mtx, 116.set nb111nf_outeriter, 120.set nb111nf_inneriter, 124.set nb111nf_work, 128                        ## stack offsets for local variables .set nb111nf_is3, 0.set nb111nf_ii3, 4.set nb111nf_ixO, 8.set nb111nf_iyO, 12.set nb111nf_izO, 16.set nb111nf_ixH, 20.set nb111nf_iyH, 28.set nb111nf_izH, 36.set nb111nf_iqO, 44.set nb111nf_iqH, 52.set nb111nf_vctot, 60.set nb111nf_Vvdwtot, 68.set nb111nf_c6, 76.set nb111nf_c12, 84.set nb111nf_ntia, 92.set nb111nf_innerjjnr, 96.set nb111nf_innerk, 100.set nb111nf_n, 104                         ## idx for outer loop.set nb111nf_nn1, 108                       ## number of outer iterations.set nb111nf_nri, 112.set nb111nf_ntype, 116.set nb111nf_nouter, 120.set nb111nf_ninner, 124        pushl %ebp        movl %esp,%ebp        pushl %eax        pushl %ebx        pushl %ecx        pushl %edx        pushl %esi        pushl %edi        subl $128,%esp          ## local stack space         femms        ## zero iteration counters        movl nb111nf_p_nri(%ebp),%ecx        movl nb111nf_p_ntype(%ebp),%edx        movl nb111nf_p_facel(%ebp),%esi        movl (%ecx),%ecx        movl (%edx),%edx        movl %ecx,nb111nf_nri(%esp)        movl %edx,nb111nf_ntype(%esp)        movl $0,%eax        movl %eax,nb111nf_nouter(%esp)        movl %eax,nb111nf_ninner(%esp)        ## assume we have at least one i particle - start directly              movl  nb111nf_iinr(%ebp),%ecx         ## ecx = pointer into iinr[]              movl  (%ecx),%ebx           ## ebx=ii         movl  nb111nf_charge(%ebp),%edx        movd  (%esi),%mm1        movd  (%edx,%ebx,4),%mm2    ## mm2=charge[ii0]         pfmul %mm1,%mm2        movq  %mm2,nb111nf_iqO(%esp)        ## iqO = facel*charge[ii]         movd  4(%edx,%ebx,4),%mm2       ## mm2=charge[ii0+1]         pfmul %mm1,%mm2        punpckldq %mm2,%mm2         ## spread to both halves         movq  %mm2,nb111nf_iqH(%esp)        ## iqH = facel*charge[ii0+1]         movl  nb111nf_type(%ebp),%edx        movl  (%edx,%ebx,4),%ecx        shll  %ecx        imull nb111nf_ntype(%esp),%ecx        ## ecx = ntia = 2*ntype*type[ii0]          movl  %ecx,nb111nf_ntia(%esp)_nb_kernel111nf_ia32_3dnow.nb111nf_threadloop:         movl  nb111nf_count(%ebp),%esi            ## pointer to sync counter        movl  (%esi),%eax_nb_kernel111nf_ia32_3dnow.nb111nf_spinlock:         movl  %eax,%ebx                         ## ebx=*count=nn0        addl  $1,%ebx                          ## ebx=nn1=nn0+10        lock         cmpxchgl %ebx,(%esi)                    ## write nn1 to *counter,                                                ## if it hasnt changed.                                                ## or reread *counter to eax.        pause                                   ## -> better p4 performance        jnz _nb_kernel111nf_ia32_3dnow.nb111nf_spinlock        ## if(nn1>nri) nn1=nri        movl nb111nf_nri(%esp),%ecx        movl %ecx,%edx        subl %ebx,%ecx        cmovlel %edx,%ebx                       ## if(nn1>nri) nn1=nri        ## Cleared the spinlock if we got here.        ## eax contains nn0, ebx contains nn1.        movl %eax,nb111nf_n(%esp)        movl %ebx,nb111nf_nn1(%esp)        subl %eax,%ebx                          ## calc number of outer lists        movl %eax,%esi                          ## copy n to esi        jg  _nb_kernel111nf_ia32_3dnow.nb111nf_outerstart        jmp _nb_kernel111nf_ia32_3dnow.nb111nf_end_nb_kernel111nf_ia32_3dnow.nb111nf_outerstart:         ## ebx contains number of outer iterations        addl nb111nf_nouter(%esp),%ebx        movl %ebx,nb111nf_nouter(%esp)_nb_kernel111nf_ia32_3dnow.nb111nf_outer:         movl  nb111nf_shift(%ebp),%eax        ## eax = pointer into shift[]         movl  (%eax,%esi,4),%ebx                ## ebx=shift[n]         leal  (%ebx,%ebx,2),%ebx    ## ebx=3*is         movl  %ebx,nb111nf_is3(%esp)            ## store is3         movl  nb111nf_shiftvec(%ebp),%eax     ## eax = base of shiftvec[]         movq  (%eax,%ebx,4),%mm5        ## move shX/shY to mm5 and shZ to mm6.         movd  8(%eax,%ebx,4),%mm6        movq  %mm5,%mm0        movq  %mm5,%mm1        movq  %mm6,%mm2        punpckldq %mm0,%mm0         ## also expand shX,Y,Z in mm0--mm2.         punpckhdq %mm1,%mm1        punpckldq %mm2,%mm2        movl  nb111nf_iinr(%ebp),%ecx         ## ecx = pointer into iinr[]              movl  (%ecx,%esi,4),%ebx    ## ebx=ii         leal  (%ebx,%ebx,2),%ebx        ## ebx = 3*ii=ii3         movl  nb111nf_pos(%ebp),%eax      ## eax = base of pos[]         pfadd (%eax,%ebx,4),%mm5    ## ix = shX + posX (and iy too)         movd  8(%eax,%ebx,4),%mm7       ## cant use direct memory add for 4 bytes (iz)         movl  %ebx,nb111nf_ii3(%esp)        ## (use mm7 as temp. storage for iz.)         pfadd %mm7,%mm6        movq  %mm5,nb111nf_ixO(%esp)        movq  %mm6,nb111nf_izO(%esp)        movd  12(%eax,%ebx,4),%mm3        movd  16(%eax,%ebx,4),%mm4        movd  20(%eax,%ebx,4),%mm5        punpckldq  24(%eax,%ebx,4),%mm3        punpckldq  28(%eax,%ebx,4),%mm4        punpckldq  32(%eax,%ebx,4),%mm5    ## coords of H1 in low mm3-mm5, H2 in high         pfadd %mm3,%mm0        pfadd %mm4,%mm1        pfadd %mm5,%mm2        movq %mm0,nb111nf_ixH(%esp)        movq %mm1,nb111nf_iyH(%esp)        movq %mm2,nb111nf_izH(%esp)        ## clear vctot and i forces         pxor  %mm7,%mm7        movq  %mm7,nb111nf_vctot(%esp)        movq  %mm7,nb111nf_Vvdwtot(%esp)        movl  nb111nf_jindex(%ebp),%eax        movl  (%eax,%esi,4),%ecx             ## jindex[n]         movl  4(%eax,%esi,4),%edx            ## jindex[n+1]         subl  %ecx,%edx              ## number of innerloop atoms         movl  %edx,nb111nf_innerk(%esp)      ## number of innerloop atoms         addl  nb111nf_ninner(%esp),%edx        movl  %edx,nb111nf_ninner(%esp)        movl  nb111nf_pos(%ebp),%esi        movl  nb111nf_jjnr(%ebp),%eax        shll  $2,%ecx        addl  %ecx,%eax        movl  %eax,nb111nf_innerjjnr(%esp)       ## pointer to jjnr[nj0] _nb_kernel111nf_ia32_3dnow.nb111nf_inner_loop:         ## a single j particle iteration here - compare with the unrolled code for comments.         movl  nb111nf_innerjjnr(%esp),%eax        movl  (%eax),%eax       ## eax=jnr offset         addl $4,nb111nf_innerjjnr(%esp)             ## advance pointer         prefetch 16(%ecx)          ## prefetch data - trial and error says 16 is best         movl nb111nf_charge(%ebp),%ecx        movd (%ecx,%eax,4),%mm7        punpckldq %mm7,%mm7        movq %mm7,%mm6        pfmul nb111nf_iqO(%esp),%mm6        pfmul nb111nf_iqH(%esp),%mm7    ## mm6=qqO, mm7=qqH         movl nb111nf_type(%ebp),%ecx        movl (%ecx,%eax,4),%edx          ## type [jnr]         movl nb111nf_vdwparam(%ebp),%ecx        shll %edx        addl nb111nf_ntia(%esp),%edx         ## tja = ntia + 2*type         movd (%ecx,%edx,4),%mm5         ## mm5 = 1st c6                         movq %mm5,nb111nf_c6(%esp)        movd 4(%ecx,%edx,4),%mm5        ## mm5 = 1st c12                        movq %mm5,nb111nf_c12(%esp)        leal  (%eax,%eax,2),%eax        movq  (%esi,%eax,4),%mm0        movd  8(%esi,%eax,4),%mm1        ## copy & expand to mm2-mm4 for the H interactions         movq  %mm0,%mm2        movq  %mm0,%mm3        movq  %mm1,%mm4        punpckldq %mm2,%mm2        punpckhdq %mm3,%mm3        punpckldq %mm4,%mm4        pfsubr nb111nf_ixO(%esp),%mm0        pfsubr nb111nf_izO(%esp),%mm1        pfmul %mm0,%mm0        pfmul %mm1,%mm1        pfacc %mm1,%mm0        pfadd %mm1,%mm0         ## mm0=rsqO         punpckldq %mm2,%mm2        punpckldq %mm3,%mm3        punpckldq %mm4,%mm4 ## mm2-mm4 is jx-jz         pfsubr nb111nf_ixH(%esp),%mm2        pfsubr nb111nf_iyH(%esp),%mm3        pfsubr nb111nf_izH(%esp),%mm4   ## mm2-mm4 is dxH-dzH         pfmul %mm2,%mm2        pfmul %mm3,%mm3        pfmul %mm4,%mm4        pfadd %mm2,%mm3        pfadd %mm4,%mm3         ## mm3=rsqH         pfrsqrt %mm0,%mm1        movq %mm1,%mm2        pfmul %mm1,%mm1        pfrsqit1 %mm0,%mm1        pfrcpit2 %mm2,%mm1      ## mm1=invsqrt         movq  %mm1,%mm4        pfmul %mm4,%mm4         ## mm4=invsq         movq  %mm4,%mm0        pfmul %mm4,%mm0        pfmul %mm4,%mm0         ## mm0=rinvsix         movq  %mm0,%mm2        pfmul %mm2,%mm2         ## mm2=rintwelve         ## calculate potential and scalar force         pfmul %mm1,%mm6         ## mm6=vcoul         movq  %mm6,%mm1         ## use mm1 for fscal sum         ## LJ for the oxygen         pfmul nb111nf_c6(%esp),%mm0        pfmul nb111nf_c12(%esp),%mm2        ## calc nb potential         pfsub %mm0,%mm2        ## update nb potential         pfadd nb111nf_Vvdwtot(%esp),%mm2        movq %mm2,nb111nf_Vvdwtot(%esp)        pfrsqrt %mm3,%mm5        pswapd %mm3,%mm3        pfrsqrt %mm3,%mm2        pswapd %mm3,%mm3        punpckldq %mm2,%mm5     ## seeds are in mm5 now, and rsq in mm3.         movq %mm5,%mm2        pfmul %mm5,%mm5        pfrsqit1 %mm3,%mm5        pfrcpit2 %mm2,%mm5      ## mm5=invsqrt         pfmul %mm5,%mm7         ## mm7=vcoul         ## update vctot         pfadd %mm6,%mm7        pfadd nb111nf_vctot(%esp),%mm7        movq %mm7,nb111nf_vctot(%esp)        ##  done  - one more?         decl nb111nf_innerk(%esp)        jz  _nb_kernel111nf_ia32_3dnow.nb111nf_updateouterdata        jmp _nb_kernel111nf_ia32_3dnow.nb111nf_inner_loop_nb_kernel111nf_ia32_3dnow.nb111nf_updateouterdata:         ## get n from stack        movl nb111nf_n(%esp),%esi        ## get group index for i particle         movl  nb111nf_gid(%ebp),%edx            ## base of gid[]        movl  (%edx,%esi,4),%edx                ## ggid=gid[n]        movq  nb111nf_vctot(%esp),%mm7        pfacc %mm7,%mm7           ## get and sum the two parts of total potential         movl  nb111nf_Vc(%ebp),%eax        movd  (%eax,%edx,4),%mm6        pfadd %mm7,%mm6        movd  %mm6,(%eax,%edx,4)          ## increment vc[gid]         movq  nb111nf_Vvdwtot(%esp),%mm7        pfacc %mm7,%mm7           ## same for Vvdw         movl  nb111nf_Vvdw(%ebp),%eax        movd  (%eax,%edx,4),%mm6        pfadd %mm7,%mm6        movd  %mm6,(%eax,%edx,4)          ## increment Vvdw[gid]         ## finish if last         movl nb111nf_nn1(%esp),%ecx        ## esi already loaded with n        incl %esi        subl %esi,%ecx        jz _nb_kernel111nf_ia32_3dnow.nb111nf_outerend        ## not last, iterate outer loop once more!          movl %esi,nb111nf_n(%esp)        jmp _nb_kernel111nf_ia32_3dnow.nb111nf_outer_nb_kernel111nf_ia32_3dnow.nb111nf_outerend:         ## check if more outer neighborlists remain        movl  nb111nf_nri(%esp),%ecx        ## esi already loaded with n above        subl  %esi,%ecx        jz _nb_kernel111nf_ia32_3dnow.nb111nf_end        ## non-zero, do one more workunit        jmp   _nb_kernel111nf_ia32_3dnow.nb111nf_threadloop_nb_kernel111nf_ia32_3dnow.nb111nf_end:         femms        movl nb111nf_nouter(%esp),%eax        movl nb111nf_ninner(%esp),%ebx        movl nb111nf_outeriter(%ebp),%ecx        movl nb111nf_inneriter(%ebp),%edx        movl %eax,(%ecx)        movl %ebx,(%edx)        addl $128,%esp        popl %edi        popl %esi        popl %edx        popl %ecx        popl %ebx        popl %eax        leave        ret

⌨️ 快捷键说明

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