nb_kernel430_ia64_single.s
来自「最著名最快的分子模拟软件」· S 代码 · 共 1,171 行 · 第 1/2 页
S
1,171 行
setf.sig f32 = NTI ldfs shY = [shiftVPtr], 4 nop 0x0 } { .mfi ldfs PosY = [posPtr], 4 nop 0x0 nop 0x0 } ;; { .mmf ldfs shZ = [shiftVPtr] ldfs PosZ = [posPtr] mov FIZ = f0 } { .mmi ldfs FShiftX = [FShiftIS], 4 ldfs FActIX = [FActII], 4 shladd VNBPtr = ggid, 2, VNB } ;;// OUTER PROLOGUE 4 { .mmf ldfs FShiftY = [FShiftIS], 4 ldfs FActIY = [FActII], 4 xma.l f32 = f32, f33, fZero } { .mmi sub InnerCnt = NJ1, NJ0, 1 ldfs dVdASum = [dVdAIPtr] shladd VCPtr = ggid, 2, VC } ;;// OUTER PROLOGUE 5 { .mmi ldfs FActIZ = [FActII], -8 ldfs FShiftZ = [FShiftIS], -8 mov NJ0 = NJ1 } ;;// OUTER PROLOGUE 6 { .mmf ldfs ICharge = [chargePtr], 4 ldfs VNBTotal = [VNBPtr] fadd IX = shX, PosX } ;;// OUTER PROLOGUE 7 { .mfi ldfs VCTotal = [VCPtr] fadd IY = shY, PosY add NN0 = 1, NN0 } { .mmi (pCont) ld4 NJ1 = [jindexPtr], 4 ldfs isaI = [isaPtr], 4 // This may seem strange, but we set the first stage of the // pipe to execute this way because setting pr.rot doesn't take // into account how much the predicates have rotated. If this is // the first time through, we cleared all the pipeline predicates // in the initialization. If not, flushing the pipeline set all // the pipeline predicates to 0 cmp.eq pPipe[0], p0 = zero, zero } ;;// OUTER PROLOGUE 8 { .mfi cmp.lt pCont, pDone = NN0, NN1 fadd IZ = shZ, PosZ mov ar.lc = InnerCnt } ;;// OUTER PROLOGUE 9 { .mfi getf.sig NTI = f32 fmpy IQ = ICharge, Facel mov ar.ec = PIPE_DEPTH } ;;// 14 bundles in outer loop - still aligned. // The inner loop is a 6-stage pipeline. The serial sequence of float ops // is folded into a 17-cycle loop (17 * 2 = 34 float ops, one empty), // then divided // into 5 stages.innerLoop:// INNER LOOP 1 { .mfi (pPipe[0]) shladd chargePtr = jnr, 2, CHARGE (pPipe[4]) fnma FScalar1 = Rep_F[2], C12[2], FScalar1 (pPipe[0]) shladd jnr3 = jnr, 1, jnr } // We march through jjnr[] sequentially, so it's usually a good idea // to preload the next value. However, we don't want to do this if // (1) we're in the epilogue or (2) this is the last time through and // there are no more atoms to inspect. Thus, we keep track of the loop // trip and use the logic below to see if we should load ahead .pred.rel "mutex", pCont, pDone { .mfi (pCont) cmp.ge pJJNR, p0 = InnerCnt, zero (pPipe[4]) fmpy FijGB = Charge[4], GB_F[2] (pDone) cmp.gt pJJNR, p0 = InnerCnt, zero } ;;// INNER LOOP 2 { .mfi nop 0x0 (pPipe[3]) fsub GBeps = GBRT[1], GBn0[1] (pPipe[0]) shladd isaPtr = jnr, 2, INVSQRTA } { .mfi (pPipe[0]) shladd posPtr = jnr3, 2, POSITION (pPipe[3]) fsub eps = RT[1], n0[1] (pPipe[0]) shladd FActPtr[0] = jnr3, 2, FACTION } ;;// INNER LOOP 3 { .mfi (pPipe[0]) ldfs JX = [posPtr], 4 (pPipe[2]) fmpy GBRT[0] = RSqr[2], RInvGBTab[1] (pPipe[0]) shladd TypeJ[0] = jnr, 2, TYPE } { .mfi nop 0x0 (pPipe[2]) fmpy RT[0] = RSqr[2], RInvTab[1] (pPipe[0]) shladd dVdAPtr[0] = jnr, 2, DVDA } ;;// INNER LOOP 4 { .mfi (pPipe[0]) ldfs JY = [posPtr], 4 (pPipe[1]) fma RSqr[1] = DZ[1], DZ[1], RSqr[1] nop 0x0 } { .mfi (pJJNR) ld4 jnr = [jjnrPtr], 4 (pPipe[2]) fmpy Charge[2] = Charge[2], IQ (pPipe[0]) add InnerCnt = -1, InnerCnt } ;;// INNER LOOP 5 { .mfi (pPipe[0]) ldfs JZ = [posPtr], 4 (pPipe[4]) fmpy FScalar1 = FScalar1, RInvTab[3] (pPipe[0]) add Ninner = 1, Ninner } { .mfi nop 0x0 (pPipe[4]) fma dVdATmp = GB_F[2], GBRT[2], GB_Y[2] nop 0x0 } ;;// INNER LOOP 6 { .mfi (pPipe[3]) ldfs FActX[0] = [FActPtr[3]], 4 (pPipe[4]) fma VNBTotal = C6[2], Disp_Y[2], VNBTotal (pJJNR) add jjnrPtr = JJNR_PREFETCH_DISTANCE, jjnrPtr } { .mfi nop 0x0 (pPipe[4]) fma VCTotal = Charge[4], GB_Y[2], VCTotal nop 0x0 } ;;// INNER LOOP 7 { .mfi (pPipe[3]) ldfs FActY[0] = [FActPtr[3]], 4 (pPipe[2]) fcvt.fx.trunc GBn0[0] = GBRT[0] (pPipe[2]) shladd TypeJ[2] = TypeJ[2], 3, NBFP } { .mfi nop 0x0 (pPipe[1]) fmpy isaJ[1] = isaJ[1], isaI nop 0x0 } ;;// INNER LOOP 8 { .mfi (pPipe[3]) ldfs FActZ[0] = [FActPtr[3]], -8 (pPipe[1]) frsqrta RInv[0], p0 = RSqr[1] nop 0x0 } { .mfi (pJJNR) lfetch.nta [jjnrPtr] (pPipe[2]) fcvt.fx.trunc n0[0] = RT[0] nop 0x0 } ;;// INNER LOOP 9 { .mfi (pPipe[0]) ldfs isaJ[0] = [isaPtr] (pPipe[3]) fma GB_G[1] = GBeps, GB_H[1], GB_G[1] nop 0x0 } { .mfi nop 0x0 (pPipe[4]) fnma FScalar1 = FijGB, RInvGBTab[3], FScalar1 nop 0x0 } ;;// INNER LOOP 10 { .mfi (pPipe[0]) ld4 TypeJ[0] = [TypeJ[0]] (pPipe[3]) fma Disp_G[1] = eps, Disp_H[1], Disp_G[1] (pJJNR) add jjnrPtr = -JJNR_PREFETCH_DISTANCE, jjnrPtr } { .mfi nop 0x0 (pPipe[4]) fma VNBTotal = C12[2], Rep_Y[2], VNBTotal nop 0x0 } ;;// INNER LOOP 11 { .mfi (pPipe[0]) ldfs Charge[0] = [chargePtr] (pPipe[4]) fnma.s dVdAJ[2] = Charge[4], dVdATmp, dVdAJ[2] nop 0x0 } { .mfi (pPipe[2]) getf.sig GBnnn = GBn0[0] (pPipe[2]) fcvt.xf GBn0[0] = GBn0[0] nop 0x0 } ;;// INNER LOOP 12 { .mfi nop 0x0 (pPipe[1]) fmpy RInvErr = RInv[0], RSqr[1] nop 0x0 } { .mfi (pPipe[2]) getf.sig nnn = n0[0] (pPipe[2]) fcvt.xf n0[0] = n0[0] nop 0x0 } ;;// INNER LOOP 13 { .mfi (pPipe[2]) ldfs C6[0] = [TypeJ[2]], 4 (pPipe[3]) fma GB_F[1] = GBeps, GB_G[1], GB_F[1] nop 0x0 } { .mfi nop 0x0 (pPipe[3]) fma GB_G[1] = GBeps, GB_H[1], GB_G[1] nop 0x0 } ;;// INNER LOOP 14 { .mfi (pPipe[2]) ldfs C12[0] = [TypeJ[2]] (pPipe[3]) fma Disp_F[1] = eps, Disp_G[1], Disp_F[1] (pPipe[1]) add TypeJ[1] = NTI, TypeJ[1] } { .mfi nop 0x0 (pPipe[3]) fma Disp_G[1] = eps, Disp_H[1], Disp_G[1] nop 0x0 } ;;// INNER LOOP 15 { .mfi (pPipe[2]) ldfs dVdAJ[0] = [dVdAPtr[2]] (pPipe[1]) fmpy Charge[1] = isaJ[1], Charge[1] nop 0x0 } { .mfi nop 0x0 (pPipe[3]) fma Rep_G[1] = eps, Rep_H[1], Rep_G[1] nop 0x0 } ;;// INNER LOOP 16 { .mfi nop 0x0 (pPipe[1]) fnma RInvErr = RInvErr, RInv[0], fOne nop 0x0 } { .mfi nop 0x0 (pPipe[4]) fnma.s FActX[1] = FScalar1, DX[4], FActX[1] nop 0x0 } ;;// INNER LOOP 17 { .mfi nop 0x0 (pPipe[3]) fma GB_Y[1] = GBeps, GB_F[1], GB_Y[1] nop 0x0 } { .mfi nop 0x0 (pPipe[3]) fma GB_F[1] = GBeps, GB_G[1], GB_F[1] (pPipe[2]) shladd GBnnn = GBnnn, 4, GBTab } ;;// INNER LOOP 18 { .mfi (pPipe[4]) stfs [dVdAPtr[4]] = dVdAJ[2] (pPipe[3]) fma Disp_Y[1] = eps, Disp_F[1], Disp_Y[1] (pPipe[2]) shladd nnn = nnn, 1, zero } { .mfi nop 0x0 (pPipe[3]) fma Disp_F[1] = eps, Disp_G[1], Disp_F[1] nop 0x0 } ;;// INNER LOOP 19 { .mfi nop 0x0 (pPipe[1]) fmpy isaJ[1] = isaJ[1], GBTabscale (pPipe[2]) shladd nnn = nnn, 4, VFTab } { .mfi nop 0x0 (pPipe[3]) fma Rep_F[1] = eps, Rep_G[1], Rep_F[1] nop 0x0 } ;;// INNER LOOP 20 { .mfi (pPipe[2]) ldfps GB_Y[0], GB_F[0] = [GBnnn], 8 (pPipe[1]) fma RInvT = RInvErr, f3_8, fHALF nop 0x0 } { .mfi nop 0x0 (pPipe[1]) fmpy RInvU = RInv[0], RInvErr nop 0x0 } ;;// INNER LOOP 21 { .mfi (pPipe[2]) ldfps GB_G[0], GB_H[0] = [GBnnn] (pPipe[0]) fsub DX[0] = IX, DX[0] nop 0x0 } { .mfi nop 0x0 (pPipe[3]) fma Rep_G[1] = eps, Rep_H[1], Rep_G[1] nop 0x0 } ;;// INNER LOOP 22 { .mfi (pPipe[2]) ldfps Disp_Y[0], Disp_F[0] = [nnn], 8 (pPipe[0]) fsub DY[0] = IY, DY[0] nop 0x0 } { .mfi nop 0x0 (pPipe[3]) fnma FScalar0 = Disp_F[1], C6[1], fZero nop 0x0 } ;;// INNER LOOP 23 { .mfi (pPipe[2]) ldfps Disp_G[0], Disp_H[0] = [nnn], 8 (pPipe[0]) fsub DZ[0] = IZ, DZ[0] nop 0x0 } { .mfi nop 0x0 (pPipe[4]) fnma.s FActY[1] = FScalar1, DY[4], FActY[1] nop 0x0 } ;;// INNER LOOP 24 { .mfi (pPipe[2]) ldfps Rep_Y[0], Rep_F[0] = [nnn], 8 (pPipe[1]) fma RInv[0] = RInvU, RInvT, RInv[0] nop 0x0 } { .mfi nop 0x0 (pPipe[4]) fnma.s FActZ[1] = FScalar1, DZ[4], FActZ[1] nop 0x0 } ;;// INNER LOOP 25 { .mfi (pPipe[2]) ldfps Rep_G[0], Rep_H[0] = [nnn] (pPipe[0]) fmpy RSqr[0] = DX[0], DX[0] nop 0x0 } { .mfi nop 0x0 (pPipe[3]) fma Rep_Y[1] = eps, Rep_F[1], Rep_Y[1] nop 0x0 } ;;// INNER LOOP 26 { .mfi nop 0x0 (pPipe[3]) fma Rep_F[1] = eps, Rep_G[1], Rep_F[1] nop 0x0 } { .mfi nop 0x0 (pPipe[4]) fnma dVdASum = Charge[4], dVdATmp, dVdASum nop 0x0 } ;;// INNER LOOP 27 { .mfi (pPipe[4]) stfs [FActPtr[4]] = FActX[1], 4 (pPipe[4]) fma FIX = DX[4], FScalar1, FIX nop 0x0 } { .mfi nop 0x0 (pPipe[4]) fma FIY = DY[4], FScalar1, FIY nop 0x0 } ;;// INNER LOOP 28 { .mfi (pPipe[4]) stfs [FActPtr[4]] = FActY[1], 4 (pPipe[1]) fmpy RInvGBTab[0] = RInv[0], isaJ[1] nop 0x0 } { .mfi nop 0x0 (pPipe[1]) fmpy RInvTab[0] = RInv[0], Tabscale nop 0x0 } ;;// INNER LOOP 29 { .mfi (pPipe[4]) stfs [FActPtr[4]] = FActZ[1] (pPipe[0]) fma RSqr[0] = DY[0], DY[0], RSqr[0] nop 0x0 } { .mfb nop 0x0 (pPipe[4]) fma FIZ = DZ[4], FScalar1, FIZ br.ctop.sptk.many innerLoop } ;;// End of modulo-scheduled inner loop // Having finshed the loop, we now compute various quantities to // store. In paralllel, start computing computing some of the values // for the next loop trip, if we're going there.// OUTER EPILOGUE 1 { .mfi (pCont) shladd typePtr = II, 2, TYPE fnorm.s VCTotal = VCTotal (pCont) shladd II3 = II, 1, II } { .mfi (pCont) shladd chargePtr = II, 2, CHARGE fnorm.s VNBTotal = VNBTotal (pCont) shladd IS3 = IS, 1, IS } ;;// OUTER EPILOGUE 2 { .mfi nop 0x0 fnorm.s dVdASum = dVdASum nop 0x0 } ;;// OUTER EPILOGUE 3 { .mfi (pCont) ld4 IS = [shiftPtr], 4 fadd.s FActIX = FActIX, FIX (pCont) shladd isaPtr = II, 2, INVSQRTA } { .mmf (pCont) setf.sig f33 = NTYPE nop 0x0 fadd.s FShiftX = FShiftX, FIX } ;;// OUTER EPILOGUE 4 { .mfi (pCont) ld4 NTI = [typePtr] fadd.s FActIY = FActIY, FIY (pCont) shladd shiftVPtr = IS3, 2, SHIFTVEC } { .mfi nop 0x0 fadd.s FShiftY = FShiftY, FIY (pCont) shladd posPtr = II3, 2, POSITION } ;;// OUTER EPILOGUE 5 { .mfi nop 0x0 fadd.s FActIZ = FActIZ, FIZ nop 0x0 } { .mfi nop 0x0 fadd.s FShiftZ = FShiftZ, FIZ nop 0x0 } ;;// OUTER EPILOGUE 6 { .mmi stfs [FActII] = FActIX, 4 stfs [FShiftIS] = FShiftX, 4 nop 0x0 } { .mmi stfs [VCPtr] = VCTotal (pCont) ld4 ggid = [gidPtr], 4 nop 0x0 } ;;// OUTER EPILOGUE 7 { .mmi stfs [dVdAIPtr] = dVdASum stfs [FActII] = FActIY, 4 shladd dVdAIPtr = II, 2, DVDA } { .mmi stfs [FShiftIS] = FShiftY, 4 (pCont) ld4 II = [iinrPtr] ,4 nop 0x0 } ;;// OUTER EPILOGUE 8 { .mmi stfs [FActII] = FActIZ stfs [VNBPtr] = VNBTotal (pCont) shladd FActII = II3, 2, FACTION } { .mib stfs [FShiftIS] = FShiftZ (pCont) shladd FShiftIS = IS3, 2, FSHIFT (pCont) br.cond.sptk.many outerLoop } ;; // Finish if this was the last chunk, or do another thread-loop iteration// THREAD EPILOGUE 1 { .mib nop 0x0 nop 0x0 (pMore) br.cond.sptk.many threadLoop } ;; // Ready to exit - restore the floating-point registers we saved, the // loop counter, and the predicates, then we're done. Note that the // stack pointer has the address of the last saved FP register.finish:// EXIT 1 { .mmi mov fillP0 = sp add fillP1 = 16, sp nop 0x0 } { .mmi st4 [OuterIter] = Nouter st4 [InnerIter] = Ninner nop 0x0 } ;;// EXIT 2 { .mmi ldf.fill fs14 = [fillP0], 32 ldf.fill fs13 = [fillP1], 32 nop 0x0 } ;;// EXIT 3 { .mmi ldf.fill fs12 = [fillP0], 32 ldf.fill fs11 = [fillP1], 32 nop 0x0 } ;;// EXIT 4 { .mmi ldf.fill fs10 = [fillP0], 32 ldf.fill fs9 = [fillP1], 32 nop 0x0 } ;;// EXIT 5 { .mmi ldf.fill fs8 = [fillP0], 32 ldf.fill fs7 = [fillP1], 32 nop 0x0 } ;;// EXIT 6 { .mmi ldf.fill fs6 = [fillP0], 32 ldf.fill fs5 = [fillP1], 32 mov ar.lc = LCSave } ;;// EXIT 7 { .mmi ldf.fill fs4 = [fillP0], 32 ldf.fill fs3 = [fillP1], 32 mov pr = PRSave, 0x1ffff } ;;// EXIT 8 { .mmi ldf.fill fs2 = [fillP0], 32 ldf.fill fs1 = [fillP1], 32 add sp = 14 * 16, sp } ;;// EXIT 9 { .mmb ldf.fill fs0 = [fillP0] nop 0x0 br.ret.sptk.few rp } ;; .endp nb_kernel430_ia64_single
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?