I just discovered this intel extension and was curious about it’s application in Rust. Since rust has very little raw pointer access, maybe it could be used for array access or as an extra precaution in unsafe code?
Things like slice lengths might be able to be offloaded to the range registers, but unfortunately, MPX bounds checks will always result in a #BR exception on failure, so they can’t be handled nicely.
That would impose overhead on the out of bounds case, but I don’t think we really care too much about how fast you can panic. The more important thing to look at is the performance of in bounds access.
Are you suggesting MPX is only used for e.g. slice::index but not for slice::get? I don’t think that’s going to give any significant performance gains since you’ll need to convert between representations often.