From 72123970c7d0465ca090fdd7f37dc1bfa0887e86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Povi=C5=A1er?= Date: Mon, 7 Aug 2023 15:51:40 +0200 Subject: [PATCH] fixup! peepopt: Add 'bmux' and 'wshift' modes for testing --- passes/pmgen/peepopt_shiftmul_right.pmg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/passes/pmgen/peepopt_shiftmul_right.pmg b/passes/pmgen/peepopt_shiftmul_right.pmg index ff30a3b17b2..23f00d38cf6 100644 --- a/passes/pmgen/peepopt_shiftmul_right.pmg +++ b/passes/pmgen/peepopt_shiftmul_right.pmg @@ -94,11 +94,12 @@ code int validbits = std::min(GetSize(out), GetSize(shift_vector) - i * shift_stride); bmux_vector.append(shift_vector.extract(i * shift_stride, validbits)); + bmux_vector.append(SigSpec(padbit, GetSize(out) - validbits)); } // Prep the select signal SigSpec bmux_sel = mul_din; - bmux_sel.extend_u0(ceil_log2(GetSize(bmux_vector))); + bmux_sel.extend_u0(ceil_log2((GetSize(bmux_vector) + GetSize(out) - 1) / GetSize(out))); // Pad the vector int vector_targetlen = GetSize(out) << GetSize(bmux_sel);