This is the mail archive of the gcc@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: How to define a built-in 24-bit type?


On Wed, 25 Jan 2012, Georg-Johann Lay wrote:

> You mean that thread?
> http://gcc.gnu.org/ml/gcc-patches/2011-07/msg00064.html
> and
> http://gcc.gnu.org/ml/gcc-patches/2011-07/msg00079.html

Yes, the whole thread (with particular reference to my comments about what 
should be kept target-dependent).

> For the 128-bit integers there is just one type __int128 and unsigned variant
> is unsigned __int128, whereas for the 24-bit types are are two types: __int24
> for signed and __uint24 for unsigned flavor.
> 
> Is there an advantage of one approach over the other?

signed and unsigned __int128 is more consistent with standard C types, but 
harder to implement within a back end because it involves a new keyword.  
Two different type names can be implemented purely within your back end 
without needing generic work elsewhere first to make that possible, but 
users might expect to be able to use unsigned __int24 - or _Complex 
__int24 - and find that won't work if you use the built-in typedef 
approach.

-- 
Joseph S. Myers
joseph@codesourcery.com


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