-
Fix break statement. · 6d12331aNicolas Capens authored
The break 'depth' was used to indicate the number of if/else execution enable mask's stack levels we need to discard when jumping from a break statement to its enclosing switch or loop. However, each switch and loop resets this depth at the end, which isn't correct for nested loops and/or switches (note that switches contain if/else statements, and loops use the same 'enable' masks as if/else). This can be fixed either by using a stack to keep track of the break depths of nested switch/loop statements, or by simply not jumping directly from the break statement to the end of it's enclosing switch or loop. The latter fix was chosen for this change, which assumes that that it's uncommon for all vector lanes to become disabled at the break statement and skip many instructions. An important exception to this is breaking out of an infinite or long-running loop, but this is handled by checking the break enable mask as part of the loop condition. Change-Id: I57d2e03941e855faefd997442931ff8619eca73f Reviewed-on: https://swiftshader-review.googlesource.com/15968Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
6d12331a
×