def q8_dot
import bendtorch@1.3.0.0/dtype.bend as Dtypeimport Base
453# Σ_l x[xi + l] · q[qe + l] for l < k, in order, from acc
454def q8_dot(k: Nat, +xi: U32, +qe: U32, +acc: F32, rx: Array<F32> & F32, rq: Array<U32> & U32) -> QD:
455 match k rx rq:
456 case 0n Tuple{x, v} Tuple{q, w}:
457 QD{x, q, acc}
458 case 1n+p Tuple{x, +v} Tuple{q, +w}:
459 q8_dot(p, (xi + 1 : U32), (qe + 1 : U32), (acc + (v * q8_at(qe, w) : F32) : F32), Array.get(F32, x, (xi + 1 : U32)), Array.get(U32, q, U32.shrn((qe + 1 : U32), 2n)))