xls
xls copied to clipboard
Priority select over data from receives can be turned into n-ary OR
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.