394def saEpilogue = (lambda unrestricted seq : Nat . (lambda unrestricted heads : Nat . (lambda unrestricted tail : (family SM86Program) .
395 (let unrestricted rowBytes = (naturalMultiply heads (naturalMultiply saHeadWidth saHalfBytes)) in
396 (saFor 2 (lambda unrestricted h : Nat . (lambda unrestricted rest : (family SM86Program) .
397 (saShfl (saTmp 2) (saL h) 1 saWait3
398 (saFadd (saL h) (saL h) (saTmp 2) saWait5
399 (saShfl (saTmp 2) (saL h) 2 saWaitNone
400 (saFadd (saL h) (saL h) (saTmp 2) saWait5
401 (saMufu (saForwardReciprocal h) (saL h) (constructor SM86MultiFunction SM86Reciprocal) saWaitNone
402 (saMufu (saTmp (naturalAdd 6 h)) (saL h) (constructor SM86MultiFunction SM86LogarithmBase2) saWaitNone
403 (saFor 16 (lambda unrestricted i : Nat .
404 (let unrestricted e = (saElem (saO (naturalDivideUnchecked i 2)) h (naturalModuloUnchecked i 2)) in
405 (saFmul e e (saForwardReciprocal h) (naturalSelect (naturalIsZero i) saWait4 saWaitNone))))
406 (saFadd (saM h) (saM h) (saTmp (naturalAdd 6 h)) saWaitNone
407 rest))))))))))
408 -- the output: this thread's rows r and r + 8, columns 8 nt + 2 (lane % 4)
409 (saWide saForwardOutputPointer saScratch saOne (saArgument 3)
410 (saFor 16 (lambda unrestricted i : Nat .
411 (let unrestricted nt = (naturalDivideUnchecked i 2) in (let unrestricted h = (naturalModuloUnchecked i 2) in
412 (lambda unrestricted rest : (family SM86Program) .
413 (saPack (saForwardOutputPackRegister i) (succ (saElem (saO nt) h 0)) (saElem (saO nt) h 0)
414 (saOp (saStore saForwardOutputPointer (saForwardOutputPackRegister i) (naturalAdd (naturalMultiply nt 16) (naturalMultiply h (naturalMultiply 8 rowBytes))) saWaitNone)
415 rest))))))
416 -- the log-sum-exp, by the quad's first lane
417 (saWide saForwardLogSumPointer saRow saOne (saArgument 4)
418 (saGreater saP0 saQuadLane 0
419 (saUnless saP0 (saStore saForwardLogSumPointer (saM 0) 0 saWaitNone)
420 (saUnless saP0 (saStore saForwardLogSumPointer (saM 1) 32 saWaitNone)
421 tail)))))))))))The compiler supplied declaration spans and resolved links from this source snapshot. This page does not assert that this file belongs to a checked closure.