< Compile Options / Object Options >
When the instalign8 option is specified, the instruction at the location address is aligned to the 8-byte boundary. |
Instruction alignment is performed only when the instruction at the specified location exceeds the address which is a multiple of the alignment value (8)*1. |
The following three types of branch destination can be selected by specifying the suboptions of -instalign4 and -instalign8*2. |
No specification: Head of function and case and default labels of switch statement |
When these options are selected, the alignment value of the program section is changed from 1 to 4 (for instalign4) or 8 (for instalign8). |
These options aim to efficiently operate the instruction queues of the RX CPU and improve the speed of program execution by aligning the addresses of branch destination instructions. |
This option is designed for improving the performance for the devices with CPU of the version of RXv2 or later. Refer to -instalign4 for the other devices. |
This is when the instruction size is equal to or smaller than the alignment value. If the instruction size is greater than the alignment value, alignment is performed only when the number of exceeding points is two or more. |
Alignment is adjusted only for the branch destinations listed above; alignment of the other destinations is not adjusted. For example, when loop is selected, alignment of the head of a loop is adjusted but alignment is not adjusted at the branch destination of an if statement that is used in the loop but does not generate a loop. |
If an object module file or a standard library that has been generated through compilation without using this option is specified for linkage, the warning W0561322 will be output at linkage but program execution will have no problem. |
[When compiling with -instalign8 specified]
In the example shown below, the head of each function is aligned so that the instruction does not exceed the 8-byte boundary.
In 8-byte boundary alignment of instructions, the address will not be changed unless the target instruction exceeds the 8-byte boundary. Therefore, only the address of function f2 is actually aligned.