I am generating some operating codes dynamically in the JIT compiler, and I am looking for recommendations for aligning the operation code.
1) I read comments that briefly “recommend” alignment by adding nops after calls
2) I also read about using nop to optimize sequences for parallelism.
3) I read that ops alignment is useful for cache performance
Usually these comments do not provide any supporting links. The only thing you need to read on a blog or in a comment that says “a good idea to do this and that” and the other is to write a compiler that implements certain sequences of operations and implements most of the materials on the Internet, especially on blogs, is not useful for practical use. Thus, I believe that I myself understand (disassembly, etc., to see what real applications in the world do). This is one case when I need external information.
I notice that compilers usually run an odd byte instruction right after any previous sequence of instructions. Therefore, in most cases, the compiler does not take special care. I see "nop" here or there, but it usually seems like nop is used sparingly, if at all. How critical is the alignment of the opcode? Can you provide links to cases that I can really use for implementation? Thank.
source
share