Instead of maintaining a special index state for "out-of-range" during linearization, just add the size of the whole histogram whenever any axis index is out of range. This assures that the final index is past the end, which can be easily detected. This should further reduce the instructions.
Instead of maintaining a special index state for "out-of-range" during linearization, just add the size of the whole histogram whenever any axis index is out of range. This assures that the final index is past the end, which can be easily detected. This should further reduce the instructions.