@@ -462,11 +462,9 @@ def step(acc, trueK, lead, blgp):
462462 kkkm = trueK % block
463463 _check_mfma_operand (tA [km ][kkkm ], threads , fn ,
464464 tile )
465- return writer .call (
466- fn , vtype , tA [km ][kkkm ], lead , acc ,
467- scale , kkm , blgp ,
468- hint = 'acc' , movable = False ,
469- materialize = True , layout = acclayout )
465+ return tile .op .mac (
466+ writer , vtype , tA [km ][kkkm ], lead , acc ,
467+ scale , kkm , blgp )
470468
471469 # Two counts of the contraction meet here. The
472470 # shared matrix is transposed a block of lanes at
@@ -617,13 +615,10 @@ def step(acc, trueK, lead, blgp):
617615 # accumulator, so the chain is
618616 # naturally SSA -- each step reads the
619617 # previous result.
620- acc = writer . call (
621- fn , vtype ,
618+ acc = tile . op . mac (
619+ writer , vtype ,
622620 tA [km ][kkkm ], tB [kkk ], acc ,
623- scale , kkm , 0 ,
624- hint = 'acc' , movable = False ,
625- materialize = True ,
626- layout = acclayout )
621+ scale , kkm , 0 )
627622
628623 for jj in range (min (block , N - j )):
629624 C (writer , _column (writer , tile , acc , jj , ftype ),
@@ -696,12 +691,10 @@ def write_wide(tile, start, end):
696691 _check_mfma_operand (a , threads , fn ,
697692 tile )
698693 for h in range (width ):
699- accs [h ] = writer . call (
700- fn , vtype , a ,
694+ accs [h ] = tile . op . mac (
695+ writer , vtype , a ,
701696 writer .extract (rows , h , ftype ),
702- accs [h ], scale , t // block , 0 ,
703- hint = 'acc' , movable = False ,
704- materialize = True )
697+ accs [h ], scale , t // block , 0 )
705698 for jj in range (min (block , N - j )):
706699 C (writer , writer .pack (wtype , * (
707700 _column (writer , tile , acc , jj , ftype )
@@ -785,7 +778,6 @@ def matmulemu(writer: Writer, C, B, A, M, N, K, kx, threads, dtype, sparse,
785778 ftype = ScalarType (dtype )
786779 block = tile .block
787780 scale = tile .scale (threads )
788- fn = op .callee
789781 # The split's outputs, and the instruction's operands. Not `dtype`:
790782 # that is what the accumulator keeps, and reaching it is the whole
791783 # reason there is more than one product.
@@ -848,12 +840,10 @@ def split4(regs, hint):
848840 kkm = kk // width
849841 for j in blocks :
850842 for ti , tj in products :
851- accs [j ] = writer . call (
852- fn , vtype ,
843+ accs [j ] = op . mac (
844+ writer , vtype ,
853845 aterms [(j , k // threads )][ti ], bterms [tj ],
854- accs [j ], scale , kkm , 0 ,
855- hint = 'acc' , movable = False ,
856- materialize = True , layout = acclayout )
846+ accs [j ], scale , kkm , 0 )
857847
858848 for j in blocks :
859849 for jj in range (min (block , N - j )):
0 commit comments