diff options
author | Eddie Hung <eddie@fpgeh.com> | 2019-07-19 13:11:48 -0700 |
---|---|---|
committer | Eddie Hung <eddie@fpgeh.com> | 2019-07-19 13:11:48 -0700 |
commit | bcd802718256efbacaf0a73f99347af40b61e464 (patch) | |
tree | 9b62f49151144421e02100660b15c09decda6fc1 | |
parent | 5bd088a686ce040c39a8353cf3a7cfe31581d635 (diff) | |
download | yosys-bcd802718256efbacaf0a73f99347af40b61e464.tar.gz yosys-bcd802718256efbacaf0a73f99347af40b61e464.tar.bz2 yosys-bcd802718256efbacaf0a73f99347af40b61e464.zip |
Also optimise MSB of $sub
-rw-r--r-- | passes/opt/wreduce.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/passes/opt/wreduce.cc b/passes/opt/wreduce.cc index e8c2cb726..dff1c5370 100644 --- a/passes/opt/wreduce.cc +++ b/passes/opt/wreduce.cc @@ -342,9 +342,9 @@ struct WreduceWorker } } - if (cell->type.in("$pos", "$add", "$mul", "$and", "$or", "$xor")) + if (cell->type.in("$pos", "$add", "$mul", "$and", "$or", "$xor", "$sub")) { - bool is_signed = cell->getParam("\\A_SIGNED").as_bool(); + bool is_signed = cell->getParam("\\A_SIGNED").as_bool() || cell->type == "$sub"; int a_size = 0, b_size = 0; if (cell->hasPort("\\A")) a_size = GetSize(cell->getPort("\\A")); @@ -352,7 +352,7 @@ struct WreduceWorker int max_y_size = max(a_size, b_size); - if (cell->type == "$add") + if (cell->type.in("$add", "$sub")) max_y_size++; if (cell->type == "$mul") |