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]

How to define a built-in 24-bit type?


Hi.

avr-gcc implements a 24-bit scalar integer types __int24 and __uint24 in
avr.c:TARGET_INIT_BUILTINS like so:

  tree int24_type  = make_signed_type (GET_MODE_BITSIZE (PSImode));
  tree uint24_type = make_unsigned_type (GET_MODE_BITSIZE (PSImode));

  (*lang_hooks.types.register_builtin_type) (int24_type, "__int24");
  (*lang_hooks.types.register_builtin_type) (uint24_type, "__uint24");

PSImode is defined in avr-modes.c:

FRACTIONAL_INT_MODE (PSI, 24, 3);

Is this the right definition of a built-in type?

The question is because __int24 shreds the compiler, see PR51527

So the question is if there is something missing or broken in the definition
above or if it's actually a flaw in the front-end.

For the __int128 there is much more code sprinkled over the compiler sources,
so maybe it's not that easy to introduce a new, built-in type completely in the
back-end?

Thanks.


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