3 ms·
I'm not sure about the current state of compiler optimisations, but IIRC in the olde-days, a not not in an if() statement would assemble to JZ, saving a clock
by cmroanirgo 6y ago
I'm not sure about the current state of compiler optimisations, but IIRC in the olde-days, a not not in an if() statement would assemble to JZ, saving a clock cycle (& an opcode?), and wouldn't need to stall to load in the full width of the register.
Today's branch predicting compilers are beyond me.
I still use it as a clarification that it's a deliberate boolean operation, rather than implicit.
- user-the-name 6y agoI highly doubt that any modern compiler would generate different code with or without the !!. Not even sure why an old compiler would do that? It's the exact same semantics, surely.