mirror of https://github.com/YosysHQ/yosys.git
alumacc: Move undersize check
Don't add undersized arithmetic to the pool of mergeable nodes (though a `wreduce` prior should make undersized output impossible).
This commit is contained in:
parent
2942aa76f5
commit
c1450b54e4
|
|
@ -380,7 +380,10 @@ struct AlumaccWorker
|
|||
alunode->c = C;
|
||||
alunode->y = n->y;
|
||||
|
||||
sig_alu[RTLIL::SigSig(A, B)].insert(alunode);
|
||||
// only consider merging if the output is at least as wide as the inputs
|
||||
if (max(GetSize(A), GetSize(B)) <= GetSize(n->y)) {
|
||||
sig_alu[RTLIL::SigSig(A, B)].insert(alunode);
|
||||
}
|
||||
delete_nodes.insert(n);
|
||||
next_macc:;
|
||||
}
|
||||
|
|
@ -432,10 +435,6 @@ struct AlumaccWorker
|
|||
// comparators need subtraction
|
||||
return false;
|
||||
}
|
||||
if (max(GetSize(cmp_A), GetSize(cmp_B)) > GetSize(node->y)) {
|
||||
// must have at least as many output bits
|
||||
return false;
|
||||
}
|
||||
if (is_signed != node->is_signed) {
|
||||
if (GetSize(cmp_A) != GetSize(cmp_B)) {
|
||||
// mismatched input widths are problematic when mixing signedness
|
||||
|
|
|
|||
Loading…
Reference in New Issue