Assembly. Should instructions be aligned even in architectures that allow data to be biased?

I know that some little-endian architectures, such as Intel x86, allow unbalanced data access. Of course, intuitively, misalignment is not very smart, as it can degrade performance (not necessary for modern chips as protected here ). Thus, non-aligned data accesses may not be very good, but they are legitimate in some architectures. Good.

Until recently, I thought the same thing applies to unfolded instructions: if a given processor handles misalignment in the data, what could prevent it from doing the same with the code? However, Linda Null's book ( here ) says quite clearly:

Typically, a real compromise involves using two to three instruction lengths that provide bit patterns that are easily distinguishable and simply decoded. The length of the instruction should also be compared with the word length on the machine. If the length of the command is exactly equal to the length of the word, the instructions are completely saved when stored in the main memory. Instructions should always be aligned according to the words to explain the reasons. Therefore, instructions that make up half, quarter, double or triple the actual size of a word can lose space. Variable-length instructions are clearly not the same size and should be aligned according to the words, which also leads to a loss of space.

On the other hand, many books in Google books naturally deal with non-standard instructions. So my questions are:

  • , ?
  • - , ? , .

?

, . , !

+4
1

, . , endiannes. , . , , endiannes, endianess , .

x86 8- , , 8 16- , , , , , , . , .

MIPS, , , , , , -endian, -, . . MIPS , , , , , , , . , , / 32- , .

ARM, , ARM7TDMI , , , ARM ARM , , ( , ). - x86, , , - , , . , , , BE-32 BE-8 armv6, , . , xscale, , , ( ?), (BE-32) , , , , . , , , . / . 16- , 2, , , 16- , 32- . 16- , , . x86.

RISC CISC, RISC , , - RISC CISC. , / ​​, (xscale vs ARM7TMDI).

, , . , , , , . , , , . 8- , . , , SATA PATA. , , ( , , pci, ethernet). , , .

+2

Source: https://habr.com/ru/post/1669385/


All Articles