| 数据搜索系统,热门电子元器件搜索 |
|
ST20C2 数据表(PDF) 29 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
ST20C2 数据表(HTML) 29 Page - STMicroelectronics |
|
29 / 212 page ![]() 29/212 ® 4.2.2 Evaluating minimal symbol offsets Several primary instructions have an operand that is an offset between the current value of the instruction pointer and some other part of the code. Generating the optimal prefix sequence to create the instruction data value for one of these instructions is more complicated. This is because two, or more, instructions with offset operands can interlock so that the minimal prefix sequences for each instruction is dependent on the prefixing sequences used for the others. For example consider the interlocking jumps below which can be prefixed in two distinct ways. The instructions j and cj are respectively jump and conditional jump. These are explained in more detail later. The sequence: cj +16; j -257 can be coded as pfix 1; cj 0; pfix 1; nfix 0; j 15 but this can be optimized to be cj 15; nfix 15; j 1 which is the encoding for the sequence cj +15; j -255 This is because when the two offsets are reduced, their prefixing sequences take 1 byte less so that the two interlocking jumps will still transfer control to the same instructions as before. This compaction of non-optimal prefix sequences is difficult to perform and a better method is to slowly build up the prefix sequences so that the optimal solution is achieved. The following algorithm performs this. 1 Associate with each jump instruction or offset load an ‘estimate’ of the number of bytes required to code it and initially set them all to 0. 2 Evaluate all jump and load offsets under the current assumptions of the size of prefix sequences to the jumps and offset loads 3 For each jump or load offset set the number of bytes needed to the number in the shortest sequence that will build up the current offset.† 4 If any change was made to the number of bytes required then go back to 2 oth- erwise the code has reached a stable state. The stable state that is achieved will be the optimal state. Steps 2 and 3 can be combined so that the number of bytes required by each jump is updated as the offset is calculated. This does mean that if an estimate is increased then some previously calculated offsets may have been invalidated, but step 4 forces another loop to be performed when those offsets can be corrected. By initially setting the estimated size of offsets to zero, all jumps whose destination is the next instruction are optimized out. † Where the code being analyzed has alignment directives, then it is possible that this algorithm will not reach a stable state. One solution to this, is to allow the algorithm to increase the instruction size but not allow it to reduce the size. This is achieved by modifying stage 3 to choose the larger of: the currently calculated length, and the previously calculated length. This approach does not always lead to minimal sized code, but it guarantees termination of the algorithm. |
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |