aboutsummaryrefslogtreecommitdiffstats
path: root/passes
diff options
context:
space:
mode:
authorclairexen <claire@symbioticeda.com>2020-08-20 16:23:07 +0200
committerGitHub <noreply@github.com>2020-08-20 16:23:07 +0200
commit799076af24ef31e8611bd99180760e7d8cd5a771 (patch)
tree7b6e9159b8eb04e9c4ead4739e84293a4a2e5041 /passes
parent6a68b8ed542b89f32303c8036ae0b698d90f8c2b (diff)
parentc1ed1c28be9bd9880cc036d13f43294bf257788b (diff)
downloadyosys-799076af24ef31e8611bd99180760e7d8cd5a771.tar.gz
yosys-799076af24ef31e8611bd99180760e7d8cd5a771.tar.bz2
yosys-799076af24ef31e8611bd99180760e7d8cd5a771.zip
Merge pull request #2333 from YosysHQ/mwk/peepopt-shiftmul-signed
peeopt.shiftmul: Add a signedness check.
Diffstat (limited to 'passes')
-rw-r--r--passes/pmgen/peepopt_shiftmul.pmg6
1 files changed, 1 insertions, 5 deletions
diff --git a/passes/pmgen/peepopt_shiftmul.pmg b/passes/pmgen/peepopt_shiftmul.pmg
index d4748ae19..d71fbf744 100644
--- a/passes/pmgen/peepopt_shiftmul.pmg
+++ b/passes/pmgen/peepopt_shiftmul.pmg
@@ -31,22 +31,18 @@ match mul
select mul->type.in($mul)
select port(mul, \A).is_fully_const() || port(mul, \B).is_fully_const()
index <SigSpec> port(mul, \Y) === shamt
+ filter !param(mul, \A_SIGNED).as_bool()
endmatch
code
{
IdString const_factor_port = port(mul, \A).is_fully_const() ? \A : \B;
- IdString const_factor_signed = const_factor_port == \A ? \A_SIGNED : \B_SIGNED;
Const const_factor_cnst = port(mul, const_factor_port).as_const();
int const_factor = const_factor_cnst.as_int();
if (GetSize(const_factor_cnst) == 0)
reject;
- if (const_factor_cnst.bits[GetSize(const_factor_cnst)-1] != State::S0 &&
- param(mul, const_factor_signed).as_bool())
- reject;
-
if (GetSize(const_factor_cnst) > 20)
reject;