This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: __intN patch 3/5: main __int128 -> __intN conversion.
- From: DJ Delorie <dj at redhat dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: nathan at codesourcery dot com, gcc-patches at gcc dot gnu dot org
- Date: Sat, 4 Oct 2014 14:36:01 -0400
- Subject: Re: __intN patch 3/5: main __int128 -> __intN conversion.
- Authentication-results: sourceware.org; auth=none
- References: <201408132211 dot s7DMBGBu016387 at greed dot delorie dot com> <Pine dot LNX dot 4 dot 64 dot 1408212030310 dot 16900 at digraph dot polyomino dot org dot uk> <201408212123 dot s7LLNPIQ018746 at greed dot delorie dot com> <Pine dot LNX dot 4 dot 64 dot 1408212131060 dot 16900 at digraph dot polyomino dot org dot uk> <201408220515 dot s7M5Fhpa007479 at greed dot delorie dot com> <Pine dot LNX dot 4 dot 64 dot 1408221051550 dot 5292 at digraph dot polyomino dot org dot uk> <201408221924 dot s7MJOcjB022631 at greed dot delorie dot com> <Pine dot LNX dot 4 dot 64 dot 1408222013390 dot 16713 at digraph dot polyomino dot org dot uk> <201408260303 dot s7Q33nqm024601 at greed dot delorie dot com> <Pine dot LNX dot 4 dot 64 dot 1409012142450 dot 7370 at digraph dot polyomino dot org dot uk> <201409302314 dot s8UNE7LP020494 at greed dot delorie dot com> <542CC4FA dot 70609 at redhat dot com> <201410020352 dot s923qLlm002274 at greed dot delorie dot com> <542D5FA4 dot 6020401 at redhat dot com> <201410021641 dot s92GfTcV024373 at greed dot delorie dot com> <542D8F05 dot 7090705 at redhat dot com> <201410021800 dot s92I04Nk026647 at greed dot delorie dot com> <542EAD69 dot 9090306 at redhat dot com> <201410032011 dot s93KBpc2005414 at greed dot delorie dot com> <54303821 dot 2090205 at redhat dot com>
> > Otherwise, I don't see what moving the test would accomplish. If
> > "long" is never 128 bits, it doesn't matter if the int128 test is
> > before or after it, and the other intN are never the same size as
> > standard types,
>
> I don't see how you can assert that these will never happen.
It's checked specifically in toplev.c - if the backend *does* request
a type that matches a standard size, they won't get it:
+static bool
+standard_type_bitsize (int bitsize)
+{
+ /* As a special exception, we always want __int128 enabled if possible. */
+ if (bitsize == 128)
+ return false;
+ if (bitsize == CHAR_TYPE_SIZE
+ || bitsize == SHORT_TYPE_SIZE
+ || bitsize == INT_TYPE_SIZE
+ || bitsize == LONG_TYPE_SIZE
+ || (bitsize == LONG_LONG_TYPE_SIZE && LONG_LONG_TYPE_SIZE < GET_MODE_BITSIZE (TImode)))
+ return true;
+ return false;
+}
+ /* This must happen after the backend has a chance to process
+ command line options, but before the parsers are
+ initialized. */
+ for (i = 0; i < NUM_INT_N_ENTS; i ++)
+ if (targetm.scalar_mode_supported_p (int_n_data[i].m)
+ && ! standard_type_bitsize (int_n_data[i].bitsize)
+ && int_n_data[i].bitsize <= HOST_BITS_PER_WIDE_INT * 2)
+ int_n_enabled_p[i] = true;
+ else
+ int_n_enabled_p[i] = false;
+