3 ms·
INTO. It signals int 0x04 if the instruction is executed while the overflow flag is set due to a prior signed arithmetic operation wrapping. It seems I misspo
by bleepblorp 6y ago
INTO.
It signals int 0x04 if the instruction is executed while the overflow flag is set due to a prior signed arithmetic operation wrapping.
It seems I misspoke somewhat; there is somewhat equivalent functionality in x64 in the JO instructions, but they're six bytes rather than one and the extra size could have cache and/or memory bandwidth impacts under demanding circumstances.
- chrisseaton 6y agoYeah I knew about jo, and I think add-jo is even fused, but without a trap you have to write code everywhere to handle the overflow which you wouldn’t need if you had a trap. And of course jo doesn’t work for address arithmetic. That’s where the real overhead is.
- BeeOnRope 6y agoUnfortunately jo is not fused on Intel chips, which is a bit surprising.
- raverbashing 6y agoCausing an interrupt is much more expensive than having a jump that won't be taken most of the time
- deleted 6y ago[deleted]
- rightbyte 6y agoUsually you don't really care that much about the overflow cost if it is an error right?
- raverbashing 6y agoTrue but do you care for all sums/muls in your code? Might be better to check where exactly can you have the overflows and test in the code for those cases. I think checking for overflows over the entire code is useful for testing/validation purposes but not really useful in production. Or use bigger data types if you're hitting overflows frequently.
- chrisseaton 6y ago> Might be better to check where exactly can you have the overflows and test in the code for those cases. Compilers already track possible ranges and do this.