By: EduardoS (no.delete@this.spam.com), February 26, 2013 2:55 am
Room: Moderated Discussions
Paul A. Clayton (paaronclayton.delete@this.gmail.com) on February 25, 2013 8:18 pm wrote:
> The concept of explicitly testing for arithmetic overflow for every possible operation seems excessive.
> Generating an exception (handled in user mode) would seem to avoid excessive test instructions.
Yes and no:
Yes for, really, testing every instruction is a pain, but required in some cases;
No for, instead of testing when required means every instruction will pay the opcode space tax, even the check is only needed in some cases*
*This is a case of historical compatibility with the wrong thing, in fact for most cases the silent overflow is not really the desired behaviour but acceptable, then where this behaviour was the intent behaviour the code silent assumes it is and is the code wich does not accept a silent overflow that pay the tax, eventually the programmer forgot to pay such a tax and bugs happens, we wouldn't be having this discussion if in the begging of computing the default behaviour were more wisely choosen.
> The concept of explicitly testing for arithmetic overflow for every possible operation seems excessive.
> Generating an exception (handled in user mode) would seem to avoid excessive test instructions.
Yes and no:
Yes for, really, testing every instruction is a pain, but required in some cases;
No for, instead of testing when required means every instruction will pay the opcode space tax, even the check is only needed in some cases*
*This is a case of historical compatibility with the wrong thing, in fact for most cases the silent overflow is not really the desired behaviour but acceptable, then where this behaviour was the intent behaviour the code silent assumes it is and is the code wich does not accept a silent overflow that pay the tax, eventually the programmer forgot to pay such a tax and bugs happens, we wouldn't be having this discussion if in the begging of computing the default behaviour were more wisely choosen.