public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Antoni Boucher <bouanto@zoho.com>
Cc: jit@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] libgccjit: Add support for sized integer types, including 128-bit integers [PR95325]
Date: Tue, 18 May 2021 14:53:06 +0200	[thread overview]
Message-ID: <20210518125306.GP1179226@tucnak> (raw)
In-Reply-To: <92a0bd2aad201de75a71d0a00414e518cf1716e6.camel@zoho.com>

On Tue, May 18, 2021 at 08:23:56AM -0400, Antoni Boucher via Gcc-patches wrote:
> Hello.
> This patch add support for sized integer types.
> Maybe it should check whether the size of a byte for the current
> platform is 8 bits and do other checks so that they're only available
> when it makes sense.
> What do you think?

Not a review, just a comment.  The 128-bit integral types are available
only on some targets, the test e.g. the C/C++ FE do for those is
targetm.scalar_mode_supported_p (TImode)
and so even libgccjit shouldn't provide those types unconditionally.
Similarly for the tests (though it could be guarded with e.g
#ifdef __SIZEOF_INT128__
in that case).
Also, while currently all in tree targets have BITS_PER_UNIT 8 and
therefore QImode is 8-bit, HImode 16-bit, SImode 32-bit and DImode 64-bit,
in the past and maybe in he future there can be targets that could have
e.g. 16-bit or 32-bit QImode and then there wouldn't be any uint8_t/int8_t
and int16_t would be intQImode_type_node etc.
  uint16_type_node = make_or_reuse_type (16, 1);
  uint32_type_node = make_or_reuse_type (32, 1);
  uint64_type_node = make_or_reuse_type (64, 1);
  if (targetm.scalar_mode_supported_p (TImode))
    uint128_type_node = make_or_reuse_type (128, 1);
are always with the given precisions, perhaps jit should use
signed_type_for (uint16_type_node) etc.?

	Jakub


  parent reply	other threads:[~2021-05-18 12:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-18 12:23 Antoni Boucher
2021-05-18 12:36 ` Antoni Boucher
2021-05-18 12:53 ` Jakub Jelinek [this message]
2021-05-20 19:25   ` David Malcolm
2022-01-04  3:13     ` Antoni Boucher
2022-01-21 16:22     ` Antoni Boucher
2022-04-08 20:29       ` Antoni Boucher
2022-04-12 21:32         ` David Malcolm

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=20210518125306.GP1179226@tucnak \
    --to=jakub@redhat.com \
    --cc=bouanto@zoho.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jit@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).