public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/102989] Implement C2x's n2763 (_BitInt)
Date: Sat, 14 Oct 2023 07:38:34 +0000	[thread overview]
Message-ID: <bug-102989-4-P5KUrnwQVJ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-102989-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102989

--- Comment #113 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:cb0119242317c2a6f3127b4acff6aadbfd1dfbc4

commit r14-4635-gcb0119242317c2a6f3127b4acff6aadbfd1dfbc4
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Sat Oct 14 09:35:44 2023 +0200

    middle-end: Allow _BitInt(65535) [PR102989]

    The following patch lifts further restrictions which limited _BitInt to at
    most 16319 bits up to 65535.
    The problem was mainly in INTEGER_CST representation, which had 3
    unsigned char members to describe lengths in number of 64-bit limbs, which
    it wanted to fit into 32 bits.  This patch removes the third one which was
    just a cache to save a few compile time cycles for wi::to_offset and
    enlarges the other two members to unsigned short.
    Furthermore, the same problem has been in some uses of trailing_wide_int*
    (in value-range-storage*) and value-range-storage* itself, while other
    uses of trailing_wide_int* have been fine (e.g. CONST_POLY_INT, where no
    constants will be larger than 3/5/9/11 limbs depending on target, so 255
    limit is plenty).  The patch turns all those length representations to be
    unsigned short for consistency, so value-range-storage* can handle even
    16320-65535 bits BITINT_TYPE ranges.  The cc1plus growth is about 16K,
    so not really significant for 38M .text section.

    Note, the reason for the new limit is
      unsigned int precision : 16;
    TYPE_PRECISION limit, if we wanted to overcome that, TYPE_PRECISION would
    need to use some other member for BITINT_TYPE from all the others and
    we could reach that way 4194239 limit (65535 * 64 - 1, again implied by
    INTEGER_CST and value-range-storage*).  Dunno if that is
    worth it or if it is something we want to do for GCC 14 though.

    2023-10-14  Jakub Jelinek  <jakub@redhat.com>

            PR c/102989
    gcc/
            * tree-core.h (struct tree_base): Remove int_length.offset
            member, change type of int_length.unextended and
int_length.extended
            from unsigned char to unsigned short.
            * tree.h (TREE_INT_CST_OFFSET_NUNITS): Remove.
            (wi::extended_tree <N>::get_len): Don't use
TREE_INT_CST_OFFSET_NUNITS,
            instead compute it at runtime from TREE_INT_CST_EXT_NUNITS and
            TREE_INT_CST_NUNITS.
            * tree.cc (wide_int_to_tree_1): Don't assert
            TREE_INT_CST_OFFSET_NUNITS value.
            (make_int_cst): Don't initialize TREE_INT_CST_OFFSET_NUNITS.
            * wide-int.h (WIDE_INT_MAX_ELTS): Change from 255 to 1024.
            (WIDEST_INT_MAX_ELTS): Change from 510 to 2048, adjust comment.
            (trailing_wide_int_storage): Change m_len type from unsigned char *
            to unsigned short *.
            (trailing_wide_int_storage::trailing_wide_int_storage): Change
second
            argument from unsigned char * to unsigned short *.
            (trailing_wide_ints): Change m_max_len type from unsigned char to
            unsigned short.  Change m_len element type from
            struct{unsigned char len;} to unsigned short.
            (trailing_wide_ints <N>::operator []): Remove .len from m_len
            accesses.
            * value-range-storage.h (irange_storage::lengths_address): Change
            return type from const unsigned char * to const unsigned short *.
            (irange_storage::write_lengths_address): Change return type from
            unsigned char * to unsigned short *.
            * value-range-storage.cc (irange_storage::write_lengths_address):
            Likewise.
            (irange_storage::lengths_address): Change return type from
            const unsigned char * to const unsigned short *.
            (write_wide_int): Change len argument type from unsigned char *&
            to unsigned short *&.
            (irange_storage::set_irange): Change len variable type from
            unsigned char * to unsigned short *.
            (read_wide_int): Change len argument type from unsigned char to
            unsigned short.  Use trailing_wide_int_storage <unsigned short>
            instead of trailing_wide_int_storage and
            trailing_wide_int <unsigned short> instead of trailing_wide_int.
            (irange_storage::get_irange): Change len variable type from
            unsigned char * to unsigned short *.
            (irange_storage::size): Multiply n by sizeof (unsigned short)
            in len_size variable initialization.
            (irange_storage::dump): Change len variable type from
            unsigned char * to unsigned short *.
    gcc/cp/
            * module.cc (trees_out::start, trees_in::start): Remove
            TREE_INT_CST_OFFSET_NUNITS handling.
    gcc/testsuite/
            * gcc.dg/bitint-38.c: Change into dg-do run test, in addition
            to checking the addition, division and right shift results at
