Skip to content

Commit

Permalink
cst_shift
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhishek-Varma committed Feb 14, 2025
1 parent f3baa79 commit 07421e1
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ func.func @matmul_trunci(%arg0: tensor<${M}x${K}x${TYPE1}>, %arg1: tensor<${K}x$
{
%cst = arith.constant ${ZERO} : ${TYPE2}
%cst_mul = arith.constant 10 : ${TYPE_MUL_RESULT}
%cst_div = arith.constant 7 : ${TYPE_MUL_RESULT}
%cst_shift = arith.constant 7 : ${TYPE_MUL_RESULT}
%0 = tensor.empty() : tensor<${M}x${N}x${TYPE2}>
%i8out = tensor.empty() : tensor<${M}x${N}x${TYPE1}>
%1 = linalg.fill ins(%cst : ${TYPE2}) outs(%0 : tensor<${M}x${N}x${TYPE2}>) -> tensor<${M}x${N}x${TYPE2}>
Expand All @@ -25,7 +25,7 @@ func.func @matmul_trunci(%arg0: tensor<${M}x${K}x${TYPE1}>, %arg1: tensor<${K}x$
^bb0(%in: ${TYPE2}, %out: ${TYPE1}):
%4 = arith.extsi %in : ${TYPE2} to ${TYPE_MUL_RESULT}
%5 = arith.muli %4, %cst_mul : ${TYPE_MUL_RESULT}
%6 = arith.shrsi %5, %cst_div : ${TYPE_MUL_RESULT}
%6 = arith.shrsi %5, %cst_shift : ${TYPE_MUL_RESULT}
%7 = arith.trunci %6 : ${TYPE_MUL_RESULT} to ${TYPE1}
linalg.yield %7 : ${TYPE1}
} -> tensor<${M}x${N}x${TYPE1}>
Expand Down

0 comments on commit 07421e1

Please sign in to comment.