Movatterモバイル変換


[0]ホーム

URL:


Next:, Previous:, Up:Introduction   [Contents][Index]


2 GCC and Portability

GCC itself aims to be portable to any machine whereint is at leasta 32-bit type. It aims to target machines with a flat (non-segmented) byteaddressed data address space (the code address space can be separate).Target ABIs may have 8, 16, 32 or 64-bitint type.charcan be wider than 8 bits.

GCC gets most of the information about the target machine from a machinedescription which gives an algebraic formula for each of the machine’sinstructions. This is a very clean way to describe the target. But whenthe compiler needs information that is difficult to express in thisfashion, ad-hoc parameters have been defined for machine descriptions.The purpose of portability is to reduce the total work needed on thecompiler; it was not of interest for its own sake.

GCC does not contain machine dependent code, but it does contain codethat depends on machine parameters such as endianness (whether the mostsignificant byte has the highest or lowest address of the bytes in a word)and the availability of autoincrement addressing. In the RTL-generationpass, it is often necessary to have multiple strategies for generating codefor a particular kind of syntax tree, strategies that are usable for differentcombinations of parameters. Often, not all possible cases have beenaddressed, but only the common ones or only the ones that have beenencountered. As a result, a new target may require additionalstrategies. You will knowif this happens because the compiler will callabort. Fortunately,the new strategies can be added in a machine-independent fashion, and willaffect only the target machines that need them.


Next:The GCC low-level runtime library, Previous:Contributing to GCC Development, Up:Introduction   [Contents][Index]


[8]ページ先頭

©2009-2026 Movatter.jp