3.3 Using type-specific operations
The MIPS hardware can access each 32-bit word as four 8-bit bytes. These four bytes can be ordered in one of two ways: from most significant to least significant, called big-endian byte ordering, or vice versa, called little-endian byte ordering. For example, in a little-endian configuration, byte 0 of a word gives you the low eight bits; in a big-endian configuration, byte 0 of a word gives you the high eight bits.
Table 3.6 shows the byte ordering for the word at location 1000 containing the hexadecimal number
|Address of byte||Little-endian||Big-endian|
The byte ordering on a MIPS chip can be configured to be either little-endian or big-endian. By default, LCL/SGI produces code specifically tailored for big-endian machines. If, however, you would like your code to be portable across all machines that use the MIPS chip, you should set the
:target option to
compile-file to produce code that can run on either type of machine. When you specify such a
:target option, certain operations involving floating-point numbers might be slightly slower, because the code will check at run-time to see if the current machine is big-endian or little-endian.
By using the
:target option, you can configure the Compiler to produce the following types of code:
:targetkeyword to the function
compiler-optionsfor more information.
Generated with Harlequin WebMaker