From: anonymous c. <nas...@us...> - 2013-12-19 12:35:51
|
> Apparently [nosplit eax] is treated as if it was [nosplit eax*1], which > was a deliberate patch introduced by Debbie in 0.98.34. This is rather > unexpected behavior, and I would really like to change it so that > nosplit means "the term with the multiplication is the index". This is > a change, but does anyone anticipate a problem with doing this? tl;dr = keep NOSPLIT unchanged, but prevent *2 opt with MPX Historically NASM's goal has always been to emit the shortest possible encoding. As a result, (nobase+)reg(*1) becomes just reg (which does emit a sib-less encoding), and (nobase+)reg*2 becomes reg+reg*1 (which does emit a disp-less sib encoding rather than a sib encoding with a signed dword disp). To give a user the ability to emit the longer encodings when desired, the NOSPLIT qualifier was added. Initially it only handled the case of *2 (and that is documented) but eventually support for *1 got added as well (but apparently not documented properly). Under http://sourceforge.net/p/nasm/feature-requests/5/ you can see the original feature request. From me, actually. :) That said, NOSPLIT is working as intended (though the *1 case ought to be documented). Please refrain from breaking it, since that will break existing code. Likewise, please don't change the existing reg*1 or reg*2 behavior, i.e. don't suddenly interpret an explicit *1 or *2 as a request for a longer encoding -- since that too will break existing code. In terms of BNDMK, BNDLDX, and BNDSTX, the [reg] case as well as the [NOSPLIT reg] case are fine. The [NOSPLIT reg*2] case is fine as well (though BNDLDX and BNDSTX now need a warning for the resulting scale=2); however, the [reg*2] case is of course problematic since NASM turns it into [reg+reg] which has a base that the user did not specify. Since MPX is new, it looks like disabling that case of *2 splitting is the right choice. |