xls icon indicating copy to clipboard operation
xls copied to clipboard

Priority select over data from receives can be turned into n-ary OR

Open taktoa opened this issue 2 years ago • 0 comments

If you have code like

if (p) {
  y = recv(...);
} else if (q) {
  y = recv(...);
} else {
  y = recv(...);
}

where the channels can be different between the receives, then you can turn the resultant priority select into an OR over the data output of the receives, since when the predicate (propagated from the if-then-else) on each receive is false, the output is all zeros.

taktoa avatar Apr 26 '22 18:04 taktoa