This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Introduce abi_word_mode


Hi,

> As I see it, there is one clear definition of abi_word_mode: the mode
> to be used for a variable declared with attribute ((mode (word))).
> 
> This is clearly a property of the ABI, so if we have two configurations
> of GCC that purport to support the same ABI, but need to use differing
> definitions of word_mode internally because they use differently-sized
> general purpose registers, then we need a new target-defined mode that
> the middle-end can use to implement attribute ((mode (word))).

Following Ulrichs suggestion my documentation bits would look like this:

@defmac BITS_PER_ABI_WORD
Number of bits in an integral data type when defined with the type 
attribute @code{mode(word)} (e.g. with 
@code{__attribute__((__mode__(__word__))))}.  If you do not 
define this macro, the default is @code{BITS_PER_UNIT * UNITS_PER_ABI_WORD}.
@end defmac

@defmac UNITS_PER_ABI_WORD
Number of storage units in an integral data type when defined with the type 
attribute @code{mode(word)} (e.g. with 
@code{__attribute__((__mode__(__word__))))}.  The value has to be a power of 
two.  If it is undefined, the default is @code{UNITS_PER_WORD}.

A gcc backend needs to define this macro when it provides configurations
using different values for @code{UNITS_PER_WORD} that need to support the 
same ABI.
@end defmac

Bye,

-Andreas-


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]