2014-12-15 16:55 GMT-02:00 Paulo Pinto via Digitalmars-d < [email protected]>: > > On Monday, 15 December 2014 at 16:30:14 UTC, Ola Fosheim Grøstad wrote: > >> Any thoughts on how the upcoming hardware supported bounds checking from >> Intel will affect D? >> >> http://en.wikipedia.org/wiki/Intel_MPX >> >> Chapter 9 in: >> >> https://software.intel.com/sites/default/files/managed/ >> 0d/53/319433-022.pdf >> > > Interesting, given that bounds checking support is an old feature > > http://x86.renejeschke.de/html/file_module_x86_id_18.html > > If I remember my Assembly days in the 90's BOUND was slower than doing the > check explicitly. > > I guess now it is way faster and the MMU is doing it instead. >
Actually, MPX provides a complete infra-structure for bounds-checking, including special-purpose registers (4 of them), a bounds directory/tables for storing/loading linearized pointer addresses, specific instructions to independently make/check upper/lower bounds, and even modified versions of call/ret/jump. They are working in the ABI level so calling conventions can benefit from it. Although MPX currently supports only statically allocated arrays, a memory-protected version of glibc is on the way: https://software.intel.com/en-us/blogs/2013/07/22/intel-memory-protection-extensions-intel-mpx-support-in-the-gnu-toolchain I've tried out the MPX-enabled GCC version and it looks pretty cool. -- Leandro
