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

Reply via email to