4 ms·
Actually, nasm does have optimization passes. https://nasm.us/doc/nasmdoc2.html#section-2.1.24 https://nasm.us/doc/nasmdoc2.html#section-2.1.24 That's not full
by glandium 5y ago
Actually, nasm does have optimization passes. https://nasm.us/doc/nasmdoc2.html#section-2.1.24 https://nasm.us/doc/nasmdoc2.html#section-2.1.24 That's not full of details, but one thing that it does on x86_64, for example is replace instructions that set 64-bits registers to immediate values smaller than 2^32 with instructions that set the equivalent 32-bits register (because that's a shorter equivalent, because those instructions zero-extend the value).
- pjmlp 5y agoThat is common in most Assemblers, RISC ones like MIPS even go further with pseudo instructions to work around how low level RISC opcodes tend to be.