compile
            time check it also at runtime.
            * gcc.dg/bitint-39.c: New test.

  parent reply	other threads:[~2023-10-14  7:38 UTC|newest]

Thread overview: 119+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-28 17:41 [Bug c/102989] New: Add Clang's _ExtInt(N) colomar.6.4.3 at gmail dot com
2021-10-28 17:54 ` [Bug c/102989] " colomar.6.4.3 at gmail dot com
2021-10-28 17:57 ` colomar.6.4.3 at gmail dot com
2021-10-28 17:57 ` colomar.6.4.3 at gmail dot com
2021-10-28 18:01 ` jakub at gcc dot gnu.org
2021-10-28 18:11 ` colomar.6.4.3 at gmail dot com
2021-10-28 21:41 ` joseph at codesourcery dot com
2021-10-28 21:47 ` [Bug c/102989] Implement C2x's n2763 (_BitInt) pinskia at gcc dot gnu.org
2021-10-28 21:49 ` pinskia at gcc dot gnu.org
2021-11-11 19:42 ` pinskia at gcc dot gnu.org
2021-11-11 19:58 ` colomar.6.4.3 at gmail dot com
2021-11-11 21:27 ` joseph at codesourcery dot com
2022-10-25 12:14 ` jakub at gcc dot gnu.org
2022-10-25 15:25 ` hjl.tools at gmail dot com
2022-10-25 20:32 ` joseph at codesourcery dot com
2022-10-25 20:42 ` hjl.tools at gmail dot com
2022-10-25 20:45 ` jakub at gcc dot gnu.org
2022-10-25 21:05 ` segher at gcc dot gnu.org
2022-10-25 21:05 ` hjl.tools at gmail dot com
2022-10-25 21:09 ` pinskia at gcc dot gnu.org
2022-10-25 21:10 ` jakub at gcc dot gnu.org
2022-10-25 21:30 ` segher at gcc dot gnu.org
2022-10-25 21:50 ` segher at gcc dot gnu.org
2022-10-26  6:29 ` uweigand at gcc dot gnu.org
2022-10-26  6:50 ` jakub at gcc dot gnu.org
2022-10-26  8:35 ` redi at gcc dot gnu.org
2022-10-26 17:29 ` joseph at codesourcery dot com
2022-10-28  9:47 ` rguenth at gcc dot gnu.org
2022-10-28 10:32 ` jakub at gcc dot gnu.org
2022-10-28 10:51 ` rguenther at suse dot de
2022-10-28 11:02 ` colomar.6.4.3 at gmail dot com
2022-10-28 17:27 ` pinskia at gcc dot gnu.org
2022-10-28 20:31 ` joseph at codesourcery dot com
2022-10-28 20:39 ` joseph at codesourcery dot com
2023-04-09 19:59 ` leni536 at gmail dot com
2023-04-12 22:17 ` george at bott dot gg
2023-05-11 18:00 ` jakub at gcc dot gnu.org
2023-05-11 18:21 ` jakub at gcc dot gnu.org
2023-05-11 22:10 ` joseph at codesourcery dot com
2023-05-12  7:46 ` jakub at gcc dot gnu.org
2023-05-12  8:41 ` rguenth at gcc dot gnu.org
2023-05-16 16:20 ` jakub at gcc dot gnu.org
2023-05-17  7:22 ` rguenth at gcc dot gnu.org
2023-05-23 12:04 ` jakub at gcc dot gnu.org
2023-05-24 11:48 ` jakub at gcc dot gnu.org
2023-05-24 12:46 ` rguenther at suse dot de
2023-05-24 13:16 ` jakub at gcc dot gnu.org
2023-05-24 13:29 ` rguenther at suse dot de
2023-05-24 14:18 ` jakub at gcc dot gnu.org
2023-05-24 14:57 ` rguenther at suse dot de
2023-05-24 15:31 ` jakub at gcc dot gnu.org
2023-05-26 16:13 ` jakub at gcc dot gnu.org
2023-05-26 16:16 ` jakub at gcc dot gnu.org
2023-05-26 17:11 ` jakub at gcc dot gnu.org
2023-06-02 10:39 ` jakub at gcc dot gnu.org
2023-06-02 10:43 ` rguenther at suse dot de
2023-06-02 10:53 ` jakub at gcc dot gnu.org
2023-06-02 17:06 ` jakub at gcc dot gnu.org
2023-06-05  7:14 ` rguenth at gcc dot gnu.org
2023-06-05  7:34 ` jakub at gcc dot gnu.org
2023-06-05  7:43 ` rguenth at gcc dot gnu.org
2023-06-05  7:58 ` jakub at gcc dot gnu.org
2023-06-05  8:21 ` rguenther at suse dot de
2023-06-05  8:33 ` jakub at gcc dot gnu.org
2023-06-06  7:13 ` rguenth at gcc dot gnu.org
2023-06-15 11:28 ` jakub at gcc dot gnu.org
2023-06-15 18:02 ` jakub at gcc dot gnu.org
2023-06-19 17:40 ` jakub at gcc dot gnu.org
2023-06-20 20:04 ` jakub at gcc dot gnu.org
2023-06-22 19:47 ` jakub at gcc dot gnu.org
2023-06-23 17:03 ` jakub at gcc dot gnu.org
2023-06-26 18:48 ` jakub at gcc dot gnu.org
2023-06-28 17:21 ` jakub at gcc dot gnu.org
2023-06-29 17:01 ` jakub at gcc dot gnu.org
2023-06-30 19:22 ` jakub at gcc dot gnu.org
2023-07-05 17:23 ` jakub at gcc dot gnu.org
2023-07-07 14:26 ` jakub at gcc dot gnu.org
2023-07-07 17:59 ` jakub at gcc dot gnu.org
2023-07-11 11:20 ` jakub at gcc dot gnu.org
2023-07-12 16:28 ` jakub at gcc dot gnu.org
2023-07-13 18:03 ` jakub at gcc dot gnu.org
2023-07-14 11:18 ` jakub at gcc dot gnu.org
2023-07-14 11:18 ` jakub at gcc dot gnu.org
2023-07-14 17:19 ` jakub at gcc dot gnu.org
2023-07-17 10:21 ` jakub at gcc dot gnu.org
2023-07-17 18:06 ` jakub at gcc dot gnu.org
2023-07-18 11:07 ` jakub at gcc dot gnu.org
2023-07-18 15:45 ` jakub at gcc dot gnu.org
2023-07-20 15:51 ` jakub at gcc dot gnu.org
2023-07-21 17:10 ` jakub at gcc dot gnu.org
2023-07-25 14:40 ` jakub at gcc dot gnu.org
2023-07-26 13:04 ` jakub at gcc dot gnu.org
2023-07-26 17:41 ` jakub at gcc dot gnu.org
2023-07-27 15:18 ` jakub at gcc dot gnu.org
2023-08-10  7:22 ` cvs-commit at gcc dot gnu.org
2023-08-10  7:23 ` cvs-commit at gcc dot gnu.org
2023-08-10 15:30 ` cvs-commit at gcc dot gnu.org
2023-08-14 21:55 ` tmgross at umich dot edu
2023-09-06 15:57 ` cvs-commit at gcc dot gnu.org
2023-09-06 15:57 ` cvs-commit at gcc dot gnu.org
2023-09-06 15:57 ` cvs-commit at gcc dot gnu.org
2023-09-06 15:57 ` cvs-commit at gcc dot gnu.org
2023-09-06 15:57 ` cvs-commit at gcc dot gnu.org
2023-09-06 15:57 ` cvs-commit at gcc dot gnu.org
2023-09-06 15:58 ` cvs-commit at gcc dot gnu.org
2023-09-06 15:58 ` cvs-commit at gcc dot gnu.org
2023-09-06 15:58 ` cvs-commit at gcc dot gnu.org
2023-09-06 15:58 ` cvs-commit at gcc dot gnu.org
2023-09-06 15:58 ` cvs-commit at gcc dot gnu.org
2023-09-06 15:58 ` cvs-commit at gcc dot gnu.org
2023-09-06 15:58 ` cvs-commit at gcc dot gnu.org
2023-09-06 15:58 ` cvs-commit at gcc dot gnu.org
2023-09-06 15:58 ` cvs-commit at gcc dot gnu.org
2023-09-07  9:21 ` cvs-commit at gcc dot gnu.org
2023-10-12 14:07 ` cvs-commit at gcc dot gnu.org
2023-10-14  7:38 ` cvs-commit at gcc dot gnu.org [this message]
2023-10-14 22:38 ` gaius at gcc dot gnu.org
2023-11-01  8:17 ` gaius at gcc dot gnu.org
2023-11-01  9:06 ` cvs-commit at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-102989-4-P5KUrnwQVJ@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).