public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Malcolm <dmalcolm@redhat.com>
To: Antoni Boucher <bouanto@zoho.com>,
	"jit@gcc.gnu.org" <jit@gcc.gnu.org>,
	 "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] libgccjit: Allow comparing aligned int types
Date: Wed, 20 Nov 2024 10:43:48 -0500	[thread overview]
Message-ID: <4ac20511fa13080b69329a569090f3512553e2ea.camel@redhat.com> (raw)
In-Reply-To: <53377be068c8f1ae87181acdde28206630535a5f.camel@zoho.com>

On Thu, 2024-02-22 at 12:40 -0500, Antoni Boucher wrote:
> Thanks for the review.
> Here's the updated patch.

Thanks; the updated patch is good for trunk.

Dave

> 
> On Wed, 2024-01-24 at 12:18 -0500, David Malcolm wrote:
> > On Thu, 2023-12-21 at 08:33 -0500, Antoni Boucher wrote:
> > > Hi.
> > > This patch allows comparing aligned integer types as equal.
> > > There's a TODO in the code about whether we should check that the
> > > alignment is equal.
> > > What are your thoughts on this?
> > 
> > I think we should check for equal alignment.
> > 
> > [...snip...]
> > 
> > > diff --git a/gcc/testsuite/jit.dg/test-types.c
> > > b/gcc/testsuite/jit.dg/test-types.c
> > > index a01944e35fa..c2f4d2bcb3d 100644
> > > --- a/gcc/testsuite/jit.dg/test-types.c
> > > +++ b/gcc/testsuite/jit.dg/test-types.c
> > > @@ -485,11 +485,15 @@ verify_code (gcc_jit_context *ctxt,
> > > gcc_jit_result *result)
> > >  
> > >    CHECK_VALUE (z.m_FILE_ptr, stderr);
> > >  
> > > +  gcc_jit_type *long_type = gcc_jit_context_get_type (ctxt,
> > > GCC_JIT_TYPE_LONG);
> > > +  gcc_jit_type *int64_type = gcc_jit_context_get_type (ctxt,
> > > GCC_JIT_TYPE_INT64_T);
> > >    if (sizeof(long) == 8)
> > > -    CHECK (gcc_jit_compatible_types (
> > > -      gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_LONG),
> > > -      gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_INT64_T)));
> > > +    CHECK (gcc_jit_compatible_types (long_type, int64_type));
> > >  
> > >    CHECK_VALUE (gcc_jit_type_get_size (gcc_jit_context_get_type
> > > (ctxt, GCC_JIT_TYPE_FLOAT)), sizeof (float));
> > >    CHECK_VALUE (gcc_jit_type_get_size (gcc_jit_context_get_type
> > > (ctxt, GCC_JIT_TYPE_DOUBLE)), sizeof (double));
> > > +
> > > +  gcc_jit_type *aligned_long = gcc_jit_type_get_aligned
> > > (long_type, 4);
> > > +  gcc_jit_type *aligned_int64 = gcc_jit_type_get_aligned
> > > (int64_type, 4);
> > > +  CHECK (gcc_jit_compatible_types (aligned_long,
> > > aligned_int64));
> > 
> > This CHECK should be guarded on sizeof(long) == 8 like the check
> > above.
> > 
> > 
> > Dave
> > 
> 


      reply	other threads:[~2024-11-20 15:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-21 13:33 Antoni Boucher
2024-01-19 20:59 ` Antoni Boucher
2024-01-24 17:18 ` David Malcolm
2024-02-22 17:40   ` Antoni Boucher
2024-11-20 15:43     ` David Malcolm [this message]

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=4ac20511fa13080b69329a569090f3512553e2ea.camel@redhat.com \
    --to=dmalcolm@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).