Commit 187f4e8
authored
[CombToDatapath] Lower comb::SubOp (#9053)
Adds support for lowering comb::SubOp in the CombToDatapath conversion
pass by refactoring the SubOp-to-AddOp conversion into a shared utility
function that can be reused across multiple conversion passes.
This commit extracts the subtraction lowering logic from CombToSynth
into a dialect-agnostic utility function `comb::convertSubToAdd` that
transforms `sub(lhs, rhs)` into `add(lhs, ~rhs, 1)` using two's
complement representation.
AIG logic depth improved 29 -> 24 for i128 subtraction1 parent 81ff229 commit 187f4e8
File tree
6 files changed
+40
-22
lines changed- include/circt/Dialect/Comb
- lib
- Conversion
- CombToDatapath
- CombToSynth
- Dialect/Comb
- test/Conversion
- CombToDatapath
- CombToSynth
6 files changed
+40
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
89 | 93 | | |
90 | 94 | | |
91 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| |||
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| 110 | + | |
109 | 111 | | |
110 | 112 | | |
111 | 113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
855 | 855 | | |
856 | 856 | | |
857 | 857 | | |
858 | | - | |
859 | | - | |
860 | | - | |
861 | | - | |
862 | | - | |
863 | | - | |
864 | | - | |
865 | | - | |
866 | | - | |
867 | | - | |
868 | | - | |
869 | | - | |
870 | | - | |
871 | | - | |
872 | | - | |
873 | | - | |
874 | | - | |
875 | | - | |
876 | | - | |
877 | 858 | | |
878 | 859 | | |
879 | 860 | | |
| |||
1376 | 1357 | | |
1377 | 1358 | | |
1378 | 1359 | | |
1379 | | - | |
| 1360 | + | |
1380 | 1361 | | |
1381 | 1362 | | |
1382 | 1363 | | |
1383 | 1364 | | |
1384 | 1365 | | |
1385 | 1366 | | |
| 1367 | + | |
| 1368 | + | |
1386 | 1369 | | |
1387 | 1370 | | |
1388 | 1371 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
217 | 218 | | |
218 | 219 | | |
219 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
220 | 237 | | |
221 | 238 | | |
222 | 239 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
29 | 40 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
| 150 | + | |
150 | 151 | | |
151 | | - | |
| 152 | + | |
152 | 153 | | |
153 | 154 | | |
154 | 155 | | |
| |||
0 commit comments