xls
xls copied to clipboard
Priority Selects on Arrays
Currently, priority selects do not codegen for arrays. I have a fix incoming, but the fix has an issue: priority selects on different array types with the same element type do not dedup. For example, priority selects on bits[16][4] and bits[16][2] will both do elementwise priority selects in codegen, e.g.:
a[0] = priority_sel_function0(sel, x[0], y[0]);
a[1] = ...
b[0] = priority_sel_function1(sel, g[0], h[0]);
...
The element types are the same, so they could use the same function- but they don't.
The reason is that the function name (which is used to dedup) is based on the op. Arrays are weird because they need to be done elementwise. Array priority selects should probably get names based only on their elements, but it's a bit ugly to make that happen.