This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: proposal to make SIZE_TYPE more flexible
- From: DJ Delorie <dj at redhat dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 14 Nov 2013 13:48:35 -0500
- Subject: Re: proposal to make SIZE_TYPE more flexible
- Authentication-results: sourceware.org; auth=none
- References: <201310300422 dot r9U4M6Mx002568 at greed dot delorie dot com> <Pine dot LNX dot 4 dot 64 dot 1310301535400 dot 22878 at digraph dot polyomino dot org dot uk> <201310301917 dot r9UJHxg7028662 at greed dot delorie dot com> <Pine dot LNX dot 4 dot 64 dot 1310302035190 dot 29408 at digraph dot polyomino dot org dot uk> <201310302219 dot r9UMJg9e001309 at greed dot delorie dot com> <Pine dot LNX dot 4 dot 64 dot 1310302249250 dot 29408 at digraph dot polyomino dot org dot uk> <201311140158 dot rAE1wCkg006136 at greed dot delorie dot com> <Pine dot LNX dot 4 dot 64 dot 1311141318300 dot 21407 at digraph dot polyomino dot org dot uk> <201311141812 dot rAEICMvn019947 at greed dot delorie dot com> <Pine dot LNX dot 4 dot 64 dot 1311141834250 dot 26499 at digraph dot polyomino dot org dot uk>
> That would be one possibility - if the idea is to define __intN for all
> integer modes not matching a standard type (and passing
> targetm.scalar_mode_supported_p), I advise posting details of what effect
> this would have for all targets so we can see how many such types would
> get added.
I was thinking of using the existing PARTIAL/FRACTIONAL_INT_MODE macros.
avr/avr-modes.def:FRACTIONAL_INT_MODE (PSI, 24, 3);
bfin/bfin-modes.def:PARTIAL_INT_MODE (DI, 40, PDI);
m32c/m32c-modes.def:PARTIAL_INT_MODE (SI, 24, PSI);
msp430/msp430-modes.def:PARTIAL_INT_MODE (SI, 20, PSI);
rs6000/rs6000-modes.def:PARTIAL_INT_MODE (TI, 128, PTI);
sh/sh-modes.def:PARTIAL_INT_MODE (SI, 22, PSI);
sh/sh-modes.def:PARTIAL_INT_MODE (DI, 64, PDI);
I suspect we'd have to filter out the power-of-two PSI ones though, leaving:
avr/avr-modes.def:FRACTIONAL_INT_MODE (PSI, 24, 3);
bfin/bfin-modes.def:PARTIAL_INT_MODE (DI, 40, PDI);
m32c/m32c-modes.def:PARTIAL_INT_MODE (SI, 24, PSI);
msp430/msp430-modes.def:PARTIAL_INT_MODE (SI, 20, PSI);
sh/sh-modes.def:PARTIAL_INT_MODE (SI, 22, PSI);
I'm assuming we need a mode to go with any type we create? Otherwise,
we could add a FRACTIONAL_INT_TYPE(wrapper-mode, bits) macro to add
yet more.