You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For 'uniform' type switch expressions, this should be a very straightforward mapping to the LLVM SwitchInst.
How to efficiently implement it for 'varying' switch expressions is an interesting question. A correct-but-possibly-slow baseline would be to transform it into the equivalent set of if/elses, updating the mask at each block. One could also imagine something more efficient along the lines of:
lanes = current active simd lanes
while (lanes != 0) {
find first lane in lanes that is on
figure out which switch target it wants to jump to
figure out which other active lanes, if any, want to jump to that target
set the mask accordingly
run the code for those lanes
update 'lanes' to turn off the bits for the lanes that just ran
}
The text was updated successfully, but these errors were encountered:
It would be good to add support for 'switch'.
For 'uniform' type switch expressions, this should be a very straightforward mapping to the LLVM SwitchInst.
How to efficiently implement it for 'varying' switch expressions is an interesting question. A correct-but-possibly-slow baseline would be to transform it into the equivalent set of if/elses, updating the mask at each block. One could also imagine something more efficient along the lines of:
lanes = current active simd lanes
while (lanes != 0) {
find first lane in lanes that is on
figure out which switch target it wants to jump to
figure out which other active lanes, if any, want to jump to that target
set the mask accordingly
run the code for those lanes
update 'lanes' to turn off the bits for the lanes that just ran
}
The text was updated successfully, but these errors were encountered: